Commit 46a1b34e authored by mythria's avatar mythria Committed by Commit bot

[Interpreter] Tune runtime profiler parameters for turbofan and OSR.

Turbofan requires a different tuning when compared to crankshaft. Crankshaft
typically has faster compilation times when compared to turbofan. Hence,
added a new parameter, so that crankshaft and turbofan can be tuned
independently.

OSRing too soon is not good for performance, especially for sunspider
benchmarks. Since they are really small functions and optimizing them is
more expensive than just executing unoptimized code. Tuning the code size
threshold of the functions that can be OSRed from ignition.

BUG=v8:4280,chromium:659111

Review-Url: https://codereview.chromium.org/2445203003
Cr-Commit-Position: refs/heads/master@{#40598}
parent 09ab8e6a
......@@ -67,7 +67,7 @@ class Interpreter {
}
// TODO(ignition): Tune code size multiplier.
static const int kCodeSizeMultiplier = 72;
static const int kCodeSizeMultiplier = 32;
private:
// Bytecode handler generator functions.
......
......@@ -26,6 +26,9 @@ static const int kProfilerTicksBeforeBaseline = 1;
// Number of times a function has to be seen on the stack before it is
// optimized.
static const int kProfilerTicksBeforeOptimization = 2;
// Number of times a interpreted function has to be seen on the stack before
// it is optimized (with Turbofan, ignition is only optimized with Turbofan).
static const int kProfilerTicksBeforeOptimizingInterpretedFunction = 4;
// If the function optimization was disabled due to high deoptimization count,
// but the function is hot and has been seen on the stack this number of times,
// then we try to reenable optimization for this function.
......@@ -36,6 +39,7 @@ static const int kProfilerTicksBeforeReenablingOptimization = 250;
static const int kTicksWhenNotEnoughTypeInfo = 100;
// We only have one byte to store the number of ticks.
STATIC_ASSERT(kProfilerTicksBeforeOptimization < 256);
STATIC_ASSERT(kProfilerTicksBeforeOptimizingInterpretedFunction < 256);
STATIC_ASSERT(kProfilerTicksBeforeReenablingOptimization < 256);
STATIC_ASSERT(kTicksWhenNotEnoughTypeInfo < 256);
......@@ -43,12 +47,12 @@ STATIC_ASSERT(kTicksWhenNotEnoughTypeInfo < 256);
static const int kOSRCodeSizeAllowanceBase =
100 * FullCodeGenerator::kCodeSizeMultiplier;
static const int kOSRCodeSizeAllowanceBaseIgnition =
100 * interpreter::Interpreter::kCodeSizeMultiplier;
10 * interpreter::Interpreter::kCodeSizeMultiplier;
static const int kOSRCodeSizeAllowancePerTick =
4 * FullCodeGenerator::kCodeSizeMultiplier;
static const int kOSRCodeSizeAllowancePerTickIgnition =
4 * interpreter::Interpreter::kCodeSizeMultiplier;
2 * interpreter::Interpreter::kCodeSizeMultiplier;
// Maximum size in bytes of generated code for a function to be optimized
// the very first time it is seen on the stack.
......@@ -404,7 +408,7 @@ OptimizationReason RuntimeProfiler::ShouldOptimizeIgnition(
SharedFunctionInfo* shared = function->shared();
int ticks = shared->profiler_ticks();
if (ticks >= kProfilerTicksBeforeOptimization) {
if (ticks >= kProfilerTicksBeforeOptimizingInterpretedFunction) {
int typeinfo, generic, total, type_percentage, generic_percentage;
GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
&generic_percentage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment