mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 624110 - Properly traverse the scope chain over strict eval frames in the tracer. r=brendan
This commit is contained in:
parent
882117c5e3
commit
50cccbcec6
3
js/src/jit-test/tests/basic/strict-eval-loop-error.js
Normal file
3
js/src/jit-test/tests/basic/strict-eval-loop-error.js
Normal file
@ -0,0 +1,3 @@
|
||||
var COUNT = RUNLOOP;
|
||||
eval("'use strict'; for (let j = 0; j < COUNT; j++); try { x; throw new Error(); } catch (e) { if (!(e instanceof ReferenceError)) throw e; }");
|
||||
assertEq(typeof j, "undefined");
|
@ -14978,6 +14978,13 @@ TraceRecorder::record_JSOP_POPN()
|
||||
return ARECORD_CONTINUE;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsFindableCallObj(JSObject *obj)
|
||||
{
|
||||
return obj->isCall() &&
|
||||
(obj->callIsForEval() || obj->getCallObjCalleeFunction()->isHeavyweight());
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate LIR to reach |obj2| from |obj| by traversing the scope chain. The
|
||||
* generated code also ensures that any call objects found have not changed shape.
|
||||
@ -15019,13 +15026,10 @@ TraceRecorder::traverseScopeChain(JSObject *obj, LIns *obj_ins, JSObject *target
|
||||
|
||||
for (;;) {
|
||||
if (searchObj != globalObj) {
|
||||
Class* clasp = searchObj->getClass();
|
||||
if (clasp == &js_BlockClass) {
|
||||
if (searchObj->isBlock())
|
||||
foundBlockObj = true;
|
||||
} else if (clasp == &js_CallClass &&
|
||||
searchObj->getCallObjCalleeFunction()->isHeavyweight()) {
|
||||
else if (IsFindableCallObj(searchObj))
|
||||
foundCallObj = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchObj == targetObj)
|
||||
@ -15054,8 +15058,7 @@ TraceRecorder::traverseScopeChain(JSObject *obj, LIns *obj_ins, JSObject *target
|
||||
// We must guard on the shape of all call objects for heavyweight functions
|
||||
// that we traverse on the scope chain: if the shape changes, a variable with
|
||||
// the same name may have been inserted in the scope chain.
|
||||
if (obj->isCall() &&
|
||||
obj->getCallObjCalleeFunction()->isHeavyweight()) {
|
||||
if (IsFindableCallObj(obj)) {
|
||||
if (!exit)
|
||||
exit = snapshot(BRANCH_EXIT);
|
||||
guard(true,
|
||||
|
Loading…
Reference in New Issue
Block a user