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

Unified Diff: src/debug/mips64/debug-mips64.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/mips/debug-mips.cc ('k') | src/debug/ppc/debug-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/mips64/debug-mips64.cc
diff --git a/src/debug/mips64/debug-mips64.cc b/src/debug/mips64/debug-mips64.cc
index 1288d43b008b02d10a5921150c63c338f3258796..aad095b64d7b93ed8fbf19051c307740aa0fc4d3 100644
--- a/src/debug/mips64/debug-mips64.cc
+++ b/src/debug/mips64/debug-mips64.cc
@@ -79,9 +79,15 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm,
__ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize)));
__ push(at);
- if (mode == SAVE_RESULT_REGISTER) __ push(v0);
-
- __ PrepareCEntryArgs(0); // No arguments.
+ // Push arguments for DebugBreak call.
+ if (mode == SAVE_RESULT_REGISTER) {
+ // Break on return.
+ __ push(v0);
+ } else {
+ // Non-return breaks.
+ __ Push(masm->isolate()->factory()->the_hole_value());
+ }
+ __ PrepareCEntryArgs(1);
__ PrepareCEntryFunction(ExternalReference(
Runtime::FunctionForId(Runtime::kDebugBreak), masm->isolate()));
@@ -91,12 +97,14 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm,
if (FLAG_debug_code) {
for (int i = 0; i < kNumJSCallerSaved; i++) {
Register reg = {JSCallerSavedCode(i)};
- __ li(reg, kDebugZapValue);
+ // Do not clobber v0 if mode is SAVE_RESULT_REGISTER. It will
+ // contain return value of the function returned by DebugBreak.
+ if (!(reg.is(v0) && (mode == SAVE_RESULT_REGISTER))) {
+ __ li(reg, kDebugZapValue);
+ }
}
}
- if (mode == SAVE_RESULT_REGISTER) __ pop(v0);
-
// Don't bother removing padding bytes pushed on the stack
// as the frame is going to be restored right away.
« no previous file with comments | « src/debug/mips/debug-mips.cc ('k') | src/debug/ppc/debug-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698