mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 821788 - Prevent elimination of phis and resume point operands for operands of inline calls, r=jandem.
This commit is contained in:
parent
3df5586b3c
commit
88c9f11bcc
@ -3098,9 +3098,12 @@ IonBuilder::jsop_call_inline(HandleFunction callee, uint32_t argc, bool construc
|
||||
{
|
||||
AssertCanGC();
|
||||
|
||||
int calleePos = -((int) argc + 2);
|
||||
current->peek(calleePos)->setFoldedUnchecked();
|
||||
|
||||
// Rewrite the stack position containing the function with the constant
|
||||
// function definition, before we take the inlineResumePoint
|
||||
current->rewriteAtDepth(-((int) argc + 2), constFun);
|
||||
current->rewriteAtDepth(calleePos, constFun);
|
||||
|
||||
// This resume point collects outer variables only. It is used to recover
|
||||
// the stack state before the current bytecode.
|
||||
@ -3506,6 +3509,7 @@ IonBuilder::inlineScriptedCall(AutoObjectVector &targets, uint32_t argc, bool co
|
||||
MPassArg *passArg = top->peek(argSlotDepth)->toPassArg();
|
||||
MBasicBlock *block = passArg->block();
|
||||
MDefinition *wrapped = passArg->getArgument();
|
||||
wrapped->setFoldedUnchecked();
|
||||
passArg->replaceAllUsesWith(wrapped);
|
||||
top->rewriteAtDepth(argSlotDepth, wrapped);
|
||||
block->discard(passArg);
|
||||
|
13
js/src/jit-test/tests/ion/bug821788.js
Normal file
13
js/src/jit-test/tests/ion/bug821788.js
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
var appendToActual = function(s) {
|
||||
actual += s + ',';
|
||||
}
|
||||
gczeal(2,(3));
|
||||
actual = '';
|
||||
function loop(f) {}
|
||||
function f(j, k) {
|
||||
var g = function(a, b, c) {}
|
||||
for (k = 0; k < 5; ++k)
|
||||
appendToActual(loop(g));
|
||||
}
|
||||
f(1);
|
10
js/src/jit-test/tests/ion/bug821794.js
Normal file
10
js/src/jit-test/tests/ion/bug821794.js
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
gczeal(2);
|
||||
function bitsinbyte() {
|
||||
var [ summary ] = true;
|
||||
}
|
||||
function TimeFunc(func) {
|
||||
for(var y=0; y<11000; y++)
|
||||
func();
|
||||
}
|
||||
TimeFunc(bitsinbyte);
|
Loading…
Reference in New Issue
Block a user