mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 843866: IonMonkey: Make sure inference ran before inlining empty script, r=jandem
This commit is contained in:
parent
aabb1feab3
commit
7067f66e5d
@ -3237,14 +3237,12 @@ IonBuilder::makeInliningDecision(AutoObjectVector &targets)
|
||||
uint32_t totalSize = 0;
|
||||
uint32_t maxInlineDepth = js_IonOptions.maxInlineDepth;
|
||||
bool allFunctionsAreSmall = true;
|
||||
RootedFunction target(cx);
|
||||
RootedScript targetScript(cx);
|
||||
for (size_t i = 0; i < targets.length(); i++) {
|
||||
target = targets[i]->toFunction();
|
||||
JSFunction *target = targets[i]->toFunction();
|
||||
if (!target->isInterpreted())
|
||||
return false;
|
||||
|
||||
targetScript = target->nonLazyScript();
|
||||
JSScript *targetScript = target->nonLazyScript();
|
||||
uint32_t calleeUses = targetScript->getUseCount();
|
||||
|
||||
totalSize += targetScript->length;
|
||||
@ -3281,6 +3279,7 @@ IonBuilder::makeInliningDecision(AutoObjectVector &targets)
|
||||
JSOp op = JSOp(*pc);
|
||||
for (size_t i = 0; i < targets.length(); i++) {
|
||||
JSFunction *target = targets[i]->toFunction();
|
||||
JSScript *targetScript = target->nonLazyScript();
|
||||
|
||||
if (!canInlineTarget(target)) {
|
||||
IonSpew(IonSpew_Inlining, "Decided not to inline");
|
||||
|
@ -603,9 +603,11 @@ TypeInferenceOracle::canEnterInlinedFunction(RawScript caller, jsbytecode *pc, R
|
||||
AssertCanGC();
|
||||
RootedScript targetScript(cx, target->nonLazyScript());
|
||||
|
||||
// Always permit the empty script.
|
||||
if (targetScript->length == 1)
|
||||
return true;
|
||||
// Make sure empty script has type information, to allow inlining in more cases.
|
||||
if (targetScript->length == 1) {
|
||||
if (!targetScript->ensureRanInference(cx))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!targetScript->hasAnalysis() ||
|
||||
!targetScript->analysis()->ranInference() ||
|
||||
|
8
js/src/jit-test/tests/ion/bug843866.js
Normal file
8
js/src/jit-test/tests/ion/bug843866.js
Normal file
@ -0,0 +1,8 @@
|
||||
function g(f) {}
|
||||
function f(b) {
|
||||
g.apply(null, arguments);
|
||||
|
||||
if (b < 10)
|
||||
f(b+1);
|
||||
}
|
||||
f(0);
|
Loading…
Reference in New Issue
Block a user