OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 { // NOLINT | 639 { // NOLINT |
640 FrameScope scope(masm, StackFrame::MANUAL); | 640 FrameScope scope(masm, StackFrame::MANUAL); |
641 __ PrepareCallCFunction(1); | 641 __ PrepareCallCFunction(1); |
642 __ CallCFunction( | 642 __ CallCFunction( |
643 ExternalReference::get_mark_code_as_executed_function(masm->isolate()), | 643 ExternalReference::get_mark_code_as_executed_function(masm->isolate()), |
644 1); | 644 1); |
645 } | 645 } |
646 __ Popad(); | 646 __ Popad(); |
647 | 647 |
648 // Perform prologue operations usually performed by the young code stub. | 648 // Perform prologue operations usually performed by the young code stub. |
649 __ pop(r10); // Pop return address into scratch register. | 649 __ PopReturnAddressTo(kScratchRegister); |
650 __ push(rbp); // Caller's frame pointer. | 650 __ push(rbp); // Caller's frame pointer. |
651 __ movq(rbp, rsp); | 651 __ movq(rbp, rsp); |
652 __ push(rsi); // Callee's context. | 652 __ push(rsi); // Callee's context. |
653 __ push(rdi); // Callee's JS Function. | 653 __ push(rdi); // Callee's JS Function. |
654 __ push(r10); // Push return address after frame prologue. | 654 __ PushReturnAddressFrom(kScratchRegister); |
655 | 655 |
656 // Jump to point after the code-age stub. | 656 // Jump to point after the code-age stub. |
657 __ ret(0); | 657 __ ret(0); |
658 } | 658 } |
659 | 659 |
660 | 660 |
661 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { | 661 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { |
662 GenerateMakeCodeYoungAgainCommon(masm); | 662 GenerateMakeCodeYoungAgainCommon(masm); |
663 } | 663 } |
664 | 664 |
(...skipping 24 matching lines...) Expand all Loading... |
689 FrameScope scope(masm, StackFrame::INTERNAL); | 689 FrameScope scope(masm, StackFrame::INTERNAL); |
690 | 690 |
691 // Pass the deoptimization type to the runtime system. | 691 // Pass the deoptimization type to the runtime system. |
692 __ Push(Smi::FromInt(static_cast<int>(type))); | 692 __ Push(Smi::FromInt(static_cast<int>(type))); |
693 | 693 |
694 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 694 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
695 // Tear down internal frame. | 695 // Tear down internal frame. |
696 } | 696 } |
697 | 697 |
698 // Get the full codegen state from the stack and untag it. | 698 // Get the full codegen state from the stack and untag it. |
699 __ SmiToInteger32(r10, Operand(rsp, kPCOnStackSize)); | 699 __ SmiToInteger32(kScratchRegister, Operand(rsp, kPCOnStackSize)); |
700 | 700 |
701 // Switch on the state. | 701 // Switch on the state. |
702 Label not_no_registers, not_tos_rax; | 702 Label not_no_registers, not_tos_rax; |
703 __ cmpq(r10, Immediate(FullCodeGenerator::NO_REGISTERS)); | 703 __ cmpq(kScratchRegister, Immediate(FullCodeGenerator::NO_REGISTERS)); |
704 __ j(not_equal, ¬_no_registers, Label::kNear); | 704 __ j(not_equal, ¬_no_registers, Label::kNear); |
705 __ ret(1 * kPointerSize); // Remove state. | 705 __ ret(1 * kPointerSize); // Remove state. |
706 | 706 |
707 __ bind(¬_no_registers); | 707 __ bind(¬_no_registers); |
708 __ movq(rax, Operand(rsp, kPCOnStackSize + kPointerSize)); | 708 __ movq(rax, Operand(rsp, kPCOnStackSize + kPointerSize)); |
709 __ cmpq(r10, Immediate(FullCodeGenerator::TOS_REG)); | 709 __ cmpq(kScratchRegister, Immediate(FullCodeGenerator::TOS_REG)); |
710 __ j(not_equal, ¬_tos_rax, Label::kNear); | 710 __ j(not_equal, ¬_tos_rax, Label::kNear); |
711 __ ret(2 * kPointerSize); // Remove state, rax. | 711 __ ret(2 * kPointerSize); // Remove state, rax. |
712 | 712 |
713 __ bind(¬_tos_rax); | 713 __ bind(¬_tos_rax); |
714 __ Abort(kNoCasesLeft); | 714 __ Abort(kNoCasesLeft); |
715 } | 715 } |
716 | 716 |
717 | 717 |
718 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { | 718 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { |
719 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 719 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 __ bind(&ok); | 1437 __ bind(&ok); |
1438 __ ret(0); | 1438 __ ret(0); |
1439 } | 1439 } |
1440 | 1440 |
1441 | 1441 |
1442 #undef __ | 1442 #undef __ |
1443 | 1443 |
1444 } } // namespace v8::internal | 1444 } } // namespace v8::internal |
1445 | 1445 |
1446 #endif // V8_TARGET_ARCH_X64 | 1446 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |