Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler.cc |
| diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc |
| index 90a8f7d13ef8e5ab4e417d714fd0fb9fa340232d..df3dba27208b552f9aef79d64113d27dd025d35b 100644 |
| --- a/runtime/vm/flow_graph_compiler.cc |
| +++ b/runtime/vm/flow_graph_compiler.cc |
| @@ -33,6 +33,9 @@ DECLARE_FLAG(bool, enable_type_checks); |
| DECLARE_FLAG(bool, intrinsify); |
| DECLARE_FLAG(bool, propagate_ic_data); |
| DECLARE_FLAG(int, optimization_counter_threshold); |
| +DECLARE_FLAG(int, optimization_counter_scale); |
| +DECLARE_FLAG(int, min_optimization_counter_threshold); |
| +DECLARE_FLAG(int, reoptimization_counter_threshold); |
| DECLARE_FLAG(bool, use_cha); |
| DECLARE_FLAG(bool, use_osr); |
| DECLARE_FLAG(int, stacktrace_every); |
| @@ -1429,4 +1432,20 @@ const ICData* FlowGraphCompiler::GetOrAddStaticCallICData( |
| return &ic_data; |
| } |
|
Vyacheslav Egorov (Google)
2014/08/29 11:17:18
+ empty line
Anders Johnsen
2014/08/29 11:56:28
Done.
|
| +intptr_t FlowGraphCompiler::GetOptimizationThreshold() const { |
| + intptr_t threshold; |
| + if (is_optimizing()) { |
| + threshold = FLAG_reoptimization_counter_threshold; |
| + } else { |
| + const intptr_t basic_blocks = flow_graph().preorder().length(); |
| + ASSERT(basic_blocks > 0); |
| + threshold = FLAG_optimization_counter_scale * basic_blocks + |
| + FLAG_min_optimization_counter_threshold; |
| + if (threshold > FLAG_optimization_counter_threshold) { |
| + threshold = FLAG_optimization_counter_threshold; |
| + } |
| + } |
| + return threshold; |
| +} |
| + |
| } // namespace dart |