| Index: src/x64/cfg-x64.cc
|
| ===================================================================
|
| --- src/x64/cfg-x64.cc (revision 2602)
|
| +++ src/x64/cfg-x64.cc (working copy)
|
| @@ -60,10 +60,11 @@
|
| __ movq(rbp, rsp);
|
| __ push(rsi);
|
| __ push(rdi);
|
| - if (local_count_ > 0) {
|
| + int count = CfgGlobals::current()->fun()->scope()->num_stack_slots();
|
| + if (count > 0) {
|
| __ movq(kScratchRegister, Factory::undefined_value(),
|
| RelocInfo::EMBEDDED_OBJECT);
|
| - for (int i = 0; i < local_count_; i++) {
|
| + for (int i = 0; i < count; i++) {
|
| __ push(kScratchRegister);
|
| }
|
| }
|
| @@ -101,7 +102,8 @@
|
| __ RecordJSReturn();
|
| __ movq(rsp, rbp);
|
| __ pop(rbp);
|
| - __ ret((parameter_count_ + 1) * kPointerSize);
|
| + int count = CfgGlobals::current()->fun()->scope()->num_parameters();
|
| + __ ret((count + 1) * kPointerSize);
|
| // Add padding that will be overwritten by a debugger breakpoint.
|
| // "movq rsp, rbp; pop rbp" has length 5. "ret k" has length 2.
|
| const int kPadding = Debug::kX64JSReturnSequenceLength - 5 - 2;
|
| @@ -121,6 +123,24 @@
|
| __ Move(reg, handle_);
|
| }
|
|
|
| +
|
| +void SlotLocation::ToRegister(MacroAssembler* masm, Register reg) {
|
| + switch (type_) {
|
| + case Slot::PARAMETER: {
|
| + int count = CfgGlobals::current()->fun()->scope()->num_parameters();
|
| + __ movq(reg, Operand(rbp, (1 + count - index_) * kPointerSize));
|
| + break;
|
| + }
|
| + case Slot::LOCAL: {
|
| + const int kOffset = JavaScriptFrameConstants::kLocal0Offset;
|
| + __ movq(reg, Operand(rbp, kOffset - index_ * kPointerSize));
|
| + break;
|
| + }
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| +}
|
| +
|
| #undef __
|
|
|
| } } // namespace v8::internal
|
|
|