OLD | NEW |
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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 // Allocate a new deoptimizer object. | 668 // Allocate a new deoptimizer object. |
669 __ PrepareCallCFunction(6, eax); | 669 __ PrepareCallCFunction(6, eax); |
670 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 670 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
671 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. | 671 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. |
672 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. | 672 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. |
673 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. | 673 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. |
674 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. | 674 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. |
675 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. | 675 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. |
676 __ mov(Operand(esp, 5 * kPointerSize), | 676 __ mov(Operand(esp, 5 * kPointerSize), |
677 Immediate(ExternalReference::isolate_address())); | 677 Immediate(ExternalReference::isolate_address())); |
678 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); | 678 { |
| 679 AllowExternalCallThatCantCauseGC scope(masm()); |
| 680 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); |
| 681 } |
679 | 682 |
680 // Preserve deoptimizer object in register eax and get the input | 683 // Preserve deoptimizer object in register eax and get the input |
681 // frame descriptor pointer. | 684 // frame descriptor pointer. |
682 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); | 685 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); |
683 | 686 |
684 // Fill in the input registers. | 687 // Fill in the input registers. |
685 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { | 688 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { |
686 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 689 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
687 __ pop(Operand(ebx, offset)); | 690 __ pop(Operand(ebx, offset)); |
688 } | 691 } |
(...skipping 27 matching lines...) Expand all Loading... |
716 __ bind(&pop_loop); | 719 __ bind(&pop_loop); |
717 __ pop(Operand(edx, 0)); | 720 __ pop(Operand(edx, 0)); |
718 __ add(Operand(edx), Immediate(sizeof(uint32_t))); | 721 __ add(Operand(edx), Immediate(sizeof(uint32_t))); |
719 __ cmp(ecx, Operand(esp)); | 722 __ cmp(ecx, Operand(esp)); |
720 __ j(not_equal, &pop_loop); | 723 __ j(not_equal, &pop_loop); |
721 | 724 |
722 // Compute the output frame in the deoptimizer. | 725 // Compute the output frame in the deoptimizer. |
723 __ push(eax); | 726 __ push(eax); |
724 __ PrepareCallCFunction(1, ebx); | 727 __ PrepareCallCFunction(1, ebx); |
725 __ mov(Operand(esp, 0 * kPointerSize), eax); | 728 __ mov(Operand(esp, 0 * kPointerSize), eax); |
726 __ CallCFunction( | 729 { |
727 ExternalReference::compute_output_frames_function(isolate), 1); | 730 AllowExternalCallThatCantCauseGC scope(masm()); |
| 731 __ CallCFunction( |
| 732 ExternalReference::compute_output_frames_function(isolate), 1); |
| 733 } |
728 __ pop(eax); | 734 __ pop(eax); |
729 | 735 |
730 // Replace the current frame with the output frames. | 736 // Replace the current frame with the output frames. |
731 Label outer_push_loop, inner_push_loop; | 737 Label outer_push_loop, inner_push_loop; |
732 // Outer loop state: eax = current FrameDescription**, edx = one past the | 738 // Outer loop state: eax = current FrameDescription**, edx = one past the |
733 // last FrameDescription**. | 739 // last FrameDescription**. |
734 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); | 740 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); |
735 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); | 741 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); |
736 __ lea(edx, Operand(eax, edx, times_4, 0)); | 742 __ lea(edx, Operand(eax, edx, times_4, 0)); |
737 __ bind(&outer_push_loop); | 743 __ bind(&outer_push_loop); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 } | 796 } |
791 __ bind(&done); | 797 __ bind(&done); |
792 } | 798 } |
793 | 799 |
794 #undef __ | 800 #undef __ |
795 | 801 |
796 | 802 |
797 } } // namespace v8::internal | 803 } } // namespace v8::internal |
798 | 804 |
799 #endif // V8_TARGET_ARCH_IA32 | 805 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |