Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
| index 8754ecfe48fe31b2a08e3ff188e891276f82b49b..c526fe03b14e5f67f74c60301b87fe0e749e7e10 100644 |
| --- a/runtime/vm/intermediate_language.cc |
| +++ b/runtime/vm/intermediate_language.cc |
| @@ -37,6 +37,8 @@ DEFINE_FLAG(bool, two_args_smi_icd, true, |
| "Generate special IC stubs for two args Smi operations"); |
| DEFINE_FLAG(bool, unbox_numeric_fields, true, |
| "Support unboxed double and float32x4 fields."); |
| +DEFINE_FLAG(bool, fields_may_be_reset, false, |
| + "Don't optimize away static field initialization"); |
|
hausner
2015/09/10 22:55:12
The flag name and the description are quite differ
rmacnak
2015/09/11 00:07:13
Added:
// When precompiling, the fact that a fi
|
| DECLARE_FLAG(bool, eliminate_type_checks); |
| DECLARE_FLAG(bool, trace_optimization); |
| DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| @@ -385,7 +387,7 @@ Instruction* InitStaticFieldInstr::Canonicalize(FlowGraph* flow_graph) { |
| const bool is_initialized = |
| (field_.StaticValue() != Object::sentinel().raw()) && |
| (field_.StaticValue() != Object::transition_sentinel().raw()); |
| - return is_initialized ? NULL : this; |
| + return is_initialized && !FLAG_fields_may_be_reset ? NULL : this; |
| } |