Chromium Code Reviews| Index: runtime/vm/flow_graph_optimizer.cc |
| diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
| index f2572a15df57d4bc2c84b8e2d73adf8f081809fb..32aa90991a6ae3bbc8785bf692a88d2422b36d52 100644 |
| --- a/runtime/vm/flow_graph_optimizer.cc |
| +++ b/runtime/vm/flow_graph_optimizer.cc |
| @@ -51,6 +51,7 @@ DEFINE_FLAG(bool, trace_smi_widening, false, "Trace Smi->Int32 widening pass."); |
| DECLARE_FLAG(bool, polymorphic_with_deopt); |
| DECLARE_FLAG(bool, source_lines); |
| +DECLARE_FLAG(bool, trace_field_guards); |
| DECLARE_FLAG(bool, trace_type_check_elimination); |
| DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
| @@ -4596,14 +4597,25 @@ void FlowGraphOptimizer::VisitStoreInstanceField( |
| Function::Handle(Z, owner.LookupGetterFunction(field_name)); |
| const Function& setter = |
| Function::Handle(Z, owner.LookupSetterFunction(field_name)); |
| - bool result = !getter.IsNull() |
| - && !setter.IsNull() |
| - && (setter.usage_counter() > 0) |
| - && (FLAG_getter_setter_ratio * setter.usage_counter() >= |
| - getter.usage_counter()); |
| + bool result = false; |
|
Cutch
2015/08/07 13:40:30
s/result/unboxed_field ?
srdjan
2015/08/07 16:15:22
Done.
|
| + if (!getter.IsNull() && !setter.IsNull()) { |
| + if (field.is_double_initialized()) { |
| + result = true; |
| + } else if ((setter.usage_counter() > 0) && |
| + ((FLAG_getter_setter_ratio * setter.usage_counter()) >= |
| + getter.usage_counter())) { |
|
Cutch
2015/08/07 13:40:30
added whitespace before getter?
srdjan
2015/08/07 16:15:22
Made it aligned with FLAG_getter_setter.... 2 spac
|
| + result = true; |
| + } |
| + } |
| if (!result) { |
| - if (FLAG_trace_optimization) { |
| + if (FLAG_trace_optimization || FLAG_trace_field_guards) { |
| ISL_Print("Disabling unboxing of %s\n", field.ToCString()); |
| + if (!setter.IsNull()) { |
| + OS::Print(" setter usage count: %" Pd "\n", setter.usage_counter()); |
| + } |
| + if (!getter.IsNull()) { |
| + OS::Print(" getter usage count: %" Pd "\n", getter.usage_counter()); |
| + } |
| } |
| field.set_is_unboxing_candidate(false); |
| field.DeoptimizeDependentCode(); |