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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 471283002: Runtime support for evaluation of static field initializer expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 39313)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -2632,6 +2632,44 @@
}
+LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate,
+ bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 1;
+ LocationSummary* locs = new(isolate) LocationSummary(
+ isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
+ locs->set_in(0, Location::RegisterLocation(R0));
+ locs->set_out(0, Location::RegisterLocation(R0));
srdjan 2014/08/19 18:49:39 You do not need output .. here and elsewhere..
hausner 2014/08/19 20:54:00 Done.
+ locs->set_temp(0, Location::RegisterLocation(R1));
zra 2014/08/18 15:56:09 Why does the temp register need to be hardcoded to
zra 2014/08/18 17:15:53 Nevermind. Looks like for kCall LocationSummary, y
hausner 2014/08/19 17:19:14 I initially tried to use Location::RequiresRegiste
+ return locs;
+}
+
+
+void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register field = locs()->in(0).reg();
+ Register temp = locs()->temp(0).reg();
+ Label call_runtime, no_call;
+
+ __ ldr(temp, FieldAddress(field, Field::value_offset()));
+ __ CompareObject(temp, Object::sentinel());
+ __ b(&call_runtime, EQ);
+
+ __ CompareObject(temp, Object::transition_sentinel());
+ __ b(&no_call, NE);
+
+ __ Bind(&call_runtime);
+ __ PushObject(Object::null_object()); // Make room for (unused) result.
+ __ Push(field);
+ compiler->GenerateRuntimeCall(token_pos(),
+ deopt_id(),
+ kInitStaticFieldRuntimeEntry,
+ 1,
+ locs());
+ __ Drop(2); // Remove argument and result placeholder.
+ __ Bind(&no_call);
+}
+
+
LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
bool opt) const {
const intptr_t kNumInputs = 1;

Powered by Google App Engine
This is Rietveld 408576698