Chromium Code Reviews| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 __ subq(arg5, rbp); | 646 __ subq(arg5, rbp); |
| 647 __ neg(arg5); | 647 __ neg(arg5); |
| 648 | 648 |
| 649 // Allocate a new deoptimizer object. | 649 // Allocate a new deoptimizer object. |
| 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 Isolate* isolate = masm()->isolate(); | |
|
Sven Panne
2013/04/23 13:18:08
Again: Add an isolate() method to EntryGenerator (
| |
| 657 | |
| 656 // On windows put the arguments on the stack (PrepareCallCFunction | 658 // On windows put the arguments on the stack (PrepareCallCFunction |
| 657 // has created space for this). On linux pass the arguments in r8 and r9. | 659 // has created space for this). On linux pass the arguments in r8 and r9. |
| 658 #ifdef _WIN64 | 660 #ifdef _WIN64 |
| 659 __ movq(Operand(rsp, 4 * kPointerSize), arg5); | 661 __ movq(Operand(rsp, 4 * kPointerSize), arg5); |
| 660 __ LoadAddress(arg5, ExternalReference::isolate_address()); | 662 __ LoadAddress(arg5, ExternalReference::isolate_address(isolate)); |
| 661 __ movq(Operand(rsp, 5 * kPointerSize), arg5); | 663 __ movq(Operand(rsp, 5 * kPointerSize), arg5); |
| 662 #else | 664 #else |
| 663 __ movq(r8, arg5); | 665 __ movq(r8, arg5); |
| 664 __ LoadAddress(r9, ExternalReference::isolate_address()); | 666 __ LoadAddress(r9, ExternalReference::isolate_address(isolate)); |
| 665 #endif | 667 #endif |
| 666 | 668 |
| 667 Isolate* isolate = masm()->isolate(); | 669 { AllowExternalCallThatCantCauseGC scope(masm()); |
| 668 | |
| 669 { | |
| 670 AllowExternalCallThatCantCauseGC scope(masm()); | |
| 671 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); | 670 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); |
| 672 } | 671 } |
| 673 // Preserve deoptimizer object in register rax and get the input | 672 // Preserve deoptimizer object in register rax and get the input |
| 674 // frame descriptor pointer. | 673 // frame descriptor pointer. |
| 675 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); | 674 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); |
| 676 | 675 |
| 677 // Fill in the input registers. | 676 // Fill in the input registers. |
| 678 for (int i = kNumberOfRegisters -1; i >= 0; i--) { | 677 for (int i = kNumberOfRegisters -1; i >= 0; i--) { |
| 679 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 678 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| 680 __ pop(Operand(rbx, offset)); | 679 __ pop(Operand(rbx, offset)); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 710 __ pop(Operand(rdx, 0)); | 709 __ pop(Operand(rdx, 0)); |
| 711 __ addq(rdx, Immediate(sizeof(intptr_t))); | 710 __ addq(rdx, Immediate(sizeof(intptr_t))); |
| 712 __ bind(&pop_loop_header); | 711 __ bind(&pop_loop_header); |
| 713 __ cmpq(rcx, rsp); | 712 __ cmpq(rcx, rsp); |
| 714 __ j(not_equal, &pop_loop); | 713 __ j(not_equal, &pop_loop); |
| 715 | 714 |
| 716 // Compute the output frame in the deoptimizer. | 715 // Compute the output frame in the deoptimizer. |
| 717 __ push(rax); | 716 __ push(rax); |
| 718 __ PrepareCallCFunction(2); | 717 __ PrepareCallCFunction(2); |
| 719 __ movq(arg1, rax); | 718 __ movq(arg1, rax); |
| 720 __ LoadAddress(arg2, ExternalReference::isolate_address()); | 719 __ LoadAddress(arg2, ExternalReference::isolate_address(isolate)); |
| 721 { | 720 { |
| 722 AllowExternalCallThatCantCauseGC scope(masm()); | 721 AllowExternalCallThatCantCauseGC scope(masm()); |
| 723 __ CallCFunction( | 722 __ CallCFunction( |
| 724 ExternalReference::compute_output_frames_function(isolate), 2); | 723 ExternalReference::compute_output_frames_function(isolate), 2); |
| 725 } | 724 } |
| 726 __ pop(rax); | 725 __ pop(rax); |
| 727 | 726 |
| 728 // Replace the current frame with the output frames. | 727 // Replace the current frame with the output frames. |
| 729 Label outer_push_loop, inner_push_loop, | 728 Label outer_push_loop, inner_push_loop, |
| 730 outer_loop_header, inner_loop_header; | 729 outer_loop_header, inner_loop_header; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 802 } | 801 } |
| 803 __ bind(&done); | 802 __ bind(&done); |
| 804 } | 803 } |
| 805 | 804 |
| 806 #undef __ | 805 #undef __ |
| 807 | 806 |
| 808 | 807 |
| 809 } } // namespace v8::internal | 808 } } // namespace v8::internal |
| 810 | 809 |
| 811 #endif // V8_TARGET_ARCH_X64 | 810 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |