OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); | 1008 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); |
1009 } | 1009 } |
1010 | 1010 |
1011 | 1011 |
1012 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1012 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1013 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1013 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
1014 GenerateTailCallToReturnedCode(masm); | 1014 GenerateTailCallToReturnedCode(masm); |
1015 } | 1015 } |
1016 | 1016 |
1017 | 1017 |
1018 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | |
1019 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | |
1020 // Push a copy of the function onto the stack. | |
1021 // Push function as parameter to the runtime call. | |
1022 __ Push(r4, r4); | |
1023 // Whether to compile in a background thread. | |
1024 __ LoadRoot( | |
1025 r0, concurrent ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex); | |
1026 __ push(r0); | |
1027 | |
1028 __ CallRuntime(Runtime::kCompileOptimized, 2); | |
1029 // Restore receiver. | |
1030 __ pop(r4); | |
1031 } | |
1032 | |
1033 | |
1034 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { | 1018 void Builtins::Generate_CompileOptimized(MacroAssembler* masm) { |
1035 CallCompileOptimized(masm, false); | 1019 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_NotConcurrent); |
1036 GenerateTailCallToReturnedCode(masm); | 1020 GenerateTailCallToReturnedCode(masm); |
1037 } | 1021 } |
1038 | 1022 |
1039 | 1023 |
1040 void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { | 1024 void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) { |
1041 CallCompileOptimized(masm, true); | 1025 CallRuntimePassFunction(masm, Runtime::kCompileOptimized_Concurrent); |
1042 GenerateTailCallToReturnedCode(masm); | 1026 GenerateTailCallToReturnedCode(masm); |
1043 } | 1027 } |
1044 | 1028 |
1045 | 1029 |
1046 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { | 1030 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
1047 // For now, we are relying on the fact that make_code_young doesn't do any | 1031 // For now, we are relying on the fact that make_code_young doesn't do any |
1048 // garbage collection which allows us to save/restore the registers without | 1032 // garbage collection which allows us to save/restore the registers without |
1049 // worrying about which of them contain pointers. We also don't build an | 1033 // worrying about which of them contain pointers. We also don't build an |
1050 // internal frame to make the code faster, since we shouldn't have to do stack | 1034 // internal frame to make the code faster, since we shouldn't have to do stack |
1051 // crawls in MakeCodeYoung. This seems a bit fragile. | 1035 // crawls in MakeCodeYoung. This seems a bit fragile. |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 __ bkpt(0); | 1925 __ bkpt(0); |
1942 } | 1926 } |
1943 } | 1927 } |
1944 | 1928 |
1945 | 1929 |
1946 #undef __ | 1930 #undef __ |
1947 } // namespace internal | 1931 } // namespace internal |
1948 } // namespace v8 | 1932 } // namespace v8 |
1949 | 1933 |
1950 #endif // V8_TARGET_ARCH_PPC | 1934 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |