| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1579 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 1580 locs->set_in(0, Location::RegisterLocation(ECX)); | 1580 locs->set_in(0, Location::RegisterLocation(ECX)); |
| 1581 locs->set_out(Location::RegisterLocation(EAX)); | 1581 locs->set_out(Location::RegisterLocation(EAX)); |
| 1582 return locs; | 1582 return locs; |
| 1583 } | 1583 } |
| 1584 | 1584 |
| 1585 | 1585 |
| 1586 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1586 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1587 // Allocate the array. EDX = length, ECX = element type. | 1587 // Allocate the array. EDX = length, ECX = element type. |
| 1588 ASSERT(locs()->in(0).reg() == ECX); | 1588 ASSERT(locs()->in(0).reg() == ECX); |
| 1589 __ movl(EDX, Immediate(Smi::RawValue(ArgumentCount()))); | 1589 __ movl(EDX, Immediate(Smi::RawValue(num_elements()))); |
| 1590 compiler->GenerateCall(token_pos(), | 1590 compiler->GenerateCall(token_pos(), |
| 1591 &StubCode::AllocateArrayLabel(), | 1591 &StubCode::AllocateArrayLabel(), |
| 1592 PcDescriptors::kOther, | 1592 PcDescriptors::kOther, |
| 1593 locs()); | 1593 locs()); |
| 1594 ASSERT(locs()->out().reg() == EAX); | 1594 ASSERT(locs()->out().reg() == EAX); |
| 1595 | |
| 1596 // Pop the element values from the stack into the array. | |
| 1597 __ leal(EDX, FieldAddress(EAX, Array::data_offset())); | |
| 1598 for (int i = ArgumentCount() - 1; i >= 0; --i) { | |
| 1599 __ popl(Address(EDX, i * kWordSize)); | |
| 1600 } | |
| 1601 } | 1595 } |
| 1602 | 1596 |
| 1603 | 1597 |
| 1604 LocationSummary* | 1598 LocationSummary* |
| 1605 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const { | 1599 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const { |
| 1606 const intptr_t kNumInputs = 2; | 1600 const intptr_t kNumInputs = 2; |
| 1607 const intptr_t kNumTemps = 0; | 1601 const intptr_t kNumTemps = 0; |
| 1608 LocationSummary* locs = | 1602 LocationSummary* locs = |
| 1609 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1603 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 1610 locs->set_in(0, Location::RegisterLocation(EAX)); | 1604 locs->set_in(0, Location::RegisterLocation(EAX)); |
| (...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3417 PcDescriptors::kOther, | 3411 PcDescriptors::kOther, |
| 3418 locs()); | 3412 locs()); |
| 3419 __ Drop(2); // Discard type arguments and receiver. | 3413 __ Drop(2); // Discard type arguments and receiver. |
| 3420 } | 3414 } |
| 3421 | 3415 |
| 3422 } // namespace dart | 3416 } // namespace dart |
| 3423 | 3417 |
| 3424 #undef __ | 3418 #undef __ |
| 3425 | 3419 |
| 3426 #endif // defined TARGET_ARCH_IA32 | 3420 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |