mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
[INFER] Always track active loop in liveness analysis, bug 643829.
This commit is contained in:
parent
40cc39a621
commit
ac1a9b0c9c
11
js/src/jit-test/tests/basic/nestedContinue.js
Normal file
11
js/src/jit-test/tests/basic/nestedContinue.js
Normal file
@ -0,0 +1,11 @@
|
||||
x = 10;
|
||||
outer:
|
||||
while (x < 10) {
|
||||
while (x < 10) {
|
||||
if (x < 10)
|
||||
continue outer;
|
||||
while (x < 10) {
|
||||
y = 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -788,6 +788,7 @@ LifetimeScript::analyze(JSContext *cx, analyze::Script *analysis, JSScript *scri
|
||||
* For each such variable, look for the last lifetime segment in the body
|
||||
* and extend it to the end of the loop.
|
||||
*/
|
||||
JS_ASSERT(loop == codeArray[offset].loop);
|
||||
unsigned backedge = codeArray[offset].loop->backedge;
|
||||
for (unsigned i = 0; i < nfixed; i++) {
|
||||
if (locals[i].lifetime && !extendVariable(cx, locals[i], offset, backedge))
|
||||
@ -798,8 +799,8 @@ LifetimeScript::analyze(JSContext *cx, analyze::Script *analysis, JSScript *scri
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_ASSERT_IF(loop, loop == codeArray[offset].loop);
|
||||
loop = NULL;
|
||||
loop = loop->parent;
|
||||
JS_ASSERT_IF(loop, loop->head < offset);
|
||||
}
|
||||
|
||||
/* Find the last jump target in the loop, other than the initial entry point. */
|
||||
@ -931,10 +932,13 @@ LifetimeScript::analyze(JSContext *cx, analyze::Script *analysis, JSScript *scri
|
||||
if (loop && loop->entry > loop->lastBlock)
|
||||
loop->lastBlock = loop->entry;
|
||||
|
||||
loop = ArenaNew<LifetimeLoop>(pool);
|
||||
if (!loop)
|
||||
LifetimeLoop *nloop = ArenaNew<LifetimeLoop>(pool);
|
||||
if (!nloop)
|
||||
return false;
|
||||
PodZero(loop);
|
||||
PodZero(nloop);
|
||||
|
||||
nloop->parent = loop;
|
||||
loop = nloop;
|
||||
|
||||
codeArray[targetOffset].loop = loop;
|
||||
loop->head = targetOffset;
|
||||
|
@ -377,6 +377,9 @@ struct Lifetime
|
||||
/* Lifetime and modset information for a loop. */
|
||||
struct LifetimeLoop
|
||||
{
|
||||
/* Any loop this one is nested in. */
|
||||
LifetimeLoop *parent;
|
||||
|
||||
/* Offset of the head of the loop. */
|
||||
uint32 head;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user