From 11e8781e4eb544fbc2e3cfa76a1ccc3fe0f05708 Mon Sep 17 00:00:00 2001 From: hogoww Date: Thu, 23 Dec 2021 18:08:38 +0100 Subject: [PATCH] Mutant #589, Installing [ Replace #ifTrue: receiver with false ] on method [ markAndShouldScan: ] --- .../VMMaker/SpurMemoryManager.class.st | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/smalltalksrc/VMMaker/SpurMemoryManager.class.st b/smalltalksrc/VMMaker/SpurMemoryManager.class.st index d6cae225bb..d04fc202c1 100644 --- a/smalltalksrc/VMMaker/SpurMemoryManager.class.st +++ b/smalltalksrc/VMMaker/SpurMemoryManager.class.st @@ -8159,6 +8159,7 @@ 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. @@ -8166,29 +8167,26 @@ SpurMemoryManager >> markAndShouldScan: objOop [ 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 | + - (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]. + false 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 ]. + (format = self ephemeronFormat and: [ + self activeAndDeferredScan: objOop ]) ifTrue: [ ^ false ]. + ^ true ] { #category : #'gc - global' }