[Vm-dev] VM Maker: VMMaker.oscog-eem.218.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Nov 21 00:53:24 UTC 2012
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.218.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.218
Author: eem
Time: 20 November 2012, 4:50:20.433 pm
UUID: aea72579-80d2-40c0-9866-80fe8d3488fc
Ancestors: VMMaker.oscog-eem.217
Revert to Esteban's CCodeGenerator>>emitCConstantsOn: which
forces def of BytesPerWord in all plugins. Mine also defined
MULTIPLEBYTECODESETS in all plugins which is wrong but thankfully
obsolete.
=============== Diff against VMMaker.oscog-eem.217 ===============
Item was changed:
----- Method: CCodeGenerator>>emitCConstantsOn: (in category 'C code generator') -----
emitCConstantsOn: aStream
"Store the global variable declarations on the given stream."
| unused constList |
unused := constants keys asSet.
methods do:
[:meth|
meth parseTree nodesDo:
[:n| n isConstant ifTrue: [unused remove: n name ifAbsent: []]]].
unused copy do:
[:const|
(variableDeclarations anySatisfy: [:value| value includesSubString: const]) ifTrue:
[unused remove: const ifAbsent: []]].
"Don't generate any defines for the externally defined constants, STACKVM, COGVM, COGMTVM et al."
(VMClass class>>#initializeMiscConstantsWith:) literalsDo:
[:lit|
lit isVariableBinding ifTrue:
[unused add: lit key]].
+ unused remove: #BytesPerWord ifAbsent: []. "force inclusion of BytesPerWord declaration"
- "force inclusion of BytesPerWord and MULTIPLEBYTECODESETS declarations."
- #(BytesPerWord MULTIPLEBYTECODESETS) do:
- [:key| unused remove: key ifAbsent: []].
constList := constants keys reject:[:any| unused includes: any].
aStream cr; nextPutAll: '/*** Constants ***/'; cr.
(self sortStrings: constList) do:
[:varName| | node default value |
node := constants at: varName.
node name isEmpty ifFalse:
["Allow the class to provide an alternative definition, either of just the value or the whole shebang"
default := self cLiteralFor: node value name: varName.
value := vmClass
ifNotNil:
[(vmClass specialValueForConstant: node name default: default)
ifNotNil: [:specialDef| specialDef]
ifNil: [default]]
ifNil: [default].
value first ~= $# ifTrue:
[aStream nextPutAll: '#define '; nextPutAll: node name; space].
aStream nextPutAll: value; cr]].
aStream cr!
More information about the Vm-dev
mailing list