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

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

Issue 6778018: Only pass isolate parameter to C helper functions that need it. (Closed)
Patch Set: Created 9 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
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/full-codegen-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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize)); 656 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize));
657 } else { 657 } else {
658 __ movq(arg4, Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize)); 658 __ movq(arg4, Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize));
659 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 2 * kPointerSize)); 659 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 2 * kPointerSize));
660 } 660 }
661 661
662 __ subq(arg5, rbp); 662 __ subq(arg5, rbp);
663 __ neg(arg5); 663 __ neg(arg5);
664 664
665 // Allocate a new deoptimizer object. 665 // Allocate a new deoptimizer object.
666 __ PrepareCallCFunction(5); 666 __ PrepareCallCFunction(6);
667 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 667 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
668 __ movq(arg1, rax); 668 __ movq(arg1, rax);
669 __ movq(arg2, Immediate(type())); 669 __ movq(arg2, Immediate(type()));
670 // Args 3 and 4 are already in the right registers. 670 // Args 3 and 4 are already in the right registers.
671 671
672 // On windows put the argument on the stack (PrepareCallCFunction have 672 // On windows put the arguments on the stack (PrepareCallCFunction
673 // created space for this). On linux pass the argument in r8. 673 // has created space for this). On linux pass the arguments in r8 and r9.
674 #ifdef _WIN64 674 #ifdef _WIN64
675 __ movq(Operand(rsp, 4 * kPointerSize), arg5); 675 __ movq(Operand(rsp, 4 * kPointerSize), arg5);
676 __ LoadAddress(arg5, ExternalReference::isolate_address());
677 __ movq(Operand(rsp, 5 * kPointerSize), arg5);
676 #else 678 #else
677 __ movq(r8, arg5); 679 __ movq(r8, arg5);
680 __ LoadAddress(r9, ExternalReference::isolate_address());
678 #endif 681 #endif
679 682
680 Isolate* isolate = masm()->isolate(); 683 Isolate* isolate = masm()->isolate();
681 684
682 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 5); 685 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6);
683 // Preserve deoptimizer object in register rax and get the input 686 // Preserve deoptimizer object in register rax and get the input
684 // frame descriptor pointer. 687 // frame descriptor pointer.
685 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); 688 __ movq(rbx, Operand(rax, Deoptimizer::input_offset()));
686 689
687 // Fill in the input registers. 690 // Fill in the input registers.
688 for (int i = kNumberOfRegisters -1; i >= 0; i--) { 691 for (int i = kNumberOfRegisters -1; i >= 0; i--) {
689 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 692 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
690 __ pop(Operand(rbx, offset)); 693 __ pop(Operand(rbx, offset));
691 } 694 }
692 695
(...skipping 22 matching lines...) Expand all
715 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); 718 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset()));
716 Label pop_loop; 719 Label pop_loop;
717 __ bind(&pop_loop); 720 __ bind(&pop_loop);
718 __ pop(Operand(rdx, 0)); 721 __ pop(Operand(rdx, 0));
719 __ addq(rdx, Immediate(sizeof(intptr_t))); 722 __ addq(rdx, Immediate(sizeof(intptr_t)));
720 __ cmpq(rcx, rsp); 723 __ cmpq(rcx, rsp);
721 __ j(not_equal, &pop_loop); 724 __ j(not_equal, &pop_loop);
722 725
723 // Compute the output frame in the deoptimizer. 726 // Compute the output frame in the deoptimizer.
724 __ push(rax); 727 __ push(rax);
725 __ PrepareCallCFunction(1); 728 __ PrepareCallCFunction(2);
726 __ movq(arg1, rax); 729 __ movq(arg1, rax);
730 __ LoadAddress(arg2, ExternalReference::isolate_address());
727 __ CallCFunction( 731 __ CallCFunction(
728 ExternalReference::compute_output_frames_function(isolate), 1); 732 ExternalReference::compute_output_frames_function(isolate), 2);
729 __ pop(rax); 733 __ pop(rax);
730 734
731 // Replace the current frame with the output frames. 735 // Replace the current frame with the output frames.
732 Label outer_push_loop, inner_push_loop; 736 Label outer_push_loop, inner_push_loop;
733 // Outer loop state: rax = current FrameDescription**, rdx = one past the 737 // Outer loop state: rax = current FrameDescription**, rdx = one past the
734 // last FrameDescription**. 738 // last FrameDescription**.
735 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); 739 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset()));
736 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); 740 __ movq(rax, Operand(rax, Deoptimizer::output_offset()));
737 __ lea(rdx, Operand(rax, rdx, times_8, 0)); 741 __ lea(rdx, Operand(rax, rdx, times_8, 0));
738 __ bind(&outer_push_loop); 742 __ bind(&outer_push_loop);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 } 807 }
804 __ bind(&done); 808 __ bind(&done);
805 } 809 }
806 810
807 #undef __ 811 #undef __
808 812
809 813
810 } } // namespace v8::internal 814 } } // namespace v8::internal
811 815
812 #endif // V8_TARGET_ARCH_X64 816 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698