Bert Freudenberg uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-bf.351.mcz
==================== Summary ====================
Name: VMMaker-bf.351 Author: bf Time: 1 October 2014, 10:20:50.38 am UUID: af5fd014-b9f4-4d17-80fa-2abd7b2b263b Ancestors: VMMaker-dtl.350
Do not hard-code ".c" module file extension.
=============== Diff against VMMaker-dtl.350 ===============
Item was changed: ----- Method: ADPCMCodecPlugin class>>translateInDirectory:doInlining: (in category 'translation') ----- translateInDirectory: directory doInlining: inlineFlag "handle a special case code string rather than generated code" "Not currently hooked into the timeStamp mechanism for VMMaker since this would mean replicating code from InterpreterPlugin; waiting for a more elegant solution to appear. In the meantime this means that this plugin will always get regenerated even if the file is uptodate" | cg aClass | self initialize.
cg := self buildCodeGenerator. aClass := Smalltalk at: #ADPCMCodec ifAbsent:[nil]. aClass ifNil:[ Transcript cr; show: 'ADPCMCodec not present in image. Skipping plugin.'. ^self].
cg addMethodsForPrimitives: aClass translatedPrimitives. inlineFlag ifTrue:[ "now remove a few which will be inlined but not pruned" cg pruneMethods: #(indexForDeltaFrom:to: nextBits: nextBits:put:)]. + self storeString: cg generateCodeStringForPrimitives onFileNamed: (directory fullNameFor: self moduleFileName). - self storeString: cg generateCodeStringForPrimitives onFileNamed: (directory fullNameFor: self moduleName, '.c'). ^cg exportedPrimitiveNames asArray !
Item was added: + ----- Method: InterpreterPlugin class>>moduleFileName (in category 'accessing') ----- + moduleFileName + "Answer the file name to generate our source code in" + + ^ self moduleName, self moduleExtension!
Item was changed: ----- Method: InterpreterPlugin class>>translateInDirectory:doInlining: (in category 'translation') ----- translateInDirectory: directory doInlining: inlineFlag "This is the default method for writing out sources for a plugin. Several classes need special handling, so look at all implementors of this message" | cg fname fstat | + fname := self moduleFileName. - fname := self moduleName, '.c'.
"don't translate if the file is newer than my timeStamp" fstat := directory entryAt: fname ifAbsent:[nil]. fstat ifNotNil:[self timeStamp < fstat modificationTime ifTrue:[^nil]].
self initialize. cg := self buildCodeGenerator. cg storeCodeOnFile: (directory fullNameFor: fname) doInlining: inlineFlag. ^cg exportedPrimitiveNames asArray!
Item was changed: ----- Method: MiscPrimitivePlugin class>>translateInDirectory:doInlining: (in category 'translation') ----- translateInDirectory: directory doInlining: inlineFlag "handle a special case code string rather than normal generated code." | cg fname fstat | + fname := self moduleFileName. - fname := self moduleName, '.c'.
"don't translate if the file is newer than my timeStamp" fstat := directory entryAt: fname ifAbsent:[nil]. fstat ifNotNil:[self timeStamp < fstat modificationTime ifTrue:[^nil]].
self initialize. cg := self buildCodeGenerator. cg addMethodsForPrimitives: self translatedPrimitives. self storeString: cg generateCodeStringForPrimitives onFileNamed: (directory fullNameFor: fname). ^cg exportedPrimitiveNames asArray !
Item was changed: ----- Method: SmartSyntaxInterpreterPlugin class>>translateDoInlining:locally:debug: (in category 'translation') ----- translateDoInlining: inlineFlag locally: localFlag debug: debugFlag ^ self + translate: self moduleFileName - translate: self moduleName , '.c' doInlining: inlineFlag locally: localFlag debug: debugFlag!
Item was changed: ----- Method: SoundGenerationPlugin class>>translateInDirectory:doInlining: (in category 'accessing') ----- translateInDirectory: directory doInlining: inlineFlag "handle a special case code string rather than generated code. NB sqOldSoundsPrims IS NOT FULLY INTEGRATED - it still isn't included in the exports list" | cg aClass | self initialize.
cg := self buildCodeGenerator.
aClass := Smalltalk at: #AbstractSound ifAbsent:[nil]. aClass ifNil:[ Transcript cr; show: 'AbstractSound not present in image. Skipping plugin.'. ^self].
cg addMethodsForPrimitives: aClass translatedPrimitives. + self storeString: cg generateCodeStringForPrimitives onFileNamed: (directory fullNameFor: self moduleFileName). - self storeString: cg generateCodeStringForPrimitives onFileNamed: (directory fullNameFor: self moduleName, '.c'). "What we need here is some way to derive the prim names from sqOldSoundPrims - or dump it entirely. Perhaps add this class (without then generating the file again) using fake entry points like SurfacePlugin does"
^cg exportedPrimitiveNames asArray !
vm-dev@lists.squeakfoundation.org