Skip to content

Commit

Permalink
[update] compatibility layer to follow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Misse-Chanabier committed Sep 26, 2023
1 parent 9d11cbf commit ebcc43c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ allOldSpaceEntitiesFrom: initialObject do: aBlock
prevPrevObj := prevObj := nil.
objOop := initialObject.
[self assert: objOop \\ self allocationUnit = 0.
self oop: objOop isLessThan: endOfMemory] whileTrue:
self oop: objOop isLessThan: self endOfMemory] whileTrue:
[(self long64At: objOop) ~= 0 ifFalse: [OopIsNotAnObject new
oop: objOop;
signal].
aBlock value: objOop.
prevPrevObj := prevObj.
prevObj := objOop.
objOop := self objectAfter: objOop limit: endOfMemory].
objOop := self objectAfter: objOop limit: self endOfMemory].
self touch: prevPrevObj.
self touch: prevObj
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*Polyphemus-Memory
endOfMemory
^ memoryMap oldSpaceEnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*Polyphemus-Memory
newSpaceStart
^ memoryMap newSpaceStart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
updating
snapshotMemory
"This size is for an oldSpace we take the end - the beginning then we compress by worsize because every address is wordSize aligned then by 8 because we remove the 3 bits tag"
| arraySize |
arraySize := (memory endOfMemory - memory newSpaceStart) >> 3.
objectsArray := Array new: arraySize.
"| arraySize |
arraySize := (memory endOfMemory - memory newSpaceStart) >> 3."
objectsArray := Array new": arraySize".
self initializeObjectsFromMemory.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ setUpUsingImage
interpreter initStackPages.
interpreter loadInitialContext.
wordSize := memory wordSize.

objectHeaderSize := 8 "bytes. Always.".
emptyObjectSize := objectHeaderSize + 8 "minimum required single empty slot, to use for forwarders".

newSpaceSize := memory newSpaceLimit - memory newSpaceStart.
oldSpaceSize := memory oldSpaceSize.


methodBuilder := VMCompiledCodeBuilder new
interpreter: interpreter;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*Polyphemus-Tests
newInterpreter
memory := self newMemory.

self interpreterClass
initializeWithOptions:
{#BytesPerWord.
self wordSize.
#ObjectMemory.
memory class name}
objectMemoryClass: memory class.

^ self interpreterClass basicNew
objectMemory: memory;
basicInitialize
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*Polyphemus-Tests
newMemory

^ self wordSize = 4
ifTrue: [ Spur32BitMemoryManager simulatorClass new ]
ifFalse: [ Spur64BitMemoryManager simulatorClass new ]

0 comments on commit ebcc43c

Please sign in to comment.