mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 994444. (r=nbp)
This commit is contained in:
parent
50d14afe31
commit
1634f6b64b
@ -392,6 +392,17 @@ GetStubReturnAddress(JSContext *cx, jsbytecode *pc)
|
|||||||
return cx->compartment()->jitCompartment()->baselineCallReturnAddr();
|
return cx->compartment()->jitCompartment()->baselineCallReturnAddr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline jsbytecode *
|
||||||
|
GetNextNonLoopEntryPc(jsbytecode *pc)
|
||||||
|
{
|
||||||
|
JSOp op = JSOp(*pc);
|
||||||
|
if (op == JSOP_GOTO)
|
||||||
|
return pc + GET_JUMP_OFFSET(pc);
|
||||||
|
if (op == JSOP_LOOPENTRY || op == JSOP_NOP || op == JSOP_LOOPHEAD)
|
||||||
|
return GetNextPc(pc);
|
||||||
|
return pc;
|
||||||
|
}
|
||||||
|
|
||||||
// For every inline frame, we write out the following data:
|
// For every inline frame, we write out the following data:
|
||||||
//
|
//
|
||||||
// | ... |
|
// | ... |
|
||||||
@ -783,16 +794,18 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
|||||||
// If we are resuming at a LOOPENTRY op, resume at the next op to avoid
|
// If we are resuming at a LOOPENTRY op, resume at the next op to avoid
|
||||||
// a bailout -> enter Ion -> bailout loop with --ion-eager. See also
|
// a bailout -> enter Ion -> bailout loop with --ion-eager. See also
|
||||||
// ThunkToInterpreter.
|
// ThunkToInterpreter.
|
||||||
|
//
|
||||||
|
// The algorithm below is the "tortoise and the hare" algorithm. See bug
|
||||||
|
// 994444 for more explanation.
|
||||||
if (!resumeAfter) {
|
if (!resumeAfter) {
|
||||||
|
jsbytecode *fasterPc = pc;
|
||||||
while (true) {
|
while (true) {
|
||||||
op = JSOp(*pc);
|
pc = GetNextNonLoopEntryPc(pc);
|
||||||
if (op == JSOP_GOTO)
|
fasterPc = GetNextNonLoopEntryPc(GetNextNonLoopEntryPc(fasterPc));
|
||||||
pc += GET_JUMP_OFFSET(pc);
|
if (fasterPc == pc)
|
||||||
else if (op == JSOP_LOOPENTRY || op == JSOP_NOP || op == JSOP_LOOPHEAD)
|
|
||||||
pc = GetNextPc(pc);
|
|
||||||
else
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
op = JSOp(*pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t pcOff = script->pcToOffset(pc);
|
uint32_t pcOff = script->pcToOffset(pc);
|
||||||
|
Loading…
Reference in New Issue
Block a user