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

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

Issue 6794050: Revert "[Arguments] Merge (7442,7496] from bleeding_edge." (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
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 | Annotate | Revision Log
« no previous file with comments | « src/x64/cpu-x64.cc ('k') | src/x64/frames-x64.h » ('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(6); 666 __ PrepareCallCFunction(5);
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 arguments on the stack (PrepareCallCFunction 672 // On windows put the argument on the stack (PrepareCallCFunction have
673 // has created space for this). On linux pass the arguments in r8 and r9. 673 // created space for this). On linux pass the argument in r8.
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);
678 #else 676 #else
679 __ movq(r8, arg5); 677 __ movq(r8, arg5);
680 __ LoadAddress(r9, ExternalReference::isolate_address());
681 #endif 678 #endif
682 679
683 Isolate* isolate = masm()->isolate(); 680 Isolate* isolate = masm()->isolate();
684 681
685 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); 682 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 5);
686 // Preserve deoptimizer object in register rax and get the input 683 // Preserve deoptimizer object in register rax and get the input
687 // frame descriptor pointer. 684 // frame descriptor pointer.
688 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); 685 __ movq(rbx, Operand(rax, Deoptimizer::input_offset()));
689 686
690 // Fill in the input registers. 687 // Fill in the input registers.
691 for (int i = kNumberOfRegisters -1; i >= 0; i--) { 688 for (int i = kNumberOfRegisters -1; i >= 0; i--) {
692 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 689 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
693 __ pop(Operand(rbx, offset)); 690 __ pop(Operand(rbx, offset));
694 } 691 }
695 692
(...skipping 22 matching lines...) Expand all
718 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); 715 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset()));
719 Label pop_loop; 716 Label pop_loop;
720 __ bind(&pop_loop); 717 __ bind(&pop_loop);
721 __ pop(Operand(rdx, 0)); 718 __ pop(Operand(rdx, 0));
722 __ addq(rdx, Immediate(sizeof(intptr_t))); 719 __ addq(rdx, Immediate(sizeof(intptr_t)));
723 __ cmpq(rcx, rsp); 720 __ cmpq(rcx, rsp);
724 __ j(not_equal, &pop_loop); 721 __ j(not_equal, &pop_loop);
725 722
726 // Compute the output frame in the deoptimizer. 723 // Compute the output frame in the deoptimizer.
727 __ push(rax); 724 __ push(rax);
728 __ PrepareCallCFunction(2); 725 __ PrepareCallCFunction(1);
729 __ movq(arg1, rax); 726 __ movq(arg1, rax);
730 __ LoadAddress(arg2, ExternalReference::isolate_address());
731 __ CallCFunction( 727 __ CallCFunction(
732 ExternalReference::compute_output_frames_function(isolate), 2); 728 ExternalReference::compute_output_frames_function(isolate), 1);
733 __ pop(rax); 729 __ pop(rax);
734 730
735 // Replace the current frame with the output frames. 731 // Replace the current frame with the output frames.
736 Label outer_push_loop, inner_push_loop; 732 Label outer_push_loop, inner_push_loop;
737 // Outer loop state: rax = current FrameDescription**, rdx = one past the 733 // Outer loop state: rax = current FrameDescription**, rdx = one past the
738 // last FrameDescription**. 734 // last FrameDescription**.
739 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); 735 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset()));
740 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); 736 __ movq(rax, Operand(rax, Deoptimizer::output_offset()));
741 __ lea(rdx, Operand(rax, rdx, times_8, 0)); 737 __ lea(rdx, Operand(rax, rdx, times_8, 0));
742 __ bind(&outer_push_loop); 738 __ bind(&outer_push_loop);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 } 803 }
808 __ bind(&done); 804 __ bind(&done);
809 } 805 }
810 806
811 #undef __ 807 #undef __
812 808
813 809
814 } } // namespace v8::internal 810 } } // namespace v8::internal
815 811
816 #endif // V8_TARGET_ARCH_X64 812 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/cpu-x64.cc ('k') | src/x64/frames-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698