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