Chromium Code Reviews| 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 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 EAX. | 26 // on the stack and return the result in a fixed register EAX. |
| 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(EAX)); | 29 result->set_out(Location::RegisterLocation(EAX)); |
| 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::Any()); | |
| 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 __ pushl(locs()->in(0).reg()); | |
|
Vyacheslav Egorov (Google)
2013/01/08 16:19:35
value.reg()
Florian Schneider
2013/01/08 16:36:56
Done.
| |
| 51 } else if (value.IsConstant()) { | |
| 52 __ PushObject(value.constant()); | |
| 53 } else { | |
| 54 ASSERT(value.IsStackSlot()); | |
| 55 __ pushl(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(EAX)); | 66 locs->set_in(0, Location::RegisterLocation(EAX)); |
| 40 locs->set_temp(0, Location::RegisterLocation(EDX)); | 67 locs->set_temp(0, Location::RegisterLocation(EDX)); |
| 41 return locs; | 68 return locs; |
| 42 } | 69 } |
| 43 | 70 |
| (...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2814 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. | 2841 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. |
| 2815 __ pxor(value, XMM0); | 2842 __ pxor(value, XMM0); |
| 2816 } | 2843 } |
| 2817 | 2844 |
| 2818 | 2845 |
| 2819 } // namespace dart | 2846 } // namespace dart |
| 2820 | 2847 |
| 2821 #undef __ | 2848 #undef __ |
| 2822 | 2849 |
| 2823 #endif // defined TARGET_ARCH_X64 | 2850 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |