[Vm-dev] VM Maker: VMMaker.oscog-eem.685.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Apr 21 19:38:26 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.685.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.685
Author: eem
Time: 21 April 2014, 12:36:07.695 pm
UUID: 07bc1e83-6566-4de0-af79-d6c7874ffcdd
Ancestors: VMMaker.oscog-djm.684
Make the FFI plugin generated files cross-platform. Output
a skeletal SqueakFFIPrims.c which includes the relevant
fleshed-out implementation. Output the two current
implementations to SqueakFFIPrims/{ARMFFIPlugin.c,IA32FFIPlugin.c}.
Change the Squeak configurations to output both the IA32
and ARM FFI plugins. Omit the FFI from the Newspeak conf.
Fix bogus assert-fail for aboutToReturn:through: send in the
simulator.
=============== Diff against VMMaker.oscog-djm.684 ===============
Item was changed:
----- Method: CogVMSimulator>>ceSendAbort:to:numArgs: (in category 'trampolines') -----
ceSendAbort: selector to: rcvr numArgs: numArgs
"self stringOf: selector"
"self printOop: rcvr"
self logSend: selector.
cogit assertCStackWellAligned.
+ self maybeCheckStackDepth: (selector = (objectMemory splObj: SelectorAboutToReturn)
+ ifTrue: [numArgs]
+ ifFalse: [numArgs + 1])
- self maybeCheckStackDepth: numArgs + 1
sp: stackPointer + BytesPerWord
pc: (stackPages longAt: stackPointer).
^super ceSendAbort: selector to: rcvr numArgs: numArgs!
Item was added:
+ ----- Method: ThreadedARMFFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
+ identifyingPredefinedMacros
+ ^#('__ARM_ARCH__' '__arm__' '__arm32__' 'ARM32')!
Item was added:
+ ----- Method: ThreadedARMFFIPlugin class>>moduleName (in category 'translation') -----
+ moduleName
+ ^'ARM32FFIPlugin'!
Item was added:
+ ----- Method: ThreadedFFIPlugin class>>generateCodeStringForPrimitives (in category 'translation') -----
+ generateCodeStringForPrimitives
+ "Output a skeletal SqueakFFIPrims.c that includes the relevant FooFFIPlugin.c for
+ each subclass based on the identifyingPredefinedMacros the subclass defines."
+
+ ^String streamContents:
+ [:s|
+ s nextPutAll: '/* Automatically generated by\ ' withCRs.
+ s nextPutAll: (CCodeGenerator monticelloDescriptionFor: self).
+ s cr; nextPutAll: ' */'.
+ s cr; cr; nextPut: $#.
+ (self subclasses sort: [:a :b| a name < b name]) do:
+ [:class |
+ class identifyingPredefinedMacros ifNotNil:
+ [:predefinedMacros|
+ s nextPutAll: 'if '.
+ predefinedMacros
+ do: [:predefinedMacro| s nextPutAll: 'defined('; nextPutAll: predefinedMacro; nextPut: $)]
+ separatedBy: [s nextPutAll: ' || '].
+ s cr; cr; nextPutAll: '# include "'; nextPutAll: class moduleName; nextPutAll: '.c"'.
+ s cr; cr; nextPutAll: '#el']].
+ s nextPutAll: 'se'.
+ #( 'As yet no FFI implementation appears to exist for your platform.'
+ 'Consider implementing it, starting by adding a subclass of ThreadedFFIPlugin.') do:
+ [:msg| s cr; nextPutAll: '# error '; nextPutAll: msg].
+ s cr; nextPutAll: '#endif'; cr]!
Item was added:
+ ----- Method: ThreadedFFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
+ identifyingPredefinedMacros
+ "Answer the predefined macros that identify the platforms a subclass handles, if any.
+ If the subclass isn't yet ready for production (a work in progress) simply answer nil."
+ ^nil!
Item was added:
+ ----- Method: ThreadedFFIPlugin class>>translateInDirectory:doInlining: (in category 'translation') -----
+ translateInDirectory: directory doInlining: inlineFlag
+ "As a hack to allow ThreadedFFIPlugin to generate a skeletal SqueakFFIPrims.c that
+ simply includes the fleshed-out SqueakIA32FFIPrims.c, SqueakARMFFIPrims.c et al,
+ intercept for ThreadedFFIPlugin and output generateCodeStringForPrimitives."
+ | ffiPluginRootClass |
+ ffiPluginRootClass := thisContext method methodClass soleInstance.
+ ^self == ffiPluginRootClass
+ ifTrue:
+ [self
+ storeString: self generateCodeStringForPrimitives
+ onFileNamed: (directory fullNameFor: self moduleName, '.c').
+ #()]
+ ifFalse:
+ [super
+ translateInDirectory: (directory containingDirectory directoryNamed: ffiPluginRootClass moduleName)
+ doInlining: inlineFlag]!
Item was added:
+ ----- Method: ThreadedIA32FFIPlugin class>>identifyingPredefinedMacros (in category 'translation') -----
+ identifyingPredefinedMacros
+ ^#('_M_I386' '_X86_' 'i386' 'i486' 'i586' 'i686' '__i386__' '__386__' 'X86' 'I386')!
Item was added:
+ ----- Method: ThreadedIA32FFIPlugin class>>moduleName (in category 'translation') -----
+ moduleName
+ ^'IA32FFIPlugin'!
Item was added:
+ ----- Method: ThreadedPPCBEFFIPlugin class>>moduleName (in category 'translation') -----
+ moduleName
+ ^'PPC32FFIPlugin'!
Item was changed:
----- Method: VMMaker class>>generateNewspeakCogVM (in category 'configurations') -----
generateNewspeakCogVM
^VMMaker
generate: CoInterpreter
and: StackToRegisterMappingCogit
with: #( NewspeakVM true
MULTIPLEBYTECODESETS true)
to: (FileDirectory default pathFromURI: self sourceTree, '/nscogsrc')
platformDir: (FileDirectory default pathFromURI: self sourceTree, '/platforms')
including:#( AsynchFilePlugin BMPReadWriterPlugin BalloonEnginePlugin BitBltSimulation DeflatePlugin DSAPlugin DropPlugin
FileCopyPlugin FilePlugin FloatArrayPlugin FloatMathPlugin ImmX11Plugin JPEGReadWriter2Plugin
JPEGReaderPlugin LargeIntegersPlugin Matrix2x3Plugin MiscPrimitivePlugin NewsqueakIA32ABIPlugin
+ RePlugin SecurityPlugin SocketPlugin SoundPlugin SqueakSSLPlugin SurfacePlugin
- RePlugin SecurityPlugin SocketPlugin SoundPlugin SqueakSSLPlugin SurfacePlugin ThreadedIA32FFIPlugin
UUIDPlugin UnixOSProcessPlugin VMProfileLinuxSupportPlugin VMProfileMacSupportPlugin Win32OSProcessPlugin)!
Item was changed:
----- Method: VMMaker class>>generateSqueakCogVMWithInterpreterClass: (in category 'confs-support') -----
generateSqueakCogVMWithInterpreterClass: interpreterClass
^VMMaker
generate: interpreterClass
and: StackToRegisterMappingCogit
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 ImmX11Plugin InternetConfigPlugin
JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin KlattSynthesizerPlugin
LargeIntegersPlugin LocalePlugin MIDIPlugin MacMenubarPlugin Matrix2x3Plugin
MiscPrimitivePlugin Mpeg3Plugin QuicktimePlugin RePlugin
ScratchPlugin SecurityPlugin SerialPlugin SocketPlugin
SoundCodecPlugin SoundGenerationPlugin SoundPlugin SqueakSSLPlugin StarSqueakPlugin
+ ThreadedFFIPlugin ThreadedARMFFIPlugin ThreadedIA32FFIPlugin
+ UnicodePlugin UnixAioPlugin UUIDPlugin UnixOSProcessPlugin
- ThreadedIA32FFIPlugin UnicodePlugin UnixAioPlugin UUIDPlugin UnixOSProcessPlugin
Win32OSProcessPlugin VMProfileLinuxSupportPlugin VMProfileMacSupportPlugin WeDoPlugin)
!
More information about the Vm-dev
mailing list