OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_BUILTINS_BUILTINS_H_ | 5 #ifndef V8_BUILTINS_BUILTINS_H_ |
6 #define V8_BUILTINS_BUILTINS_H_ | 6 #define V8_BUILTINS_BUILTINS_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 /* Construct */ \ | 78 /* Construct */ \ |
79 /* ES6 section 9.2.2 [[Construct]] ( argumentsList, newTarget) */ \ | 79 /* ES6 section 9.2.2 [[Construct]] ( argumentsList, newTarget) */ \ |
80 ASM(ConstructFunction) \ | 80 ASM(ConstructFunction) \ |
81 /* ES6 section 9.4.1.2 [[Construct]] (argumentsList, newTarget) */ \ | 81 /* ES6 section 9.4.1.2 [[Construct]] (argumentsList, newTarget) */ \ |
82 ASM(ConstructBoundFunction) \ | 82 ASM(ConstructBoundFunction) \ |
83 ASM(ConstructedNonConstructable) \ | 83 ASM(ConstructedNonConstructable) \ |
84 /* ES6 section 9.5.14 [[Construct]] ( argumentsList, newTarget) */ \ | 84 /* ES6 section 9.5.14 [[Construct]] ( argumentsList, newTarget) */ \ |
85 ASM(ConstructProxy) \ | 85 ASM(ConstructProxy) \ |
86 /* ES6 section 7.3.13 Construct (F, [argumentsList], [newTarget]) */ \ | 86 /* ES6 section 7.3.13 Construct (F, [argumentsList], [newTarget]) */ \ |
87 ASM(Construct) \ | 87 ASM(Construct) \ |
| 88 ASM(ConstructWithSpread) \ |
88 ASM(JSConstructStubApi) \ | 89 ASM(JSConstructStubApi) \ |
89 ASM(JSConstructStubGeneric) \ | 90 ASM(JSConstructStubGeneric) \ |
90 ASM(JSBuiltinsConstructStub) \ | 91 ASM(JSBuiltinsConstructStub) \ |
91 ASM(JSBuiltinsConstructStubForDerived) \ | 92 ASM(JSBuiltinsConstructStubForDerived) \ |
92 TFS(FastNewClosure, BUILTIN, kNoExtraICState, FastNewClosure) \ | 93 TFS(FastNewClosure, BUILTIN, kNoExtraICState, FastNewClosure) \ |
93 TFS(FastNewFunctionContextEval, BUILTIN, kNoExtraICState, \ | 94 TFS(FastNewFunctionContextEval, BUILTIN, kNoExtraICState, \ |
94 FastNewFunctionContext) \ | 95 FastNewFunctionContext) \ |
95 TFS(FastNewFunctionContextFunction, BUILTIN, kNoExtraICState, \ | 96 TFS(FastNewFunctionContextFunction, BUILTIN, kNoExtraICState, \ |
96 FastNewFunctionContext) \ | 97 FastNewFunctionContext) \ |
97 TFS(FastCloneRegExp, BUILTIN, kNoExtraICState, FastCloneRegExp) \ | 98 TFS(FastCloneRegExp, BUILTIN, kNoExtraICState, FastCloneRegExp) \ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 \ | 137 \ |
137 /* Interpreter */ \ | 138 /* Interpreter */ \ |
138 ASM(InterpreterEntryTrampoline) \ | 139 ASM(InterpreterEntryTrampoline) \ |
139 ASM(InterpreterPushArgsAndCall) \ | 140 ASM(InterpreterPushArgsAndCall) \ |
140 ASM(InterpreterPushArgsAndCallFunction) \ | 141 ASM(InterpreterPushArgsAndCallFunction) \ |
141 ASM(InterpreterPushArgsAndTailCall) \ | 142 ASM(InterpreterPushArgsAndTailCall) \ |
142 ASM(InterpreterPushArgsAndTailCallFunction) \ | 143 ASM(InterpreterPushArgsAndTailCallFunction) \ |
143 ASM(InterpreterPushArgsAndConstruct) \ | 144 ASM(InterpreterPushArgsAndConstruct) \ |
144 ASM(InterpreterPushArgsAndConstructFunction) \ | 145 ASM(InterpreterPushArgsAndConstructFunction) \ |
145 ASM(InterpreterPushArgsAndConstructArray) \ | 146 ASM(InterpreterPushArgsAndConstructArray) \ |
| 147 ASM(InterpreterPushArgsAndConstructWithFinalSpread) \ |
146 ASM(InterpreterEnterBytecodeAdvance) \ | 148 ASM(InterpreterEnterBytecodeAdvance) \ |
147 ASM(InterpreterEnterBytecodeDispatch) \ | 149 ASM(InterpreterEnterBytecodeDispatch) \ |
148 ASM(InterpreterOnStackReplacement) \ | 150 ASM(InterpreterOnStackReplacement) \ |
149 \ | 151 \ |
150 /* Code life-cycle */ \ | 152 /* Code life-cycle */ \ |
151 ASM(CompileBaseline) \ | 153 ASM(CompileBaseline) \ |
152 ASM(CompileOptimized) \ | 154 ASM(CompileOptimized) \ |
153 ASM(CompileOptimizedConcurrent) \ | 155 ASM(CompileOptimizedConcurrent) \ |
154 ASM(InOptimizationQueue) \ | 156 ASM(InOptimizationQueue) \ |
155 ASM(InstantiateAsmJs) \ | 157 ASM(InstantiateAsmJs) \ |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 #define BUILTIN_LIST_A(V) \ | 786 #define BUILTIN_LIST_A(V) \ |
785 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 787 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
786 V, V, V) | 788 V, V, V) |
787 | 789 |
788 #define BUILTIN_LIST_DBG(V) \ | 790 #define BUILTIN_LIST_DBG(V) \ |
789 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 791 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
790 IGNORE_BUILTIN, IGNORE_BUILTIN, V) | 792 IGNORE_BUILTIN, IGNORE_BUILTIN, V) |
791 | 793 |
792 // Forward declarations. | 794 // Forward declarations. |
793 class ObjectVisitor; | 795 class ObjectVisitor; |
| 796 enum class PushArgsConstructMode : unsigned; |
794 namespace compiler { | 797 namespace compiler { |
795 class CodeAssemblerState; | 798 class CodeAssemblerState; |
796 } | 799 } |
797 | 800 |
798 class Builtins { | 801 class Builtins { |
799 public: | 802 public: |
800 ~Builtins(); | 803 ~Builtins(); |
801 | 804 |
802 // Generate all builtin code objects. Should be called once during | 805 // Generate all builtin code objects. Should be called once during |
803 // isolate initialization. | 806 // isolate initialization. |
(...skipping 24 matching lines...) Expand all Loading... |
828 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 831 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
829 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 832 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
830 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 833 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
831 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 834 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
832 Handle<Code> NonPrimitiveToPrimitive( | 835 Handle<Code> NonPrimitiveToPrimitive( |
833 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 836 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
834 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); | 837 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); |
835 Handle<Code> InterpreterPushArgsAndCall( | 838 Handle<Code> InterpreterPushArgsAndCall( |
836 TailCallMode tail_call_mode, | 839 TailCallMode tail_call_mode, |
837 CallableType function_type = CallableType::kAny); | 840 CallableType function_type = CallableType::kAny); |
838 Handle<Code> InterpreterPushArgsAndConstruct(CallableType function_type); | 841 Handle<Code> InterpreterPushArgsAndConstruct(PushArgsConstructMode mode); |
839 Handle<Code> NewFunctionContext(ScopeType scope_type); | 842 Handle<Code> NewFunctionContext(ScopeType scope_type); |
840 Handle<Code> NewCloneShallowArray(AllocationSiteMode allocation_mode); | 843 Handle<Code> NewCloneShallowArray(AllocationSiteMode allocation_mode); |
841 Handle<Code> NewCloneShallowObject(int length); | 844 Handle<Code> NewCloneShallowObject(int length); |
842 | 845 |
843 Code* builtin(Name name) { | 846 Code* builtin(Name name) { |
844 // Code::cast cannot be used here since we access builtins | 847 // Code::cast cannot be used here since we access builtins |
845 // during the marking phase of mark sweep. See IC::Clear. | 848 // during the marking phase of mark sweep. See IC::Clear. |
846 return reinterpret_cast<Code*>(builtins_[name]); | 849 return reinterpret_cast<Code*>(builtins_[name]); |
847 } | 850 } |
848 | 851 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 TailCallMode tail_call_mode); | 889 TailCallMode tail_call_mode); |
887 | 890 |
888 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, | 891 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, |
889 TailCallMode tail_call_mode); | 892 TailCallMode tail_call_mode); |
890 | 893 |
891 static void Generate_InterpreterPushArgsAndCallImpl( | 894 static void Generate_InterpreterPushArgsAndCallImpl( |
892 MacroAssembler* masm, TailCallMode tail_call_mode, | 895 MacroAssembler* masm, TailCallMode tail_call_mode, |
893 CallableType function_type); | 896 CallableType function_type); |
894 | 897 |
895 static void Generate_InterpreterPushArgsAndConstructImpl( | 898 static void Generate_InterpreterPushArgsAndConstructImpl( |
896 MacroAssembler* masm, CallableType function_type); | 899 MacroAssembler* masm, PushArgsConstructMode mode); |
897 | 900 |
898 enum class MathMaxMinKind { kMax, kMin }; | 901 enum class MathMaxMinKind { kMax, kMin }; |
899 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); | 902 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); |
900 | 903 |
901 #define DECLARE_ASM(Name, ...) \ | 904 #define DECLARE_ASM(Name, ...) \ |
902 static void Generate_##Name(MacroAssembler* masm); | 905 static void Generate_##Name(MacroAssembler* masm); |
903 #define DECLARE_TF(Name, ...) \ | 906 #define DECLARE_TF(Name, ...) \ |
904 static void Generate_##Name(compiler::CodeAssemblerState* state); | 907 static void Generate_##Name(compiler::CodeAssemblerState* state); |
905 | 908 |
906 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF, | 909 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF, |
(...skipping 10 matching lines...) Expand all Loading... |
917 | 920 |
918 friend class Isolate; | 921 friend class Isolate; |
919 | 922 |
920 DISALLOW_COPY_AND_ASSIGN(Builtins); | 923 DISALLOW_COPY_AND_ASSIGN(Builtins); |
921 }; | 924 }; |
922 | 925 |
923 } // namespace internal | 926 } // namespace internal |
924 } // namespace v8 | 927 } // namespace v8 |
925 | 928 |
926 #endif // V8_BUILTINS_BUILTINS_H_ | 929 #endif // V8_BUILTINS_BUILTINS_H_ |
OLD | NEW |