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

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 15960009: Streamline IL for instantiating type arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 1598
1599 1599
1600 void InstantiateTypeArgumentsInstr::EmitNativeCode( 1600 void InstantiateTypeArgumentsInstr::EmitNativeCode(
1601 FlowGraphCompiler* compiler) { 1601 FlowGraphCompiler* compiler) {
1602 __ TraceSimMsg("InstantiateTypeArgumentsInstr"); 1602 __ TraceSimMsg("InstantiateTypeArgumentsInstr");
1603 Register instantiator_reg = locs()->in(0).reg(); 1603 Register instantiator_reg = locs()->in(0).reg();
1604 Register result_reg = locs()->out().reg(); 1604 Register result_reg = locs()->out().reg();
1605 1605
1606 // 'instantiator_reg' is the instantiator AbstractTypeArguments object 1606 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1607 // (or null). 1607 // (or null).
1608 if (!type_arguments().IsUninstantiatedIdentity() && 1608 ASSERT(!type_arguments().IsUninstantiatedIdentity() &&
1609 !type_arguments().CanShareInstantiatorTypeArguments( 1609 !type_arguments().CanShareInstantiatorTypeArguments(
1610 instantiator_class())) { 1610 instantiator_class()));
1611 // If the instantiator is null and if the type argument vector 1611 // If the instantiator is null and if the type argument vector
1612 // instantiated from null becomes a vector of dynamic, then use null as 1612 // instantiated from null becomes a vector of dynamic, then use null as
1613 // the type arguments. 1613 // the type arguments.
1614 Label type_arguments_instantiated; 1614 Label type_arguments_instantiated;
1615 const intptr_t len = type_arguments().Length(); 1615 const intptr_t len = type_arguments().Length();
1616 if (type_arguments().IsRawInstantiatedRaw(len)) { 1616 if (type_arguments().IsRawInstantiatedRaw(len)) {
1617 __ beq(instantiator_reg, NULLREG, &type_arguments_instantiated); 1617 __ beq(instantiator_reg, NULLREG, &type_arguments_instantiated);
1618 } 1618 }
1619 // Instantiate non-null type arguments. 1619 // Instantiate non-null type arguments.
1620 // A runtime call to instantiate the type arguments is required. 1620 // A runtime call to instantiate the type arguments is required.
1621 __ addiu(SP, SP, Immediate(-3 * kWordSize)); 1621 __ addiu(SP, SP, Immediate(-3 * kWordSize));
1622 __ LoadObject(TMP1, Object::ZoneHandle()); 1622 __ LoadObject(TMP1, Object::ZoneHandle());
1623 __ sw(TMP1, Address(SP, 2 * kWordSize)); // Make room for the result. 1623 __ sw(TMP1, Address(SP, 2 * kWordSize)); // Make room for the result.
1624 __ LoadObject(TMP1, type_arguments()); 1624 __ LoadObject(TMP1, type_arguments());
1625 __ sw(TMP1, Address(SP, 1 * kWordSize)); 1625 __ sw(TMP1, Address(SP, 1 * kWordSize));
1626 // Push instantiator type arguments. 1626 // Push instantiator type arguments.
1627 __ sw(instantiator_reg, Address(SP, 0 * kWordSize)); 1627 __ sw(instantiator_reg, Address(SP, 0 * kWordSize));
1628 1628
1629 compiler->GenerateCallRuntime(token_pos(), 1629 compiler->GenerateCallRuntime(token_pos(),
1630 deopt_id(), 1630 deopt_id(),
1631 kInstantiateTypeArgumentsRuntimeEntry, 1631 kInstantiateTypeArgumentsRuntimeEntry,
1632 locs()); 1632 locs());
1633 // Pop instantiated type arguments. 1633 // Pop instantiated type arguments.
1634 __ lw(result_reg, Address(SP, 2 * kWordSize)); 1634 __ lw(result_reg, Address(SP, 2 * kWordSize));
1635 // Drop instantiator and uninstantiated type arguments. 1635 // Drop instantiator and uninstantiated type arguments.
1636 __ addiu(SP, SP, Immediate(3 * kWordSize)); 1636 __ addiu(SP, SP, Immediate(3 * kWordSize));
1637 __ Bind(&type_arguments_instantiated); 1637 __ Bind(&type_arguments_instantiated);
1638 }
1639 ASSERT(instantiator_reg == result_reg); 1638 ASSERT(instantiator_reg == result_reg);
1640 // 'result_reg': Instantiated type arguments.
1641 } 1639 }
1642 1640
1643 1641
1644 LocationSummary* 1642 LocationSummary*
1645 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const { 1643 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const {
1646 const intptr_t kNumInputs = 1; 1644 const intptr_t kNumInputs = 1;
1647 const intptr_t kNumTemps = 0; 1645 const intptr_t kNumTemps = 0;
1648 LocationSummary* locs = 1646 LocationSummary* locs =
1649 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 1647 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
1650 locs->set_in(0, Location::RequiresRegister()); 1648 locs->set_in(0, Location::RequiresRegister());
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 compiler->GenerateCall(token_pos(), 2978 compiler->GenerateCall(token_pos(),
2981 &label, 2979 &label,
2982 PcDescriptors::kOther, 2980 PcDescriptors::kOther,
2983 locs()); 2981 locs());
2984 __ Drop(2); // Discard type arguments and receiver. 2982 __ Drop(2); // Discard type arguments and receiver.
2985 } 2983 }
2986 2984
2987 } // namespace dart 2985 } // namespace dart
2988 2986
2989 #endif // defined TARGET_ARCH_MIPS 2987 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698