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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 compiler->GenerateInstanceOf(token_pos(), | 1828 compiler->GenerateInstanceOf(token_pos(), |
1829 deopt_id(), | 1829 deopt_id(), |
1830 type(), | 1830 type(), |
1831 negate_result(), | 1831 negate_result(), |
1832 locs()); | 1832 locs()); |
1833 ASSERT(locs()->out().reg() == EAX); | 1833 ASSERT(locs()->out().reg() == EAX); |
1834 } | 1834 } |
1835 | 1835 |
1836 | 1836 |
1837 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { | 1837 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { |
1838 const intptr_t kNumInputs = 1; | 1838 const intptr_t kNumInputs = 2; |
1839 const intptr_t kNumTemps = 0; | 1839 const intptr_t kNumTemps = 0; |
1840 LocationSummary* locs = | 1840 LocationSummary* locs = |
1841 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1841 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
1842 locs->set_in(0, Location::RegisterLocation(ECX)); | 1842 locs->set_in(0, Location::RegisterLocation(ECX)); |
| 1843 locs->set_in(1, Location::RegisterLocation(EDX)); |
1843 locs->set_out(Location::RegisterLocation(EAX)); | 1844 locs->set_out(Location::RegisterLocation(EAX)); |
1844 return locs; | 1845 return locs; |
1845 } | 1846 } |
1846 | 1847 |
1847 | 1848 |
1848 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1849 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1849 // Allocate the array. EDX = length, ECX = element type. | 1850 // Allocate the array. EDX = length, ECX = element type. |
1850 ASSERT(locs()->in(0).reg() == ECX); | 1851 ASSERT(locs()->in(0).reg() == ECX); |
1851 __ movl(EDX, Immediate(Smi::RawValue(num_elements()))); | 1852 ASSERT(locs()->in(1).reg() == EDX); |
1852 compiler->GenerateCall(token_pos(), | 1853 compiler->GenerateCall(token_pos(), |
1853 &StubCode::AllocateArrayLabel(), | 1854 &StubCode::AllocateArrayLabel(), |
1854 PcDescriptors::kOther, | 1855 PcDescriptors::kOther, |
1855 locs()); | 1856 locs()); |
1856 ASSERT(locs()->out().reg() == EAX); | 1857 ASSERT(locs()->out().reg() == EAX); |
1857 } | 1858 } |
1858 | 1859 |
1859 | 1860 |
1860 LocationSummary* | 1861 LocationSummary* |
1861 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary(bool opt) const { | 1862 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary(bool opt) const { |
(...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5235 PcDescriptors::kOther, | 5236 PcDescriptors::kOther, |
5236 locs()); | 5237 locs()); |
5237 __ Drop(2); // Discard type arguments and receiver. | 5238 __ Drop(2); // Discard type arguments and receiver. |
5238 } | 5239 } |
5239 | 5240 |
5240 } // namespace dart | 5241 } // namespace dart |
5241 | 5242 |
5242 #undef __ | 5243 #undef __ |
5243 | 5244 |
5244 #endif // defined TARGET_ARCH_IA32 | 5245 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |