OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 // -- r2 : the resume mode (tagged) | 712 // -- r2 : the resume mode (tagged) |
713 // -- lr : return address | 713 // -- lr : return address |
714 // ----------------------------------- | 714 // ----------------------------------- |
715 __ AssertGeneratorObject(r1); | 715 __ AssertGeneratorObject(r1); |
716 | 716 |
717 // Store input value into generator object. | 717 // Store input value into generator object. |
718 __ str(r0, FieldMemOperand(r1, JSGeneratorObject::kInputOffset)); | 718 __ str(r0, FieldMemOperand(r1, JSGeneratorObject::kInputOffset)); |
719 __ RecordWriteField(r1, JSGeneratorObject::kInputOffset, r0, r3, | 719 __ RecordWriteField(r1, JSGeneratorObject::kInputOffset, r0, r3, |
720 kLRHasNotBeenSaved, kDontSaveFPRegs); | 720 kLRHasNotBeenSaved, kDontSaveFPRegs); |
721 | 721 |
| 722 // Store resume mode into generator object. |
| 723 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kResumeModeOffset)); |
| 724 |
722 // Load suspended function and context. | 725 // Load suspended function and context. |
723 __ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); | 726 __ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); |
724 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); | 727 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
725 | 728 |
726 // Flood function if we are stepping. | 729 // Flood function if we are stepping. |
727 Label skip_flooding; | 730 Label skip_flooding; |
728 ExternalReference step_in_enabled = | 731 ExternalReference step_in_enabled = |
729 ExternalReference::debug_step_in_enabled_address(masm->isolate()); | 732 ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
730 __ mov(ip, Operand(step_in_enabled)); | 733 __ mov(ip, Operand(step_in_enabled)); |
731 __ ldrb(ip, MemOperand(ip)); | 734 __ ldrb(ip, MemOperand(ip)); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 Label done_loop, loop; | 790 Label done_loop, loop; |
788 __ bind(&loop); | 791 __ bind(&loop); |
789 __ cmp(r0, r3); | 792 __ cmp(r0, r3); |
790 __ b(eq, &done_loop); | 793 __ b(eq, &done_loop); |
791 __ ldr(ip, MemOperand(r0, kPointerSize, PostIndex)); | 794 __ ldr(ip, MemOperand(r0, kPointerSize, PostIndex)); |
792 __ Push(ip); | 795 __ Push(ip); |
793 __ b(&loop); | 796 __ b(&loop); |
794 __ bind(&done_loop); | 797 __ bind(&done_loop); |
795 } | 798 } |
796 | 799 |
797 // Push resume mode (consumed in continuation). | |
798 __ Push(r2); | |
799 | |
800 // Reset operand stack so we don't leak. | 800 // Reset operand stack so we don't leak. |
801 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); | 801 __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); |
802 __ str(ip, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); | 802 __ str(ip, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
803 | 803 |
804 // Restore value. | |
805 __ ldr(r0, FieldMemOperand(r1, JSGeneratorObject::kInputOffset)); | |
806 | |
807 // Resume the generator function at the continuation. | 804 // Resume the generator function at the continuation. |
808 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 805 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
809 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); | 806 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); |
810 __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); | 807 __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); |
811 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 808 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
812 __ add(r3, r3, Operand(r2, ASR, 1)); | 809 __ add(r3, r3, Operand(r2, ASR, 1)); |
813 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 810 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
814 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 811 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
| 812 __ Move(r0, r1); // Continuation expects generator object in r0. |
815 __ Jump(r3); | 813 __ Jump(r3); |
816 } | 814 } |
817 | 815 |
818 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { | 816 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
819 FrameScope scope(masm, StackFrame::INTERNAL); | 817 FrameScope scope(masm, StackFrame::INTERNAL); |
820 __ push(r1); | 818 __ push(r1); |
821 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); | 819 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); |
822 } | 820 } |
823 | 821 |
824 | 822 |
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 } | 2620 } |
2623 } | 2621 } |
2624 | 2622 |
2625 | 2623 |
2626 #undef __ | 2624 #undef __ |
2627 | 2625 |
2628 } // namespace internal | 2626 } // namespace internal |
2629 } // namespace v8 | 2627 } // namespace v8 |
2630 | 2628 |
2631 #endif // V8_TARGET_ARCH_ARM | 2629 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |