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

Unified Diff: runtime/vm/stub_code_x64.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, 5 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 | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 7367a5ff836cb3965454f4d225608f311642e8fc..cdd7bcd3b783aabb829306e1bdc396bab376da20 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -83,7 +83,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
__ movq(Address(RSP, isolate_offset), CTX); // Set isolate in NativeArgs.
// There are no runtime calls to closures, so we do not need to set the tag
// bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
- __ SmiUntag(R10);
__ movq(Address(RSP, argc_tag_offset), R10); // Set argc in NativeArguments.
__ leaq(RAX, Address(RBP, R10, TIMES_8, 1 * kWordSize)); // Compute argv.
__ movq(Address(RSP, argv_offset), RAX); // Set argv in NativeArguments.
@@ -1554,9 +1553,29 @@ void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
}
-// RBX, R10: May contain arguments to runtime stub.
-// TOS(0): return address (Dart code).
-void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
+// RBX: Contains an ICData.
+// TOS(0): return address (Dart code).
+void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ // Preserve IC data.
+ __ pushq(RBX);
+ // Room for result. Debugger stub returns address of the
+ // unpatched runtime stub.
+ __ LoadObject(R12, Object::null_object(), PP);
+ __ pushq(R12); // Room for result.
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
+ __ popq(RAX); // Address of original.
+ __ popq(RBX); // Restore IC data.
+ __ LeaveStubFrame();
+ __ jmp(RAX); // Jump to original stub.
+}
+
+
+// RBX: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile
+// stub).
+// R10: Contains an arguments descriptor.
+// TOS(0): return address (Dart code).
+void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) {
__ EnterStubFrame();
// Preserve runtime args.
__ pushq(RBX);
@@ -1574,6 +1593,20 @@ void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
}
+// TOS(0): return address (Dart code).
+void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ // Room for result. Debugger stub returns address of the
+ // unpatched runtime stub.
+ __ LoadObject(R12, Object::null_object(), PP);
+ __ pushq(R12); // Room for result.
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
+ __ popq(RAX); // Address of original.
+ __ LeaveStubFrame();
+ __ jmp(RAX); // Jump to original stub.
+}
+
+
// Called only from unoptimized code.
void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) {
if (FLAG_enable_debugger) {
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698