Index: runtime/vm/flow_graph_compiler_x64.cc |
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc |
index 460387922a800748a88262d35b9adc9e4e3eae6e..11ddd379e2d9ab3a3258d652e7402bed69968288 100644 |
--- a/runtime/vm/flow_graph_compiler_x64.cc |
+++ b/runtime/vm/flow_graph_compiler_x64.cc |
@@ -48,16 +48,24 @@ void DeoptimizationStub::GenerateCode(FlowGraphCompiler* compiler, |
const intptr_t local_slot_count = values.length() - fixed_parameter_count; |
const intptr_t top_offset = |
ParsedFunction::kFirstLocalSlotIndex - (local_slot_count - 1); |
+ |
__ leaq(RSP, Address(RBP, top_offset * kWordSize)); |
// 2. Build and emit a parallel move representing the frame translation. |
+ intptr_t height = compiler->StackSize(); |
ParallelMoveInstr* move = new ParallelMoveInstr(); |
for (intptr_t i = 0; i < values.length(); i++) { |
Location destination = Location::StackSlot(i - fixed_parameter_count); |
Location source = deoptimization_env_->LocationAt(i); |
if (source.IsInvalid()) { |
- ASSERT(values[i]->IsConstant()); |
- source = Location::Constant(values[i]->AsConstant()->value()); |
+ Value* value = values[i]; |
+ if (value->IsConstant()) { |
+ source = Location::Constant(value->AsConstant()->value()); |
+ } else { |
+ ASSERT(value->IsUse() && |
+ value->AsUse()->definition()->IsPushArgument()); |
+ source = Location::StackSlot(height++); |
+ } |
} |
move->AddMove(destination, source); |
} |