[Vm-dev] VM Maker: VMMaker-dtl.279.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jul 24 01:39:29 UTC 2012


David T. Lewis uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-dtl.279.mcz

==================== Summary ====================

Name: VMMaker-dtl.279
Author: dtl
Time: 23 July 2012, 9:38:07.75 pm
UUID: 20278fca-3812-4cfe-b7b1-43d6b41e3583
Ancestors: VMMaker-dtl.278

VMMaker 4.9.7

Simplify matters for first time VM builders.

Opening a new VMMakerTool from the world menu will now initialize with plugins sufficient for a minimal VM. Additional configuration is done in the usual manner with menu picks or drag and drop plugins in the VMMakerTool, or by loading an existing configuration file from disk.

To generate sources for an interpreter VM with the minimum plugins needed to load an image and connect to the internet:

	VMMakerTool minimal cleanoutSrcDir; generateAll

To generate sources for an interpreter VM for unix/linux similar to the unix distribution on squeakvm.org:

	VMMakerTool forUnix cleanoutSrcDir; generateAll

Remove VMMakerTool>>isFor64BitVM and VMMakerTool>>toggle64BitVM, obsolete since long ago. This is governed by compile time macros in the generated sources.

Initial support for #mustBeGlobal: for NewObjectMemory and StackInterpreter, do not localize global variables if declared in a #mustBeGlobal:

Declare #primitiveInvokeObjectAsMethod as a required method name in StackInterpreterPrimitives

=============== Diff against VMMaker-dtl.278 ===============

Item was changed:
  ----- Method: CCodeGenerator>>localizeGlobalVariables (in category 'utilities') -----
  localizeGlobalVariables
  	| candidates procedure |
  
  	"find all globals used in only one method"
  	candidates := globalVariableUsage select: [:e | e size = 1].
+ 	(candidates keys select: [:k| vmClass mustBeGlobal: k]) do:
+ 		[:k| candidates removeKey: k].
  	variables removeAllFoundIn: candidates keys.
  
  	"move any suitable global to be local to the single method using it"
  	candidates keysAndValuesDo: [:key :targets | 
  		targets do: [:name |
  			procedure := methods at: name.
  			procedure locals add: key.
  			variableDeclarations at: key ifPresent: [:v | 
  				procedure declarations at: key put: v.
  				variableDeclarations removeKey: key]]].!

Item was added:
+ ----- Method: Object>>mustBeGlobal: (in category '*VMMaker-translation support') -----
+ mustBeGlobal: var
+ 	"Answer if a variable must be global and exported.  Used for inst vars that are accessed from VM support code."
+ 	^false
+ !

Item was added:
+ ----- Method: StackInterpreterPrimitives class>>requiredMethodNames (in category 'translation') -----
+ requiredMethodNames
+ 	"return the list of method names that should be retained for export or other support reasons"
+ 
+ 	^{
+ 		#primitiveInvokeObjectAsMethod
+ 	 }!

Item was added:
+ ----- Method: VMMaker class>>forConfiguration: (in category 'initialisation') -----
+ forConfiguration: spec
+ 
+ 	^(self forPlatform: (spec at: 5)) loadConfiguration: spec
+ !

Item was changed:
  ----- Method: VMMaker class>>forConfigurationFile: (in category 'initialisation') -----
  forConfigurationFile: aFileName
+ 	| config fileStream |
- 	| config fileStream vmMaker |
  
  	fileStream := FileStream oldFileNamed: aFileName.
  	config := ('#(' includes: fileStream peek) "for storeOn: format"
  				ifTrue: [Object readFrom: fileStream]
  				ifFalse: [fileStream fileInObjectAndCode].
+ 	^self forConfiguration: config.
+ !
- 	vmMaker := self forPlatform: (config at: 5).
- 	vmMaker loadConfiguration: config.
- 	^vmMaker!

Item was changed:
  ----- Method: VMMaker class>>versionString (in category 'version testing') -----
  versionString
  
  	"VMMaker versionString"
  
+ 	^'4.9.7'!
- 	^'4.9.6'!

Item was added:
+ ----- Method: VMMakerTool class>>defaultUnixSpec (in category 'configurations') -----
+ defaultUnixSpec
+ 	"Typical VMMaker spec for a unix/linux target platform"
+ 
+ 	"VMMakerTool defaultUnixSpec"
+ 
+ 	^#(
+ 		#(	"internal plugins"
+ 			#ADPCMCodecPlugin
+ 			#AsynchFilePlugin
+ 			#BMPReadWriterPlugin
+ 			#BalloonEnginePlugin
+ 			#BitBltSimulation
+ 			#CroquetPlugin
+ 			#DSAPlugin
+ 			#DeflatePlugin
+ 			#DropPlugin
+ 			#FFTPlugin
+ 			#FT2Plugin
+ 			#FilePlugin
+ 			#FloatArrayPlugin
+ 			#FloatMathPlugin
+ 			#GeniePlugin
+ 			#JPEGReadWriter2Plugin
+ 			#JPEGReaderPlugin
+ 			#JoystickTabletPlugin
+ 			#KlattSynthesizerPlugin
+ 			#LargeIntegersPlugin
+ 			#LocalePlugin
+ 			#MD5Plugin
+ 			#Matrix2x3Plugin
+ 			#MiscPrimitivePlugin
+ 			#RandPlugin
+ 			#RePlugin
+ 			#SHA256Plugin
+ 			#SecurityPlugin
+ 			#SerialPlugin
+ 			#SlangTestPlugin
+ 			#SlangTestSupportPlugin
+ 			#SocketPlugin
+ 			#SoundCodecPlugin
+ 			#SoundGenerationPlugin
+ 			#SoundPlugin
+ 			#StarSqueakPlugin
+ 			#SurfacePlugin
+ 		)
+ 		#(	"external plugins"
+ 			#B3DAcceleratorPlugin
+ 			#B3DEnginePlugin
+ 			#ClipboardExtendedPlugin
+ 			#DBusPlugin
+ 			#FFIPlugin
+ 			#FileCopyPlugin
+ 			#GStreamerPlugin
+ 			#HostWindowPlugin
+ 			#KedamaPlugin
+ 			#KedamaPlugin2
+ 			#MIDIPlugin
+ 			#Mpeg3Plugin
+ 			#RomePlugin
+ 			#UUIDPlugin
+ 			#UnixAioPlugin
+ 			#UnixOSProcessPlugin
+ 			#XDisplayControlPlugin
+ 		)
+ 		true			"inline flag"
+ 		false			"forBrowser flag"
+ 		'unix'			"platform"
+ 		'src'			"source directory for generated sources"
+ 		'platforms'		"path to platform sources"
+ 		4				"unused, was bytesPerWord which is now a compile time definition"
+ 		true			"unused, was flag for source directtory pathname is relative"
+ 		true			"unused, was flag for platforms directory path is relative"
+ 		'Interpreter'	"interpreter class name"
+ 	)!

Item was added:
+ ----- Method: VMMakerTool class>>forUnix (in category 'instance creation') -----
+ forUnix
+ 	"Open a VMMakerTool with a configuration suitable for a typical unix platform"
+ 	
+ 	"VMMakerTool forUnix"
+ 
+ 	| vmm |
+ 	vmm := self new configuration: VMMakerTool defaultUnixSpec.
+ 	vmm buildWindow openInWorld.
+ 	^vmm!

Item was changed:
+ ----- Method: VMMakerTool class>>initialize (in category 'class initialization') -----
- ----- Method: VMMakerTool class>>initialize (in category 'instance creation') -----
  initialize
  
  	Smalltalk at: #TheWorldMenu ifPresent: [ :class |
  		class class methodDict at: #registerOpenCommand: ifPresent: [ :method |
  			(method hasLiteral: #deprecated:) "n.b.  use #hasLiteral: rather than #sendsSelector: for Squeak 3.8"
  				ifFalse: [ class registerOpenCommand: (Array with: 'VMMaker' with: (Array with: self with: #openInWorld)) ] ] ]!

Item was added:
+ ----- Method: VMMakerTool class>>minimal (in category 'instance creation') -----
+ minimal
+ 	"Open a VMMakerTool with a configuration suitable for building a VM with minimal plugin support"
+ 	
+ 	"VMMakerTool minimal"
+ 
+ 	| vmm |
+ 	vmm := self new configuration: VMMakerTool minimalSpec.
+ 	vmm buildWindow openInWorld.
+ 	^vmm!

Item was added:
+ ----- Method: VMMakerTool class>>minimalSpec (in category 'configurations') -----
+ minimalSpec
+ 	"VMMaker spec for a minimal VM"
+ 
+ 	"VMMakerTool minimalSpec"
+ 
+ 	^#(
+ 		#(	"internal plugins required for a minimum usable VM"
+ 			#BitBltSimulation
+ 			#BalloonEnginePlugin
+ 			#FilePlugin
+ 		)
+ 		#(	"external plugins not strictly required"
+ 			#SocketPlugin
+ 		)
+ 		true			"inline flag"
+ 		false			"forBrowser flag"
+ 		nil				"platform (unspecified)"
+ 		'src'			"source directory for generated sources"
+ 		'platforms'		"path to platform sources"
+ 		4				"unused, was bytesPerWord which is now a compile time definition"
+ 		true			"unused, was flag for source directtory pathname is relative"
+ 		true			"unused, was flag for platforms directory path is relative"
+ 		'Interpreter'	"interpreter class name"
+ 	)!

Item was changed:
  ----- Method: VMMakerTool class>>openInWorld (in category 'instance creation') -----
  openInWorld
  	"Build a VMMakerTool and open it"
+ 
  	"VMMakerTool openInWorld"
  
+ 	^self minimal!
- 	^self new buildWindow openInWorld!

Item was added:
+ ----- Method: VMMakerTool>>configuration: (in category 'initialisation') -----
+ configuration: aSpec
+ 	vmMaker loadConfiguration: aSpec!

Item was removed:
- ----- Method: VMMakerTool>>isFor64BitVM (in category 'deprecated') -----
- isFor64BitVM
- 	"This selector may be used by obsolete instances of VMMakerTool. The
- 	64-bit setting of VMMaker is no longer functionally relevant, but this method
- 	is retained to prevent problems with existing VMMakerTool instances that
- 	may exist in some images."!

Item was removed:
- ----- Method: VMMakerTool>>toggle64BitVM (in category 'deprecated') -----
- toggle64BitVM
- 	"This selector may be used by obsolete instances of VMMakerTool. The
- 	64-bit setting of VMMaker is no longer functionally relevant, but this method
- 	is retained to prevent problems with existing VMMakerTool instances that
- 	may exist in some images."!

Item was added:
+ ----- Method: VMMakerTool>>vmMaker (in category 'model access') -----
+ vmMaker
+ 	^vmMaker!



More information about the Vm-dev mailing list