Chromium Code Reviews| Index: runtime/vm/deopt_instructions.cc |
| diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc |
| index 1839f7fae8a14eb760f594f2148744adb99bc4f8..09ee4e6dbcdf06b8abc3c182a07fcb5017c75bd9 100644 |
| --- a/runtime/vm/deopt_instructions.cc |
| +++ b/runtime/vm/deopt_instructions.cc |
| @@ -67,13 +67,17 @@ DeoptContext::DeoptContext(const StackFrame* frame, |
| // return-address. This section is copied as well, so that its contained |
| // values can be updated before returning to the deoptimized function. |
| // Note: on DBC stack grows upwards unlike on all other architectures. |
| + const intptr_t frame_size = |
| +#if defined(TARGET_ARCH_DBC) |
| + (static_cast<intptr_t>(frame->sp()) - |
| + static_cast<intptr_t>(frame->fp())) / kWordSize; |
| +#else |
| + (static_cast<intptr_t>(frame->fp()) - |
| + static_cast<intptr_t>(frame->sp())) / kWordSize; |
| +#endif |
| source_frame_size_ = |
| + kDartFrameFixedSize // For saved values below sp. |
| -#if !defined(TARGET_ARCH_DBC) |
| - + ((frame->fp() - frame->sp()) / kWordSize) // For frame size incl. sp. |
| -#else |
| - + ((frame->sp() - frame->fp()) / kWordSize) // For frame size incl. sp. |
|
zra
2016/06/07 22:31:28
For some reason sp() is < fp() ? Moved around to a
Vyacheslav Egorov (Google)
2016/06/08 11:58:53
If SP is less then FP on DBC then this is bug some
zra
2016/06/08 17:46:30
Added ASSERT.
|
| -#endif // !defined(TARGET_ARCH_DBC) |
| + + frame_size // For frame size incl. sp. |
| + 1 // For fp. |
| + kParamEndSlotFromFp // For saved values above fp. |
| + num_args_; // For arguments. |