Skip to content

Commit

Permalink
Mutant pharo-project#38, Installing [ Replace #and: argument with [tr…
Browse files Browse the repository at this point in the history
…ue] ] on method [ numPointerSlotsOf: ]
  • Loading branch information
hogoww committed Dec 22, 2021
1 parent 8f4395a commit e608a1d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions smalltalksrc/VMMaker/SpurMemoryManager.class.st
Expand Up @@ -9128,26 +9128,26 @@ SpurMemoryManager >> numFreeLists [
{ #category : #'object access' }
SpurMemoryManager >> numPointerSlotsOf: objOop [
"Answer the number of pointer fields in the given object.
Works with CompiledMethods, as well as ordinary objects."
<api>
<inline: true>
| fmt contextSize numLiterals header |
fmt := self formatOf: objOop.
fmt <= self lastPointerFormat ifTrue:
[(fmt = self indexablePointersFormat
and: [self isContextNonImm: objOop]) ifTrue:
["contexts end at the stack pointer"
fmt <= self lastPointerFormat ifTrue: [
(fmt = self indexablePointersFormat and: [ true ]) ifTrue: [ "contexts end at the stack pointer"
contextSize := coInterpreter fetchStackPointerOf: objOop.
^CtxtTempFrameStart + contextSize].
^self numSlotsOf: objOop "all pointers"].
fmt = self forwardedFormat ifTrue: [^1].
fmt < self firstCompiledMethodFormat ifTrue: [^0]. "no pointers"
^ CtxtTempFrameStart + contextSize ].
^ self numSlotsOf: objOop "all pointers" ].
fmt = self forwardedFormat ifTrue: [ ^ 1 ].
fmt < self firstCompiledMethodFormat ifTrue: [ ^ 0 ]. "no pointers"
"CompiledMethod: contains both pointers and bytes"
header := self methodHeaderOf: objOop.
numLiterals := self literalCountOfMethodHeader: header.
^numLiterals + LiteralStart
^ numLiterals + LiteralStart
]
{ #category : #segments }
Expand Down

0 comments on commit e608a1d

Please sign in to comment.