mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Sync record_JSOP_LAMBDA with interpreter (517637, r=jorendorff).
This commit is contained in:
parent
e102fc5e1c
commit
4bb103007a
@ -12633,7 +12633,21 @@ TraceRecorder::record_JSOP_LAMBDA()
|
||||
JSFunction* fun;
|
||||
fun = cx->fp->script->getFunction(getFullIndex());
|
||||
|
||||
/*
|
||||
* Emit code to clone a null closure parented by this recorder's global
|
||||
* object, in order to preserve function object evaluation rules observable
|
||||
* via identity and mutation. But don't clone if our result is consumed by
|
||||
* JSOP_SETMETHOD or JSOP_INITMETHOD, since we optimize away the clone for
|
||||
* these combinations and clone only if the "method value" escapes.
|
||||
*/
|
||||
if (FUN_NULL_CLOSURE(fun) && OBJ_GET_PARENT(cx, FUN_OBJECT(fun)) == globalObj) {
|
||||
JSOp op2 = JSOp(cx->fp->regs->pc[JSOP_LAMBDA_LENGTH]);
|
||||
|
||||
if (op2 == JSOP_SETMETHOD || op2 == JSOP_INITMETHOD) {
|
||||
stack(0, INS_CONSTOBJ(FUN_OBJECT(fun)));
|
||||
return JSRS_CONTINUE;
|
||||
}
|
||||
|
||||
LIns *proto_ins;
|
||||
CHECK_STATUS(getClassPrototype(JSProto_Function, proto_ins));
|
||||
|
||||
|
9
js/src/trace-test/tests/basic/testMethodInitDeref.js
Normal file
9
js/src/trace-test/tests/basic/testMethodInitDeref.js
Normal file
@ -0,0 +1,9 @@
|
||||
for (var j = 0; j < 7; ++j)
|
||||
({x: function () {}}).x;
|
||||
|
||||
checkStats({
|
||||
recorderStarted: 1,
|
||||
recorderAborted: 0,
|
||||
traceCompleted: 1,
|
||||
sideExitIntoInterpreter: 1
|
||||
});
|
9
js/src/trace-test/tests/basic/testMethodInitUneval.js
Normal file
9
js/src/trace-test/tests/basic/testMethodInitUneval.js
Normal file
@ -0,0 +1,9 @@
|
||||
for (var j = 0; j < 7; ++j)
|
||||
uneval({x: function () {}});
|
||||
|
||||
checkStats({
|
||||
recorderStarted: 1,
|
||||
recorderAborted: 0,
|
||||
traceCompleted: 1,
|
||||
sideExitIntoInterpreter: 4
|
||||
});
|
Loading…
Reference in New Issue
Block a user