Skip to content

Commit

Permalink
Mutant pharo-project#451, Installing [ Replace #ifTrue: with #ifFalse…
Browse files Browse the repository at this point in the history
…: ] on method [ lastPointerOfWhileSwizzling: ]
  • Loading branch information
hogoww committed Dec 23, 2021
1 parent 442d0ab commit 325fa67
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions smalltalksrc/VMMaker/SpurMemoryManager.class.st
Expand Up @@ -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)."
<api>
<inline: true>
| 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' }
Expand Down

0 comments on commit 325fa67

Please sign in to comment.