| Index: src/mips/builtins-mips.cc
|
| diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
|
| index ade514a4505e70494b8dd48df47a2117e0134818..707ea728f787e855d62176a4b1e01d2c441f416d 100644
|
| --- a/src/mips/builtins-mips.cc
|
| +++ b/src/mips/builtins-mips.cc
|
| @@ -469,25 +469,6 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
|
| __ sw(a0, FieldMemOperand(v0, JSValue::kValueOffset)); // In delay slot
|
| }
|
|
|
| -
|
| -static void CallRuntimePassFunction(
|
| - MacroAssembler* masm, Runtime::FunctionId function_id) {
|
| - // ----------- S t a t e -------------
|
| - // -- a1 : target function (preserved for callee)
|
| - // -- a3 : new target (preserved for callee)
|
| - // -----------------------------------
|
| -
|
| - FrameScope scope(masm, StackFrame::INTERNAL);
|
| - // Push a copy of the target function and the new target.
|
| - // Push function as parameter to the runtime call.
|
| - __ Push(a1, a3, a1);
|
| -
|
| - __ CallRuntime(function_id, 1);
|
| - // Restore target function and new target.
|
| - __ Pop(a1, a3);
|
| -}
|
| -
|
| -
|
| static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
|
| __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
| __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCodeOffset));
|
| @@ -495,8 +476,27 @@ static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
|
| __ Jump(at);
|
| }
|
|
|
| +static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
|
| + Runtime::FunctionId function_id) {
|
| + // ----------- S t a t e -------------
|
| + // -- a0 : argument count (preserved for callee)
|
| + // -- a1 : target function (preserved for callee)
|
| + // -- a3 : new target (preserved for callee)
|
| + // -----------------------------------
|
| + {
|
| + FrameScope scope(masm, StackFrame::INTERNAL);
|
| + // Push a copy of the target function and the new target.
|
| + // Push function as parameter to the runtime call.
|
| + __ SmiTag(a0);
|
| + __ Push(a0, a1, a3, a1);
|
| +
|
| + __ CallRuntime(function_id, 1);
|
| +
|
| + // Restore target function and new target.
|
| + __ Pop(a0, a1, a3);
|
| + __ SmiUntag(a0);
|
| + }
|
|
|
| -static void GenerateTailCallToReturnedCode(MacroAssembler* masm) {
|
| __ Addu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| __ Jump(at);
|
| }
|
| @@ -512,8 +512,7 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
|
| __ LoadRoot(t0, Heap::kStackLimitRootIndex);
|
| __ Branch(&ok, hs, sp, Operand(t0));
|
|
|
| - CallRuntimePassFunction(masm, Runtime::kTryInstallOptimizedCode);
|
| - GenerateTailCallToReturnedCode(masm);
|
| + GenerateTailCallToReturnedCode(masm, Runtime::kTryInstallOptimizedCode);
|
|
|
| __ bind(&ok);
|
| GenerateTailCallToSharedCode(masm);
|
| @@ -1234,20 +1233,18 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
|
|
|
|
|
| void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
|
| - CallRuntimePassFunction(masm, Runtime::kCompileLazy);
|
| - GenerateTailCallToReturnedCode(masm);
|
| + GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
|
| }
|
|
|
|
|
| void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
|
| - CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent);
|
| - GenerateTailCallToReturnedCode(masm);
|
| + GenerateTailCallToReturnedCode(masm,
|
| + Runtime::kCompileOptimized_NotConcurrent);
|
| }
|
|
|
|
|
| void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
|
| - CallRuntimePassFunction(masm, Runtime::kCompileOptimized_Concurrent);
|
| - GenerateTailCallToReturnedCode(masm);
|
| + GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
|
| }
|
|
|
|
|
|
|