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

Unified Diff: src/runtime-profiler.cc

Issue 2497933002: [Interpreter] Fix runtime-profiler ticks for Interpreted functions. (Closed)
Patch Set: Review comments Created 4 years, 1 month 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 | « src/compiler.cc ('k') | 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 2762f2327178108f32b20669dbdacbc3bbc351a9..1871f04e91a68bb09ff0a9bb24f5ba34e50b5656 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -22,7 +22,7 @@ namespace internal {
// Number of times a function has to be seen on the stack before it is
// compiled for baseline.
-static const int kProfilerTicksBeforeBaseline = 1;
+static const int kProfilerTicksBeforeBaseline = 0;
// Number of times a function has to be seen on the stack before it is
// optimized.
static const int kProfilerTicksBeforeOptimization = 2;
@@ -447,16 +447,6 @@ void RuntimeProfiler::MarkCandidatesForOptimization() {
JavaScriptFrame* frame = it.frame();
JSFunction* function = frame->function();
- List<JSFunction*> functions(4);
- frame->GetFunctions(&functions);
- for (int i = functions.length(); --i >= 0; ) {
- SharedFunctionInfo* shared_function_info = functions[i]->shared();
- int ticks = shared_function_info->profiler_ticks();
- if (ticks < Smi::kMaxValue) {
- shared_function_info->set_profiler_ticks(ticks + 1);
- }
- }
-
Compiler::CompilationTier next_tier =
Compiler::NextCompilationTier(function);
if (function->shared()->IsInterpreted()) {
@@ -470,6 +460,19 @@ void RuntimeProfiler::MarkCandidatesForOptimization() {
DCHECK_EQ(next_tier, Compiler::OPTIMIZED);
MaybeOptimizeFullCodegen(function, frame, frame_count);
}
+
+ // Update shared function info ticks after checking for whether functions
+ // should be optimized to keep FCG (which updates ticks on code) and
+ // Ignition (which updates ticks on shared function info) in sync.
+ List<JSFunction*> functions(4);
+ frame->GetFunctions(&functions);
+ for (int i = functions.length(); --i >= 0;) {
+ SharedFunctionInfo* shared_function_info = functions[i]->shared();
+ int ticks = shared_function_info->profiler_ticks();
+ if (ticks < Smi::kMaxValue) {
+ shared_function_info->set_profiler_ticks(ticks + 1);
+ }
+ }
}
any_ic_changed_ = false;
}
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698