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

Unified Diff: runtime/vm/stub_code_x64.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_mips.cc ('k') | tests/standalone/code_collection_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 29013)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1600,8 +1600,25 @@
__ Bind(&call_target_function);
// RAX: Target function.
- __ movq(RAX, FieldAddress(RAX, Function::code_offset()));
- __ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
+ Label is_compiled;
+ __ movq(RCX, FieldAddress(RAX, Function::code_offset()));
+ if (FLAG_collect_code) {
+ // If code might be GC'd, then EBX might be null. If it is, recompile.
+ __ CompareObject(RCX, Object::null_object(), PP);
+ __ j(NOT_EQUAL, &is_compiled, Assembler::kNearJump);
+ __ EnterStubFrame();
+ __ pushq(R10); // Preserve arguments descriptor array.
+ __ pushq(RBX); // Preserve IC data object.
+ __ pushq(RAX); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ popq(RAX); // Restore function.
+ __ popq(RBX); // Restore IC data array.
+ __ popq(R10); // Restore arguments descriptor array.
+ __ LeaveFrame();
+ __ movq(RCX, FieldAddress(RAX, Function::code_offset()));
+ __ Bind(&is_compiled);
+ }
+ __ movq(RAX, FieldAddress(RCX, Code::instructions_offset()));
__ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(RAX);
@@ -1782,6 +1799,24 @@
}
+// Stub for calling the CompileFunction runtime call.
+// RCX: IC-Data.
+// RDX: Arguments descriptor.
+// RAX: Function.
+void StubCode::GenerateCompileFunctionRuntimeCallStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ __ pushq(RDX); // Preserve arguments descriptor array.
+ __ pushq(RCX); // Preserve IC data object.
+ __ pushq(RAX); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ popq(RAX); // Restore function.
+ __ popq(RCX); // Restore IC data array.
+ __ popq(RDX); // Restore arguments descriptor array.
+ __ LeaveFrame();
+ __ ret();
+}
+
+
// RBX, R10: May contain arguments to runtime stub.
// TOS(0): return address (Dart code).
void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | tests/standalone/code_collection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698