| 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 const intptr_t local_slot_count = values.length() - fixed_parameter_count; | 47 const intptr_t local_slot_count = values.length() - fixed_parameter_count; |
| 48 const intptr_t top_offset = | 48 const intptr_t top_offset = |
| 49 ParsedFunction::kFirstLocalSlotIndex - (local_slot_count - 1); | 49 ParsedFunction::kFirstLocalSlotIndex - (local_slot_count - 1); |
| 50 __ leaq(RSP, Address(RBP, top_offset * kWordSize)); | 50 __ leaq(RSP, Address(RBP, top_offset * kWordSize)); |
| 51 | 51 |
| 52 // 2. Build and emit a parallel move representing the frame translation. | 52 // 2. Build and emit a parallel move representing the frame translation. |
| 53 ParallelMoveInstr* move = new ParallelMoveInstr(); | 53 ParallelMoveInstr* move = new ParallelMoveInstr(); |
| 54 for (intptr_t i = 0; i < values.length(); i++) { | 54 for (intptr_t i = 0; i < values.length(); i++) { |
| 55 Location destination = Location::StackSlot(i - fixed_parameter_count); | 55 Location destination = Location::StackSlot(i - fixed_parameter_count); |
| 56 Location source = deoptimization_env_->LocationAt(i); | 56 Location source = deoptimization_env_->LocationAt(i); |
| 57 if (!source.IsRegister() && !source.IsInvalid()) { | |
| 58 compiler->Bailout("unsupported deoptimization state"); | |
| 59 } | |
| 60 if (source.IsInvalid()) { | 57 if (source.IsInvalid()) { |
| 61 ASSERT(values[i]->IsConstant()); | 58 ASSERT(values[i]->IsConstant()); |
| 62 source = Location::Constant(values[i]->AsConstant()->value()); | 59 source = Location::Constant(values[i]->AsConstant()->value()); |
| 63 } | 60 } |
| 64 move->AddMove(destination, source); | 61 move->AddMove(destination, source); |
| 65 } | 62 } |
| 66 compiler->parallel_move_resolver()->EmitNativeCode(move); | 63 compiler->parallel_move_resolver()->EmitNativeCode(move); |
| 67 } | 64 } |
| 68 | 65 |
| 69 if (compiler->IsLeaf()) { | 66 if (compiler->IsLeaf()) { |
| (...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { | 1226 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { |
| 1230 __ Exchange(mem1, mem2); | 1227 __ Exchange(mem1, mem2); |
| 1231 } | 1228 } |
| 1232 | 1229 |
| 1233 | 1230 |
| 1234 #undef __ | 1231 #undef __ |
| 1235 | 1232 |
| 1236 } // namespace dart | 1233 } // namespace dart |
| 1237 | 1234 |
| 1238 #endif // defined TARGET_ARCH_X64 | 1235 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |