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

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 18801007: Support type parameters and classes as expression in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 24832)
+++ runtime/vm/intermediate_language_mips.cc (working copy)
@@ -1886,6 +1886,45 @@
}
+LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* locs =
+ new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
+ locs->set_in(0, Location::RegisterLocation(T0));
+ locs->set_out(Location::RegisterLocation(T0));
+ return locs;
+}
+
+
+void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ TraceSimMsg("InstantiateTypeInstr");
+ Register instantiator_reg = locs()->in(0).reg();
+ Register result_reg = locs()->out().reg();
+
+ // 'instantiator_reg' is the instantiator AbstractTypeArguments object
+ // (or null).
+ // A runtime call to instantiate the type is required.
+ __ addiu(SP, SP, Immediate(-3 * kWordSize));
+ __ LoadObject(TMP1, Object::ZoneHandle());
+ __ sw(TMP1, Address(SP, 2 * kWordSize)); // Make room for the result.
+ __ LoadObject(TMP1, type());
+ __ sw(TMP1, Address(SP, 1 * kWordSize));
+ // Push instantiator type arguments.
+ __ sw(instantiator_reg, Address(SP, 0 * kWordSize));
+
+ compiler->GenerateCallRuntime(token_pos(),
+ deopt_id(),
+ kInstantiateTypeRuntimeEntry,
+ locs());
+ // Pop instantiated type.
+ __ lw(result_reg, Address(SP, 2 * kWordSize));
+ // Drop instantiator and uninstantiated type.
+ __ addiu(SP, SP, Immediate(3 * kWordSize));
+ ASSERT(instantiator_reg == result_reg);
+}
+
+
LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
« 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