From ebcc43c228889ae0c251d71e9b8036b2036c5ac6 Mon Sep 17 00:00:00 2001 From: Pierre Misse-Chanabier Date: Tue, 26 Sep 2023 20:31:12 +0200 Subject: [PATCH] [update] compatibility layer to follow changes --- .../instance/allOldSpaceEntitiesFrom.do..st | 4 ++-- .../instance/endOfMemory.st | 3 +++ .../instance/newSpaceStart.st | 3 +++ .../instance/snapshotMemory.st | 6 +++--- .../instance/setUpUsingImage.st | 7 +------ .../instance/newInterpreter.st | 15 +++++++++++++++ .../instance/newMemory.st | 6 ++++++ 7 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 Polyphemus-Memory.package/SpurMemoryManager.extension/instance/endOfMemory.st create mode 100644 Polyphemus-Memory.package/SpurMemoryManager.extension/instance/newSpaceStart.st create mode 100644 Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newInterpreter.st create mode 100644 Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newMemory.st diff --git a/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/allOldSpaceEntitiesFrom.do..st b/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/allOldSpaceEntitiesFrom.do..st index 03da486d..e7d2ce80 100644 --- a/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/allOldSpaceEntitiesFrom.do..st +++ b/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/allOldSpaceEntitiesFrom.do..st @@ -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 \ No newline at end of file diff --git a/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/endOfMemory.st b/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/endOfMemory.st new file mode 100644 index 00000000..6ae2f8d9 --- /dev/null +++ b/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/endOfMemory.st @@ -0,0 +1,3 @@ +*Polyphemus-Memory +endOfMemory + ^ memoryMap oldSpaceEnd \ No newline at end of file diff --git a/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/newSpaceStart.st b/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/newSpaceStart.st new file mode 100644 index 00000000..4d2084b1 --- /dev/null +++ b/Polyphemus-Memory.package/SpurMemoryManager.extension/instance/newSpaceStart.st @@ -0,0 +1,3 @@ +*Polyphemus-Memory +newSpaceStart + ^ memoryMap newSpaceStart \ No newline at end of file diff --git a/Polyphemus-Object.package/AbstractReifiedMemory.class/instance/snapshotMemory.st b/Polyphemus-Object.package/AbstractReifiedMemory.class/instance/snapshotMemory.st index 1a93ef5a..b9690533 100644 --- a/Polyphemus-Object.package/AbstractReifiedMemory.class/instance/snapshotMemory.st +++ b/Polyphemus-Object.package/AbstractReifiedMemory.class/instance/snapshotMemory.st @@ -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. \ No newline at end of file diff --git a/Polyphemus-Tests.package/AbstractInspectorsTest.class/instance/setUpUsingImage.st b/Polyphemus-Tests.package/AbstractInspectorsTest.class/instance/setUpUsingImage.st index 90c0d3f4..29b4485e 100644 --- a/Polyphemus-Tests.package/AbstractInspectorsTest.class/instance/setUpUsingImage.st +++ b/Polyphemus-Tests.package/AbstractInspectorsTest.class/instance/setUpUsingImage.st @@ -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; diff --git a/Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newInterpreter.st b/Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newInterpreter.st new file mode 100644 index 00000000..da1c8d6c --- /dev/null +++ b/Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newInterpreter.st @@ -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 \ No newline at end of file diff --git a/Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newMemory.st b/Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newMemory.st new file mode 100644 index 00000000..28a7f8e7 --- /dev/null +++ b/Polyphemus-Tests.package/VMSpurMemoryManagerTest.extension/instance/newMemory.st @@ -0,0 +1,6 @@ +*Polyphemus-Tests +newMemory + + ^ self wordSize = 4 + ifTrue: [ Spur32BitMemoryManager simulatorClass new ] + ifFalse: [ Spur64BitMemoryManager simulatorClass new ]