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

Unified Diff: runtime/vm/stub_code_mips.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_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 29013)
+++ runtime/vm/stub_code_mips.cc (working copy)
@@ -1812,8 +1812,26 @@
__ Bind(&call_target_function);
// T3: Target function.
- __ lw(T3, FieldAddress(T3, Function::code_offset()));
- __ lw(T3, FieldAddress(T3, Code::instructions_offset()));
+ Label is_compiled;
+ __ lw(T4, FieldAddress(T3, Function::code_offset()));
+ if (FLAG_collect_code) {
+ __ BranchNotEqual(T4, reinterpret_cast<int32_t>(Object::null()),
+ &is_compiled);
+ __ EnterStubFrame();
+ __ addiu(SP, SP, Immediate(-3 * kWordSize));
+ __ sw(S5, Address(SP, 2 * kWordSize)); // Preserve IC data.
+ __ sw(S4, Address(SP, 1 * kWordSize)); // Preserve arg desc.
+ __ sw(T3, Address(SP, 0 * kWordSize)); // Function argument.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ lw(T3, Address(SP, 0 * kWordSize)); // Restore Function.
+ __ lw(S4, Address(SP, 1 * kWordSize)); // Restore arg desc.
+ __ lw(S5, Address(SP, 2 * kWordSize)); // Restore IC data.
+ __ addiu(SP, SP, Immediate(3 * kWordSize));
+ __ LeaveStubFrame();
+ __ lw(T4, FieldAddress(T3, Function::code_offset()));
+ __ Bind(&is_compiled);
+ }
+ __ lw(T3, FieldAddress(T4, Code::instructions_offset()));
__ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag);
__ jr(T3);
@@ -1993,6 +2011,24 @@
}
+// Stub for calling the CompileFunction runtime call.
+// S5: IC-Data.
+// S4: Arguments descriptor.
+// T0: Function.
+void StubCode::GenerateCompileFunctionRuntimeCallStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ __ addiu(SP, SP, Immediate(-3 * kWordSize));
+ __ sw(S5, Address(SP, 2 * kWordSize)); // Preserve IC data object.
+ __ sw(S4, Address(SP, 1 * kWordSize)); // Preserve args descriptor array.
+ __ sw(T0, Address(SP, 0 * kWordSize)); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ lw(T0, Address(SP, 0 * kWordSize)); // Restore function.
+ __ lw(S4, Address(SP, 1 * kWordSize)); // Restore args descriptor array.
+ __ lw(S5, Address(SP, 2 * kWordSize)); // Restore IC data array.
+ __ LeaveStubFrameAndReturn();
+}
+
+
void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
__ Comment("BreakpointRuntime stub");
__ EnterStubFrame();
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698