[Vm-dev] VM Maker: VMMaker.oscog-eem.594.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Jan 28 22:45:24 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.594.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.594
Author: eem
Time: 28 January 2014, 2:42:02.47 pm
UUID: dc0cca0d-8f63-4da1-a647-94be0840104b
Ancestors: VMMaker.oscog-eem.593
Stabilize generation so that implicitly default options cause the same
dead code elimination as explicit defaults.
Generate CameraPlugin, ScratchPlugin, UnicodePlugin & WeDoPlugin.
=============== Diff against VMMaker.oscog-eem.593 ===============
Item was changed:
----- Method: CCodeGenerator>>vmClass: (in category 'accessing') -----
vmClass: aClass
"Set the main translation class if any. This is nil other than for the core VM.
It may be an interpreter or a cogit"
vmClass := aClass.
vmClass ifNotNil:
+ [generateDeadCode := vmClass shouldGenerateDeadCode.
+ vmClass copyOptionsBackTo: optionsDictionary]!
- [generateDeadCode := vmClass shouldGenerateDeadCode]!
Item was added:
+ ----- Method: VMClass class>>copyOptionsBackTo: (in category 'initialization') -----
+ copyOptionsBackTo: optionsDictionary
+ "Ugh. Copy back those options that the CCodeGenerator will do
+ dead-code elimination for that are not yet set in optionsDictionary.
+ This lets the CCodeGenerator see defaults for the options below."
+
+ optionsDictionary ifNil: [^self].
+ initializationOptions ifNil: [^self].
+ #(MULTIPLEBYTECODESETS IMMUTABILITY) do:
+ [:option|
+ ((initializationOptions includesKey: option)
+ and: [(optionsDictionary includesKey: option) not]) ifTrue:
+ [optionsDictionary at: option put: (initializationOptions at: option)]]!
Item was changed:
----- Method: VMClass class>>initializeMiscConstants (in category 'initialization') -----
initializeMiscConstants
"Falsify the `what type of VM is this?' flags that are defined in the various interp.h files,
or in the case of VMBIGENDIAN the various sqConfig.h files.
+ Subclass implementations need to include a super initializeMiscConstants"
- Subclass implementations need to include a super initializeMiscConstantsWith:."
| omc |
VMBIGENDIAN class. "Mention this for the benefit of CCodeGenerator>>emitCConstantsOn:"
self isInterpreterClass ifTrue:
[STACKVM := COGVM := COGMTVM := false].
omc := initializationOptions at: #ObjectMemory ifAbsent: nil.
initializationOptions
at: #SqueakV3ObjectMemory "the good ole default"
put: (omc
ifNil: [true]
ifNotNil: [(Smalltalk at: omc) inheritsFrom: ObjectMemory]);
at: #SpurObjectMemory "the new condender"
put: (omc
ifNil: [false]
ifNotNil: [(Smalltalk at: omc) inheritsFrom: SpurMemoryManager]).
+ "Use ifAbsentPut: so that they will get copied back to the
+ VMMaker's options and dead code will likely be eliminated."
+ NewspeakVM := initializationOptions at: #NewspeakVM ifAbsentPut: [false].
+ MULTIPLEBYTECODESETS := initializationOptions at: #MULTIPLEBYTECODESETS ifAbsentPut: [false].
- NewspeakVM := initializationOptions at: #NewspeakVM ifAbsent: [false].
- MULTIPLEBYTECODESETS := initializationOptions at: #MULTIPLEBYTECODESETS ifAbsent: [false].
"N.B. Not yet implemented."
+ IMMUTABILITY := initializationOptions at: #IMMUTABILITY ifAbsentPut: [false].
- IMMUTABILITY := initializationOptions at: #IMMUTABILITY ifAbsent: [false].
"These for scripts etc... Usually they should get set by an Interpreter class's initializeMiscConstantsWith:"
(initializationOptions includesKey: #STACKVM) ifTrue:
[STACKVM := initializationOptions at: #STACKVM].
(initializationOptions includesKey: #COGVM) ifTrue:
[COGVM := initializationOptions at: #COGVM].
(initializationOptions includesKey: #COGMTVM) ifTrue:
[COGMTVM := initializationOptions at: #COGMTVM]!
Item was changed:
----- Method: VMClass class>>initializeWithOptions: (in category 'initialization') -----
initializeWithOptions: optionsDictionaryOrArray
"Initialize the receiver, typically initializing class variables. Initialize any class variables
whose names occur in optionsDictionary with the corresponding values there-in."
| optionsDictionary |
optionsDictionary := optionsDictionaryOrArray isArray
ifTrue: [Dictionary newFromPairs: optionsDictionaryOrArray]
ifFalse: [optionsDictionaryOrArray].
+ "This is necessary. e.g. if the receiver is CoInterpreterPrimitives,
+ it is still necessary to set the options in CoInterpreter. Otherwise,
+ some class in the chain may have stale options, and when building
+ the code generator, a stale ancilliary class may be computed."
(self withAllSuperclasses copyUpThrough: VMClass) do:
[:class|
class initializationOptions: optionsDictionary]!
Item was removed:
- ----- Method: VMMaker class>>generateNewSqueakCogVM (in category 'configurations') -----
- generateNewSqueakCogVM
- "self generateNewSqueakCogVM"
- ^VMMaker
- generate: (Smalltalk at: ([:choices| choices at: (UIManager default chooseFrom: choices) ifAbsent: [^self]]
- value: #(CoInterpreter CoInterpreterMT)))
- and: StackToRegisterMappingCogit
- with: #( MULTIPLEBYTECODESETS false
- NewspeakVM false
- bytecodeTableInitializer newInitializeBytecodeTableForSqueakV3PlusClosures)
- to: (FileDirectory default pathFromURI: 'oscogvm/src')
- platformDir: (FileDirectory default pathFromURI: 'oscogvm/platforms')
- including:#( ADPCMCodecPlugin AsynchFilePlugin BalloonEnginePlugin B3DAcceleratorPlugin
- BMPReadWriterPlugin BitBltSimulation BochsIA32Plugin CroquetPlugin DSAPlugin
- DeflatePlugin DropPlugin FT2Plugin FFTPlugin FileCopyPlugin FilePlugin FloatArrayPlugin
- FloatMathPlugin GeniePlugin HostWindowPlugin IA32ABIPlugin InternetConfigPlugin
- JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin KlattSynthesizerPlugin
- LargeIntegersPlugin LocalePlugin MIDIPlugin MacMenubarPlugin Matrix2x3Plugin
- MiscPrimitivePlugin Mpeg3Plugin QuicktimePlugin RePlugin SecurityPlugin SerialPlugin
- SocketPlugin SoundCodecPlugin SoundGenerationPlugin SoundPlugin SqueakSSLPlugin StarSqueakPlugin
- ThreadedIA32FFIPlugin UnixAioPlugin UUIDPlugin UnixOSProcessPlugin
- Win32OSProcessPlugin VMProfileLinuxSupportPlugin VMProfileMacSupportPlugin)!
Item was changed:
----- Method: VMMaker class>>generateNewspeakSpurStackVM (in category 'configurations') -----
generateNewspeakSpurStackVM
"No primitives since we can use those for the Cog Newspeak VM"
^VMMaker
generate: StackInterpreter
with: #( ObjectMemory Spur32BitMemoryManager
MULTIPLEBYTECODESETS true
NewspeakVM true)
to: (FileDirectory default directoryNamed: 'oscogvm/nsspurstacksrc') fullName
platformDir: (FileDirectory default directoryNamed: 'oscogvm/platforms') fullName
+ including: #()!
- excluding: (InterpreterPlugin withAllSubclasses collect: [:ea| ea name])!
Item was changed:
----- Method: VMMaker class>>generateNewspeakStackVM (in category 'configurations') -----
generateNewspeakStackVM
"No primitives since we can use those for the Cog Newspeak VM"
^VMMaker
generate: StackInterpreter
with: #(NewspeakVM true MULTIPLEBYTECODESETS true)
to: (FileDirectory default pathFromURI: 'oscogvm/nsstacksrc')
platformDir: (FileDirectory default pathFromURI: 'oscogvm/platforms')
+ including: #()!
- excluding: (InterpreterPlugin withAllSubclasses collect: [:ea| ea name])!
Item was changed:
----- Method: VMMaker class>>generateSqueakCogSistaVM (in category 'configurations') -----
generateSqueakCogSistaVM
+ "No primitives since we can use those for the Cog VM"
^VMMaker
generate: CoInterpreter
and: SistaStackToRegisterMappingCogit
to: (FileDirectory default pathFromURI: 'oscogvm/sistasrc')
platformDir: (FileDirectory default pathFromURI: 'oscogvm/platforms')
+ including: #()!
- excluding: (InterpreterPlugin withAllSubclasses collect: [:ea| ea name])!
Item was changed:
----- Method: VMMaker class>>generateSqueakCogVMWithInterpreterClass: (in category 'confs-support') -----
generateSqueakCogVMWithInterpreterClass: interpreterClass
^VMMaker
generate: interpreterClass
and: StackToRegisterMappingCogit
- with: #( MULTIPLEBYTECODESETS false
- NewspeakVM false)
to: (FileDirectory default pathFromURI: 'oscogvm/src')
platformDir: (FileDirectory default pathFromURI: 'oscogvm/platforms')
+ including:#( ADPCMCodecPlugin AsynchFilePlugin
+ BalloonEnginePlugin B3DAcceleratorPlugin BMPReadWriterPlugin BitBltSimulation BochsIA32Plugin
+ CameraPlugin CroquetPlugin DSAPlugin DeflatePlugin DropPlugin
+ FT2Plugin FFTPlugin FileCopyPlugin FilePlugin FloatArrayPlugin FloatMathPlugin
+ GeniePlugin HostWindowPlugin IA32ABIPlugin InternetConfigPlugin
- including:#( ADPCMCodecPlugin AsynchFilePlugin BalloonEnginePlugin B3DAcceleratorPlugin
- BMPReadWriterPlugin BitBltSimulation BochsIA32Plugin CroquetPlugin DSAPlugin
- DeflatePlugin DropPlugin FT2Plugin FFTPlugin FileCopyPlugin FilePlugin FloatArrayPlugin
- FloatMathPlugin GeniePlugin HostWindowPlugin IA32ABIPlugin InternetConfigPlugin
JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin KlattSynthesizerPlugin
LargeIntegersPlugin LocalePlugin MIDIPlugin MacMenubarPlugin Matrix2x3Plugin
+ MiscPrimitivePlugin Mpeg3Plugin QuicktimePlugin RePlugin
+ ScratchPlugin SecurityPlugin SerialPlugin SocketPlugin
+ SoundCodecPlugin SoundGenerationPlugin SoundPlugin SqueakSSLPlugin StarSqueakPlugin
+ ThreadedIA32FFIPlugin UnicodePlugin UnixAioPlugin UUIDPlugin UnixOSProcessPlugin
+ Win32OSProcessPlugin VMProfileLinuxSupportPlugin VMProfileMacSupportPlugin WeDoPlugin)
+
+ !
- MiscPrimitivePlugin Mpeg3Plugin QuicktimePlugin RePlugin SecurityPlugin SerialPlugin
- SocketPlugin SoundCodecPlugin SoundGenerationPlugin SoundPlugin SqueakSSLPlugin StarSqueakPlugin
- ThreadedIA32FFIPlugin UnixAioPlugin UUIDPlugin UnixOSProcessPlugin
- Win32OSProcessPlugin VMProfileLinuxSupportPlugin VMProfileMacSupportPlugin)!
Item was changed:
----- Method: VMMaker class>>generateSqueakSpurCogVM (in category 'configurations') -----
generateSqueakSpurCogVM
"No primitives since we can use those for the Cog VM"
^VMMaker
generate: CoInterpreter
and: StackToRegisterMappingCogit
+ with: #( ObjectMemory Spur32BitCoMemoryManager)
- with: #( ObjectMemory Spur32BitCoMemoryManager
- MULTIPLEBYTECODESETS false
- NewspeakVM false)
to: (FileDirectory default pathFromURI: 'oscogvm/spursrc')
platformDir: (FileDirectory default pathFromURI: 'oscogvm/platforms')
including:#()!
Item was changed:
----- Method: VMMaker class>>generateSqueakSpurStackVM (in category 'configurations') -----
generateSqueakSpurStackVM
"No primitives since we can use those for the Cog VM"
^VMMaker
generate: StackInterpreter
with: #(ObjectMemory Spur32BitMemoryManager)
to: (FileDirectory default directoryNamed: 'oscogvm/spurstacksrc') fullName
platformDir: (FileDirectory default directoryNamed: 'oscogvm/platforms') fullName
+ including: #()!
- excluding: (InterpreterPlugin withAllSubclasses collect: [:ea| ea name])!
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
+ including: #()!
- excluding: (InterpreterPlugin withAllSubclasses collect: [:ea| ea name])!
More information about the Vm-dev
mailing list