Chromium Code Reviews| 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()); |