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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/s390/debug-s390.cc ('k') | src/debug/x87/debug-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/x64/debug-x64.cc
diff --git a/src/debug/x64/debug-x64.cc b/src/debug/x64/debug-x64.cc
index 094e7b608ece3dc54ac5f1f708a057b62854a9cf..46805963220a9a65cab7ed48bc7aec27e1e70358 100644
--- a/src/debug/x64/debug-x64.cc
+++ b/src/debug/x64/debug-x64.cc
@@ -69,9 +69,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm,
}
__ Push(Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
- if (mode == SAVE_RESULT_REGISTER) __ Push(rax);
-
- __ Set(rax, 0); // No arguments (argc == 0).
+ // Push arguments for DebugBreak call.
+ if (mode == SAVE_RESULT_REGISTER) {
+ // Break on return.
+ __ Push(rax);
+ } else {
+ // Non-return breaks.
+ __ Push(masm->isolate()->factory()->the_hole_value());
+ }
+ __ Set(rax, 1);
__ Move(rbx, ExternalReference(Runtime::FunctionForId(Runtime::kDebugBreak),
masm->isolate()));
@@ -81,12 +87,14 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm,
if (FLAG_debug_code) {
for (int i = 0; i < kNumJSCallerSaved; ++i) {
Register reg = {JSCallerSavedCode(i)};
- __ Set(reg, kDebugZapValue);
+ // Do not clobber rax if SAVE_RESULT_REGISTER is set. It will
+ // contain return value of the function.
+ if (!(reg.is(rax) && SAVE_RESULT_REGISTER)) {
+ __ Set(reg, kDebugZapValue);
+ }
}
}
- if (mode == SAVE_RESULT_REGISTER) __ Pop(rax);
-
// Read current padding counter and skip corresponding number of words.
__ Pop(kScratchRegister);
__ SmiToInteger32(kScratchRegister, kScratchRegister);
« no previous file with comments | « src/debug/s390/debug-s390.cc ('k') | src/debug/x87/debug-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698