[Vm-dev] VM Maker: VMMaker.oscog-tpr.283.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 10 20:08:04 UTC 2013


tim Rowledge uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-tpr.283.mcz

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

Name: VMMaker.oscog-tpr.283
Author: tpr
Time: 10 April 2013, 12:59:03.611 pm
UUID: d2f9d806-1112-4c6e-a21d-3228b51fa2e8
Ancestors: VMMaker.oscog-eem.282

Make it work for RISC OS; simple changes to use the RiscOSVMMaker class, not do the gnuify step, use RISC OS tolerabel filenames etc.
Also fixes apparent bug for all platforms in VMPluginCodeGenerator>>emitCCodeOn:doInlining:doAssertions:

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

Item was added:
+ ----- Method: RiscOSVMMaker class>>forPlatform: (in category 'initialisation') -----
+ forPlatform: ignired
+ 	"over-ride to keep a RiscOSVMMaker in charge instead of a CrossPlatormVMMaker"
+ 		^self new initialize setPlatName: self name!

Item was added:
+ ----- Method: RiscOSVMMaker class>>generateSqueakStackVM (in category 'configurations') -----
+ generateSqueakStackVM
+ 	"RISC OS version; build needed plugins, make sure filename tweaking is used"
+ "RiscOSVMMaker generateSqueakStackVM"
+ 	^self
+ 		generate: StackInterpreter
+ 		to: (FileDirectory default directoryNamed: 'stacksrc') fullName
+ 		platformDir: (FileDirectory default directoryNamed: 'platforms') fullName
+ 		excluding: #(AsynchFilePlugin BrokenPlugin CroquetPlugin FFIPlugin IA32ABIPlugin ImmX11Plugin InternetConfigPlugin JoystickTabletPlugin MIDIPlugin MacMenubarPlugin Mpeg3Plugin NewsqueakIA32ABIPlugin QuicktimePlugin SerialPlugin  TestOSAPlugin ThreadedARMFFIPlugin ThreadedFFIPlugin ThreadedIA32FFIPlugin ThreadedPPCBEFFIPlugin UUIDPlugin VMProfileMacSupportPlugin)!

Item was added:
+ ----- Method: RiscOSVMMaker>>gnuifyInterpreterFile (in category 'processing external files') -----
+ gnuifyInterpreterFile
+ "do nothing here"!

Item was changed:
  ----- Method: RiscOSVMMaker>>sourceFilePathFor: (in category 'generate sources') -----
+ sourceFilePathFor: sourceFileName
- sourceFilePathFor: class
  	"return the full path for the interpreter file"
  	"RiscOS keeps the interp file in a 'c' subdirectory of coreVMDirectory"
  	self coreVMDirectory assureExistenceOfPath: 'c'.
+ 	^(self coreVMDirectory directoryNamed: 'c') fullNameFor: (sourceFileName allButLast: 2)!
- 	^(self coreVMDirectory directoryNamed: 'c') fullNameFor: class sourceFileName!

Item was changed:
  ----- Method: VMMaker class>>generateSqueakStackVM (in category 'configurations') -----
  generateSqueakStackVM
  	"No primitives since we can use those for the Cog VM"
  	^VMMaker
  		generate: StackInterpreter
+ 		to: (FileDirectory default directoryNamed: 'oscogvm/stacksrc') fullName
+ 		platformDir: (FileDirectory default directoryNamed: 'oscogvm/platforms') fullName
- 		to: (FileDirectory default pathFromURI: 'oscogvm/stacksrc')
- 		platformDir: (FileDirectory default pathFromURI: 'oscogvm/platforms')
  		excluding: (InterpreterPlugin withAllSubclasses collect: [:ea| ea name])!

Item was changed:
  ----- Method: VMMaker>>generateInterpreterFile (in category 'generate sources') -----
  generateInterpreterFile
  	"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 vmHeaderContents |
  	cg := [self buildCodeGeneratorForInterpreter]
  			on: Notification
  			do: [:ex|
  				ex tag == #getVMMaker
  					ifTrue: [ex resume: self]
  					ifFalse: [(ex respondsTo: #rearmHandlerDuring:)
  								ifTrue: [ex rearmHandlerDuring: [ex pass]]
  								ifFalse: [ex pass]]].
  	self needsToRegenerateInterpreterFile ifFalse: [^nil].
  	cg removeUnneededBuiltins.
  	self interpreterClass preGenerationHook: cg.
  
  	vmHeaderContents := cg vmHeaderContentsWithBytesPerWord: self bytesPerWord.
  	(cg needToGenerateHeader: self interpreterHeaderName file: self interpreterHeaderPath contents: vmHeaderContents) ifTrue:
  		[cg storeHeaderOnFile: self interpreterHeaderPath contents: vmHeaderContents].
  	cg storeCodeOnFile: (self sourceFilePathFor: self interpreterClass sourceFileName) doInlining: self doInlining.
  	self interpreterClass additionalHeadersDo:
  		[:headerName :headerContents| | filePath |
  		 filePath := self coreVMDirectory fullNameFor: headerName.
  		 (cg needToGenerateHeader: headerName file: filePath contents: headerContents) ifTrue:
  			 [cg storeHeaderOnFile: filePath contents: headerContents]].
  	self interpreterClass apiExportHeaderName ifNotNil:
  		[cg storeAPIExportHeader: self interpreterClass apiExportHeaderName
  			OnFile: (self sourceFilePathFor: self interpreterClass apiExportHeaderName)].
+ 	self gnuifyInterpreterFile!
- 	(Gnuifier on: self coreVMDirectory)
- 		interpreterFilename: self interpreterFilename;
- 		gnuify.!

Item was added:
+ ----- Method: VMMaker>>gnuifyInterpreterFile (in category 'processing external files') -----
+ gnuifyInterpreterFile
+ "post-process the interp.c file to make it gcc friendly"
+ 	(Gnuifier on: self coreVMDirectory)
+ 		interpreterFilename: self interpreterFilename;
+ 		gnuify.!

Item was changed:
  ----- Method: VMPluginCodeGenerator>>emitCCodeOn:doInlining:doAssertions: (in category 'C code generator') -----
  emitCCodeOn: aStream doInlining: inlineFlag doAssertions: assertionFlag
  	"Generate twice; the first time to collect the used functions, the second to output the used functions."
  	| savedHeaders |
  	savedHeaders := headerFiles copy.
  	[super emitCCodeOn: NullStream new doInlining: inlineFlag doAssertions: assertionFlag]
  		on: MessageNotUnderstood
  		do: [:ex|
+ 				(#(cr crtab: ensureCr peekLast space tab tab:) includes: ex message selector) ifTrue:
- 				(#(cr crtab: peekLast space tab tab:) includes: ex message selector) ifTrue:
  					[ex resume: nil].
  				ex pass].
  	headerFiles := savedHeaders.
  	super emitCCodeOn: aStream doInlining: inlineFlag doAssertions: assertionFlag!



More information about the Vm-dev mailing list