| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 781 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); |
| 782 } | 782 } |
| 783 | 783 |
| 784 | 784 |
| 785 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 785 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 786 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 786 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
| 787 GenerateTailCallToReturnedCode(masm); | 787 GenerateTailCallToReturnedCode(masm); |
| 788 } | 788 } |
| 789 | 789 |
| 790 | 790 |
| 791 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | |
| 792 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 793 // Push a copy of the function. | |
| 794 __ push(edi); | |
| 795 // Function is also the parameter to the runtime call. | |
| 796 __ push(edi); | |
| 797 // Whether to compile in a background thread. | |
| 798 __ Push(masm->isolate()->factory()->ToBoolean(concurrent)); | |
| 799 | |
| 800 __ CallRuntime(Runtime::kCompileOptimized, 2); | |
| 801 // Restore receiver. | |
| 802 __ pop(edi); | |
| 803 } | |
| 804 | |
| 805 | |
| 806 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 791 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
| 807 CallCompileOptimized(masm, false); | 792 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); |
| 808 GenerateTailCallToReturnedCode(masm); | 793 GenerateTailCallToReturnedCode(masm); |
| 809 } | 794 } |
| 810 | 795 |
| 811 | 796 |
| 812 void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { | 797 void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { |
| 813 CallCompileOptimized(masm, true); | 798 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_Concurrent); |
| 814 GenerateTailCallToReturnedCode(masm); | 799 GenerateTailCallToReturnedCode(masm); |
| 815 } | 800 } |
| 816 | 801 |
| 817 | 802 |
| 818 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { | 803 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
| 819 // For now, we are relying on the fact that make_code_young doesn't do any | 804 // For now, we are relying on the fact that make_code_young doesn't do any |
| 820 // garbage collection which allows us to save/restore the registers without | 805 // garbage collection which allows us to save/restore the registers without |
| 821 // worrying about which of them contain pointers. We also don't build an | 806 // worrying about which of them contain pointers. We also don't build an |
| 822 // internal frame to make the code faster, since we shouldn't have to do stack | 807 // internal frame to make the code faster, since we shouldn't have to do stack |
| 823 // crawls in MakeCodeYoung. This seems a bit fragile. | 808 // crawls in MakeCodeYoung. This seems a bit fragile. |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1905 | 1890 |
| 1906 __ bind(&ok); | 1891 __ bind(&ok); |
| 1907 __ ret(0); | 1892 __ ret(0); |
| 1908 } | 1893 } |
| 1909 | 1894 |
| 1910 #undef __ | 1895 #undef __ |
| 1911 } // namespace internal | 1896 } // namespace internal |
| 1912 } // namespace v8 | 1897 } // namespace v8 |
| 1913 | 1898 |
| 1914 #endif // V8_TARGET_ARCH_X87 | 1899 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |