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

Unified Diff: runtime/vm/stub_code_ia32.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_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index fc1ef63cfc60f758f2f5e84ea4d14f9b5fd1d635..33f280392c867923b367e76b3ebb5731da777a25 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -37,7 +37,7 @@ DECLARE_FLAG(bool, enable_debugger);
// ESP + 4*EDX : address of first argument in argument array.
// ESP + 4*EDX + 4 : address of return value.
// ECX : address of the runtime function to call.
-// EDX : number of arguments to the call as Smi.
+// EDX : number of arguments to the call.
// Must preserve callee saved registers EDI and EBX.
void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
const intptr_t isolate_offset = NativeArguments::isolate_offset();
@@ -46,7 +46,6 @@ void StubCode::GenerateCallToRuntimeStub(Assembler* assembler) {
const intptr_t retval_offset = NativeArguments::retval_offset();
__ EnterFrame(0);
- __ SmiUntag(EDX);
// Load current Isolate pointer from Context structure into EAX.
__ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
@@ -1588,10 +1587,30 @@ void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
}
-// EDX, ECX: May contain arguments to runtime stub.
-void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
+// ECX: Contains an ICData.
+void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
__ EnterStubFrame();
- // Save runtime args.
+ // Save IC data.
+ __ pushl(ECX);
+ // Room for result. Debugger stub returns address of the
+ // unpatched runtime stub.
+ const Immediate& raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Object::null()));
+ __ pushl(raw_null); // Room for result.
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
+ __ popl(EAX); // Address of original stub.
+ __ popl(ECX); // Restore IC data.
+ __ LeaveFrame();
+ __ jmp(EAX); // Jump to original stub.
+}
+
+
+// ECX: Contains Smi 0 (need to preserve a GC-safe value for the lazy compile
+// stub).
+// EDX: Contains an arguments descriptor.
+void StubCode::GenerateClosureCallBreakpointStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ // Save arguments to original stub.
__ pushl(ECX);
__ pushl(EDX);
// Room for result. Debugger stub returns address of the
@@ -1601,13 +1620,27 @@ void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
__ pushl(raw_null); // Room for result.
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
__ popl(EAX); // Address of original stub.
- __ popl(EDX); // Restore arguments.
+ __ popl(EDX); // Restore arguments to original stub.
__ popl(ECX);
__ LeaveFrame();
__ jmp(EAX); // Jump to original stub.
}
+void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ // Room for result. Debugger stub returns address of the
+ // unpatched runtime stub.
+ const Immediate& raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Object::null()));
+ __ pushl(raw_null); // Room for result.
+ __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
+ __ popl(EAX); // Address of original stub.
+ __ LeaveFrame();
+ __ jmp(EAX); // 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_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698