Skip to content

Commit

Permalink
Mutant pharo-project#457, Installing [ Replace #ifTrue:ifFalse: recei…
Browse files Browse the repository at this point in the history
…ver with false ] on method [ popObjStack: ] 14 test cases.
  • Loading branch information
hogoww committed Feb 25, 2022
1 parent e4a3c2e commit 0a33fa0
Showing 1 changed file with 44 additions and 28 deletions.
72 changes: 44 additions & 28 deletions smalltalksrc/VMMaker/SpurMemoryManager.class.st
Expand Up @@ -9670,38 +9670,54 @@ SpurMemoryManager >> pop: nItems thenPush: oop [
{ #category : #'obj stacks' }
SpurMemoryManager >> popObjStack: objStack [
| topx top nextPage myx |
self eassert: [self isValidObjStack: objStack].
self eassert: [ self isValidObjStack: objStack ].
topx := self fetchPointer: ObjStackTopx ofObject: objStack.
topx = 0 ifTrue:
[self assert: (self fetchPointer: ObjStackNextx ofObject: objStack) = 0.
self cCode: [] "for debugging markAndTrace: set (MarkStackRecord := OrderedCollection new)"
inSmalltalk:
[(self fetchPointer: ObjStackMyx ofObject: objStack) = MarkStackRootIndex ifTrue:
[MarkStackRecord ifNotNil:
[MarkStackRecord addLast: {#EMPTY. nil}]]].
^nil].
topx = 0 ifTrue: [
self assert:
(self fetchPointer: ObjStackNextx ofObject: objStack) = 0.
self
cCode: [ "for debugging markAndTrace: set (MarkStackRecord := OrderedCollection new)"
]
inSmalltalk: [
(self fetchPointer: ObjStackMyx ofObject: objStack)
= MarkStackRootIndex ifTrue: [
MarkStackRecord ifNotNil: [
MarkStackRecord addLast: { #EMPTY. nil } ] ] ].
^ nil ].
topx := topx - 1.
top := self fetchPointer: topx + ObjStackFixedSlots ofObject: objStack.
self cCode: [] "for debugging markAndTrace: set (MarkStackRecord := OrderedCollection new)"
inSmalltalk:
[(self fetchPointer: ObjStackMyx ofObject: objStack) = MarkStackRootIndex ifTrue:
[MarkStackRecord ifNotNil:
[(MarkStackRecord last first = #push and: [MarkStackRecord last last = top])
ifTrue: [MarkStackRecord removeLast]
ifFalse: [MarkStackRecord addLast: {#pop. top}]]]].
top := self
fetchPointer: topx + ObjStackFixedSlots
ofObject: objStack.
self
cCode: [ "for debugging markAndTrace: set (MarkStackRecord := OrderedCollection new)"
]
inSmalltalk: [
(self fetchPointer: ObjStackMyx ofObject: objStack)
= MarkStackRootIndex ifTrue: [
MarkStackRecord ifNotNil: [
false
ifTrue: [ MarkStackRecord removeLast ]
ifFalse: [
MarkStackRecord addLast: {
#pop.
top } ] ] ] ].
self storePointer: ObjStackTopx ofObjStack: objStack withValue: topx.
(topx = 0
and: [(nextPage := self fetchPointer: ObjStackNextx ofObject: objStack) ~= 0])
ifTrue:
[self storePointer: ObjStackFreex ofObjStack: nextPage withValue: objStack.
self storePointer: ObjStackNextx ofObjStack: objStack withValue: 0.
myx := self fetchPointer: ObjStackMyx ofObject: objStack.
self updateRootOfObjStackAt: myx with: nextPage.
self eassert: [self isValidObjStack: nextPage]]
ifFalse:
[self eassert: [self isValidObjStack: objStack]].
^top
(topx = 0 and: [
(nextPage := self fetchPointer: ObjStackNextx ofObject: objStack)
~= 0 ])
ifTrue: [
self
storePointer: ObjStackFreex
ofObjStack: nextPage
withValue: objStack.
self storePointer: ObjStackNextx ofObjStack: objStack withValue: 0.
myx := self fetchPointer: ObjStackMyx ofObject: objStack.
self updateRootOfObjStackAt: myx with: nextPage.
self eassert: [ self isValidObjStack: nextPage ] ]
ifFalse: [ self eassert: [ self isValidObjStack: objStack ] ].
^ top
]
{ #category : #'interpreter access' }
Expand Down

0 comments on commit 0a33fa0

Please sign in to comment.