Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index 0af0a434772602fbdb104c77f18e24e2d1813357..b19a3d0878a1205fae901f15d40badc07d9f0a31 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -73,6 +73,45 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
} |
+static void GenerateTailCallToSharedCode(MacroAssembler* masm) { |
+ __ movq(kScratchRegister, |
+ FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
+ __ movq(kScratchRegister, |
+ FieldOperand(kScratchRegister, SharedFunctionInfo::kCodeOffset)); |
+ __ lea(kScratchRegister, FieldOperand(kScratchRegister, Code::kHeaderSize)); |
+ __ jmp(kScratchRegister); |
+} |
+ |
+ |
+void Builtins::Generate_InRecompileQueue(MacroAssembler* masm) { |
+ GenerateTailCallToSharedCode(masm); |
+} |
+ |
+ |
+void Builtins::Generate_ParallelRecompile(MacroAssembler* masm) { |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ |
+ // Push a copy of the function onto the stack. |
+ __ push(rdi); |
+ // Push call kind information. |
+ __ push(rcx); |
+ |
+ __ push(rdi); // Function is also the parameter to the runtime call. |
+ __ CallRuntime(Runtime::kParallelRecompile, 1); |
+ |
+ // Restore call kind information. |
+ __ pop(rcx); |
+ // Restore receiver. |
+ __ pop(rdi); |
+ |
+ // Tear down internal frame. |
+ } |
+ |
+ GenerateTailCallToSharedCode(masm); |
+} |
+ |
+ |
static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
bool is_api_function, |
bool count_constructions) { |