mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
Bug 893853 - IonMonkey: Don't set typeset of |this| when type is unknown, r=bhackett
This commit is contained in:
parent
4d8aa129aa
commit
e68cdf7206
@ -3469,11 +3469,13 @@ IonBuilder::inlineScriptedCall(CallInfo &callInfo, JSFunction *target)
|
||||
// Improve type information of |this| when not set.
|
||||
if (callInfo.constructing() && !callInfo.thisArg()->resultTypeSet()) {
|
||||
types::StackTypeSet *types = types::TypeScript::ThisTypes(calleeScript);
|
||||
MTypeBarrier *barrier = MTypeBarrier::New(callInfo.thisArg(), cloneTypeSet(types), Bailout_Normal);
|
||||
current->add(barrier);
|
||||
MUnbox *unbox = MUnbox::New(barrier, MIRType_Object, MUnbox::Infallible);
|
||||
current->add(unbox);
|
||||
callInfo.setThis(unbox);
|
||||
if (!types->unknown()) {
|
||||
MTypeBarrier *barrier = MTypeBarrier::New(callInfo.thisArg(), cloneTypeSet(types), Bailout_Normal);
|
||||
current->add(barrier);
|
||||
MUnbox *unbox = MUnbox::New(barrier, MIRType_Object, MUnbox::Infallible);
|
||||
current->add(unbox);
|
||||
callInfo.setThis(unbox);
|
||||
}
|
||||
}
|
||||
|
||||
// Start inlining.
|
||||
|
9
js/src/jit-test/tests/ion/bug893853.js
Normal file
9
js/src/jit-test/tests/ion/bug893853.js
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
function f() {}
|
||||
new EvalTest();
|
||||
function EvalTest() {
|
||||
with (this) {
|
||||
f(EvalTest)
|
||||
}
|
||||
}
|
||||
evaluate("var obj = new f(1, 'x');");
|
Loading…
Reference in New Issue
Block a user