| Index: src/mips/builtins-mips.cc
|
| diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
|
| index 40cc99f4a30920ba06a450cf3bb7600bfbf8edb7..c7fc56f198ce0a2f4ce17397b69de0baff05864d 100644
|
| --- a/src/mips/builtins-mips.cc
|
| +++ b/src/mips/builtins-mips.cc
|
| @@ -297,16 +297,20 @@ 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 call kind information and function as parameter to the runtime call.
|
| - __ Push(a1, t1, a1);
|
| -
|
| - __ CallRuntime(function_id, 1);
|
| - // Restore call kind information and receiver.
|
| - __ Pop(a1, t1);
|
| +static void CallRuntimePassFunctionAndTailCall(
|
| + MacroAssembler* masm, Runtime::FunctionId function_id) {
|
| + { FrameScope scope(masm, StackFrame::INTERNAL);
|
| + // Push a copy of the function onto the stack.
|
| + // Push call kind information and function as parameter to the runtime call.
|
| + __ Push(a1, t1, a1);
|
| +
|
| + __ CallRuntime(function_id, 1);
|
| + // Restore call kind information and receiver.
|
| + __ Pop(a1, t1);
|
| + }
|
| + // Tail call to returned code.
|
| + __ Addu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| + __ Jump(at);
|
| }
|
|
|
|
|
| @@ -318,7 +322,7 @@ static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| -void Builtins::Generate_InRecompileQueue(MacroAssembler* masm) {
|
| +void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
|
| // Checking whether the queued function is ready for install is optional,
|
| // since we come across interrupts and stack checks elsewhere. However,
|
| // not checking may delay installing ready functions, and always checking
|
| @@ -328,22 +332,13 @@ void Builtins::Generate_InRecompileQueue(MacroAssembler* masm) {
|
| __ LoadRoot(t0, Heap::kStackLimitRootIndex);
|
| __ Branch(&ok, hs, sp, Operand(t0));
|
|
|
| - CallRuntimePassFunction(masm, Runtime::kTryInstallRecompiledCode);
|
| - // Tail call to returned code.
|
| - __ Addu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| - __ Jump(at);
|
| + CallRuntimePassFunctionAndTailCall(masm, Runtime::kTryInstallOptimizedCode);
|
|
|
| __ bind(&ok);
|
| GenerateTailCallToSharedCode(masm);
|
| }
|
|
|
|
|
| -void Builtins::Generate_ConcurrentRecompile(MacroAssembler* masm) {
|
| - CallRuntimePassFunction(masm, Runtime::kConcurrentRecompile);
|
| - GenerateTailCallToSharedCode(masm);
|
| -}
|
| -
|
| -
|
| static void Generate_JSConstructStubHelper(MacroAssembler* masm,
|
| bool is_api_function,
|
| bool count_constructions) {
|
| @@ -791,21 +786,41 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
|
|
|
|
|
| void Builtins::Generate_LazyCompile(MacroAssembler* masm) {
|
| - CallRuntimePassFunction(masm, Runtime::kLazyCompile);
|
| - // Do a tail-call of the compiled function.
|
| - __ Addu(t9, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| - __ Jump(t9);
|
| + CallRuntimePassFunctionAndTailCall(masm, Runtime::kCompileUnoptimized);
|
| +}
|
| +
|
| +
|
| +static void CallCompileOptimizedAndTailCall(MacroAssembler* masm,
|
| + bool concurrent) {
|
| + { FrameScope scope(masm, StackFrame::INTERNAL);
|
| + // Push a copy of the function onto the stack.
|
| + // Push call kind information and function as parameter to the runtime call.
|
| + __ Push(a1, t1, a1);
|
| + // Whether to compile in a background thread.
|
| + __ Push(masm->isolate()->factory()->ToBoolean(concurrent));
|
| +
|
| + __ CallRuntime(Runtime::kCompileOptimized, 2);
|
| + // Restore call kind information and receiver.
|
| + __ Pop(a1, t1);
|
| + }
|
| + // Tail call to returned code.
|
| + __ Addu(at, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| + __ Jump(at);
|
| +}
|
| +
|
| +
|
| +
|
| +void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
|
| + CallCompileOptimizedAndTailCall(masm, false);
|
| }
|
|
|
|
|
| -void Builtins::Generate_LazyRecompile(MacroAssembler* masm) {
|
| - CallRuntimePassFunction(masm, Runtime::kLazyRecompile);
|
| - // Do a tail-call of the compiled function.
|
| - __ Addu(t9, v0, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| - __ Jump(t9);
|
| +void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
|
| + CallCompileOptimizedAndTailCall(masm, true);
|
| }
|
|
|
|
|
| +
|
| static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
|
| // For now, we are relying on the fact that make_code_young doesn't do any
|
| // garbage collection which allows us to save/restore the registers without
|
|
|