| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 970 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 971 locs->set_in(0, Location::RegisterLocation(ECX)); | 971 locs->set_in(0, Location::RegisterLocation(ECX)); |
| 972 locs->set_out(Location::RegisterLocation(EAX)); | 972 locs->set_out(Location::RegisterLocation(EAX)); |
| 973 return locs; | 973 return locs; |
| 974 } | 974 } |
| 975 | 975 |
| 976 | 976 |
| 977 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 977 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 978 // Allocate the array. EDX = length, ECX = element type. | 978 // Allocate the array. EDX = length, ECX = element type. |
| 979 ASSERT(locs()->in(0).reg() == ECX); | 979 ASSERT(locs()->in(0).reg() == ECX); |
| 980 __ movl(EDX, Immediate(Smi::RawValue(ElementCount()))); | 980 __ movl(EDX, Immediate(Smi::RawValue(ArgumentCount()))); |
| 981 compiler->GenerateCall(token_pos(), | 981 compiler->GenerateCall(token_pos(), |
| 982 try_index(), | 982 try_index(), |
| 983 &StubCode::AllocateArrayLabel(), | 983 &StubCode::AllocateArrayLabel(), |
| 984 PcDescriptors::kOther, | 984 PcDescriptors::kOther, |
| 985 locs()->stack_bitmap()); | 985 locs()->stack_bitmap()); |
| 986 ASSERT(locs()->out().reg() == EAX); | 986 ASSERT(locs()->out().reg() == EAX); |
| 987 | 987 |
| 988 // Pop the element values from the stack into the array. | 988 // Pop the element values from the stack into the array. |
| 989 __ leal(EDX, FieldAddress(EAX, Array::data_offset())); | 989 __ leal(EDX, FieldAddress(EAX, Array::data_offset())); |
| 990 for (int i = ElementCount() - 1; i >= 0; --i) { | 990 for (int i = ArgumentCount() - 1; i >= 0; --i) { |
| 991 ASSERT(ElementAt(i)->IsUse()); | 991 ASSERT(ArgumentAt(i)->value()->IsUse()); |
| 992 __ popl(Address(EDX, i * kWordSize)); | 992 __ popl(Address(EDX, i * kWordSize)); |
| 993 } | 993 } |
| 994 } | 994 } |
| 995 | 995 |
| 996 | 996 |
| 997 LocationSummary* | 997 LocationSummary* |
| 998 AllocateObjectWithBoundsCheckComp::MakeLocationSummary() const { | 998 AllocateObjectWithBoundsCheckComp::MakeLocationSummary() const { |
| 999 const intptr_t kNumInputs = 2; | 999 const intptr_t kNumInputs = 2; |
| 1000 const intptr_t kNumTemps = 0; | 1000 const intptr_t kNumTemps = 0; |
| 1001 LocationSummary* locs = | 1001 LocationSummary* locs = |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2128 locs()->stack_bitmap()); | 2128 locs()->stack_bitmap()); |
| 2129 __ CompareObject(EAX, compiler->bool_true()); | 2129 __ CompareObject(EAX, compiler->bool_true()); |
| 2130 EmitBranchOnCondition(compiler, branch_condition); | 2130 EmitBranchOnCondition(compiler, branch_condition); |
| 2131 } | 2131 } |
| 2132 | 2132 |
| 2133 } // namespace dart | 2133 } // namespace dart |
| 2134 | 2134 |
| 2135 #undef __ | 2135 #undef __ |
| 2136 | 2136 |
| 2137 #endif // defined TARGET_ARCH_X64 | 2137 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |