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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 339183010: Specialize breakpoint stubs by set of live registers of the stubs they are intercepting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
Index: runtime/vm/stub_code_mips.cc
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index 5c9a554a581bcd9bb2c5b7c45354524415a982f3..6e79e849adbd8be2effcf29458bc34e0fd72f494 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -34,7 +34,7 @@ DECLARE_FLAG(bool, enable_debugger);
// SP + 4*S4 - 4 : address of first argument in argument array.
// SP + 4*S4 : address of return value.
// S5 : address of the runtime function to call.
-// S4 : number of arguments to the call as Smi.
+// S4 : number of arguments to the call.
void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
const intptr_t isolate_offset = NativeArguments::isolate_offset();
const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
@@ -49,7 +49,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ sw(RA, Address(SP, 1 * kWordSize));
__ sw(FP, Address(SP, 0 * kWordSize));
__ mov(FP, SP);
- __ SmiUntag(S4);
// Load current Isolate pointer from Context structure into A0.
__ lw(A0, FieldAddress(CTX, Context::isolate_offset()));
@@ -1721,8 +1720,30 @@ void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
}
-void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
- __ Comment("BreakpointRuntime stub");
+// S5: Contains an ICData.
+void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
+ __ Comment("ICCallBreakpoint stub");
+ __ EnterStubFrame();
+ __ addiu(SP, SP, Immediate(-2 * kWordSize));
+ __ sw(S5, Address(SP, 1 * kWordSize));
+ __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+ __ sw(TMP, Address(SP, 0 * kWordSize));
+
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
+
+ __ lw(S5, Address(SP, 1 * kWordSize));
+ __ lw(T0, Address(SP, 0 * kWordSize));
+ __ addiu(SP, SP, Immediate(2 * kWordSize));
+ __ LeaveStubFrame();
+ __ jr(T0);
+}
+
+
+// S5: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile
+// stub).
+// S4: Contains an arguments descriptor.
+void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) {
+ __ Comment("ClosureCallBreakpoint stub");
__ EnterStubFrame();
__ addiu(SP, SP, Immediate(-3 * kWordSize));
__ sw(S5, Address(SP, 2 * kWordSize));
@@ -1741,6 +1762,31 @@ void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
}
+// S5: Garbage or function address.
+// S4: Garbage or raw argument count.
+void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) {
+ __ Comment("RuntimeCallBreakpoint stub");
+ __ EnterStubFrame();
+ __ addiu(SP, SP, Immediate(-3 * kWordSize));
+ __ AndImmediate(S5, S5, ~kSmiTagMask);
+ __ sw(S5, Address(SP, 2 * kWordSize));
+ __ SmiTag(S4);
+ __ sw(S4, Address(SP, 1 * kWordSize));
+ __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+ __ sw(TMP, Address(SP, 0 * kWordSize));
+
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
+
+ __ lw(S5, Address(SP, 2 * kWordSize));
+ __ lw(S4, Address(SP, 1 * kWordSize));
+ __ SmiUntag(S4);
+ __ lw(T0, Address(SP, 0 * kWordSize));
+ __ addiu(SP, SP, Immediate(3 * kWordSize));
+ __ LeaveStubFrame();
+ __ jr(T0);
+}
+
+
// Called only from unoptimized code. All relevant registers have been saved.
// RA: return address.
void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) {

Powered by Google App Engine
This is Rietveld 408576698