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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 501553005: Scale invocation count by the number of BBs in the flow-graph of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 6 years, 4 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: runtime/vm/flow_graph_compiler_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index a00e8b99efe1c8f7d2133a56aadf0abce5920843..afd779a069f112d6ed1cfeba0d5cef5deb45f344 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -29,6 +29,10 @@ DECLARE_FLAG(int, optimization_counter_threshold);
DECLARE_FLAG(int, reoptimization_counter_threshold);
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(bool, enable_simd_inline);
+DEFINE_FLAG(int, optimization_counter_scale, 2270,
Vyacheslav Egorov (Google) 2014/08/28 14:26:40 Maybe use 100 * Math.pow(Math.PI, Math.E) here? :)
Anders Johnsen 2014/08/28 14:44:16 I'm not sure - where do you get that "magic number
srdjan 2014/08/28 16:49:16 The number is definitely wrong, it must be a typo
srdjan 2014/08/28 17:39:10 On a serious note: do specific number (2270) looks
Vyacheslav Egorov (Google) 2014/08/28 18:06:49 I would like to clarify where 2270 came from: orig
Anders Johnsen 2014/08/29 07:11:37 Yes, the quadratic scale came from Karl and I expe
+ "The scale of invocation count, by size of the function.");
+DEFINE_FLAG(int, optimization_counter_start, 5000,
+ "The minimum invocation count for a function.");
srdjan 2014/08/28 17:39:10 Maybe rename to min_optimization_counter_threshold
Anders Johnsen 2014/08/29 07:11:37 Done.
FlowGraphCompiler::~FlowGraphCompiler() {
@@ -1000,9 +1004,16 @@ void FlowGraphCompiler::EmitFrameEntry() {
__ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()),
Immediate(FLAG_reoptimization_counter_threshold));
} else {
+ intptr_t basic_blocks = flow_graph().preorder().length();
srdjan 2014/08/28 17:39:10 const
Anders Johnsen 2014/08/29 07:11:37 Done.
+ ASSERT(basic_blocks > 0);
+ intptr_t limit = FLAG_optimization_counter_scale * basic_blocks +
+ FLAG_optimization_counter_start;
srdjan 2014/08/28 17:39:10 const
Anders Johnsen 2014/08/29 07:11:37 Cannot, I may reassign below.
+ if (limit > FLAG_optimization_counter_threshold) {
+ limit = FLAG_optimization_counter_threshold;
+ }
__ incl(FieldAddress(function_reg, Function::usage_counter_offset()));
__ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()),
- Immediate(FLAG_optimization_counter_threshold));
+ Immediate(limit));
}
ASSERT(function_reg == EDI);
__ j(GREATER_EQUAL, &stub_code->OptimizeFunctionLabel());
« 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