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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 27802002: Disconnects code objects from infrequently used unoptimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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_arm.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
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 29013)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1613,8 +1613,25 @@
__ Bind(&call_target_function);
// EAX: Target function.
- __ movl(EAX, FieldAddress(EAX, Function::code_offset()));
- __ movl(EAX, FieldAddress(EAX, Code::instructions_offset()));
+ Label is_compiled;
+ __ movl(EBX, FieldAddress(EAX, Function::code_offset()));
+ if (FLAG_collect_code) {
+ // If code might be GC'd, then EBX might be null. If it is, recompile.
+ __ cmpl(EBX, raw_null);
+ __ j(NOT_EQUAL, &is_compiled, Assembler::kNearJump);
+ __ EnterStubFrame();
+ __ pushl(EDX); // Preserve arguments descriptor array.
+ __ pushl(ECX); // Preserve IC data object.
+ __ pushl(EAX); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ popl(EAX); // Restore function.
+ __ popl(ECX); // Restore IC data array.
+ __ popl(EDX); // Restore arguments descriptor array.
+ __ LeaveFrame();
+ __ movl(EBX, FieldAddress(EAX, Function::code_offset()));
+ __ Bind(&is_compiled);
+ }
+ __ movl(EAX, FieldAddress(EBX, Code::instructions_offset()));
__ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(EAX);
@@ -1796,6 +1813,24 @@
}
+// Stub for calling the CompileFunction runtime call.
+// ECX: IC-Data.
+// EDX: Arguments descriptor.
+// EAX: Function.
+void StubCode::GenerateCompileFunctionRuntimeCallStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ __ pushl(EDX); // Preserve arguments descriptor array.
+ __ pushl(ECX); // Preserve IC data object.
+ __ pushl(EAX); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ popl(EAX); // Restore function.
+ __ popl(ECX); // Restore IC data array.
+ __ popl(EDX); // Restore arguments descriptor array.
+ __ LeaveFrame();
+ __ ret();
+}
+
+
// EDX, ECX: May contain arguments to runtime stub.
void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
__ EnterStubFrame();
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698