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

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

Issue 1818873003: [Interpreter] Adds support to fetch return value on break at return. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Port to ppc,mips,mips64,x87,s390 Created 4 years, 9 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/debug/arm/debug-arm.cc ('k') | src/debug/debug.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 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 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 Register scratch = x10; 85 Register scratch = x10;
86 { 86 {
87 FrameScope scope(masm, StackFrame::INTERNAL); 87 FrameScope scope(masm, StackFrame::INTERNAL);
88 88
89 // Load padding words on stack. 89 // Load padding words on stack.
90 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue)); 90 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue));
91 __ PushMultipleTimes(scratch, LiveEdit::kFramePaddingInitialSize); 91 __ PushMultipleTimes(scratch, LiveEdit::kFramePaddingInitialSize);
92 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); 92 __ Mov(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
93 __ Push(scratch); 93 __ Push(scratch);
94 94
95 if (mode == SAVE_RESULT_REGISTER) __ Push(x0); 95 // Push arguments for DebugBreak call.
96 96 if (mode == SAVE_RESULT_REGISTER) {
97 __ Mov(x0, 0); // No arguments. 97 // Break on return.
98 __ Push(x0);
99 } else {
100 // Non-return breaks.
101 __ Push(masm->isolate()->factory()->the_hole_value());
102 }
103 __ Mov(x0, 1);
98 __ Mov(x1, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak), 104 __ Mov(x1, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak),
99 masm->isolate())); 105 masm->isolate()));
100 106
101 CEntryStub stub(masm->isolate(), 1); 107 CEntryStub stub(masm->isolate(), 1);
102 __ CallStub(&stub); 108 __ CallStub(&stub);
103 109
104 if (FLAG_debug_code) { 110 if (FLAG_debug_code) {
105 for (int i = 0; i < kNumJSCallerSaved; i++) { 111 for (int i = 0; i < kNumJSCallerSaved; i++) {
106 Register reg = Register::XRegFromCode(JSCallerSavedCode(i)); 112 Register reg = Register::XRegFromCode(JSCallerSavedCode(i));
107 __ Mov(reg, Operand(kDebugZapValue)); 113 // Do not clobber x0 if SAVE_RESULT_REGISTER is set. It will
114 // contain return value of the function.
115 if (!(reg.is(x0) && SAVE_RESULT_REGISTER)) {
116 __ Mov(reg, Operand(kDebugZapValue));
117 }
108 } 118 }
109 } 119 }
110 120
111 // Restore the register values from the expression stack.
112 if (mode == SAVE_RESULT_REGISTER) __ Pop(x0);
113
114 // Don't bother removing padding bytes pushed on the stack 121 // Don't bother removing padding bytes pushed on the stack
115 // as the frame is going to be restored right away. 122 // as the frame is going to be restored right away.
116 123
117 // Leave the internal frame. 124 // Leave the internal frame.
118 } 125 }
119 126
120 // Now that the break point has been handled, resume normal execution by 127 // Now that the break point has been handled, resume normal execution by
121 // jumping to the target address intended by the caller and that was 128 // jumping to the target address intended by the caller and that was
122 // overwritten by the address of DebugBreakXXX. 129 // overwritten by the address of DebugBreakXXX.
123 ExternalReference after_break_target = 130 ExternalReference after_break_target =
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 __ Br(scratch); 165 __ Br(scratch);
159 } 166 }
160 167
161 168
162 const bool LiveEdit::kFrameDropperSupported = true; 169 const bool LiveEdit::kFrameDropperSupported = true;
163 170
164 } // namespace internal 171 } // namespace internal
165 } // namespace v8 172 } // namespace v8
166 173
167 #endif // V8_TARGET_ARCH_ARM64 174 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/debug/arm/debug-arm.cc ('k') | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698