| 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 // Allocate a new deoptimizer object. | 643 // Allocate a new deoptimizer object. |
| 644 __ PrepareCallCFunction(6, eax); | 644 __ PrepareCallCFunction(6, eax); |
| 645 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 645 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 646 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. | 646 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. |
| 647 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. | 647 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. |
| 648 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. | 648 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. |
| 649 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. | 649 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. |
| 650 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. | 650 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. |
| 651 __ mov(Operand(esp, 5 * kPointerSize), | 651 __ mov(Operand(esp, 5 * kPointerSize), |
| 652 Immediate(ExternalReference::isolate_address())); | 652 Immediate(ExternalReference::isolate_address())); |
| 653 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); | 653 { |
| 654 AllowExternalCallThatCantCauseGC scope(masm()); |
| 655 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); |
| 656 } |
| 654 | 657 |
| 655 // Preserve deoptimizer object in register eax and get the input | 658 // Preserve deoptimizer object in register eax and get the input |
| 656 // frame descriptor pointer. | 659 // frame descriptor pointer. |
| 657 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); | 660 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); |
| 658 | 661 |
| 659 // Fill in the input registers. | 662 // Fill in the input registers. |
| 660 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { | 663 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { |
| 661 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 664 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| 662 __ pop(Operand(ebx, offset)); | 665 __ pop(Operand(ebx, offset)); |
| 663 } | 666 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 691 __ bind(&pop_loop); | 694 __ bind(&pop_loop); |
| 692 __ pop(Operand(edx, 0)); | 695 __ pop(Operand(edx, 0)); |
| 693 __ add(Operand(edx), Immediate(sizeof(uint32_t))); | 696 __ add(Operand(edx), Immediate(sizeof(uint32_t))); |
| 694 __ cmp(ecx, Operand(esp)); | 697 __ cmp(ecx, Operand(esp)); |
| 695 __ j(not_equal, &pop_loop); | 698 __ j(not_equal, &pop_loop); |
| 696 | 699 |
| 697 // Compute the output frame in the deoptimizer. | 700 // Compute the output frame in the deoptimizer. |
| 698 __ push(eax); | 701 __ push(eax); |
| 699 __ PrepareCallCFunction(1, ebx); | 702 __ PrepareCallCFunction(1, ebx); |
| 700 __ mov(Operand(esp, 0 * kPointerSize), eax); | 703 __ mov(Operand(esp, 0 * kPointerSize), eax); |
| 701 __ CallCFunction( | 704 { |
| 702 ExternalReference::compute_output_frames_function(isolate), 1); | 705 AllowExternalCallThatCantCauseGC scope(masm()); |
| 706 __ CallCFunction( |
| 707 ExternalReference::compute_output_frames_function(isolate), 1); |
| 708 } |
| 703 __ pop(eax); | 709 __ pop(eax); |
| 704 | 710 |
| 705 // Replace the current frame with the output frames. | 711 // Replace the current frame with the output frames. |
| 706 Label outer_push_loop, inner_push_loop; | 712 Label outer_push_loop, inner_push_loop; |
| 707 // Outer loop state: eax = current FrameDescription**, edx = one past the | 713 // Outer loop state: eax = current FrameDescription**, edx = one past the |
| 708 // last FrameDescription**. | 714 // last FrameDescription**. |
| 709 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); | 715 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); |
| 710 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); | 716 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); |
| 711 __ lea(edx, Operand(eax, edx, times_4, 0)); | 717 __ lea(edx, Operand(eax, edx, times_4, 0)); |
| 712 __ bind(&outer_push_loop); | 718 __ bind(&outer_push_loop); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 771 } |
| 766 __ bind(&done); | 772 __ bind(&done); |
| 767 } | 773 } |
| 768 | 774 |
| 769 #undef __ | 775 #undef __ |
| 770 | 776 |
| 771 | 777 |
| 772 } } // namespace v8::internal | 778 } } // namespace v8::internal |
| 773 | 779 |
| 774 #endif // V8_TARGET_ARCH_IA32 | 780 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |