diff --git a/smalltalksrc/VMMaker/SpurMemoryManager.class.st b/smalltalksrc/VMMaker/SpurMemoryManager.class.st index d6cae225bb..2980d6a60e 100644 --- a/smalltalksrc/VMMaker/SpurMemoryManager.class.st +++ b/smalltalksrc/VMMaker/SpurMemoryManager.class.st @@ -7844,25 +7844,26 @@ SpurMemoryManager >> lastPointerOfMethodHeader: methodHeader [ ] { #category : #snapshot } -SpurMemoryManager >> lastPointerOfWhileSwizzling: objOop [ +SpurMemoryManager >> lastPointerOfWhileSwizzling: objOop [ + "Answer the byte offset of the last pointer field of the given object. Works with CompiledMethods, as well as ordinary objects. Does not examine the stack pointer of contexts to be sure to swizzle the nils that fill contexts on snapshot. It is invariant that on image load no object contains a forwarding pointer, and the image contains no forwarders (see class comment)." + | fmt header | fmt := self formatOf: objOop. self assert: fmt ~= self forwardedFormat. - fmt <= self lastPointerFormat ifTrue: - [^(self numSlotsOf: objOop) - 1 * self bytesPerOop + self baseHeaderSize "all pointers"]. - fmt < self firstCompiledMethodFormat ifTrue: [^0]. "no pointers" - - "CompiledMethod: contains both pointers and bytes" + fmt <= self lastPointerFormat ifTrue: [ + ^ (self numSlotsOf: objOop) - 1 * self bytesPerOop + + self baseHeaderSize "all pointers" ]. + fmt < self firstCompiledMethodFormat ifFalse: [ ^ 0 ]. header := self methodHeaderOf: objOop. - ^self lastPointerOfMethodHeader: header + ^ self lastPointerOfMethodHeader: header ] { #category : #'debug support' }