[Vm-dev] VM Maker: VMMaker.oscog-eem.1238.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 22 17:28:32 UTC 2015


Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1238.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.1238
Author: eem
Time: 22 April 2015, 10:25:11.206 am
UUID: 6d58bf61-31c3-4ae5-a203-3b154b9cebf6
Ancestors: VMMaker.oscog-eem.1237

Fix some glitches with the new cogit source scheme

=============== Diff against VMMaker.oscog-eem.1237 ===============

Item was changed:
  ----- Method: VMMaker>>generateCogitFileFor: (in category 'generate sources') -----
  generateCogitFileFor: cogitClass
  	"Translate the Smalltalk description of the virtual machine into C.  If 'self doInlining' is true, small method bodies are inlined to reduce procedure call overhead.  On the PPC, this results in a factor of three speedup with only 30% increase in code size.  Subclasses can use specialised versions of CCodeGenerator and interpreterClass."
  
  	| cg |
  	cg := [self buildCodeGeneratorForCogit]
  			on: Notification
  			do: [:ex|
  				ex tag == #getVMMaker
  					ifTrue: [ex resume: self]
  					ifFalse: [(ex respondsTo: #rearmHandlerDuring:)
  								ifTrue: [ex rearmHandlerDuring: [ex pass]]
  								ifFalse: [ex pass]]].
+ 	self needsToRegenerateCogitFile ifFalse: [^cg].
- 	self needsToRegenerateCogitFile ifFalse: [^nil].
  
  	cg inferTypesForImplicitlyTypedVariablesAndMethods.
  
  	cg vmClass preGenerationHook: cg.
  	cg storeCodeOnFile: (self sourceFilePathFor: cogitClass processorSpecificSourceFileName) doInlining: cogitClass doInlining.
  	^cg!

Item was changed:
  ----- Method: VMMaker>>generateCogitIncludeFileFor: (in category 'generate sources') -----
  generateCogitIncludeFileFor: cogitClass
  	"Generate the skeletal cogit.c that includes the processor-specific cogit files."
  
+ 	| code fileName file fileCode |
- 	| code fileName file |
  	code := Cogit generateCodeStringForCogitDotC.
  	fileName := self coreVMDirectory fullNameFor: cogitClass sourceFileName.
  	((self coreVMDirectory fileExists: cogitClass sourceFileName)
+ 	and: [fileCode := (self class oldFileNamed: fileName) contentsOfEntireFile.
+ 		(fileCode allButFirst: (fileCode indexOf: $#)) = (code allButFirst: (code indexOf: $#))]) ifFalse:
- 	and: [(self class oldFileNamed: fileName) contents = code]) ifFalse:
  		[file := self class forceNewFileNamed: fileName.
  		 [file nextPutAll: code] ensure:
  			[file close]]!



More information about the Vm-dev mailing list