| OLD | NEW |
| 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 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 } | 1710 } |
| 1711 | 1711 |
| 1712 | 1712 |
| 1713 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 1713 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
| 1714 FlowGraphCompiler* compiler) { | 1714 FlowGraphCompiler* compiler) { |
| 1715 Register instantiator_reg = locs()->in(0).reg(); | 1715 Register instantiator_reg = locs()->in(0).reg(); |
| 1716 Register result_reg = locs()->out().reg(); | 1716 Register result_reg = locs()->out().reg(); |
| 1717 | 1717 |
| 1718 // 'instantiator_reg' is the instantiator AbstractTypeArguments object | 1718 // 'instantiator_reg' is the instantiator AbstractTypeArguments object |
| 1719 // (or null). | 1719 // (or null). |
| 1720 if (!type_arguments().IsUninstantiatedIdentity() && | 1720 ASSERT(!type_arguments().IsUninstantiatedIdentity() && |
| 1721 !type_arguments().CanShareInstantiatorTypeArguments( | 1721 !type_arguments().CanShareInstantiatorTypeArguments( |
| 1722 instantiator_class())) { | 1722 instantiator_class())); |
| 1723 // If the instantiator is null and if the type argument vector | 1723 // If the instantiator is null and if the type argument vector |
| 1724 // instantiated from null becomes a vector of dynamic, then use null as | 1724 // instantiated from null becomes a vector of dynamic, then use null as |
| 1725 // the type arguments. | 1725 // the type arguments. |
| 1726 Label type_arguments_instantiated; | 1726 Label type_arguments_instantiated; |
| 1727 const intptr_t len = type_arguments().Length(); | 1727 const intptr_t len = type_arguments().Length(); |
| 1728 if (type_arguments().IsRawInstantiatedRaw(len)) { | 1728 if (type_arguments().IsRawInstantiatedRaw(len)) { |
| 1729 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); | 1729 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); |
| 1730 __ cmp(instantiator_reg, ShifterOperand(IP)); | 1730 __ cmp(instantiator_reg, ShifterOperand(IP)); |
| 1731 __ b(&type_arguments_instantiated, EQ); | 1731 __ b(&type_arguments_instantiated, EQ); |
| 1732 } | |
| 1733 // Instantiate non-null type arguments. | |
| 1734 // A runtime call to instantiate the type arguments is required. | |
| 1735 __ PushObject(Object::ZoneHandle()); // Make room for the result. | |
| 1736 __ PushObject(type_arguments()); | |
| 1737 __ Push(instantiator_reg); // Push instantiator type arguments. | |
| 1738 compiler->GenerateCallRuntime(token_pos(), | |
| 1739 deopt_id(), | |
| 1740 kInstantiateTypeArgumentsRuntimeEntry, | |
| 1741 locs()); | |
| 1742 __ Drop(2); // Drop instantiator and uninstantiated type arguments. | |
| 1743 __ Pop(result_reg); // Pop instantiated type arguments. | |
| 1744 __ Bind(&type_arguments_instantiated); | |
| 1745 } | 1732 } |
| 1733 // Instantiate non-null type arguments. |
| 1734 // A runtime call to instantiate the type arguments is required. |
| 1735 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 1736 __ PushObject(type_arguments()); |
| 1737 __ Push(instantiator_reg); // Push instantiator type arguments. |
| 1738 compiler->GenerateCallRuntime(token_pos(), |
| 1739 deopt_id(), |
| 1740 kInstantiateTypeArgumentsRuntimeEntry, |
| 1741 locs()); |
| 1742 __ Drop(2); // Drop instantiator and uninstantiated type arguments. |
| 1743 __ Pop(result_reg); // Pop instantiated type arguments. |
| 1744 __ Bind(&type_arguments_instantiated); |
| 1746 ASSERT(instantiator_reg == result_reg); | 1745 ASSERT(instantiator_reg == result_reg); |
| 1747 // 'result_reg': Instantiated type arguments. | |
| 1748 } | 1746 } |
| 1749 | 1747 |
| 1750 | 1748 |
| 1751 LocationSummary* | 1749 LocationSummary* |
| 1752 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const { | 1750 ExtractConstructorTypeArgumentsInstr::MakeLocationSummary() const { |
| 1753 const intptr_t kNumInputs = 1; | 1751 const intptr_t kNumInputs = 1; |
| 1754 const intptr_t kNumTemps = 0; | 1752 const intptr_t kNumTemps = 0; |
| 1755 LocationSummary* locs = | 1753 LocationSummary* locs = |
| 1756 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1754 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1757 locs->set_in(0, Location::RequiresRegister()); | 1755 locs->set_in(0, Location::RequiresRegister()); |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3031 compiler->GenerateCall(token_pos(), | 3029 compiler->GenerateCall(token_pos(), |
| 3032 &label, | 3030 &label, |
| 3033 PcDescriptors::kOther, | 3031 PcDescriptors::kOther, |
| 3034 locs()); | 3032 locs()); |
| 3035 __ Drop(2); // Discard type arguments and receiver. | 3033 __ Drop(2); // Discard type arguments and receiver. |
| 3036 } | 3034 } |
| 3037 | 3035 |
| 3038 } // namespace dart | 3036 } // namespace dart |
| 3039 | 3037 |
| 3040 #endif // defined TARGET_ARCH_ARM | 3038 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |