Bug 893853 - IonMonkey: Don't set typeset of |this| when type is unknown, r=bhackett

This commit is contained in:
Hannes Verschore 2013-07-19 09:46:23 -07:00
parent 4d8aa129aa
commit e68cdf7206
2 changed files with 16 additions and 5 deletions

View File

@ -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.

View File

@ -0,0 +1,9 @@
function f() {}
new EvalTest();
function EvalTest() {
with (this) {
f(EvalTest)
}
}
evaluate("var obj = new f(1, 'x');");