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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 833 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); |
834 } | 834 } |
835 | 835 |
836 | 836 |
837 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 837 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
838 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 838 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
839 GenerateTailCallToReturnedCode(masm); | 839 GenerateTailCallToReturnedCode(masm); |
840 } | 840 } |
841 | 841 |
842 | 842 |
843 static void CallCompileOptimized(MacroAssembler* masm, | |
844 bool concurrent) { | |
845 FrameScope scope(masm, StackFrame::INTERNAL); | |
846 // Push a copy of the function onto the stack. | |
847 __ Push(rdi); | |
848 // Function is also the parameter to the runtime call. | |
849 __ Push(rdi); | |
850 // Whether to compile in a background thread. | |
851 __ Push(masm->isolate()->factory()->ToBoolean(concurrent)); | |
852 | |
853 __ CallRuntime(Runtime::kCompileOptimized, 2); | |
854 // Restore receiver. | |
855 __ Pop(rdi); | |
856 } | |
857 | |
858 | |
859 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 843 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
860 CallCompileOptimized(masm, false); | 844 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); |
861 GenerateTailCallToReturnedCode(masm); | 845 GenerateTailCallToReturnedCode(masm); |
862 } | 846 } |
863 | 847 |
864 | 848 |
865 void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { | 849 void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { |
866 CallCompileOptimized(masm, true); | 850 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_Concurrent); |
867 GenerateTailCallToReturnedCode(masm); | 851 GenerateTailCallToReturnedCode(masm); |
868 } | 852 } |
869 | 853 |
870 | 854 |
871 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { | 855 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
872 // For now, we are relying on the fact that make_code_young doesn't do any | 856 // For now, we are relying on the fact that make_code_young doesn't do any |
873 // garbage collection which allows us to save/restore the registers without | 857 // garbage collection which allows us to save/restore the registers without |
874 // worrying about which of them contain pointers. We also don't build an | 858 // worrying about which of them contain pointers. We also don't build an |
875 // internal frame to make the code faster, since we shouldn't have to do stack | 859 // internal frame to make the code faster, since we shouldn't have to do stack |
876 // crawls in MakeCodeYoung. This seems a bit fragile. | 860 // crawls in MakeCodeYoung. This seems a bit fragile. |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1978 __ ret(0); | 1962 __ ret(0); |
1979 } | 1963 } |
1980 | 1964 |
1981 | 1965 |
1982 #undef __ | 1966 #undef __ |
1983 | 1967 |
1984 } // namespace internal | 1968 } // namespace internal |
1985 } // namespace v8 | 1969 } // namespace v8 |
1986 | 1970 |
1987 #endif // V8_TARGET_ARCH_X64 | 1971 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |