| Index: src/x64/deoptimizer-x64.cc
|
| ===================================================================
|
| --- src/x64/deoptimizer-x64.cc (revision 8618)
|
| +++ src/x64/deoptimizer-x64.cc (working copy)
|
| @@ -317,7 +317,7 @@
|
| USE(height_in_bytes);
|
|
|
| unsigned fixed_size = ComputeFixedSize(function_);
|
| - unsigned input_frame_size = static_cast<unsigned>(input_->GetFrameSize());
|
| + unsigned input_frame_size = input_->GetFrameSize();
|
| ASSERT(fixed_size + height_in_bytes == input_frame_size);
|
|
|
| unsigned stack_slot_size = optimized_code_->stack_slots() * kPointerSize;
|
| @@ -341,6 +341,9 @@
|
| output_ = new FrameDescription*[1];
|
| output_[0] = new(output_frame_size) FrameDescription(
|
| output_frame_size, function_);
|
| +#ifdef DEBUG
|
| + output_[0]->SetKind(Code::OPTIMIZED_FUNCTION);
|
| +#endif
|
|
|
| // Clear the incoming parameters in the optimized frame to avoid
|
| // confusing the garbage collector.
|
| @@ -449,12 +452,15 @@
|
| // The 'fixed' part of the frame consists of the incoming parameters and
|
| // the part described by JavaScriptFrameConstants.
|
| unsigned fixed_frame_size = ComputeFixedSize(function);
|
| - unsigned input_frame_size = static_cast<unsigned>(input_->GetFrameSize());
|
| + unsigned input_frame_size = input_->GetFrameSize();
|
| unsigned output_frame_size = height_in_bytes + fixed_frame_size;
|
|
|
| // Allocate and store the output frame description.
|
| FrameDescription* output_frame =
|
| new(output_frame_size) FrameDescription(output_frame_size, function);
|
| +#ifdef DEBUG
|
| + output_frame->SetKind(Code::FUNCTION);
|
| +#endif
|
|
|
| bool is_bottommost = (0 == frame_index);
|
| bool is_topmost = (output_count_ - 1 == frame_index);
|
| @@ -585,7 +591,7 @@
|
| output_frame->SetState(Smi::FromInt(state));
|
|
|
| // Set the continuation for the topmost frame.
|
| - if (is_topmost) {
|
| + if (is_topmost && bailout_type_ != DEBUGGER) {
|
| Code* continuation = (bailout_type_ == EAGER)
|
| ? isolate_->builtins()->builtin(Builtins::kNotifyDeoptimized)
|
| : isolate_->builtins()->builtin(Builtins::kNotifyLazyDeoptimized);
|
| @@ -597,6 +603,26 @@
|
| }
|
|
|
|
|
| +void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
|
| + // Set the register values. The values are not important as there are no
|
| + // callee saved registers in JavaScript frames, so all registers are
|
| + // spilled. Registers rbp and rsp are set to the correct values though.
|
| + for (int i = 0; i < Register::kNumRegisters; i++) {
|
| + input_->SetRegister(i, i * 4);
|
| + }
|
| + input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp()));
|
| + input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp()));
|
| + for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) {
|
| + input_->SetDoubleRegister(i, 0.0);
|
| + }
|
| +
|
| + // Fill the frame content from the actual data on the frame.
|
| + for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
|
| + input_->SetFrameSlot(i, Memory::uint64_at(tos + i));
|
| + }
|
| +}
|
| +
|
| +
|
| #define __ masm()->
|
|
|
| void Deoptimizer::EntryGenerator::Generate() {
|
|
|