mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 921035 - Dont phi-eliminate scopeChain object in heavyweight functions if it may be neede for argsobj construction later. r=h4writer
This commit is contained in:
parent
936b294d34
commit
b276f5133e
12
js/src/jit-test/tests/ion/bug921035.js
Normal file
12
js/src/jit-test/tests/ion/bug921035.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
function $ERROR() {}
|
||||||
|
function testMultipleArgumentsObjects() {
|
||||||
|
var testargs = arguments;
|
||||||
|
var f = function (which) {
|
||||||
|
var args = [ testargs ];
|
||||||
|
return args[which][0];
|
||||||
|
};
|
||||||
|
var arr = [0, 0, 0, 0, 1];
|
||||||
|
for (var i = 0; i < arr.length; i++)
|
||||||
|
$ERROR[i] = f(arr[i]);
|
||||||
|
}
|
||||||
|
testMultipleArgumentsObjects()
|
@ -211,16 +211,25 @@ IsPhiObservable(MPhi *phi, Observability observe)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the Phi is of the |this| value, it must always be observable.
|
|
||||||
uint32_t slot = phi->slot();
|
uint32_t slot = phi->slot();
|
||||||
CompileInfo &info = phi->block()->info();
|
CompileInfo &info = phi->block()->info();
|
||||||
if (info.fun() && slot == info.thisSlot())
|
JSFunction *fun = info.fun();
|
||||||
|
|
||||||
|
// If the Phi is of the |this| value, it must always be observable.
|
||||||
|
if (fun && slot == info.thisSlot())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// If the function is heavyweight, and the Phi is of the |scopeChain|
|
||||||
|
// value, and the function may need an arguments object, then make sure
|
||||||
|
// to preserve the scope chain, because it may be needed to construct the
|
||||||
|
// arguments object during bailout.
|
||||||
|
if (fun && fun->isHeavyweight() && info.hasArguments() && slot == info.scopeChainSlot())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// If the Phi is one of the formal argument, and we are using an argument
|
// If the Phi is one of the formal argument, and we are using an argument
|
||||||
// object in the function. The phi might be observable after a bailout.
|
// object in the function. The phi might be observable after a bailout.
|
||||||
// For inlined frames this is not needed, as they are captured in the inlineResumePoint.
|
// For inlined frames this is not needed, as they are captured in the inlineResumePoint.
|
||||||
if (info.fun() && info.hasArguments()) {
|
if (fun && info.hasArguments()) {
|
||||||
uint32_t first = info.firstArgSlot();
|
uint32_t first = info.firstArgSlot();
|
||||||
if (first <= slot && slot - first < info.nargs()) {
|
if (first <= slot && slot - first < info.nargs()) {
|
||||||
// If arguments obj aliases formals, then the arg slots will never be used.
|
// If arguments obj aliases formals, then the arg slots will never be used.
|
||||||
|
Loading…
Reference in New Issue
Block a user