Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index cd43dafa831a5d3c9d16902d758154baa2aa15d7..639c48e31d65ed2d34abbca38bcb9588c37dc900 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -893,11 +893,8 @@ void Deoptimizer::DoComputeJSFrame(TranslatedFrame* translated_frame, |
CHECK_NULL(output_[frame_index]); |
output_[frame_index] = output_frame; |
- // The top address for the bottommost output frame can be computed from |
- // the input frame pointer and the output frame's height. For all |
- // subsequent output frames, it can be computed from the previous one's |
- // top address and the current frame's size. |
- Register fp_reg = JavaScriptFrame::fp_register(); |
+ // The top address of the frame is computed from the previous frame's top and |
+ // this frame's size. |
intptr_t top_address; |
if (is_bottommost) { |
top_address = caller_frame_top_ - output_frame_size; |
@@ -945,7 +942,10 @@ void Deoptimizer::DoComputeJSFrame(TranslatedFrame* translated_frame, |
output_frame->SetCallerFp(output_offset, value); |
intptr_t fp_value = top_address + output_offset; |
output_frame->SetFp(fp_value); |
- if (is_topmost) output_frame->SetRegister(fp_reg.code(), fp_value); |
+ if (is_topmost) { |
+ Register fp_reg = JavaScriptFrame::fp_register(); |
+ output_frame->SetRegister(fp_reg.code(), fp_value); |
+ } |
DebugPrintOutputSlot(value, frame_index, output_offset, "caller's fp\n"); |
if (FLAG_enable_embedded_constant_pool) { |
@@ -1115,11 +1115,8 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame, |
CHECK_NULL(output_[frame_index]); |
output_[frame_index] = output_frame; |
- // The top address for the bottommost output frame can be computed from |
- // the input frame pointer and the output frame's height. For all |
- // subsequent output frames, it can be computed from the previous one's |
- // top address and the current frame's size. |
- Register fp_reg = InterpretedFrame::fp_register(); |
+ // The top address of the frame is computed from the previous frame's top and |
+ // this frame's size. |
intptr_t top_address; |
if (is_bottommost) { |
top_address = caller_frame_top_ - output_frame_size; |
@@ -1168,7 +1165,10 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame, |
output_frame->SetCallerFp(output_offset, value); |
intptr_t fp_value = top_address + output_offset; |
output_frame->SetFp(fp_value); |
- if (is_topmost) output_frame->SetRegister(fp_reg.code(), fp_value); |
+ if (is_topmost) { |
+ Register fp_reg = InterpretedFrame::fp_register(); |
+ output_frame->SetRegister(fp_reg.code(), fp_value); |
+ } |
DebugPrintOutputSlot(value, frame_index, output_offset, "caller's fp\n"); |
if (FLAG_enable_embedded_constant_pool) { |
@@ -1332,8 +1332,8 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame( |
CHECK(output_[frame_index] == NULL); |
output_[frame_index] = output_frame; |
- // The top address of the frame is computed from the previous |
- // frame's top and this frame's size. |
+ // The top address of the frame is computed from the previous frame's top and |
+ // this frame's size. |
intptr_t top_address; |
if (is_bottommost) { |
top_address = caller_frame_top_ - output_frame_size; |
@@ -1483,7 +1483,6 @@ void Deoptimizer::DoComputeTailCallerFrame(TranslatedFrame* translated_frame, |
offset, stack_fp_, new_stack_fp, caller_frame_top_, |
new_caller_frame_top); |
} |
- stack_fp_ = new_stack_fp; |
caller_frame_top_ = new_caller_frame_top; |
caller_fp_ = adaptor_caller_fp; |
caller_pc_ = adaptor_caller_pc; |
@@ -1519,8 +1518,8 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame, |
DCHECK(output_[frame_index] == NULL); |
output_[frame_index] = output_frame; |
- // The top address of the frame is computed from the previous |
- // frame's top and this frame's size. |
+ // The top address of the frame is computed from the previous frame's top and |
+ // this frame's size. |
intptr_t top_address; |
top_address = output_[frame_index - 1]->GetTop() - output_frame_size; |
output_frame->SetTop(top_address); |
@@ -1805,13 +1804,9 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslatedFrame* translated_frame, |
CHECK_EQ(frame_index, 0); |
output_[frame_index] = output_frame; |
- // The top address for the output frame can be computed from the input |
- // frame pointer and the output frame's height. Subtract space for the |
- // context and function slots. |
- Register fp_reg = StubFailureTrampolineFrame::fp_register(); |
- intptr_t top_address = |
- stack_fp_ - StubFailureTrampolineFrameConstants::kFixedFrameSizeFromFp - |
- height_in_bytes; |
+ // The top address of the frame is computed from the previous frame's top and |
+ // this frame's size. |
+ intptr_t top_address = caller_frame_top_ - output_frame_size; |
output_frame->SetTop(top_address); |
// Set caller's PC (JSFunction continuation). |
@@ -1825,7 +1820,8 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslatedFrame* translated_frame, |
value = caller_fp_; |
output_frame_offset -= kFPOnStackSize; |
output_frame->SetCallerFp(output_frame_offset, value); |
- intptr_t frame_ptr = stack_fp_; |
+ intptr_t frame_ptr = top_address + output_frame_offset; |
+ Register fp_reg = StubFailureTrampolineFrame::fp_register(); |
output_frame->SetRegister(fp_reg.code(), frame_ptr); |
output_frame->SetFp(frame_ptr); |
DebugPrintOutputSlot(value, frame_index, output_frame_offset, |