Bug 782432 - Ion-compile small functions more aggressively. (r=dvander)

This commit is contained in:
Kannan Vijayan 2012-08-13 19:41:17 -04:00
parent 7ef28ac5ac
commit 9773cee987
2 changed files with 17 additions and 2 deletions

View File

@ -987,8 +987,13 @@ Compile(JSContext *cx, JSScript *script, JSFunction *fun, jsbytecode *osrPc, boo
if (cx->methodJitEnabled) {
// If JM is enabled we use getUseCount instead of incUseCount to avoid
// bumping the use count twice.
if (script->getUseCount() < js_IonOptions.usesBeforeCompile)
return Method_Skipped;
if (script->length < js_IonOptions.smallFunctionMaxBytecodeLength) {
if (script->getUseCount() < js_IonOptions.smallFunctionUsesBeforeCompile)
return Method_Skipped;
} else {
if (script->getUseCount() < js_IonOptions.usesBeforeCompile)
return Method_Skipped;
}
} else {
if (script->incUseCount() < js_IonOptions.usesBeforeCompileNoJaeger)
return Method_Skipped;

View File

@ -104,6 +104,15 @@ struct IonOptions
// Default: 100
uint32 smallFunctionMaxBytecodeLength;
// The compile useCount for small functions.
//
// This value has been arrived at empirically.
// We may want to revisit this tuning after other optimizations have
// gone in.
//
// Default: usesBeforeCompile / 4
uint32 smallFunctionUsesBeforeCompile;
// The inlining limit for small functions.
//
// This value has been arrived at empirically via benchmarking.
@ -158,6 +167,7 @@ struct IonOptions
maxStackArgs(4096),
maxInlineDepth(3),
smallFunctionMaxBytecodeLength(100),
smallFunctionUsesBeforeCompile(usesBeforeCompile / 4),
smallFunctionUsesBeforeInlining(usesBeforeInlining / 4),
polyInlineMax(4),
inlineMaxTotalBytecodeLength(800),