| Index: src/x64/codegen-x64.cc
|
| ===================================================================
|
| --- src/x64/codegen-x64.cc (revision 7006)
|
| +++ src/x64/codegen-x64.cc (working copy)
|
| @@ -2994,21 +2994,22 @@
|
| // Leave the frame and return popping the arguments and the
|
| // receiver.
|
| frame_->Exit();
|
| - masm_->ret((scope()->num_parameters() + 1) * kPointerSize);
|
| + int arguments_bytes = (scope()->num_parameters() + 1) * kPointerSize;
|
| + __ Ret(arguments_bytes, rcx);
|
| DeleteFrame();
|
|
|
| #ifdef ENABLE_DEBUGGER_SUPPORT
|
| // Add padding that will be overwritten by a debugger breakpoint.
|
| - // frame_->Exit() generates "movq rsp, rbp; pop rbp; ret k"
|
| + // The shortest return sequence generated is "movq rsp, rbp; pop rbp; ret k"
|
| // with length 7 (3 + 1 + 3).
|
| const int kPadding = Assembler::kJSReturnSequenceLength - 7;
|
| for (int i = 0; i < kPadding; ++i) {
|
| masm_->int3();
|
| }
|
| - // Check that the size of the code used for returning matches what is
|
| - // expected by the debugger.
|
| - ASSERT_EQ(Assembler::kJSReturnSequenceLength,
|
| - masm_->SizeOfCodeGeneratedSince(&check_exit_codesize));
|
| + // Check that the size of the code used for returning is large enough
|
| + // for the debugger's requirements.
|
| + ASSERT(Assembler::kJSReturnSequenceLength <=
|
| + masm_->SizeOfCodeGeneratedSince(&check_exit_codesize));
|
| #endif
|
| }
|
|
|
| @@ -5403,9 +5404,12 @@
|
| }
|
| frame_->PushParameterAt(-1);
|
|
|
| + // Push the strict mode flag.
|
| + frame_->Push(Smi::FromInt(strict_mode_flag()));
|
| +
|
| // Resolve the call.
|
| result =
|
| - frame_->CallRuntime(Runtime::kResolvePossiblyDirectEvalNoLookup, 3);
|
| + frame_->CallRuntime(Runtime::kResolvePossiblyDirectEvalNoLookup, 4);
|
|
|
| done.Jump(&result);
|
| slow.Bind();
|
| @@ -5422,8 +5426,11 @@
|
| }
|
| frame_->PushParameterAt(-1);
|
|
|
| + // Push the strict mode flag.
|
| + frame_->Push(Smi::FromInt(strict_mode_flag()));
|
| +
|
| // Resolve the call.
|
| - result = frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 3);
|
| + result = frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 4);
|
|
|
| // If we generated fast-case code bind the jump-target where fast
|
| // and slow case merge.
|
| @@ -6970,10 +6977,12 @@
|
| __ j(not_equal, ¬_minus_half);
|
|
|
| // Calculates reciprocal of square root.
|
| - // Note that 1/sqrt(x) = sqrt(1/x))
|
| - __ divsd(xmm3, xmm0);
|
| + // sqrtsd returns -0 when input is -0. ECMA spec requires +0.
|
| + __ xorpd(xmm1, xmm1);
|
| + __ addsd(xmm1, xmm0);
|
| + __ sqrtsd(xmm1, xmm1);
|
| + __ divsd(xmm3, xmm1);
|
| __ movsd(xmm1, xmm3);
|
| - __ sqrtsd(xmm1, xmm1);
|
| __ jmp(&allocate_return);
|
|
|
| // Test for 0.5.
|
| @@ -6986,7 +6995,9 @@
|
| call_runtime.Branch(not_equal);
|
|
|
| // Calculates square root.
|
| - __ movsd(xmm1, xmm0);
|
| + // sqrtsd returns -0 when input is -0. ECMA spec requires +0.
|
| + __ xorpd(xmm1, xmm1);
|
| + __ addsd(xmm1, xmm0);
|
| __ sqrtsd(xmm1, xmm1);
|
|
|
| JumpTarget done;
|
|
|