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

Unified Diff: runtime/vm/stub_code_arm.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.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm.cc
===================================================================
--- runtime/vm/stub_code_arm.cc (revision 29013)
+++ runtime/vm/stub_code_arm.cc (working copy)
@@ -1589,8 +1589,25 @@
__ Bind(&call_target_function);
// R0: target function.
- __ ldr(R0, FieldAddress(R0, Function::code_offset()));
- __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
+ __ ldr(R1, FieldAddress(R0, Function::code_offset()));
+ if (FLAG_collect_code) {
+ // If we are collecting code, the code object may be null.
+ Label is_compiled;
+ __ CompareImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+ __ b(&is_compiled, NE);
+ __ EnterStubFrame();
+ // Preserve arg desc. and IC data object.
+ __ PushList((1 << R4) | (1 << R5));
+ __ Push(R0); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ Pop(R0); // Discard argument.
+ __ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data.
+ __ LeaveStubFrame();
+ // R0: target function.
+ __ ldr(R1, FieldAddress(R0, Function::code_offset()));
+ __ Bind(&is_compiled);
+ }
+ __ ldr(R0, FieldAddress(R1, Code::instructions_offset()));
__ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
__ bx(R0);
@@ -1758,6 +1775,23 @@
}
+// Stub for calling the CompileFunction runtime call.
+// R5: IC-Data.
+// R4: Arguments descriptor.
+// R0: Function.
+void StubCode::GenerateCompileFunctionRuntimeCallStub(Assembler* assembler) {
+ // Preserve arg desc. and IC data object.
+ __ EnterStubFrame();
+ __ PushList((1 << R4) | (1 << R5));
+ __ Push(R0); // Pass function.
+ __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
+ __ Pop(R0); // Restore argument.
+ __ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data.
+ __ LeaveStubFrame();
+ __ Ret();
+}
+
+
void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
__ Comment("BreakpointRuntime stub");
__ EnterStubFrame();
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698