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

Side by Side Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.cc ('k') | src/objects.h » ('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 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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // -- a2 : the resume mode (tagged) 698 // -- a2 : the resume mode (tagged)
699 // -- ra : return address 699 // -- ra : return address
700 // ----------------------------------- 700 // -----------------------------------
701 __ AssertGeneratorObject(a1); 701 __ AssertGeneratorObject(a1);
702 702
703 // Store input value into generator object. 703 // Store input value into generator object.
704 __ sd(v0, FieldMemOperand(a1, JSGeneratorObject::kInputOffset)); 704 __ sd(v0, FieldMemOperand(a1, JSGeneratorObject::kInputOffset));
705 __ RecordWriteField(a1, JSGeneratorObject::kInputOffset, v0, a3, 705 __ RecordWriteField(a1, JSGeneratorObject::kInputOffset, v0, a3,
706 kRAHasNotBeenSaved, kDontSaveFPRegs); 706 kRAHasNotBeenSaved, kDontSaveFPRegs);
707 707
708 // Store resume mode into generator object.
709 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kResumeModeOffset));
710
708 // Load suspended function and context. 711 // Load suspended function and context.
709 __ ld(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); 712 __ ld(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset));
710 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); 713 __ ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
711 714
712 // Flood function if we are stepping. 715 // Flood function if we are stepping.
713 Label skip_flooding; 716 Label skip_flooding;
714 ExternalReference step_in_enabled = 717 ExternalReference step_in_enabled =
715 ExternalReference::debug_step_in_enabled_address(masm->isolate()); 718 ExternalReference::debug_step_in_enabled_address(masm->isolate());
716 __ li(t1, Operand(step_in_enabled)); 719 __ li(t1, Operand(step_in_enabled));
717 __ lb(t1, MemOperand(t1)); 720 __ lb(t1, MemOperand(t1));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 Label done_loop, loop; 775 Label done_loop, loop;
773 __ bind(&loop); 776 __ bind(&loop);
774 __ Branch(&done_loop, eq, a0, Operand(a3)); 777 __ Branch(&done_loop, eq, a0, Operand(a3));
775 __ ld(a5, MemOperand(a0)); 778 __ ld(a5, MemOperand(a0));
776 __ Push(a5); 779 __ Push(a5);
777 __ Branch(USE_DELAY_SLOT, &loop); 780 __ Branch(USE_DELAY_SLOT, &loop);
778 __ daddiu(a0, a0, kPointerSize); // In delay slot. 781 __ daddiu(a0, a0, kPointerSize); // In delay slot.
779 __ bind(&done_loop); 782 __ bind(&done_loop);
780 } 783 }
781 784
782 // Push resume mode (consumed in continuation).
783 __ Push(a2);
784
785 // Reset operand stack so we don't leak. 785 // Reset operand stack so we don't leak.
786 __ LoadRoot(a5, Heap::kEmptyFixedArrayRootIndex); 786 __ LoadRoot(a5, Heap::kEmptyFixedArrayRootIndex);
787 __ sd(a5, FieldMemOperand(a1, JSGeneratorObject::kOperandStackOffset)); 787 __ sd(a5, FieldMemOperand(a1, JSGeneratorObject::kOperandStackOffset));
788 788
789 // Restore value.
790 __ ld(v0, FieldMemOperand(a1, JSGeneratorObject::kInputOffset));
791
792 // Resume the generator function at the continuation. 789 // Resume the generator function at the continuation.
793 __ ld(a3, FieldMemOperand(a4, JSFunction::kSharedFunctionInfoOffset)); 790 __ ld(a3, FieldMemOperand(a4, JSFunction::kSharedFunctionInfoOffset));
794 __ ld(a3, FieldMemOperand(a3, SharedFunctionInfo::kCodeOffset)); 791 __ ld(a3, FieldMemOperand(a3, SharedFunctionInfo::kCodeOffset));
795 __ Daddu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag)); 792 __ Daddu(a3, a3, Operand(Code::kHeaderSize - kHeapObjectTag));
796 __ ld(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); 793 __ ld(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset));
797 __ SmiUntag(a2); 794 __ SmiUntag(a2);
798 __ Daddu(a3, a3, Operand(a2)); 795 __ Daddu(a3, a3, Operand(a2));
799 __ li(a2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); 796 __ li(a2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)));
800 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); 797 __ sd(a2, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset));
798 __ Move(v0, a1); // Continuation expects generator object in v0.
801 __ Jump(a3); 799 __ Jump(a3);
802 } 800 }
803 801
804 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { 802 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
805 FrameScope scope(masm, StackFrame::INTERNAL); 803 FrameScope scope(masm, StackFrame::INTERNAL);
806 __ Push(a1); 804 __ Push(a1);
807 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); 805 __ CallRuntime(Runtime::kThrowConstructedNonConstructable);
808 } 806 }
809 807
810 808
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 } 2699 }
2702 } 2700 }
2703 2701
2704 2702
2705 #undef __ 2703 #undef __
2706 2704
2707 } // namespace internal 2705 } // namespace internal
2708 } // namespace v8 2706 } // namespace v8
2709 2707
2710 #endif // V8_TARGET_ARCH_MIPS64 2708 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698