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

Unified Diff: runtime/vm/intermediate_language_mips.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
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_mips.cc
===================================================================
--- runtime/vm/intermediate_language_mips.cc (revision 39381)
+++ runtime/vm/intermediate_language_mips.cc (working copy)
@@ -2387,6 +2387,47 @@
}
+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(T0));
+ locs->set_temp(0, Location::RegisterLocation(T1));
+ return locs;
+}
+
+
+void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ Register field = locs()->in(0).reg();
+ Register temp = locs()->temp(0).reg();
+
+ Label call_runtime, no_call;
+ __ TraceSimMsg("InitStaticFieldInstr");
+
+ __ lw(temp, FieldAddress(field, Field::value_offset()));
+ __ BranchEqual(temp, Object::sentinel(), &call_runtime);
+ __ BranchNotEqual(temp, Object::transition_sentinel(), &no_call);
+
+ __ Bind(&call_runtime);
+ __ addiu(SP, SP, Immediate(-2 * kWordSize));
+ __ LoadObject(TMP, Object::null_object());
+ __ sw(TMP, Address(SP, 1 * kWordSize)); // Make room for (unused) result.
+ __ sw(field, Address(SP, 0 * kWordSize));
+
+ compiler->GenerateRuntimeCall(token_pos(),
+ deopt_id(),
+ kInitStaticFieldRuntimeEntry,
+ 1,
+ locs());
+
+ __ addiu(SP, SP, Immediate(2 * kWordSize)); // Purge argument and result.
+
+ __ Bind(&no_call);
+}
+
+
LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
bool opt) const {
const intptr_t kNumInputs = 1;
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698