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

Unified Diff: runtime/vm/intermediate_language_arm.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.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 24832)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -1809,6 +1809,37 @@
}
+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(R0));
+ locs->set_out(Location::RegisterLocation(R0));
+ return locs;
+}
+
+
+void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ 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.
+ __ PushObject(Object::ZoneHandle()); // Make room for the result.
+ __ PushObject(type());
+ __ Push(instantiator_reg); // Push instantiator type arguments.
+ compiler->GenerateCallRuntime(token_pos(),
+ deopt_id(),
+ kInstantiateTypeRuntimeEntry,
+ locs());
+ __ Drop(2); // Drop instantiator and uninstantiated type.
+ __ Pop(result_reg); // Pop instantiated type.
+ 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.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698