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 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1802 | 1802 |
1803 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1803 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1804 Register instance_reg = locs()->in(0).reg(); | 1804 Register instance_reg = locs()->in(0).reg(); |
1805 Register result_reg = locs()->out().reg(); | 1805 Register result_reg = locs()->out().reg(); |
1806 | 1806 |
1807 __ LoadFromOffset(kLoadWord, result_reg, | 1807 __ LoadFromOffset(kLoadWord, result_reg, |
1808 instance_reg, offset_in_bytes() - kHeapObjectTag); | 1808 instance_reg, offset_in_bytes() - kHeapObjectTag); |
1809 } | 1809 } |
1810 | 1810 |
1811 | 1811 |
| 1812 LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const { |
| 1813 const intptr_t kNumInputs = 1; |
| 1814 const intptr_t kNumTemps = 0; |
| 1815 LocationSummary* locs = |
| 1816 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 1817 locs->set_in(0, Location::RegisterLocation(R0)); |
| 1818 locs->set_out(Location::RegisterLocation(R0)); |
| 1819 return locs; |
| 1820 } |
| 1821 |
| 1822 |
| 1823 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1824 Register instantiator_reg = locs()->in(0).reg(); |
| 1825 Register result_reg = locs()->out().reg(); |
| 1826 |
| 1827 // 'instantiator_reg' is the instantiator AbstractTypeArguments object |
| 1828 // (or null). |
| 1829 // A runtime call to instantiate the type is required. |
| 1830 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 1831 __ PushObject(type()); |
| 1832 __ Push(instantiator_reg); // Push instantiator type arguments. |
| 1833 compiler->GenerateCallRuntime(token_pos(), |
| 1834 deopt_id(), |
| 1835 kInstantiateTypeRuntimeEntry, |
| 1836 locs()); |
| 1837 __ Drop(2); // Drop instantiator and uninstantiated type. |
| 1838 __ Pop(result_reg); // Pop instantiated type. |
| 1839 ASSERT(instantiator_reg == result_reg); |
| 1840 } |
| 1841 |
| 1842 |
1812 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const { | 1843 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const { |
1813 const intptr_t kNumInputs = 1; | 1844 const intptr_t kNumInputs = 1; |
1814 const intptr_t kNumTemps = 0; | 1845 const intptr_t kNumTemps = 0; |
1815 LocationSummary* locs = | 1846 LocationSummary* locs = |
1816 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1847 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
1817 locs->set_in(0, Location::RegisterLocation(R0)); | 1848 locs->set_in(0, Location::RegisterLocation(R0)); |
1818 locs->set_out(Location::RegisterLocation(R0)); | 1849 locs->set_out(Location::RegisterLocation(R0)); |
1819 return locs; | 1850 return locs; |
1820 } | 1851 } |
1821 | 1852 |
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3596 compiler->GenerateCall(token_pos(), | 3627 compiler->GenerateCall(token_pos(), |
3597 &label, | 3628 &label, |
3598 PcDescriptors::kOther, | 3629 PcDescriptors::kOther, |
3599 locs()); | 3630 locs()); |
3600 __ Drop(2); // Discard type arguments and receiver. | 3631 __ Drop(2); // Discard type arguments and receiver. |
3601 } | 3632 } |
3602 | 3633 |
3603 } // namespace dart | 3634 } // namespace dart |
3604 | 3635 |
3605 #endif // defined TARGET_ARCH_ARM | 3636 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |