| 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();
|
|
|