| Index: src/arm/deoptimizer-arm.cc
|
| ===================================================================
|
| --- src/arm/deoptimizer-arm.cc (revision 7180)
|
| +++ src/arm/deoptimizer-arm.cc (working copy)
|
| @@ -46,6 +46,7 @@
|
|
|
|
|
| void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
|
| + HandleScope scope;
|
| AssertNoAllocation no_allocation;
|
|
|
| if (!function->IsOptimized()) return;
|
| @@ -69,8 +70,6 @@
|
| int deoptimization_index = safepoint_entry.deoptimization_index();
|
| int gap_code_size = safepoint_entry.gap_code_size();
|
| // Check that we did not shoot past next safepoint.
|
| - // TODO(srdjan): How do we guarantee that safepoint code does not
|
| - // overlap other safepoint patching code?
|
| CHECK(pc_offset >= last_pc_offset);
|
| #ifdef DEBUG
|
| // Destroy the code which is not supposed to be run again.
|
| @@ -117,6 +116,11 @@
|
| PrintF("[forced deoptimization: ");
|
| function->PrintName();
|
| PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function));
|
| +#ifdef DEBUG
|
| + if (FLAG_print_code) {
|
| + code->PrintLn();
|
| + }
|
| +#endif
|
| }
|
| }
|
|
|
| @@ -431,14 +435,16 @@
|
| fp_value, output_offset, value);
|
| }
|
|
|
| - // The context can be gotten from the function so long as we don't
|
| - // optimize functions that need local contexts.
|
| + // For the bottommost output frame the context can be gotten from the input
|
| + // frame. For all subsequent output frames it can be gotten from the function
|
| + // so long as we don't inline functions that need local contexts.
|
| output_offset -= kPointerSize;
|
| input_offset -= kPointerSize;
|
| - value = reinterpret_cast<intptr_t>(function->context());
|
| - // The context for the bottommost output frame should also agree with the
|
| - // input frame.
|
| - ASSERT(!is_bottommost || input_->GetFrameSlot(input_offset) == value);
|
| + if (is_bottommost) {
|
| + value = input_->GetFrameSlot(input_offset);
|
| + } else {
|
| + value = reinterpret_cast<intptr_t>(function->context());
|
| + }
|
| output_frame->SetFrameSlot(output_offset, value);
|
| if (is_topmost) {
|
| output_frame->SetRegister(cp.code(), value);
|
|
|