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

Side by Side Diff: src/debug/x64/debug-x64.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: Fixed the bugs in earlier implementation. Changed full-codegen to match ignition for fetching the r… 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
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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/assembler.h" 7 #include "src/assembler.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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // Enter an internal frame. 62 // Enter an internal frame.
63 { 63 {
64 FrameScope scope(masm, StackFrame::INTERNAL); 64 FrameScope scope(masm, StackFrame::INTERNAL);
65 65
66 // Load padding words on stack. 66 // Load padding words on stack.
67 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) { 67 for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) {
68 __ Push(Smi::FromInt(LiveEdit::kFramePaddingValue)); 68 __ Push(Smi::FromInt(LiveEdit::kFramePaddingValue));
69 } 69 }
70 __ Push(Smi::FromInt(LiveEdit::kFramePaddingInitialSize)); 70 __ Push(Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
71 71
72 if (mode == SAVE_RESULT_REGISTER) __ Push(rax); 72 // Push arguments for DebugBreak call.
73 73 if (mode == SAVE_RESULT_REGISTER) {
74 __ Set(rax, 0); // No arguments (argc == 0). 74 // Break on return.
75 __ Push(rax);
76 } else {
77 // Non-return breaks.
78 __ Push(masm->isolate()->factory()->the_hole_value());
79 }
80 __ Set(rax, 1);
75 __ Move(rbx, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak), 81 __ Move(rbx, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak),
76 masm->isolate())); 82 masm->isolate()));
77 83
78 CEntryStub ceb(masm->isolate(), 1); 84 CEntryStub ceb(masm->isolate(), 1);
79 __ CallStub(&ceb); 85 __ CallStub(&ceb);
80 86
81 if (FLAG_debug_code) { 87 if (FLAG_debug_code) {
82 for (int i = 0; i < kNumJSCallerSaved; ++i) { 88 // Do not clobber rax if SAVE_RESULT_REGISTER is set. It will
89 // contain return value of the function.
90 for (int i = SAVE_RESULT_REGISTER ? 1 : 0; i < kNumJSCallerSaved; ++i) {
mythria 2016/03/21 16:24:29 If this is too hacky, I will just push and pop rax
rmcilroy 2016/03/22 11:32:34 Ditto. I'm not sure it's necessary to push / pop,
mythria 2016/03/22 12:08:09 Done.
83 Register reg = {JSCallerSavedCode(i)}; 91 Register reg = {JSCallerSavedCode(i)};
84 __ Set(reg, kDebugZapValue); 92 __ Set(reg, kDebugZapValue);
85 } 93 }
86 } 94 }
87 95
88 if (mode == SAVE_RESULT_REGISTER) __ Pop(rax);
89
90 // Read current padding counter and skip corresponding number of words. 96 // Read current padding counter and skip corresponding number of words.
91 __ Pop(kScratchRegister); 97 __ Pop(kScratchRegister);
92 __ SmiToInteger32(kScratchRegister, kScratchRegister); 98 __ SmiToInteger32(kScratchRegister, kScratchRegister);
93 __ leap(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0)); 99 __ leap(rsp, Operand(rsp, kScratchRegister, times_pointer_size, 0));
94 100
95 // Get rid of the internal frame. 101 // Get rid of the internal frame.
96 } 102 }
97 103
98 // This call did not replace a call , so there will be an unwanted 104 // This call did not replace a call , so there will be an unwanted
99 // return address left on the stack. Here we get rid of that. 105 // return address left on the stack. Here we get rid of that.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 144 }
139 145
140 const bool LiveEdit::kFrameDropperSupported = true; 146 const bool LiveEdit::kFrameDropperSupported = true;
141 147
142 #undef __ 148 #undef __
143 149
144 } // namespace internal 150 } // namespace internal
145 } // namespace v8 151 } // namespace v8
146 152
147 #endif // V8_TARGET_ARCH_X64 153 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698