| Index: runtime/vm/deopt_instructions.cc
|
| diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
|
| index f6f8869a51bc8b6e912900c87277dc7b0f07bc79..bbb7adcc65f175667383b227d410a91ca214918d 100644
|
| --- a/runtime/vm/deopt_instructions.cc
|
| +++ b/runtime/vm/deopt_instructions.cc
|
| @@ -759,6 +759,13 @@ intptr_t DeoptInfoBuilder::FindOrAddObjectInTable(const Object& obj) const {
|
| }
|
|
|
|
|
| +intptr_t DeoptInfoBuilder::CalculateStackIndex(const Location& from_loc) const {
|
| + return from_loc.stack_index() < 0 ?
|
| + from_loc.stack_index() + num_args_ :
|
| + from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1;
|
| +}
|
| +
|
| +
|
| void DeoptInfoBuilder::AddReturnAddress(const Function& function,
|
| intptr_t deopt_id,
|
| intptr_t to_index) {
|
| @@ -807,20 +814,24 @@ void DeoptInfoBuilder::AddCopy(Value* value,
|
| }
|
| } else if (from_loc.IsStackSlot()) {
|
| ASSERT(value->definition()->representation() == kTagged);
|
| - intptr_t from_index = (from_loc.stack_index() < 0) ?
|
| - from_loc.stack_index() + num_args_ :
|
| - from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1;
|
| + intptr_t from_index = CalculateStackIndex(from_loc);
|
| deopt_instr = new DeoptStackSlotInstr(from_index);
|
| } else if (from_loc.IsDoubleStackSlot()) {
|
| - intptr_t from_index = (from_loc.stack_index() < 0) ?
|
| - from_loc.stack_index() + num_args_ :
|
| - from_loc.stack_index() + num_args_ - kFirstLocalSlotIndex + 1;
|
| + intptr_t from_index = CalculateStackIndex(from_loc);
|
| if (value->definition()->representation() == kUnboxedDouble) {
|
| deopt_instr = new DeoptDoubleStackSlotInstr(from_index);
|
| } else {
|
| ASSERT(value->definition()->representation() == kUnboxedMint);
|
| deopt_instr = new DeoptInt64StackSlotInstr(from_index);
|
| }
|
| + } else if (from_loc.IsQuadStackSlot()) {
|
| + intptr_t from_index = CalculateStackIndex(from_loc);
|
| + if (value->definition()->representation() == kUnboxedFloat32x4) {
|
| + deopt_instr = new DeoptFloat32x4StackSlotInstr(from_index);
|
| + } else {
|
| + ASSERT(value->definition()->representation() == kUnboxedUint32x4);
|
| + deopt_instr = new DeoptUint32x4StackSlotInstr(from_index);
|
| + }
|
| } else {
|
| UNREACHABLE();
|
| }
|
|
|