Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: src/runtime-profiler.cc

Issue 2427283004: [interpreter] Also optimize small functions earlier. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index b1e640c2ecb42c78215f6f632fb3a9b0aa13105b..ab76cc90649901d3f562de3f94c973ba1661e254 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -54,6 +54,8 @@ static const int kOSRCodeSizeAllowancePerTickIgnition =
// the very first time it is seen on the stack.
static const int kMaxSizeEarlyOpt =
5 * FullCodeGenerator::kCodeSizeMultiplier;
+static const int kMaxSizeEarlyOptIgnition =
+ 5 * interpreter::Interpreter::kCodeSizeMultiplier;
#define OPTIMIZATION_REASON_LIST(V) \
V(DoNotOptimize, "do not optimize") \
@@ -422,9 +424,18 @@ OptimizationReason RuntimeProfiler::ShouldOptimizeIgnition(
}
return OptimizationReason::kDoNotOptimize;
}
+ } else if (!any_ic_changed_ &&
+ shared->bytecode_array()->Size() < kMaxSizeEarlyOptIgnition) {
+ // If no IC was patched since the last tick and this function is very
mythria 2016/10/19 13:17:29 Just for my understanding, any_ic_changed_ means i
Benedikt Meurer 2016/10/19 13:19:40 That's a good point, I missed that. Can you put th
+ // small, optimistically optimize it now.
+ int typeinfo, generic, total, type_percentage, generic_percentage;
+ GetICCounts(function, &typeinfo, &generic, &total, &type_percentage,
+ &generic_percentage);
+ if (type_percentage >= FLAG_type_info_threshold &&
+ generic_percentage <= FLAG_generic_ic_threshold) {
+ return OptimizationReason::kSmallFunction;
+ }
}
- // TODO(rmcilroy): Consider whether we should optimize small functions when
- // they are first seen on the stack (e.g., kMaxSizeEarlyOpt).
return OptimizationReason::kDoNotOptimize;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698