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

Unified Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2486863002: Fix static field initialization in optimzed DBC code. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index ec13a8339869a875de4b355bfe2cd7fdfb11c64e..5f986cb9104f38910a82ebce6ecc2ecd72a0d994 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -418,9 +418,13 @@ EMIT_NATIVE_CODE(LoadStaticField, 1, Location::RequiresRegister()) {
}
-EMIT_NATIVE_CODE(InitStaticField, 0) {
- ASSERT(!compiler->is_optimizing());
- __ InitStaticTOS();
+EMIT_NATIVE_CODE(InitStaticField, 1) {
+ if (compiler->is_optimizing()) {
+ __ Push(locs()->in(0).reg());
+ __ InitStaticTOS();
Vyacheslav Egorov (Google) 2016/11/09 09:28:28 This looks like a call. Does this need compiler->R
Florian Schneider 2016/11/09 13:51:52 Actually yes, good point. It could throw, or cause
Vyacheslav Egorov (Google) 2016/11/09 13:55:11 I think it should work. Maybe write a test?
+ } else {
+ __ InitStaticTOS();
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698