Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1327383002: Don't optimize away static field initialization when precompiling. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/compiler.cc ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« runtime/vm/compiler.cc ('K') | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698