clean stack sites more aggressively after function calls to avoid GC bugs

This commit is contained in:
Joel Dice 2008-11-25 16:00:40 -07:00
parent eea2225176
commit 58a9718d82

View File

@ -2375,10 +2375,6 @@ class CallEvent: public Event {
target = read(c, footprintSizeInBytes(s->footprint), target = read(c, footprintSizeInBytes(s->footprint),
1 << MemoryOperand, 0, frameIndex); 1 << MemoryOperand, 0, frameIndex);
frameIndex += s->footprint; frameIndex += s->footprint;
if (stackArgumentFootprint == 0) {
popIndex = frameIndex;
}
} }
addRead(c, this, s->value, target); addRead(c, this, s->value, target);
index += s->footprint; index += s->footprint;
@ -2412,18 +2408,18 @@ class CallEvent: public Event {
(c, footprintSizeInBytes(s->footprint), (c, footprintSizeInBytes(s->footprint),
1 << MemoryOperand, 0, frameIndex)); 1 << MemoryOperand, 0, frameIndex));
} else { } else {
unsigned index = ::frameIndex unsigned logicalIndex = ::frameIndex
(c, s->index + c->localFootprint, s->footprint); (c, s->index + c->localFootprint, s->footprint);
if (DebugReads) { if (DebugReads) {
fprintf(stderr, "stack save read %p of footprint %d at %d of %d\n", fprintf(stderr, "stack save read %p of footprint %d at %d of %d\n",
s->value, s->footprint, index, s->value, s->footprint, logicalIndex,
c->alignedFrameSize + c->parameterFootprint); c->alignedFrameSize + c->parameterFootprint);
} }
addRead(c, this, s->value, read addRead(c, this, s->value, read
(c, footprintSizeInBytes(s->footprint), 1 << MemoryOperand, (c, footprintSizeInBytes(s->footprint), 1 << MemoryOperand,
0, index)); 0, logicalIndex));
} }
footprint -= s->footprint; footprint -= s->footprint;
@ -2436,12 +2432,19 @@ class CallEvent: public Event {
padding = logicalIndex - frameIndex; padding = logicalIndex - frameIndex;
padIndex = s->index + c->localFootprint; padIndex = s->index + c->localFootprint;
popIndex = frameIndex + s->footprint;
} }
frameIndex += s->footprint; frameIndex += s->footprint;
} }
popIndex = ::frameIndex
(c, (stackBefore
? stackBefore->index
+ stackBefore->footprint
- stackArgumentFootprint
: 0)
+ c->localFootprint, 0);
saveLocals(c, this); saveLocals(c, this);
} }