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

Side by Side Diff: src/debug/arm/debug-arm.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 | « no previous file | src/debug/arm64/debug-arm64.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 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 9
10 namespace v8 { 10 namespace v8 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 74 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
75 75
76 // Load padding words on stack. 76 // Load padding words on stack.
77 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); 77 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue)));
78 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { 78 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) {
79 __ push(ip); 79 __ push(ip);
80 } 80 }
81 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); 81 __ mov(ip, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize)));
82 __ push(ip); 82 __ push(ip);
83 83
84 if (mode == SAVE_RESULT_REGISTER) __ push(r0); 84 // Push arguments for DebugBreak call.
85 85 if (mode == SAVE_RESULT_REGISTER) {
86 __ mov(r0, Operand::Zero()); // no arguments 86 // Break on return.
87 __ push(r0);
88 } else {
89 // Non-return breaks.
90 __ Push(masm->isolate()->factory()->the_hole_value());
91 }
92 __ mov(r0, Operand(1));
87 __ mov(r1, 93 __ mov(r1,
88 Operand(ExternalReference( 94 Operand(ExternalReference(
89 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()))); 95 Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate())));
90 96
91 CEntryStub ceb(masm->isolate(), 1); 97 CEntryStub ceb(masm->isolate(), 1);
92 __ CallStub(&ceb); 98 __ CallStub(&ceb);
93 99
94 if (FLAG_debug_code) { 100 if (FLAG_debug_code) {
95 for (int i = 0; i < kNumJSCallerSaved; i++) { 101 for (int i = 0; i < kNumJSCallerSaved; i++) {
96 Register reg = {JSCallerSavedCode(i)}; 102 Register reg = {JSCallerSavedCode(i)};
97 __ mov(reg, Operand(kDebugZapValue)); 103 // Do not clobber r0 if SAVE_RESULT_REGISTER is set. It will
104 // contain return value of the function.
105 if (!(reg.is(r0) && SAVE_RESULT_REGISTER)) {
106 __ mov(reg, Operand(kDebugZapValue));
107 }
98 } 108 }
99 } 109 }
100 110
101 if (mode == SAVE_RESULT_REGISTER) __ pop(r0);
102
103 // Don't bother removing padding bytes pushed on the stack 111 // Don't bother removing padding bytes pushed on the stack
104 // as the frame is going to be restored right away. 112 // as the frame is going to be restored right away.
105 113
106 // Leave the internal frame. 114 // Leave the internal frame.
107 } 115 }
108 116
109 // Now that the break point has been handled, resume normal execution by 117 // Now that the break point has been handled, resume normal execution by
110 // jumping to the target address intended by the caller and that was 118 // jumping to the target address intended by the caller and that was
111 // overwritten by the address of DebugBreakXXX. 119 // overwritten by the address of DebugBreakXXX.
112 ExternalReference after_break_target = 120 ExternalReference after_break_target =
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 155
148 156
149 const bool LiveEdit::kFrameDropperSupported = true; 157 const bool LiveEdit::kFrameDropperSupported = true;
150 158
151 #undef __ 159 #undef __
152 160
153 } // namespace internal 161 } // namespace internal
154 } // namespace v8 162 } // namespace v8
155 163
156 #endif // V8_TARGET_ARCH_ARM 164 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/debug/arm64/debug-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698