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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 // Pass four arguments in r0 to r3 and fifth argument on stack. | 596 // Pass four arguments in r0 to r3 and fifth argument on stack. |
597 __ PrepareCallCFunction(6, r5); | 597 __ PrepareCallCFunction(6, r5); |
598 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 598 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
599 __ mov(r1, Operand(type())); // bailout type, | 599 __ mov(r1, Operand(type())); // bailout type, |
600 // r2: bailout id already loaded. | 600 // r2: bailout id already loaded. |
601 // r3: code address or 0 already loaded. | 601 // r3: code address or 0 already loaded. |
602 __ str(r4, MemOperand(sp, 0 * kPointerSize)); // Fp-to-sp delta. | 602 __ str(r4, MemOperand(sp, 0 * kPointerSize)); // Fp-to-sp delta. |
603 __ mov(r5, Operand(ExternalReference::isolate_address())); | 603 __ mov(r5, Operand(ExternalReference::isolate_address())); |
604 __ str(r5, MemOperand(sp, 1 * kPointerSize)); // Isolate. | 604 __ str(r5, MemOperand(sp, 1 * kPointerSize)); // Isolate. |
605 // Call Deoptimizer::New(). | 605 // Call Deoptimizer::New(). |
606 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); | 606 { |
| 607 AllowExternalCallThatCantCauseGC scope(masm()); |
| 608 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); |
| 609 } |
607 | 610 |
608 // Preserve "deoptimizer" object in register r0 and get the input | 611 // Preserve "deoptimizer" object in register r0 and get the input |
609 // frame descriptor pointer to r1 (deoptimizer->input_); | 612 // frame descriptor pointer to r1 (deoptimizer->input_); |
610 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); | 613 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); |
611 | 614 |
612 // Copy core registers into FrameDescription::registers_[kNumRegisters]. | 615 // Copy core registers into FrameDescription::registers_[kNumRegisters]. |
613 ASSERT(Register::kNumRegisters == kNumberOfRegisters); | 616 ASSERT(Register::kNumRegisters == kNumberOfRegisters); |
614 for (int i = 0; i < kNumberOfRegisters; i++) { | 617 for (int i = 0; i < kNumberOfRegisters; i++) { |
615 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 618 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
616 __ ldr(r2, MemOperand(sp, i * kPointerSize)); | 619 __ ldr(r2, MemOperand(sp, i * kPointerSize)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 __ str(r4, MemOperand(r3, 0)); | 653 __ str(r4, MemOperand(r3, 0)); |
651 __ add(r3, r3, Operand(sizeof(uint32_t))); | 654 __ add(r3, r3, Operand(sizeof(uint32_t))); |
652 __ cmp(r2, sp); | 655 __ cmp(r2, sp); |
653 __ b(ne, &pop_loop); | 656 __ b(ne, &pop_loop); |
654 | 657 |
655 // Compute the output frame in the deoptimizer. | 658 // Compute the output frame in the deoptimizer. |
656 __ push(r0); // Preserve deoptimizer object across call. | 659 __ push(r0); // Preserve deoptimizer object across call. |
657 // r0: deoptimizer object; r1: scratch. | 660 // r0: deoptimizer object; r1: scratch. |
658 __ PrepareCallCFunction(1, r1); | 661 __ PrepareCallCFunction(1, r1); |
659 // Call Deoptimizer::ComputeOutputFrames(). | 662 // Call Deoptimizer::ComputeOutputFrames(). |
660 __ CallCFunction( | 663 { |
661 ExternalReference::compute_output_frames_function(isolate), 1); | 664 AllowExternalCallThatCantCauseGC scope(masm()); |
| 665 __ CallCFunction( |
| 666 ExternalReference::compute_output_frames_function(isolate), 1); |
| 667 } |
662 __ pop(r0); // Restore deoptimizer object (class Deoptimizer). | 668 __ pop(r0); // Restore deoptimizer object (class Deoptimizer). |
663 | 669 |
664 // Replace the current (input) frame with the output frames. | 670 // Replace the current (input) frame with the output frames. |
665 Label outer_push_loop, inner_push_loop; | 671 Label outer_push_loop, inner_push_loop; |
666 // Outer loop state: r0 = current "FrameDescription** output_", | 672 // Outer loop state: r0 = current "FrameDescription** output_", |
667 // r1 = one past the last FrameDescription**. | 673 // r1 = one past the last FrameDescription**. |
668 __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); | 674 __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); |
669 __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset())); // r0 is output_. | 675 __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset())); // r0 is output_. |
670 __ add(r1, r0, Operand(r1, LSL, 2)); | 676 __ add(r1, r0, Operand(r1, LSL, 2)); |
671 __ bind(&outer_push_loop); | 677 __ bind(&outer_push_loop); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 __ push(ip); | 742 __ push(ip); |
737 __ b(&done); | 743 __ b(&done); |
738 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 744 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
739 } | 745 } |
740 __ bind(&done); | 746 __ bind(&done); |
741 } | 747 } |
742 | 748 |
743 #undef __ | 749 #undef __ |
744 | 750 |
745 } } // namespace v8::internal | 751 } } // namespace v8::internal |
OLD | NEW |