Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: src/x64/deoptimizer-x64.cc

Issue 14429003: Refactor ExternalReference::isolate_address() to not rely on Isolate::Current(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 __ PrepareCallCFunction(6); 650 __ PrepareCallCFunction(6);
651 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 651 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
652 __ movq(arg1, rax); 652 __ movq(arg1, rax);
653 __ Set(arg2, type()); 653 __ Set(arg2, type());
654 // Args 3 and 4 are already in the right registers. 654 // Args 3 and 4 are already in the right registers.
655 655
656 // On windows put the arguments on the stack (PrepareCallCFunction 656 // On windows put the arguments on the stack (PrepareCallCFunction
657 // has created space for this). On linux pass the arguments in r8 and r9. 657 // has created space for this). On linux pass the arguments in r8 and r9.
658 #ifdef _WIN64 658 #ifdef _WIN64
659 __ movq(Operand(rsp, 4 * kPointerSize), arg5); 659 __ movq(Operand(rsp, 4 * kPointerSize), arg5);
660 __ LoadAddress(arg5, ExternalReference::isolate_address()); 660 __ LoadAddress(arg5, ExternalReference::isolate_address(isolate()));
661 __ movq(Operand(rsp, 5 * kPointerSize), arg5); 661 __ movq(Operand(rsp, 5 * kPointerSize), arg5);
662 #else 662 #else
663 __ movq(r8, arg5); 663 __ movq(r8, arg5);
664 __ LoadAddress(r9, ExternalReference::isolate_address()); 664 __ LoadAddress(r9, ExternalReference::isolate_address(isolate()));
665 #endif 665 #endif
666 666
667 Isolate* isolate = masm()->isolate(); 667 { AllowExternalCallThatCantCauseGC scope(masm());
668 668 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6);
669 {
670 AllowExternalCallThatCantCauseGC scope(masm());
671 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6);
672 } 669 }
673 // Preserve deoptimizer object in register rax and get the input 670 // Preserve deoptimizer object in register rax and get the input
674 // frame descriptor pointer. 671 // frame descriptor pointer.
675 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); 672 __ movq(rbx, Operand(rax, Deoptimizer::input_offset()));
676 673
677 // Fill in the input registers. 674 // Fill in the input registers.
678 for (int i = kNumberOfRegisters -1; i >= 0; i--) { 675 for (int i = kNumberOfRegisters -1; i >= 0; i--) {
679 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 676 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
680 __ pop(Operand(rbx, offset)); 677 __ pop(Operand(rbx, offset));
681 } 678 }
(...skipping 28 matching lines...) Expand all
710 __ pop(Operand(rdx, 0)); 707 __ pop(Operand(rdx, 0));
711 __ addq(rdx, Immediate(sizeof(intptr_t))); 708 __ addq(rdx, Immediate(sizeof(intptr_t)));
712 __ bind(&pop_loop_header); 709 __ bind(&pop_loop_header);
713 __ cmpq(rcx, rsp); 710 __ cmpq(rcx, rsp);
714 __ j(not_equal, &pop_loop); 711 __ j(not_equal, &pop_loop);
715 712
716 // Compute the output frame in the deoptimizer. 713 // Compute the output frame in the deoptimizer.
717 __ push(rax); 714 __ push(rax);
718 __ PrepareCallCFunction(2); 715 __ PrepareCallCFunction(2);
719 __ movq(arg1, rax); 716 __ movq(arg1, rax);
720 __ LoadAddress(arg2, ExternalReference::isolate_address()); 717 __ LoadAddress(arg2, ExternalReference::isolate_address(isolate()));
721 { 718 {
722 AllowExternalCallThatCantCauseGC scope(masm()); 719 AllowExternalCallThatCantCauseGC scope(masm());
723 __ CallCFunction( 720 __ CallCFunction(
724 ExternalReference::compute_output_frames_function(isolate), 2); 721 ExternalReference::compute_output_frames_function(isolate()), 2);
725 } 722 }
726 __ pop(rax); 723 __ pop(rax);
727 724
728 // Replace the current frame with the output frames. 725 // Replace the current frame with the output frames.
729 Label outer_push_loop, inner_push_loop, 726 Label outer_push_loop, inner_push_loop,
730 outer_loop_header, inner_loop_header; 727 outer_loop_header, inner_loop_header;
731 // Outer loop state: rax = current FrameDescription**, rdx = one past the 728 // Outer loop state: rax = current FrameDescription**, rdx = one past the
732 // last FrameDescription**. 729 // last FrameDescription**.
733 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); 730 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset()));
734 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); 731 __ movq(rax, Operand(rax, Deoptimizer::output_offset()));
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 } 799 }
803 __ bind(&done); 800 __ bind(&done);
804 } 801 }
805 802
806 #undef __ 803 #undef __
807 804
808 805
809 } } // namespace v8::internal 806 } } // namespace v8::internal
810 807
811 #endif // V8_TARGET_ARCH_X64 808 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698