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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 15743019: Consolidate debug stubs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 23045)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1708,29 +1708,25 @@
}
-// ECX: ICData
-void StubCode::GenerateBreakpointEqNullStub(Assembler* assembler) {
+// EDX, EXC: May contain arguments to runtime stub.
+void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
__ EnterStubFrame();
+ // Save runtime args.
__ pushl(ECX);
- __ CallRuntime(kBreakpointEqualNullHandlerRuntimeEntry);
+ __ pushl(EDX);
+ // Room for result. Debugger stub returns address of the
+ // unpatched runtime stub.
+ __ pushl(Immediate(0));
siva 2013/05/23 01:11:26 const Immediate& raw_null = Immediate(reinterpret_
hausner 2013/05/23 18:32:12 Done.
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry);
+ __ popl(EAX); // Address of original stub.
+ __ popl(EDX); // Restore arguments.
__ popl(ECX);
__ LeaveFrame();
- __ jmp(&StubCode::EqualityWithNullArgLabel());
+ __ jmp(EAX); // Jump to original stub.
}
// EDX: Arguments descriptor array.
-void StubCode::GenerateBreakpointClosureStub(Assembler* assembler) {
- __ EnterStubFrame();
- __ pushl(EDX); // Push arguments descriptor.
- __ CallRuntime(kBreakpointClosureHandlerRuntimeEntry);
- __ popl(EDX); // Restore arguments descriptor.
- __ LeaveFrame();
- __ jmp(&StubCode::CallClosureFunctionLabel());
-}
-
-
-// EDX: Arguments descriptor array.
// TOS(0): return address (Dart code).
void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
// Create a stub frame as we are pushing some objects on the stack before
@@ -1747,6 +1743,9 @@
// Now call the static function. The breakpoint handler function
// ensures that the call target is compiled.
+ // Note that we can't just jump to the CallStatic function stub
+ // here since that stub would patch the call site with the
+ // static function address.
__ movl(ECX, FieldAddress(EAX, Code::instructions_offset()));
__ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(ECX);

Powered by Google App Engine
This is Rietveld 408576698