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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Generic summary for call instructions that have all arguments pushed | 25 // Generic summary for call instructions that have all arguments pushed |
26 // on the stack and return the result in a fixed register RAX. | 26 // on the stack and return the result in a fixed register RAX. |
27 LocationSummary* Instruction::MakeCallSummary() { | 27 LocationSummary* Instruction::MakeCallSummary() { |
28 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); | 28 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); |
29 result->set_out(Location::RegisterLocation(RAX)); | 29 result->set_out(Location::RegisterLocation(RAX)); |
30 return result; | 30 return result; |
31 } | 31 } |
32 | 32 |
33 | 33 |
| 34 LocationSummary* PushArgumentInstr::MakeLocationSummary() const { |
| 35 const intptr_t kNumInputs = 1; |
| 36 const intptr_t kNumTemps= 0; |
| 37 LocationSummary* locs = |
| 38 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 39 locs->set_in(0, Location::AnyOrConstant(value())); |
| 40 return locs; |
| 41 } |
| 42 |
| 43 |
| 44 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 45 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
| 46 // where PushArgument is handled by BindInstr::EmitNativeCode. |
| 47 if (compiler->is_optimizing()) { |
| 48 Location value = locs()->in(0); |
| 49 if (value.IsRegister()) { |
| 50 __ pushq(value.reg()); |
| 51 } else if (value.IsConstant()) { |
| 52 __ PushObject(value.constant()); |
| 53 } else { |
| 54 ASSERT(value.IsStackSlot()); |
| 55 __ pushq(value.ToStackSlotAddress()); |
| 56 } |
| 57 } |
| 58 } |
| 59 |
| 60 |
34 LocationSummary* ReturnInstr::MakeLocationSummary() const { | 61 LocationSummary* ReturnInstr::MakeLocationSummary() const { |
35 const intptr_t kNumInputs = 1; | 62 const intptr_t kNumInputs = 1; |
36 const intptr_t kNumTemps = 1; | 63 const intptr_t kNumTemps = 1; |
37 LocationSummary* locs = | 64 LocationSummary* locs = |
38 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 65 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
39 locs->set_in(0, Location::RegisterLocation(RAX)); | 66 locs->set_in(0, Location::RegisterLocation(RAX)); |
40 locs->set_temp(0, Location::RegisterLocation(RDX)); | 67 locs->set_temp(0, Location::RegisterLocation(RDX)); |
41 return locs; | 68 return locs; |
42 } | 69 } |
43 | 70 |
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2461 | 2488 |
2462 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2489 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2463 UNIMPLEMENTED(); | 2490 UNIMPLEMENTED(); |
2464 } | 2491 } |
2465 | 2492 |
2466 } // namespace dart | 2493 } // namespace dart |
2467 | 2494 |
2468 #undef __ | 2495 #undef __ |
2469 | 2496 |
2470 #endif // defined TARGET_ARCH_X64 | 2497 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |