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

Unified Diff: src/debug/ia32/debug-ia32.cc

Issue 1842683002: [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 failures on linux-nosnap-dbg 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/debug.cc ('k') | src/debug/mips/debug-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/ia32/debug-ia32.cc
diff --git a/src/debug/ia32/debug-ia32.cc b/src/debug/ia32/debug-ia32.cc
index 7df18c7eb8f7bddd8768769058021cc153ca099c..056407f29a05b7035d7eba7a03a1a14d58b19882 100644
--- a/src/debug/ia32/debug-ia32.cc
+++ b/src/debug/ia32/debug-ia32.cc
@@ -68,9 +68,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm,
}
__ push(Immediate(Smi::FromInt(LiveEdit::kFramePaddingInitialSize)));
- if (mode == SAVE_RESULT_REGISTER) __ push(eax);
-
- __ Move(eax, Immediate(0)); // No arguments.
+ // Push arguments for DebugBreak call.
+ if (mode == SAVE_RESULT_REGISTER) {
+ // Break on return.
+ __ push(eax);
+ } else {
+ // Non-return breaks.
+ __ Push(masm->isolate()->factory()->the_hole_value());
+ }
+ __ Move(eax, Immediate(1));
__ mov(ebx,
Immediate(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)};
- __ Move(reg, Immediate(kDebugZapValue));
+ // Do not clobber eax if mode is SAVE_RESULT_REGISTER. It will
+ // contain return value of the function.
+ if (!(reg.is(eax) && (mode == SAVE_RESULT_REGISTER))) {
+ __ Move(reg, Immediate(kDebugZapValue));
+ }
}
}
- if (mode == SAVE_RESULT_REGISTER) __ pop(eax);
-
__ pop(ebx);
// We divide stored value by 2 (untagging) and multiply it by word's size.
STATIC_ASSERT(kSmiTagSize == 1 && kSmiShiftSize == 0);
« no previous file with comments | « src/debug/debug.cc ('k') | src/debug/mips/debug-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698