Skip to content

Commit

Permalink
Mutant pharo-project#599, Installing [ Replace #ifTrue: receiver with…
Browse files Browse the repository at this point in the history
… true ] on method [ markAndShouldScan: ]
  • Loading branch information
hogoww committed Dec 23, 2021
1 parent 08a78bd commit 975a7f4
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions smalltalksrc/VMMaker/SpurMemoryManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8159,36 +8159,33 @@ SpurMemoryManager >> markAllUnscannedEphemerons [
{ #category : #'gc - global' }
SpurMemoryManager >> markAndShouldScan: objOop [
"Helper for markAndTrace:.
Mark the argument, and answer if its fields should be scanned now.
Immediate objects don't need to be marked.
Already marked objects have already been processed.
Pure bits objects don't need scanning, although their class does.
Weak objects should be pushed on the weakling stack.
Anything else need scanning."
| format |
<inline: true>
(self isImmediate: objOop) ifTrue:
[^false].
| format |
(self isImmediate: objOop) ifTrue: [ ^ false ].
"if markAndTrace: is to follow and eliminate forwarding pointers
in its scan it cannot be handed an r-value which is forwarded."
self assert: (self isForwarded: objOop) not.
(self isMarked: objOop) ifTrue:
[^false].
(self isMarked: objOop) ifTrue: [ ^ false ].
self setIsMarkedOf: objOop to: true.
format := self formatOf: objOop.
(self isPureBitsFormat: format) ifTrue: "avoid pushing non-pointer objects on the markStack."
["Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters."
(self classIndexOf: objOop) > self lastClassIndexPun ifTrue:
[self markAndTraceClassOf: objOop].
^false].
format = self weakArrayFormat ifTrue: "push weaklings on the weakling stack to scan later"
[self push: objOop onObjStack: weaklingStack.
^false].
(format = self ephemeronFormat
and: [self activeAndDeferredScan: objOop]) ifTrue:
[^false].
^true
(self isPureBitsFormat: format) ifTrue: [ "Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters.""avoid pushing non-pointer objects on the markStack."
(self classIndexOf: objOop) > self lastClassIndexPun ifTrue: [
self markAndTraceClassOf: objOop ].
^ false ].
format = self weakArrayFormat ifTrue: [ "push weaklings on the weakling stack to scan later"
self push: objOop onObjStack: weaklingStack.
^ false ].
true ifTrue: [ ^ false ].
^ true
]
{ #category : #'gc - global' }
Expand Down

0 comments on commit 975a7f4

Please sign in to comment.