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

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

Issue 15564004: Refactor the IL for object allocation with type arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 1610
1611 // instantiator_reg is the instantiator type argument vector, i.e. an 1611 // instantiator_reg is the instantiator type argument vector, i.e. an
1612 // AbstractTypeArguments object (or null). 1612 // AbstractTypeArguments object (or null).
1613 ASSERT(!type_arguments().IsUninstantiatedIdentity() && 1613 ASSERT(!type_arguments().IsUninstantiatedIdentity() &&
1614 !type_arguments().CanShareInstantiatorTypeArguments( 1614 !type_arguments().CanShareInstantiatorTypeArguments(
1615 instantiator_class())); 1615 instantiator_class()));
1616 // If the instantiator is null and if the type argument vector 1616 // If the instantiator is null and if the type argument vector
1617 // instantiated from null becomes a vector of dynamic, then use null as 1617 // instantiated from null becomes a vector of dynamic, then use null as
1618 // the type arguments. 1618 // the type arguments.
1619 Label type_arguments_instantiated; 1619 Label type_arguments_instantiated;
1620 const intptr_t len = type_arguments().Length(); 1620 ASSERT(type_arguments().IsRawInstantiatedRaw(type_arguments().Length()));
regis 2013/05/21 16:39:36 Do I understand correctly that you only use this E
1621 if (type_arguments().IsRawInstantiatedRaw(len)) { 1621 __ CompareImmediate(instantiator_reg,
1622 __ CompareImmediate(instantiator_reg, 1622 reinterpret_cast<intptr_t>(Object::null()));
1623 reinterpret_cast<intptr_t>(Object::null())); 1623 __ b(&type_arguments_instantiated, EQ);
1624 __ b(&type_arguments_instantiated, EQ);
1625 }
1626 // Instantiate non-null type arguments. 1624 // Instantiate non-null type arguments.
1627 // In the non-factory case, we rely on the allocation stub to 1625 // In the non-factory case, we rely on the allocation stub to
1628 // instantiate the type arguments. 1626 // instantiate the type arguments.
1629 __ LoadObject(result_reg, type_arguments()); 1627 __ LoadObject(result_reg, type_arguments());
1630 // result_reg: uninstantiated type arguments. 1628 // result_reg: uninstantiated type arguments.
1631 __ Bind(&type_arguments_instantiated); 1629 __ Bind(&type_arguments_instantiated);
1632 1630
1633 // result_reg: uninstantiated or instantiated type arguments. 1631 // result_reg: uninstantiated or instantiated type arguments.
1634 } 1632 }
1635 1633
(...skipping 17 matching lines...) Expand all
1653 1651
1654 // instantiator_reg is the instantiator AbstractTypeArguments object 1652 // instantiator_reg is the instantiator AbstractTypeArguments object
1655 // (or null). 1653 // (or null).
1656 ASSERT(!type_arguments().IsUninstantiatedIdentity() && 1654 ASSERT(!type_arguments().IsUninstantiatedIdentity() &&
1657 !type_arguments().CanShareInstantiatorTypeArguments( 1655 !type_arguments().CanShareInstantiatorTypeArguments(
1658 instantiator_class())); 1656 instantiator_class()));
1659 1657
1660 // If the instantiator is null and if the type argument vector 1658 // If the instantiator is null and if the type argument vector
1661 // instantiated from null becomes a vector of dynamic, then use null as 1659 // instantiated from null becomes a vector of dynamic, then use null as
1662 // the type arguments and do not pass the instantiator. 1660 // the type arguments and do not pass the instantiator.
1663 const intptr_t len = type_arguments().Length(); 1661 ASSERT(type_arguments().IsRawInstantiatedRaw(type_arguments().Length()));
1664 if (type_arguments().IsRawInstantiatedRaw(len)) { 1662 Label instantiator_not_null;
1665 Label instantiator_not_null; 1663 __ CompareImmediate(instantiator_reg,
1666 __ CompareImmediate(instantiator_reg, 1664 reinterpret_cast<intptr_t>(Object::null()));
1667 reinterpret_cast<intptr_t>(Object::null())); 1665 __ b(&instantiator_not_null, NE);
1668 __ b(&instantiator_not_null, NE); 1666 // Null was used in VisitExtractConstructorTypeArguments as the
1669 // Null was used in VisitExtractConstructorTypeArguments as the 1667 // instantiated type arguments, no proper instantiator needed.
1670 // instantiated type arguments, no proper instantiator needed. 1668 __ LoadImmediate(instantiator_reg,
1671 __ LoadImmediate(instantiator_reg, 1669 Smi::RawValue(StubCode::kNoInstantiator));
1672 Smi::RawValue(StubCode::kNoInstantiator)); 1670 __ Bind(&instantiator_not_null);
1673 __ Bind(&instantiator_not_null);
1674 }
1675 // instantiator_reg: instantiator or kNoInstantiator. 1671 // instantiator_reg: instantiator or kNoInstantiator.
1676 } 1672 }
1677 1673
1678 1674
1679 LocationSummary* AllocateContextInstr::MakeLocationSummary() const { 1675 LocationSummary* AllocateContextInstr::MakeLocationSummary() const {
1680 const intptr_t kNumInputs = 0; 1676 const intptr_t kNumInputs = 0;
1681 const intptr_t kNumTemps = 1; 1677 const intptr_t kNumTemps = 1;
1682 LocationSummary* locs = 1678 LocationSummary* locs =
1683 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1679 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1684 locs->set_temp(0, Location::RegisterLocation(R1)); 1680 locs->set_temp(0, Location::RegisterLocation(R1));
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 compiler->GenerateCall(token_pos(), 2862 compiler->GenerateCall(token_pos(),
2867 &label, 2863 &label,
2868 PcDescriptors::kOther, 2864 PcDescriptors::kOther,
2869 locs()); 2865 locs());
2870 __ Drop(2); // Discard type arguments and receiver. 2866 __ Drop(2); // Discard type arguments and receiver.
2871 } 2867 }
2872 2868
2873 } // namespace dart 2869 } // namespace dart
2874 2870
2875 #endif // defined TARGET_ARCH_ARM 2871 #endif // defined TARGET_ARCH_ARM
OLDNEW
« 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