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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 742 |
743 // Preserve registers across notification, this is important for compiled | 743 // Preserve registers across notification, this is important for compiled |
744 // stubs that tail call the runtime on deopts passing their parameters in | 744 // stubs that tail call the runtime on deopts passing their parameters in |
745 // registers. | 745 // registers. |
746 __ Pushad(); | 746 __ Pushad(); |
747 __ CallRuntime(Runtime::kHiddenNotifyStubFailure, 0, save_doubles); | 747 __ CallRuntime(Runtime::kHiddenNotifyStubFailure, 0, save_doubles); |
748 __ Popad(); | 748 __ Popad(); |
749 // Tear down internal frame. | 749 // Tear down internal frame. |
750 } | 750 } |
751 | 751 |
752 __ Pop(MemOperand(rsp, 0)); // Ignore state offset | 752 __ DropUnderReturnAddress(1); // Ignore state offset |
753 __ ret(0); // Return to IC Miss stub, continuation still on stack. | 753 __ ret(0); // Return to IC Miss stub, continuation still on stack. |
754 } | 754 } |
755 | 755 |
756 | 756 |
757 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { | 757 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { |
758 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); | 758 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); |
759 } | 759 } |
760 | 760 |
761 | 761 |
762 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { | 762 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 // receiver, so overwrite the first argument which will ultimately | 919 // receiver, so overwrite the first argument which will ultimately |
920 // become the receiver. | 920 // become the receiver. |
921 __ movp(args.GetArgumentOperand(1), rdi); | 921 __ movp(args.GetArgumentOperand(1), rdi); |
922 | 922 |
923 // 4. Shift arguments and return address one slot down on the stack | 923 // 4. Shift arguments and return address one slot down on the stack |
924 // (overwriting the original receiver). Adjust argument count to make | 924 // (overwriting the original receiver). Adjust argument count to make |
925 // the original first argument the new receiver. | 925 // the original first argument the new receiver. |
926 __ bind(&shift_arguments); | 926 __ bind(&shift_arguments); |
927 { Label loop; | 927 { Label loop; |
928 __ movp(rcx, rax); | 928 __ movp(rcx, rax); |
| 929 StackArgumentsAccessor args(rsp, rcx); |
929 __ bind(&loop); | 930 __ bind(&loop); |
930 __ movp(rbx, Operand(rsp, rcx, times_pointer_size, 0)); | 931 __ movp(rbx, args.GetArgumentOperand(1)); |
931 __ movp(Operand(rsp, rcx, times_pointer_size, 1 * kPointerSize), rbx); | 932 __ movp(args.GetArgumentOperand(0), rbx); |
932 __ decp(rcx); | 933 __ decp(rcx); |
933 __ j(not_sign, &loop); // While non-negative (to copy return address). | 934 __ j(not_zero, &loop); // While non-zero. |
934 __ popq(rbx); // Discard copy of return address. | 935 __ DropUnderReturnAddress(1, rbx); // Drop one slot under return address. |
935 __ decp(rax); // One fewer argument (first argument is new receiver). | 936 __ decp(rax); // One fewer argument (first argument is new receiver). |
936 } | 937 } |
937 | 938 |
938 // 5a. Call non-function via tail call to CALL_NON_FUNCTION builtin, | 939 // 5a. Call non-function via tail call to CALL_NON_FUNCTION builtin, |
939 // or a function proxy via CALL_FUNCTION_PROXY. | 940 // or a function proxy via CALL_FUNCTION_PROXY. |
940 { Label function, non_proxy; | 941 { Label function, non_proxy; |
941 __ testp(rdx, rdx); | 942 __ testp(rdx, rdx); |
942 __ j(zero, &function); | 943 __ j(zero, &function); |
943 __ Set(rbx, 0); | 944 __ Set(rbx, 0); |
944 __ cmpp(rdx, Immediate(1)); | 945 __ cmpp(rdx, Immediate(1)); |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 __ bind(&ok); | 1531 __ bind(&ok); |
1531 __ ret(0); | 1532 __ ret(0); |
1532 } | 1533 } |
1533 | 1534 |
1534 | 1535 |
1535 #undef __ | 1536 #undef __ |
1536 | 1537 |
1537 } } // namespace v8::internal | 1538 } } // namespace v8::internal |
1538 | 1539 |
1539 #endif // V8_TARGET_ARCH_X64 | 1540 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |