Index: runtime/vm/intermediate_language_x64.cc |
=================================================================== |
--- runtime/vm/intermediate_language_x64.cc (revision 24832) |
+++ runtime/vm/intermediate_language_x64.cc (working copy) |
@@ -1841,6 +1841,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(RAX)); |
+ locs->set_out(Location::RegisterLocation(RAX)); |
+ 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()); |
+ __ pushq(instantiator_reg); // Push instantiator type arguments. |
+ compiler->GenerateCallRuntime(token_pos(), |
+ deopt_id(), |
+ kInstantiateTypeRuntimeEntry, |
+ locs()); |
+ __ Drop(2); // Drop instantiator and uninstantiated type. |
+ __ popq(result_reg); // Pop instantiated type. |
+ ASSERT(instantiator_reg == result_reg); |
+} |
+ |
+ |
LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const { |
const intptr_t kNumInputs = 1; |
const intptr_t kNumTemps = 0; |