Commit 82d28ad2 authored by haitao.feng@intel.com's avatar haitao.feng@intel.com

Use PopReturnAddressTo and PushReturnAddressFrom in...

Use PopReturnAddressTo and PushReturnAddressFrom in Generate_MarkCodeAsExecutedOnce builtin function for X64

R=danno@chromium.org

Review URL: https://codereview.chromium.org/38613003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17357 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2f67645f
......@@ -110,8 +110,8 @@ void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
#endif
// Patch the code.
patcher.masm()->movq(r10, target, RelocInfo::NONE64);
patcher.masm()->call(r10);
patcher.masm()->movq(kScratchRegister, target, RelocInfo::NONE64);
patcher.masm()->call(kScratchRegister);
// Check that the size of the code generated is as expected.
ASSERT_EQ(Assembler::kCallSequenceLength,
......
......@@ -646,12 +646,12 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ Popad();
// Perform prologue operations usually performed by the young code stub.
__ pop(r10); // Pop return address into scratch register.
__ PopReturnAddressTo(kScratchRegister);
__ push(rbp); // Caller's frame pointer.
__ movq(rbp, rsp);
__ push(rsi); // Callee's context.
__ push(rdi); // Callee's JS Function.
__ push(r10); // Push return address after frame prologue.
__ PushReturnAddressFrom(kScratchRegister);
// Jump to point after the code-age stub.
__ ret(0);
......@@ -696,17 +696,17 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
}
// Get the full codegen state from the stack and untag it.
__ SmiToInteger32(r10, Operand(rsp, kPCOnStackSize));
__ SmiToInteger32(kScratchRegister, Operand(rsp, kPCOnStackSize));
// Switch on the state.
Label not_no_registers, not_tos_rax;
__ cmpq(r10, Immediate(FullCodeGenerator::NO_REGISTERS));
__ cmpq(kScratchRegister, Immediate(FullCodeGenerator::NO_REGISTERS));
__ j(not_equal, &not_no_registers, Label::kNear);
__ ret(1 * kPointerSize); // Remove state.
__ bind(&not_no_registers);
__ movq(rax, Operand(rsp, kPCOnStackSize + kPointerSize));
__ cmpq(r10, Immediate(FullCodeGenerator::TOS_REG));
__ cmpq(kScratchRegister, Immediate(FullCodeGenerator::TOS_REG));
__ j(not_equal, &not_tos_rax, Label::kNear);
__ ret(2 * kPointerSize); // Remove state, rax.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment