| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 4418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4429 if (emit_debug_code()) { | 4429 if (emit_debug_code()) { |
| 4430 Move(kScratchRegister, Smi::FromInt(type)); | 4430 Move(kScratchRegister, Smi::FromInt(type)); |
| 4431 cmpp(Operand(rbp, CommonFrameConstants::kContextOrFrameTypeOffset), | 4431 cmpp(Operand(rbp, CommonFrameConstants::kContextOrFrameTypeOffset), |
| 4432 kScratchRegister); | 4432 kScratchRegister); |
| 4433 Check(equal, kStackFrameTypesMustMatch); | 4433 Check(equal, kStackFrameTypesMustMatch); |
| 4434 } | 4434 } |
| 4435 movp(rsp, rbp); | 4435 movp(rsp, rbp); |
| 4436 popq(rbp); | 4436 popq(rbp); |
| 4437 } | 4437 } |
| 4438 | 4438 |
| 4439 void MacroAssembler::EnterBuiltinFrame(Register context, Register target, |
| 4440 Register argc) { |
| 4441 Push(rbp); |
| 4442 Move(rbp, rsp); |
| 4443 Push(context); |
| 4444 Push(target); |
| 4445 Push(argc); |
| 4446 } |
| 4447 |
| 4448 void MacroAssembler::LeaveBuiltinFrame(Register context, Register target, |
| 4449 Register argc) { |
| 4450 Pop(argc); |
| 4451 Pop(target); |
| 4452 Pop(context); |
| 4453 leave(); |
| 4454 } |
| 4455 |
| 4439 void MacroAssembler::EnterExitFramePrologue(bool save_rax, | 4456 void MacroAssembler::EnterExitFramePrologue(bool save_rax, |
| 4440 StackFrame::Type frame_type) { | 4457 StackFrame::Type frame_type) { |
| 4441 DCHECK(frame_type == StackFrame::EXIT || | 4458 DCHECK(frame_type == StackFrame::EXIT || |
| 4442 frame_type == StackFrame::BUILTIN_EXIT); | 4459 frame_type == StackFrame::BUILTIN_EXIT); |
| 4443 | 4460 |
| 4444 // Set up the frame structure on the stack. | 4461 // Set up the frame structure on the stack. |
| 4445 // All constants are relative to the frame pointer of the exit frame. | 4462 // All constants are relative to the frame pointer of the exit frame. |
| 4446 DCHECK_EQ(kFPOnStackSize + kPCOnStackSize, | 4463 DCHECK_EQ(kFPOnStackSize + kPCOnStackSize, |
| 4447 ExitFrameConstants::kCallerSPDisplacement); | 4464 ExitFrameConstants::kCallerSPDisplacement); |
| 4448 DCHECK_EQ(kFPOnStackSize, ExitFrameConstants::kCallerPCOffset); | 4465 DCHECK_EQ(kFPOnStackSize, ExitFrameConstants::kCallerPCOffset); |
| (...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5716 movl(rax, dividend); | 5733 movl(rax, dividend); |
| 5717 shrl(rax, Immediate(31)); | 5734 shrl(rax, Immediate(31)); |
| 5718 addl(rdx, rax); | 5735 addl(rdx, rax); |
| 5719 } | 5736 } |
| 5720 | 5737 |
| 5721 | 5738 |
| 5722 } // namespace internal | 5739 } // namespace internal |
| 5723 } // namespace v8 | 5740 } // namespace v8 |
| 5724 | 5741 |
| 5725 #endif // V8_TARGET_ARCH_X64 | 5742 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |