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

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

Issue 2040803003: PPC: [debug] implement intuitive semantics for stepping over await call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 kLRHasNotBeenSaved, kDontSaveFPRegs); 716 kLRHasNotBeenSaved, kDontSaveFPRegs);
717 717
718 // Store resume mode into generator object. 718 // Store resume mode into generator object.
719 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kResumeModeOffset), r0); 719 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kResumeModeOffset), r0);
720 720
721 // Load suspended function and context. 721 // Load suspended function and context.
722 __ LoadP(cp, FieldMemOperand(r4, JSGeneratorObject::kContextOffset)); 722 __ LoadP(cp, FieldMemOperand(r4, JSGeneratorObject::kContextOffset));
723 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); 723 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));
724 724
725 // Flood function if we are stepping. 725 // Flood function if we are stepping.
726 Label skip_flooding; 726 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator;
727 Label stepping_prepared;
727 ExternalReference step_in_enabled = 728 ExternalReference step_in_enabled =
728 ExternalReference::debug_step_in_enabled_address(masm->isolate()); 729 ExternalReference::debug_step_in_enabled_address(masm->isolate());
729 __ mov(ip, Operand(step_in_enabled)); 730 __ mov(ip, Operand(step_in_enabled));
730 __ lbz(ip, MemOperand(ip)); 731 __ lbz(ip, MemOperand(ip));
731 __ cmpi(ip, Operand::Zero()); 732 __ cmpi(ip, Operand::Zero());
732 __ beq(&skip_flooding); 733 __ bne(&prepare_step_in_if_stepping);
733 { 734
734 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 735 // Flood function if we need to continue stepping in the suspended generator.
735 __ Push(r4, r5, r7); 736
736 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); 737 ExternalReference debug_suspended_generator =
737 __ Pop(r4, r5); 738 ExternalReference::debug_suspended_generator_address(masm->isolate());
738 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); 739
739 } 740 __ mov(ip, Operand(debug_suspended_generator));
740 __ bind(&skip_flooding); 741 __ LoadP(ip, MemOperand(ip));
742 __ cmp(ip, r4);
743 __ beq(&prepare_step_in_suspended_generator);
744 __ bind(&stepping_prepared);
741 745
742 // Push receiver. 746 // Push receiver.
743 __ LoadP(ip, FieldMemOperand(r4, JSGeneratorObject::kReceiverOffset)); 747 __ LoadP(ip, FieldMemOperand(r4, JSGeneratorObject::kReceiverOffset));
744 __ Push(ip); 748 __ Push(ip);
745 749
746 // ----------- S t a t e ------------- 750 // ----------- S t a t e -------------
747 // -- r4 : the JSGeneratorObject to resume 751 // -- r4 : the JSGeneratorObject to resume
748 // -- r5 : the resume mode (tagged) 752 // -- r5 : the resume mode (tagged)
749 // -- r7 : generator function 753 // -- r7 : generator function
750 // -- cp : generator context 754 // -- cp : generator context
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 __ SmiUntag(r5); 840 __ SmiUntag(r5);
837 __ add(r6, r6, r5); 841 __ add(r6, r6, r5);
838 __ LoadSmiLiteral(r5, 842 __ LoadSmiLiteral(r5,
839 Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); 843 Smi::FromInt(JSGeneratorObject::kGeneratorExecuting));
840 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset), 844 __ StoreP(r5, FieldMemOperand(r4, JSGeneratorObject::kContinuationOffset),
841 r0); 845 r0);
842 __ mr(r3, r4); // Continuation expects generator object in r3. 846 __ mr(r3, r4); // Continuation expects generator object in r3.
843 __ Jump(r6); 847 __ Jump(r6);
844 } 848 }
845 } 849 }
850
851 __ bind(&prepare_step_in_if_stepping);
852 {
853 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
854 __ Push(r4, r5, r7);
855 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping);
856 __ Pop(r4, r5);
857 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));
858 }
859 __ b(&stepping_prepared);
860
861 __ bind(&prepare_step_in_suspended_generator);
862 {
863 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
864 __ Push(r4, r5);
865 __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator);
866 __ Pop(r4, r5);
867 __ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));
868 }
869 __ b(&stepping_prepared);
846 } 870 }
847 871
848 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { 872 void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
849 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 873 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
850 __ push(r4); 874 __ push(r4);
851 __ CallRuntime(Runtime::kThrowConstructedNonConstructable); 875 __ CallRuntime(Runtime::kThrowConstructedNonConstructable);
852 } 876 }
853 877
854 878
855 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; 879 enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
(...skipping 2002 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 __ bkpt(0); 2882 __ bkpt(0);
2859 } 2883 }
2860 } 2884 }
2861 2885
2862 2886
2863 #undef __ 2887 #undef __
2864 } // namespace internal 2888 } // namespace internal
2865 } // namespace v8 2889 } // namespace v8
2866 2890
2867 #endif // V8_TARGET_ARCH_PPC 2891 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698