Bug 941028 - IonMonkey: Don't inline into big functions, r=jandem

This commit is contained in:
Hannes Verschore 2013-11-21 22:14:27 +01:00
parent 2ccb902003
commit 62f5679921
2 changed files with 15 additions and 1 deletions

View File

@ -204,6 +204,12 @@ struct IonOptions
// Default: 1
uint32_t usesBeforeCompilePar;
// The maximum bytecode length the caller may have,
// before we stop inlining any functions in that caller.
//
// Default: 10000
uint32_t inliningMaxCallerBytecodeLength;
void setEagerCompilation() {
eagerCompilation = true;
usesBeforeCompile = 0;
@ -242,7 +248,8 @@ struct IonOptions
inlineMaxTotalBytecodeLength(1000),
inlineUseCountRatio(128),
eagerCompilation(false),
usesBeforeCompilePar(1)
usesBeforeCompilePar(1),
inliningMaxCallerBytecodeLength(10000)
{
}

View File

@ -4036,6 +4036,13 @@ IonBuilder::makeInliningDecision(JSFunction *target, CallInfo &callInfo)
targetScript->filename(), targetScript->lineno);
return false;
}
// Caller must not be excessively large.
if (script()->length >= js_IonOptions.inliningMaxCallerBytecodeLength) {
IonSpew(IonSpew_Inlining, "%s:%d - Vetoed: caller excessively large.",
targetScript->filename(), targetScript->lineno);
return false;
}
}
// Callee must not be excessively large.