Chromium Code Reviews| Index: src/x64/builtins-x64.cc |
| diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
| index 0af0a434772602fbdb104c77f18e24e2d1813357..b7b1517dd0f7acd33520bf4aa8aada9c3caa72b6 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)); |
| + __ addq(kScratchRegister, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
|
Yang
2012/07/19 12:47:30
I'd prefer if you use the lea-instruction and Fiel
sanjoy
2012/07/19 15:06:09
Done.
|
| + __ 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) { |