Skip to content

Commit

Permalink
Mutant pharo-project#527, Reverting [ Replace #ifTrue: with #ifFalse:…
Browse files Browse the repository at this point in the history
… ] on method [ postBecomeScanClassTable: ] KILLED by 1/3 test cases.
  • Loading branch information
hogoww committed Dec 23, 2021
1 parent 5aebdb3 commit 07eac2e
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions smalltalksrc/VMMaker/SpurMemoryManager.class.st
Expand Up @@ -9766,7 +9766,6 @@ SpurMemoryManager >> possibleRootStoreInto: destObj [
{ #category : #'become implementation' }
SpurMemoryManager >> postBecomeScanClassTable: effectsFlags [
"Scan the class table post-become (iff an active class object was becommed) to ensure no
forwarding pointers, and no unhashed classes exist in the class table.
Expand All @@ -9775,29 +9774,27 @@ SpurMemoryManager >> postBecomeScanClassTable: effectsFlags [
(not the classes themselves, since marking a class doesn't help in knowing if its index is used).
On image load, and during incrememtal scan-mark and full GC, classIndices are marked.
We can somehow avoid following classes from the classTable until after this mark phase."
self assert: self validClassTableRootPages.
(effectsFlags anyMask: BecamePointerObjectFlag) ifFalse: [ ^ self ].
(effectsFlags anyMask: BecamePointerObjectFlag) ifFalse: [^self].
0 to: numClassTablePages - 1 do: [ :i |
| page |
0 to: numClassTablePages - 1 do:
[:i| | page |
page := self fetchPointer: i ofObject: hiddenRootsObj.
self assert: (self isForwarded: page) not.
0 to: (self numSlotsOf: page) - 1 do: [ :j |
| classOrNil |
0 to: (self numSlotsOf: page) - 1 do:
[:j| | classOrNil |
classOrNil := self fetchPointer: j ofObject: page.
classOrNil ~= nilObj ifTrue: [
(self isForwarded: classOrNil) ifFalse: [
classOrNil := self followForwarded: classOrNil.
self storePointer: j ofObject: page withValue: classOrNil ].
(self rawHashBitsOf: classOrNil) = 0 ifTrue: [
self storePointerUnchecked: j ofObject: page withValue: nilObj.
"If the removed class is before the classTableIndex, set the
classOrNil ~= nilObj ifTrue:
[(self isForwarded: classOrNil) ifTrue:
[classOrNil := self followForwarded: classOrNil.
self storePointer: j ofObject: page withValue: classOrNil].
(self rawHashBitsOf: classOrNil) = 0 ifTrue:
[self storePointerUnchecked: j ofObject: page withValue: nilObj.
"If the removed class is before the classTableIndex, set the
classTableIndex to point to the empty slot so as to reuse it asap."
i << self classTableMajorIndexShift + j < classTableIndex
ifTrue: [
classTableIndex := i << self classTableMajorIndexShift + j ] ] ] ] ].
(i << self classTableMajorIndexShift + j) < classTableIndex ifTrue:
[classTableIndex := i << self classTableMajorIndexShift + j]]]]].
"classTableIndex must never index the first page, which is reserved for classes known to the VM."
self assert: classTableIndex >= (1 << self classTableMajorIndexShift)
]
Expand Down

0 comments on commit 07eac2e

Please sign in to comment.