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..d3a4ea68b25aeab744a1ce0bfcd00f9262d298ea 100644 |
| --- a/runtime/vm/flow_graph_compiler_ia32.cc |
| +++ b/runtime/vm/flow_graph_compiler_ia32.cc |
| @@ -25,8 +25,6 @@ namespace dart { |
| DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); |
| DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); |
| -DECLARE_FLAG(int, optimization_counter_threshold); |
| -DECLARE_FLAG(int, reoptimization_counter_threshold); |
| DECLARE_FLAG(bool, enable_type_checks); |
| DECLARE_FLAG(bool, enable_simd_inline); |
| @@ -994,15 +992,16 @@ void FlowGraphCompiler::EmitFrameEntry() { |
| // Patch point is after the eventually inlined function object. |
| entry_patch_pc_offset_ = assembler()->CodeSize(); |
| + const intptr_t threshold = GetOptimizationThreshold(); |
| if (is_optimizing()) { |
| // Reoptimization of an optimized function is triggered by counting in |
| // IC stubs, but not at the entry of the function. |
| __ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()), |
|
Vyacheslav Egorov (Google)
2014/08/29 11:17:18
Move comparison out of the if() [it is duplicated
Anders Johnsen
2014/08/29 11:56:28
Done.
|
| - Immediate(FLAG_reoptimization_counter_threshold)); |
| + Immediate(threshold)); |
| } else { |
|
Vyacheslav Egorov (Google)
2014/08/29 11:17:18
else -> if (!is_optimizing()), leave only incl ins
Anders Johnsen
2014/08/29 11:56:28
Done.
|
| __ incl(FieldAddress(function_reg, Function::usage_counter_offset())); |
| __ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()), |
| - Immediate(FLAG_optimization_counter_threshold)); |
| + Immediate(threshold)); |
| } |
| ASSERT(function_reg == EDI); |
| __ j(GREATER_EQUAL, &stub_code->OptimizeFunctionLabel()); |