Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index e0c37e1a9ff82d03427e04e3e5acf184b2dc2c06..70c5bc0bd3545070e3f60a1916682695056ee625 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -291,68 +291,51 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { |
} |
+static void CallRuntimePassFunction(MacroAssembler* masm, |
+ Runtime::FunctionId function_id) { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ // Push a copy of the function onto the stack. |
+ __ push(r1); |
+ // Push call kind information. |
+ __ push(r5); |
+ // Function is also the parameter to the runtime call. |
+ __ push(r1); |
+ |
+ __ CallRuntime(function_id, 1); |
+ // Restore call kind information. |
+ __ pop(r5); |
+ // Restore receiver. |
+ __ pop(r1); |
+} |
+ |
+ |
static void GenerateTailCallToSharedCode(MacroAssembler* masm) { |
__ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
__ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kCodeOffset)); |
__ add(r2, r2, Operand(Code::kHeaderSize - kHeapObjectTag)); |
- __ mov(pc, r2); |
+ __ Jump(r2); |
} |
void Builtins::Generate_InRecompileQueue(MacroAssembler* masm) { |
+ Label ok; |
+ // Check stack limit for signal to install code. |
+ __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
+ __ cmp(sp, Operand(ip)); |
+ __ b(hs, &ok); |
+ |
+ CallRuntimePassFunction(masm, Runtime::kTryInstallRecompiledCode); |
+ // Tail call to returned code. |
+ __ add(r0, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
+ __ Jump(r0); |
+ |
+ __ bind(&ok); |
GenerateTailCallToSharedCode(masm); |
} |
-void Builtins::Generate_InstallRecompiledCode(MacroAssembler* masm) { |
- // Enter an internal frame. |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- |
- // Preserve the function. |
- __ push(r1); |
- // Push call kind information. |
- __ push(r5); |
- |
- // Push the function on the stack as the argument to the runtime function. |
- __ push(r1); |
- __ CallRuntime(Runtime::kInstallRecompiledCode, 1); |
- // Calculate the entry point. |
- __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
- |
- // Restore call kind information. |
- __ pop(r5); |
- // Restore saved function. |
- __ pop(r1); |
- |
- // Tear down internal frame. |
- } |
- |
- // Do a tail-call of the compiled function. |
- __ Jump(r2); |
-} |
- |
- |
void Builtins::Generate_ConcurrentRecompile(MacroAssembler* masm) { |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- |
- // Push a copy of the function onto the stack. |
- __ push(r1); |
- // Push call kind information. |
- __ push(r5); |
- |
- __ push(r1); // Function is also the parameter to the runtime call. |
- __ CallRuntime(Runtime::kConcurrentRecompile, 1); |
- |
- // Restore call kind information. |
- __ pop(r5); |
- // Restore receiver. |
- __ pop(r1); |
- |
- // Tear down internal frame. |
- } |
- |
+ CallRuntimePassFunction(masm, Runtime::kConcurrentRecompile); |
GenerateTailCallToSharedCode(masm); |
} |
@@ -795,59 +778,17 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
void Builtins::Generate_LazyCompile(MacroAssembler* masm) { |
- // Enter an internal frame. |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- |
- // Preserve the function. |
- __ push(r1); |
- // Push call kind information. |
- __ push(r5); |
- |
- // Push the function on the stack as the argument to the runtime function. |
- __ push(r1); |
- __ CallRuntime(Runtime::kLazyCompile, 1); |
- // Calculate the entry point. |
- __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
- |
- // Restore call kind information. |
- __ pop(r5); |
- // Restore saved function. |
- __ pop(r1); |
- |
- // Tear down internal frame. |
- } |
- |
+ CallRuntimePassFunction(masm, Runtime::kLazyCompile); |
// Do a tail-call of the compiled function. |
+ __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
__ Jump(r2); |
} |
void Builtins::Generate_LazyRecompile(MacroAssembler* masm) { |
- // Enter an internal frame. |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- |
- // Preserve the function. |
- __ push(r1); |
- // Push call kind information. |
- __ push(r5); |
- |
- // Push the function on the stack as the argument to the runtime function. |
- __ push(r1); |
- __ CallRuntime(Runtime::kLazyRecompile, 1); |
- // Calculate the entry point. |
- __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
- |
- // Restore call kind information. |
- __ pop(r5); |
- // Restore saved function. |
- __ pop(r1); |
- |
- // Tear down internal frame. |
- } |
- |
+ CallRuntimePassFunction(masm, Runtime::kLazyRecompile); |
// Do a tail-call of the compiled function. |
+ __ add(r2, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
__ Jump(r2); |
} |