Hi all!!
I was looking at the VMMaker sources and noticed that by default when generating my vm, the interpreter and cogit files are generated with different CodeGenerators:
CrossPlatformVMMaker>>createCodeGenerator "Set up a CCodeGenerator for this VMMaker - A cross platform tree leaves it up to the makefiles to decide whether to use the global struct or not." ^CCodeGeneratorGlobalStructure new initialize; globalStructDefined: true; structDefDefine: 'USE_GLOBAL_STRUCT'; logger: logger; yourself
VMMaker>>createCogitCodeGenerator ^CCodeGenerator new initialize logger: logger; yourself
Why should they use different code generators? Shouldn't they by default use the same?
Tx, Guille
Hi Guille,
I use VMMaker class>>activeVMMakerClassFor: to create the VMMaker, and hence the code generator, using 'Cross' as the platform name, which yields a CrossPlatformVMMaker. Look at the methods in VMMaker class's configurations protocol. IMO, this is the right way to generate sources. e.g.
generateSqueakCogVM ^VMMaker generate: CoInterpreter 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 GdbARMPlugin 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 ThreadedIA32FFIPlugin StarSqueakPlugin UUIDPlugin UnixOSProcessPlugin Win32OSProcessPlugin VMProfileMacSupportPlugin)
and follow the send chain through to activeVMMakerClassFor:
On Tue, Nov 27, 2012 at 5:18 AM, Guillermo Polito <guillermopolito@gmail.com
wrote:
Hi all!!
I was looking at the VMMaker sources and noticed that by default when generating my vm, the interpreter and cogit files are generated with different CodeGenerators:
CrossPlatformVMMaker>>createCodeGenerator "Set up a CCodeGenerator for this VMMaker - A cross platform tree leaves it up to the makefiles to decide whether to use the global struct or not." ^CCodeGeneratorGlobalStructure new initialize; globalStructDefined: true; structDefDefine: 'USE_GLOBAL_STRUCT'; logger: logger; yourself
VMMaker>>createCogitCodeGenerator ^CCodeGenerator new initialize logger: logger; yourself
Why should they use different code generators? Shouldn't they by default use the same?
Tx, Guille
vm-dev@lists.squeakfoundation.org