| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1418 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 1419 locs->set_in(0, Location::RegisterLocation(RBX)); | 1419 locs->set_in(0, Location::RegisterLocation(RBX)); |
| 1420 locs->set_out(Location::RegisterLocation(RAX)); | 1420 locs->set_out(Location::RegisterLocation(RAX)); |
| 1421 return locs; | 1421 return locs; |
| 1422 } | 1422 } |
| 1423 | 1423 |
| 1424 | 1424 |
| 1425 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1425 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1426 // Allocate the array. R10 = length, RBX = element type. | 1426 // Allocate the array. R10 = length, RBX = element type. |
| 1427 ASSERT(locs()->in(0).reg() == RBX); | 1427 ASSERT(locs()->in(0).reg() == RBX); |
| 1428 __ movq(R10, Immediate(Smi::RawValue(ArgumentCount()))); | 1428 __ movq(R10, Immediate(Smi::RawValue(num_elements()))); |
| 1429 compiler->GenerateCall(token_pos(), | 1429 compiler->GenerateCall(token_pos(), |
| 1430 &StubCode::AllocateArrayLabel(), | 1430 &StubCode::AllocateArrayLabel(), |
| 1431 PcDescriptors::kOther, | 1431 PcDescriptors::kOther, |
| 1432 locs()); | 1432 locs()); |
| 1433 ASSERT(locs()->out().reg() == RAX); | 1433 ASSERT(locs()->out().reg() == RAX); |
| 1434 | |
| 1435 // Pop the element values from the stack into the array. | |
| 1436 __ leaq(R10, FieldAddress(RAX, Array::data_offset())); | |
| 1437 for (int i = ArgumentCount() - 1; i >= 0; --i) { | |
| 1438 __ popq(Address(R10, i * kWordSize)); | |
| 1439 } | |
| 1440 } | 1434 } |
| 1441 | 1435 |
| 1442 | 1436 |
| 1443 LocationSummary* | 1437 LocationSummary* |
| 1444 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const { | 1438 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const { |
| 1445 const intptr_t kNumInputs = 2; | 1439 const intptr_t kNumInputs = 2; |
| 1446 const intptr_t kNumTemps = 0; | 1440 const intptr_t kNumTemps = 0; |
| 1447 LocationSummary* locs = | 1441 LocationSummary* locs = |
| 1448 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 1442 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 1449 locs->set_in(0, Location::RegisterLocation(RAX)); | 1443 locs->set_in(0, Location::RegisterLocation(RAX)); |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3046 PcDescriptors::kOther, | 3040 PcDescriptors::kOther, |
| 3047 locs()); | 3041 locs()); |
| 3048 __ Drop(2); // Discard type arguments and receiver. | 3042 __ Drop(2); // Discard type arguments and receiver. |
| 3049 } | 3043 } |
| 3050 | 3044 |
| 3051 } // namespace dart | 3045 } // namespace dart |
| 3052 | 3046 |
| 3053 #undef __ | 3047 #undef __ |
| 3054 | 3048 |
| 3055 #endif // defined TARGET_ARCH_X64 | 3049 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |