[INFER] Allow uncopies of loop temporaries after backedges, bug 684621.

This commit is contained in:
Brian Hackett 2011-09-05 07:33:06 -07:00
parent 80de01cc3c
commit 0b4b0ae639
2 changed files with 18 additions and 4 deletions

View File

@ -0,0 +1,15 @@
function runRichards() {
queue = new Packet;
Packet(queue, ID_DEVICE_A, KIND_DEVICE);
new Packet;
}
var ID_DEVICE_A = 4;
var KIND_DEVICE = 0;
Packet = function (queue) {
this.link = null
if (queue == null) return;
var peek, next = queue;
while ((peek = next.link) != null)
ID_HANDLER_B
};
runRichards()

View File

@ -1949,9 +1949,6 @@ FrameState::pushCopyOf(FrameEntry *backing)
FrameEntry *
FrameState::walkTrackerForUncopy(FrameEntry *original)
{
/* Temporary entries are immutable and should never be uncopied. */
JS_ASSERT(!isTemporary(original));
uint32 firstCopy = InvalidIndex;
FrameEntry *bestFe = NULL;
uint32 ncopies = 0;
@ -1978,7 +1975,7 @@ FrameState::walkTrackerForUncopy(FrameEntry *original)
JS_ASSERT(firstCopy != InvalidIndex);
JS_ASSERT(bestFe);
JS_ASSERT(bestFe > original);
JS_ASSERT_IF(!isTemporary(original), bestFe > original);
/* Mark all extra copies as copies of the new backing index. */
bestFe->setCopyOf(NULL);
@ -2873,6 +2870,8 @@ FrameState::clearTemporaries()
for (FrameEntry *fe = temporaries; fe < temporariesTop; fe++) {
if (!fe->isTracked())
continue;
if (fe->isCopied())
uncopy(fe);
forgetAllRegs(fe);
fe->resetSynced();
}