| 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_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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 990 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 991 locs->set_in(0, Location::RegisterLocation(RBX)); | 991 locs->set_in(0, Location::RegisterLocation(RBX)); |
| 992 locs->set_out(Location::RegisterLocation(RAX)); | 992 locs->set_out(Location::RegisterLocation(RAX)); |
| 993 return locs; | 993 return locs; |
| 994 } | 994 } |
| 995 | 995 |
| 996 | 996 |
| 997 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 997 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 998 // Allocate the array. R10 = length, RBX = element type. | 998 // Allocate the array. R10 = length, RBX = element type. |
| 999 ASSERT(locs()->in(0).reg() == RBX); | 999 ASSERT(locs()->in(0).reg() == RBX); |
| 1000 __ movq(R10, Immediate(Smi::RawValue(ElementCount()))); | 1000 __ movq(R10, Immediate(Smi::RawValue(ArgumentCount()))); |
| 1001 compiler->GenerateCall(token_pos(), | 1001 compiler->GenerateCall(token_pos(), |
| 1002 try_index(), | 1002 try_index(), |
| 1003 &StubCode::AllocateArrayLabel(), | 1003 &StubCode::AllocateArrayLabel(), |
| 1004 PcDescriptors::kOther, | 1004 PcDescriptors::kOther, |
| 1005 locs()->stack_bitmap()); | 1005 locs()->stack_bitmap()); |
| 1006 ASSERT(locs()->out().reg() == RAX); | 1006 ASSERT(locs()->out().reg() == RAX); |
| 1007 | 1007 |
| 1008 // Pop the element values from the stack into the array. | 1008 // Pop the element values from the stack into the array. |
| 1009 __ leaq(R10, FieldAddress(RAX, Array::data_offset())); | 1009 __ leaq(R10, FieldAddress(RAX, Array::data_offset())); |
| 1010 for (int i = ElementCount() - 1; i >= 0; --i) { | 1010 for (int i = ArgumentCount() - 1; i >= 0; --i) { |
| 1011 ASSERT(ElementAt(i)->IsUse()); | 1011 ASSERT(ArgumentAt(i)->value()->IsUse()); |
| 1012 __ popq(Address(R10, i * kWordSize)); | 1012 __ popq(Address(R10, i * kWordSize)); |
| 1013 } | 1013 } |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 | 1016 |
| 1017 LocationSummary* | 1017 LocationSummary* |
| 1018 AllocateObjectWithBoundsCheckComp::MakeLocationSummary() const { | 1018 AllocateObjectWithBoundsCheckComp::MakeLocationSummary() const { |
| 1019 const intptr_t kNumInputs = 2; | 1019 const intptr_t kNumInputs = 2; |
| 1020 const intptr_t kNumTemps = 0; | 1020 const intptr_t kNumTemps = 0; |
| 1021 LocationSummary* locs = | 1021 LocationSummary* locs = |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 locs()->stack_bitmap()); | 2141 locs()->stack_bitmap()); |
| 2142 __ CompareObject(RAX, compiler->bool_true()); | 2142 __ CompareObject(RAX, compiler->bool_true()); |
| 2143 EmitBranchOnCondition(compiler, branch_condition); | 2143 EmitBranchOnCondition(compiler, branch_condition); |
| 2144 } | 2144 } |
| 2145 | 2145 |
| 2146 } // namespace dart | 2146 } // namespace dart |
| 2147 | 2147 |
| 2148 #undef __ | 2148 #undef __ |
| 2149 | 2149 |
| 2150 #endif // defined TARGET_ARCH_X64 | 2150 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |