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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 #define BUILTIN_LIST_A(V) \ | 787 #define BUILTIN_LIST_A(V) \ |
786 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 788 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
787 V, V, V) | 789 V, V, V) |
788 | 790 |
789 #define BUILTIN_LIST_DBG(V) \ | 791 #define BUILTIN_LIST_DBG(V) \ |
790 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 792 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
791 IGNORE_BUILTIN, IGNORE_BUILTIN, V) | 793 IGNORE_BUILTIN, IGNORE_BUILTIN, V) |
792 | 794 |
793 // Forward declarations. | 795 // Forward declarations. |
794 class ObjectVisitor; | 796 class ObjectVisitor; |
| 797 enum class PushArgsConstructMode : unsigned; |
795 namespace compiler { | 798 namespace compiler { |
796 class CodeAssemblerState; | 799 class CodeAssemblerState; |
797 } | 800 } |
798 | 801 |
799 class Builtins { | 802 class Builtins { |
800 public: | 803 public: |
801 ~Builtins(); | 804 ~Builtins(); |
802 | 805 |
803 // Generate all builtin code objects. Should be called once during | 806 // Generate all builtin code objects. Should be called once during |
804 // isolate initialization. | 807 // isolate initialization. |
(...skipping 24 matching lines...) Expand all Loading... |
829 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 832 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
830 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 833 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
831 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 834 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
832 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 835 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
833 Handle<Code> NonPrimitiveToPrimitive( | 836 Handle<Code> NonPrimitiveToPrimitive( |
834 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 837 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
835 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); | 838 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); |
836 Handle<Code> InterpreterPushArgsAndCall( | 839 Handle<Code> InterpreterPushArgsAndCall( |
837 TailCallMode tail_call_mode, | 840 TailCallMode tail_call_mode, |
838 CallableType function_type = CallableType::kAny); | 841 CallableType function_type = CallableType::kAny); |
839 Handle<Code> InterpreterPushArgsAndConstruct(CallableType function_type); | 842 Handle<Code> InterpreterPushArgsAndConstruct(PushArgsConstructMode mode); |
840 Handle<Code> NewFunctionContext(ScopeType scope_type); | 843 Handle<Code> NewFunctionContext(ScopeType scope_type); |
841 Handle<Code> NewCloneShallowArray(AllocationSiteMode allocation_mode); | 844 Handle<Code> NewCloneShallowArray(AllocationSiteMode allocation_mode); |
842 Handle<Code> NewCloneShallowObject(int length); | 845 Handle<Code> NewCloneShallowObject(int length); |
843 | 846 |
844 Code* builtin(Name name) { | 847 Code* builtin(Name name) { |
845 // Code::cast cannot be used here since we access builtins | 848 // Code::cast cannot be used here since we access builtins |
846 // during the marking phase of mark sweep. See IC::Clear. | 849 // during the marking phase of mark sweep. See IC::Clear. |
847 return reinterpret_cast<Code*>(builtins_[name]); | 850 return reinterpret_cast<Code*>(builtins_[name]); |
848 } | 851 } |
849 | 852 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 TailCallMode tail_call_mode); | 890 TailCallMode tail_call_mode); |
888 | 891 |
889 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, | 892 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, |
890 TailCallMode tail_call_mode); | 893 TailCallMode tail_call_mode); |
891 | 894 |
892 static void Generate_InterpreterPushArgsAndCallImpl( | 895 static void Generate_InterpreterPushArgsAndCallImpl( |
893 MacroAssembler* masm, TailCallMode tail_call_mode, | 896 MacroAssembler* masm, TailCallMode tail_call_mode, |
894 CallableType function_type); | 897 CallableType function_type); |
895 | 898 |
896 static void Generate_InterpreterPushArgsAndConstructImpl( | 899 static void Generate_InterpreterPushArgsAndConstructImpl( |
897 MacroAssembler* masm, CallableType function_type); | 900 MacroAssembler* masm, PushArgsConstructMode mode); |
898 | 901 |
899 enum class MathMaxMinKind { kMax, kMin }; | 902 enum class MathMaxMinKind { kMax, kMin }; |
900 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); | 903 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); |
901 | 904 |
902 #define DECLARE_ASM(Name, ...) \ | 905 #define DECLARE_ASM(Name, ...) \ |
903 static void Generate_##Name(MacroAssembler* masm); | 906 static void Generate_##Name(MacroAssembler* masm); |
904 #define DECLARE_TF(Name, ...) \ | 907 #define DECLARE_TF(Name, ...) \ |
905 static void Generate_##Name(compiler::CodeAssemblerState* state); | 908 static void Generate_##Name(compiler::CodeAssemblerState* state); |
906 | 909 |
907 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF, | 910 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF, |
(...skipping 10 matching lines...) Expand all Loading... |
918 | 921 |
919 friend class Isolate; | 922 friend class Isolate; |
920 | 923 |
921 DISALLOW_COPY_AND_ASSIGN(Builtins); | 924 DISALLOW_COPY_AND_ASSIGN(Builtins); |
922 }; | 925 }; |
923 | 926 |
924 } // namespace internal | 927 } // namespace internal |
925 } // namespace v8 | 928 } // namespace v8 |
926 | 929 |
927 #endif // V8_BUILTINS_BUILTINS_H_ | 930 #endif // V8_BUILTINS_BUILTINS_H_ |
OLD | NEW |