Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: src/arm64/builtins-arm64.cc

Issue 1867263002: [generators] Store the resume mode in the generator object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Other platforms Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 // -- x2 : the resume mode (tagged) 719 // -- x2 : the resume mode (tagged)
720 // -- lr : return address 720 // -- lr : return address
721 // ----------------------------------- 721 // -----------------------------------
722 __ AssertGeneratorObject(x1); 722 __ AssertGeneratorObject(x1);
723 723
724 // Store input value into generator object. 724 // Store input value into generator object.
725 __ Str(x0, FieldMemOperand(x1, JSGeneratorObject::kInputOffset)); 725 __ Str(x0, FieldMemOperand(x1, JSGeneratorObject::kInputOffset));
726 __ RecordWriteField(x1, JSGeneratorObject::kInputOffset, x0, x3, 726 __ RecordWriteField(x1, JSGeneratorObject::kInputOffset, x0, x3,
727 kLRHasNotBeenSaved, kDontSaveFPRegs); 727 kLRHasNotBeenSaved, kDontSaveFPRegs);
728 728
729 // Store resume mode into generator object.
730 __ Str(x2, FieldMemOperand(x1, JSGeneratorObject::kResumeModeOffset));
731
729 // Load suspended function and context. 732 // Load suspended function and context.
730 __ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset)); 733 __ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset));
731 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); 734 __ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset));
732 735
733 // Flood function if we are stepping. 736 // Flood function if we are stepping.
734 Label skip_flooding; 737 Label skip_flooding;
735 ExternalReference step_in_enabled = 738 ExternalReference step_in_enabled =
736 ExternalReference::debug_step_in_enabled_address(masm->isolate()); 739 ExternalReference::debug_step_in_enabled_address(masm->isolate());
737 __ Mov(x10, Operand(step_in_enabled)); 740 __ Mov(x10, Operand(step_in_enabled));
738 __ Ldrb(x10, MemOperand(x10)); 741 __ Ldrb(x10, MemOperand(x10));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 Label done_loop, loop; 793 Label done_loop, loop;
791 __ Bind(&loop); 794 __ Bind(&loop);
792 __ Cmp(x0, x3); 795 __ Cmp(x0, x3);
793 __ B(eq, &done_loop); 796 __ B(eq, &done_loop);
794 __ Ldr(x10, MemOperand(x0, kPointerSize, PostIndex)); 797 __ Ldr(x10, MemOperand(x0, kPointerSize, PostIndex));
795 __ Push(x10); 798 __ Push(x10);
796 __ B(&loop); 799 __ B(&loop);
797 __ Bind(&done_loop); 800 __ Bind(&done_loop);
798 } 801 }
799 802
800 // Push resume mode (consumed in continuation).
801 __ Push(x2);
802
803 // Reset operand stack so we don't leak. 803 // Reset operand stack so we don't leak.
804 __ LoadRoot(x10, Heap::kEmptyFixedArrayRootIndex); 804 __ LoadRoot(x10, Heap::kEmptyFixedArrayRootIndex);
805 __ Str(x10, FieldMemOperand(x1, JSGeneratorObject::kOperandStackOffset)); 805 __ Str(x10, FieldMemOperand(x1, JSGeneratorObject::kOperandStackOffset));
806 806
807 // Restore value.
808 __ Ldr(x0, FieldMemOperand(x1, JSGeneratorObject::kInputOffset));
809
810 // Resume the generator function at the continuation. 807 // Resume the generator function at the continuation.
811 __ Ldr(x10, FieldMemOperand(x4, JSFunction::kSharedFunctionInfoOffset)); 808 __ Ldr(x10, FieldMemOperand(x4, JSFunction::kSharedFunctionInfoOffset));
812 __ Ldr(x10, FieldMemOperand(x10, SharedFunctionInfo::kCodeOffset)); 809 __ Ldr(x10, FieldMemOperand(x10, SharedFunctionInfo::kCodeOffset));
813 __ Add(x10, x10, Code::kHeaderSize - kHeapObjectTag); 810 __ Add(x10, x10, Code::kHeaderSize - kHeapObjectTag);
814 __ Ldrsw(x11, 811 __ Ldrsw(x11,
815 UntagSmiFieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); 812 UntagSmiFieldMemOperand(x1, JSGeneratorObject::kContinuationOffset));
816 __ Add(x10, x10, x11); 813 __ Add(x10, x10, x11);
817 __ Mov(x12, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); 814 __ Mov(x12, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting));
818 __ Str(x12, FieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); 815 __ Str(x12, FieldMemOperand(x1, JSGeneratorObject::kContinuationOffset));
816 __ Move(x0, x1); // Continuation expects generator object in x0.
819 __ Br(x10); 817 __ Br(x10);
820 } 818 }
821 819
822 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; 820 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
823 821
824 822
825 // Clobbers x10, x15; preserves all other registers. 823 // Clobbers x10, x15; preserves all other registers.
826 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, 824 static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
827 IsTagged argc_is_tagged) { 825 IsTagged argc_is_tagged) {
828 // Check the stack for overflow. 826 // Check the stack for overflow.
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2760 } 2758 }
2761 } 2759 }
2762 2760
2763 2761
2764 #undef __ 2762 #undef __
2765 2763
2766 } // namespace internal 2764 } // namespace internal
2767 } // namespace v8 2765 } // namespace v8
2768 2766
2769 #endif // V8_TARGET_ARCH_ARM 2767 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698