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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 2523053002: Implement rewind: drop one or more frames from the debugger. (Closed)
Patch Set: code review Created 4 years, 1 month 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 | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index d52e6cc643960d196aa06281fd80040299619e56..53394cf82eb4beda3bcd581482bc3bb36f8a0f71 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -549,18 +549,19 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
// Remove materialization arguments.
__ SmiUntag(T1);
__ addu(SP, SP, T1);
- __ Ret();
+ // The caller is responsible for emitting the return instruction.
}
// V0: result, must be preserved
void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
// Push zap value instead of CODE_REG for lazy deopt.
- __ LoadImmediate(TMP, 0xf1f1f1f1);
+ __ LoadImmediate(TMP, kZapCodeReg);
__ Push(TMP);
// Return address for "call" to deopt stub.
- __ LoadImmediate(RA, 0xe1e1e1e1);
+ __ LoadImmediate(RA, kZapReturnAddress);
__ lw(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset()));
GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn);
+ __ Ret();
}
@@ -568,17 +569,19 @@ void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
// V1: stacktrace, must be preserved
void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) {
// Push zap value instead of CODE_REG for lazy deopt.
- __ LoadImmediate(TMP, 0xf1f1f1f1);
+ __ LoadImmediate(TMP, kZapCodeReg);
__ Push(TMP);
// Return address for "call" to deopt stub.
- __ LoadImmediate(RA, 0xe1e1e1e1);
+ __ LoadImmediate(RA, kZapReturnAddress);
__ lw(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset()));
GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow);
+ __ Ret();
}
void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
GenerateDeoptimizationSequence(assembler, kEagerDeopt);
+ __ Ret();
}
@@ -2028,6 +2031,26 @@ void StubCode::GenerateRunExceptionHandlerStub(Assembler* assembler) {
}
+// Deoptimize a frame on the call stack before rewinding.
+// The arguments are stored in the Thread object.
+// No result.
+void StubCode::GenerateDeoptForRewindStub(Assembler* assembler) {
+ // Push zap value instead of CODE_REG.
+ __ LoadImmediate(TMP, kZapCodeReg);
+ __ Push(TMP);
+
+ // Load the deopt pc into RA.
+ __ lw(RA, Address(THR, Thread::resume_pc_offset()));
+ GenerateDeoptimizationSequence(assembler, kEagerDeopt);
+
+ // After we have deoptimized, jump to the correct frame.
+ __ EnterStubFrame();
+ __ CallRuntime(kRewindPostDeoptRuntimeEntry, 0);
+ __ LeaveStubFrame();
+ __ break_(0);
+}
+
+
// Calls to the runtime to optimize the given function.
// T0: function to be reoptimized.
// S4: argument descriptor (preserved).
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698