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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 // Pass four arguments in r0 to r3 and fifth argument on stack. | 625 // Pass four arguments in r0 to r3 and fifth argument on stack. |
626 __ PrepareCallCFunction(6, r5); | 626 __ PrepareCallCFunction(6, r5); |
627 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 627 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
628 __ mov(r1, Operand(type())); // bailout type, | 628 __ mov(r1, Operand(type())); // bailout type, |
629 // r2: bailout id already loaded. | 629 // r2: bailout id already loaded. |
630 // r3: code address or 0 already loaded. | 630 // r3: code address or 0 already loaded. |
631 __ str(r4, MemOperand(sp, 0 * kPointerSize)); // Fp-to-sp delta. | 631 __ str(r4, MemOperand(sp, 0 * kPointerSize)); // Fp-to-sp delta. |
632 __ mov(r5, Operand(ExternalReference::isolate_address())); | 632 __ mov(r5, Operand(ExternalReference::isolate_address())); |
633 __ str(r5, MemOperand(sp, 1 * kPointerSize)); // Isolate. | 633 __ str(r5, MemOperand(sp, 1 * kPointerSize)); // Isolate. |
634 // Call Deoptimizer::New(). | 634 // Call Deoptimizer::New(). |
635 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); | 635 { |
| 636 AllowExternalCallThatCantCauseGC scope(masm()); |
| 637 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); |
| 638 } |
636 | 639 |
637 // Preserve "deoptimizer" object in register r0 and get the input | 640 // Preserve "deoptimizer" object in register r0 and get the input |
638 // frame descriptor pointer to r1 (deoptimizer->input_); | 641 // frame descriptor pointer to r1 (deoptimizer->input_); |
639 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); | 642 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); |
640 | 643 |
641 // Copy core registers into FrameDescription::registers_[kNumRegisters]. | 644 // Copy core registers into FrameDescription::registers_[kNumRegisters]. |
642 ASSERT(Register::kNumRegisters == kNumberOfRegisters); | 645 ASSERT(Register::kNumRegisters == kNumberOfRegisters); |
643 for (int i = 0; i < kNumberOfRegisters; i++) { | 646 for (int i = 0; i < kNumberOfRegisters; i++) { |
644 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 647 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
645 __ ldr(r2, MemOperand(sp, i * kPointerSize)); | 648 __ ldr(r2, MemOperand(sp, i * kPointerSize)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 __ str(r4, MemOperand(r3, 0)); | 682 __ str(r4, MemOperand(r3, 0)); |
680 __ add(r3, r3, Operand(sizeof(uint32_t))); | 683 __ add(r3, r3, Operand(sizeof(uint32_t))); |
681 __ cmp(r2, sp); | 684 __ cmp(r2, sp); |
682 __ b(ne, &pop_loop); | 685 __ b(ne, &pop_loop); |
683 | 686 |
684 // Compute the output frame in the deoptimizer. | 687 // Compute the output frame in the deoptimizer. |
685 __ push(r0); // Preserve deoptimizer object across call. | 688 __ push(r0); // Preserve deoptimizer object across call. |
686 // r0: deoptimizer object; r1: scratch. | 689 // r0: deoptimizer object; r1: scratch. |
687 __ PrepareCallCFunction(1, r1); | 690 __ PrepareCallCFunction(1, r1); |
688 // Call Deoptimizer::ComputeOutputFrames(). | 691 // Call Deoptimizer::ComputeOutputFrames(). |
689 __ CallCFunction( | 692 { |
690 ExternalReference::compute_output_frames_function(isolate), 1); | 693 AllowExternalCallThatCantCauseGC scope(masm()); |
| 694 __ CallCFunction( |
| 695 ExternalReference::compute_output_frames_function(isolate), 1); |
| 696 } |
691 __ pop(r0); // Restore deoptimizer object (class Deoptimizer). | 697 __ pop(r0); // Restore deoptimizer object (class Deoptimizer). |
692 | 698 |
693 // Replace the current (input) frame with the output frames. | 699 // Replace the current (input) frame with the output frames. |
694 Label outer_push_loop, inner_push_loop; | 700 Label outer_push_loop, inner_push_loop; |
695 // Outer loop state: r0 = current "FrameDescription** output_", | 701 // Outer loop state: r0 = current "FrameDescription** output_", |
696 // r1 = one past the last FrameDescription**. | 702 // r1 = one past the last FrameDescription**. |
697 __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); | 703 __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); |
698 __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset())); // r0 is output_. | 704 __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset())); // r0 is output_. |
699 __ add(r1, r0, Operand(r1, LSL, 2)); | 705 __ add(r1, r0, Operand(r1, LSL, 2)); |
700 __ bind(&outer_push_loop); | 706 __ bind(&outer_push_loop); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 __ push(ip); | 771 __ push(ip); |
766 __ b(&done); | 772 __ b(&done); |
767 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 773 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
768 } | 774 } |
769 __ bind(&done); | 775 __ bind(&done); |
770 } | 776 } |
771 | 777 |
772 #undef __ | 778 #undef __ |
773 | 779 |
774 } } // namespace v8::internal | 780 } } // namespace v8::internal |
OLD | NEW |