Skip to content

Commit

Permalink
Pass options as argument to allow more flexible configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
guillep committed Jul 18, 2023
1 parent ef56dde commit 03b0b6b
Showing 1 changed file with 8 additions and 42 deletions.
50 changes: 8 additions & 42 deletions smalltalksrc/VMMakerCompatibilityForPharo6/PharoVMMaker.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Class {
'stopOnErrors',
'generatePlugins',
'wordSizesToGenerate',
'imageFormatName'
'imageFormatName',
'options'
],
#category : #'VMMakerCompatibilityForPharo6-CommandLine'
}
Expand Down Expand Up @@ -65,21 +66,10 @@ PharoVMMaker class >> generate: anInterpreterClass outputDirectory: aDirectory [
]

{ #category : #generation }
PharoVMMaker class >> generate: anInterpreterClass outputDirectory: aDirectory imageFormat: imageFormatName [

Transcript
nextPutAll: 'Generating ';
nextPutAll: anInterpreterClass printString;
nextPutAll: ' in ';
nextPutAll: aDirectory printString;
nextPutAll: ' with ';
nextPutAll: imageFormatName;
nextPutAll: '...';
newLine;
flush.
PharoVMMaker class >> generate: anInterpreterClass outputDirectory: aDirectory options: options [

self new
imageFormatName: imageFormatName;
options: options;
outputDirectory: aDirectory;
perform: #generate , anInterpreterClass asSymbol
]
Expand Down Expand Up @@ -115,14 +105,9 @@ PharoVMMaker >> generate: interpreterClass memoryManager: memoryManager [
{ #category : #generation }
PharoVMMaker >> generate: interpreterClass memoryManager: memoryManager compilerClass: compilerClass [

self generate: interpreterClass memoryManager: memoryManager compilerClass: compilerClass options: #()
]

{ #category : #generation }
PharoVMMaker >> generate: interpreterClass memoryManager: memoryManager compilerClass: compilerClass options: options [

| platformDirectory vmmaker imageReaderClassName imageWriterClassName |

imageFormatName := (Dictionary newFromPairs: options) at: 'ImageFormat' ifAbsent: [ imageFormatName ].
(#(SpurFormat ComposedFormat) includes: imageFormatName)
ifFalse:[ self error: 'Invalid Image Format'].

Expand Down Expand Up @@ -181,27 +166,6 @@ PharoVMMaker >> generatePlugins: anObject [
generatePlugins := anObject
]

{ #category : #generation }
PharoVMMaker >> generateSistaVM [

self generates64Bits ifTrue: [
self
generate: CoInterpreter
memoryManager: Spur64BitCoMemoryManager
compilerClass: SistaCogit
options: #( SistaVM true )].


self generates32Bits ifTrue: [
self
generate: CoInterpreter
memoryManager: Spur32BitCoMemoryManager
compilerClass: SistaCogit
options: #( SistaVM true )].


]

{ #category : #generation }
PharoVMMaker >> generateStackVM [

Expand Down Expand Up @@ -234,7 +198,9 @@ PharoVMMaker >> initialize [
stopOnErrors := false.
generatePlugins := true.
wordSizesToGenerate := #(4 8).
imageFormatName := self class defaultImageFormatName
imageFormatName := self class defaultImageFormatName.

options := #()
]

{ #category : #initialization }
Expand Down

0 comments on commit 03b0b6b

Please sign in to comment.