Skip to content

Commit

Permalink
Fix baseline: Moving back VMClass and VMObjectIndices to Melchor package
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Dec 2, 2022
1 parent 8d67c07 commit 577dac4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Class {
#classInstVars : [
'timeStamp'
],
#category : #'VMMaker-Support'
#category : #Melchor
}

{ #category : #translation }
Expand Down Expand Up @@ -147,68 +147,6 @@ VMClass class >> initialize [
ExpensiveAsserts := false
]

{ #category : #'*VMMaker' }
VMClass class >> initializeForPlugins: optionsDictionaryOrArray [
"Do a default initialization, suitable for generating plugin sources."
StackInterpreterSimulator
initializeWithOptions: optionsDictionaryOrArray

]

{ #category : #'*VMMaker' }
VMClass class >> initializeMiscConstants [
"Falsify the `what type of VM is this?' flags that are defined in the various interp.h files.
Subclass implementations need to include a super initializeMiscConstants"

| omc |
VMBIGENDIAN class. "Mention this for the benefit of CCodeGenerator>>emitCConstantsOn:"
SPURVM := STACKVM := COGVM := false.

InitializationOptions ifNil: [InitializationOptions := Dictionary new].
omc := InitializationOptions at: #ObjectMemory ifAbsent: [self error: 'Please specify an object memory'].

InitializationOptions
at: #SpurObjectMemory "the new contender"
ifAbsentPut: (omc
ifNil: [false]
ifNotNil: [(Smalltalk at: omc) includesBehavior: SpurMemoryManager]).

"Use ifAbsentPut: so that they will get copied back to the
VMMaker's options and dead code will likely be eliminated."
PharoVM := InitializationOptions at: #PharoVM ifAbsentPut: [false].
FEATURE_FFI := InitializationOptions at: #FEATURE_FFI ifAbsentPut: [false].
FEATURE_THREADED_FFI := InitializationOptions at: #FEATURE_THREADED_FFI ifAbsentPut: [false].
FEATURE_MESSAGE_COUNT := InitializationOptions at: #FEATURE_MESSAGE_COUNT ifAbsentPut: [false].

SistaVM := InitializationOptions at: #SistaVM ifAbsentPut: [false].
TempVectReadBarrier := InitializationOptions at: #TempVectReadBarrier ifAbsentPut: [false].
MULTIPLEBYTECODESETS := InitializationOptions at: #MULTIPLEBYTECODESETS ifAbsentPut: [false].
"Simulation only; on by default..."
CloneOnGC := InitializationOptions at: #CloneOnGC ifAbsentPut: [true].
CloneOnScavenge := InitializationOptions at: #CloneOnScavenge ifAbsentPut: [true].

"These must be set only if specified, not defaulted, because they are set on the command line or in include files."
InitializationOptions
at: #VMBIGENDIAN ifPresent: [:value| VMBIGENDIAN := value];
at: #ObjectMemory ifPresent: [:value| SPURVM := value beginsWith: 'Spur'];
at: #STACKVM ifPresent: [:value| STACKVM := value];
at: #COGVM ifPresent: [:value| COGVM := InitializationOptions at: #COGVM].

"consistency checks"
SPURVM
ifTrue:
[(TempVectReadBarrier not
and: [{SpurMemoryManager compactorClass}, (SpurMemoryManager compactorClass ancilliaryClasses) anySatisfy:
[:c| c == SpurSelectiveCompactor]]) ifTrue:
[self error: 'Selective compactor requires read barrier']]
ifFalse:
[TempVectReadBarrier ifTrue: [self error: 'read barrier works with spur VM only...'].
SistaVM ifTrue: [self error: 'Sista VM works with spur VM only...']].

"And not these; they're compile-time"
IMMUTABILITY := InitializationOptions at: #IMMUTABILITY ifAbsent: [SPURVM] "Default as enabled for Spur VMs"
]

{ #category : #initialization }
VMClass class >> initializePrimitiveErrorCodes [
"Define the VM's primitive error codes. N.B. these are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ Class {
'XIndex',
'YIndex'
],
#category : #'VMMaker-Interpreter'
#category : #Melchor
}
63 changes: 0 additions & 63 deletions smalltalksrc/VMMaker/VMClass.extension.st

This file was deleted.

0 comments on commit 577dac4

Please sign in to comment.