| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 /* ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) */ \ | 67 /* ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) */ \ |
| 68 ASM(CallBoundFunction) \ | 68 ASM(CallBoundFunction) \ |
| 69 ASM(TailCallBoundFunction) \ | 69 ASM(TailCallBoundFunction) \ |
| 70 /* ES6 section 7.3.12 Call(F, V, [argumentsList]) */ \ | 70 /* ES6 section 7.3.12 Call(F, V, [argumentsList]) */ \ |
| 71 ASM(Call_ReceiverIsNullOrUndefined) \ | 71 ASM(Call_ReceiverIsNullOrUndefined) \ |
| 72 ASM(Call_ReceiverIsNotNullOrUndefined) \ | 72 ASM(Call_ReceiverIsNotNullOrUndefined) \ |
| 73 ASM(Call_ReceiverIsAny) \ | 73 ASM(Call_ReceiverIsAny) \ |
| 74 ASM(TailCall_ReceiverIsNullOrUndefined) \ | 74 ASM(TailCall_ReceiverIsNullOrUndefined) \ |
| 75 ASM(TailCall_ReceiverIsNotNullOrUndefined) \ | 75 ASM(TailCall_ReceiverIsNotNullOrUndefined) \ |
| 76 ASM(TailCall_ReceiverIsAny) \ | 76 ASM(TailCall_ReceiverIsAny) \ |
| 77 ASM(CallWithSpread) \ |
| 77 \ | 78 \ |
| 78 /* Construct */ \ | 79 /* Construct */ \ |
| 79 /* ES6 section 9.2.2 [[Construct]] ( argumentsList, newTarget) */ \ | 80 /* ES6 section 9.2.2 [[Construct]] ( argumentsList, newTarget) */ \ |
| 80 ASM(ConstructFunction) \ | 81 ASM(ConstructFunction) \ |
| 81 /* ES6 section 9.4.1.2 [[Construct]] (argumentsList, newTarget) */ \ | 82 /* ES6 section 9.4.1.2 [[Construct]] (argumentsList, newTarget) */ \ |
| 82 ASM(ConstructBoundFunction) \ | 83 ASM(ConstructBoundFunction) \ |
| 83 ASM(ConstructedNonConstructable) \ | 84 ASM(ConstructedNonConstructable) \ |
| 84 /* ES6 section 9.5.14 [[Construct]] ( argumentsList, newTarget) */ \ | 85 /* ES6 section 9.5.14 [[Construct]] ( argumentsList, newTarget) */ \ |
| 85 ASM(ConstructProxy) \ | 86 ASM(ConstructProxy) \ |
| 86 /* ES6 section 7.3.13 Construct (F, [argumentsList], [newTarget]) */ \ | 87 /* ES6 section 7.3.13 Construct (F, [argumentsList], [newTarget]) */ \ |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 TFS(StringLessThanOrEqual, BUILTIN, kNoExtraICState, Compare) \ | 133 TFS(StringLessThanOrEqual, BUILTIN, kNoExtraICState, Compare) \ |
| 133 TFS(StringGreaterThan, BUILTIN, kNoExtraICState, Compare) \ | 134 TFS(StringGreaterThan, BUILTIN, kNoExtraICState, Compare) \ |
| 134 TFS(StringGreaterThanOrEqual, BUILTIN, kNoExtraICState, Compare) \ | 135 TFS(StringGreaterThanOrEqual, BUILTIN, kNoExtraICState, Compare) \ |
| 135 TFS(StringCharAt, BUILTIN, kNoExtraICState, StringCharAt) \ | 136 TFS(StringCharAt, BUILTIN, kNoExtraICState, StringCharAt) \ |
| 136 TFS(StringCharCodeAt, BUILTIN, kNoExtraICState, StringCharCodeAt) \ | 137 TFS(StringCharCodeAt, BUILTIN, kNoExtraICState, StringCharCodeAt) \ |
| 137 \ | 138 \ |
| 138 /* Interpreter */ \ | 139 /* Interpreter */ \ |
| 139 ASM(InterpreterEntryTrampoline) \ | 140 ASM(InterpreterEntryTrampoline) \ |
| 140 ASM(InterpreterPushArgsAndCall) \ | 141 ASM(InterpreterPushArgsAndCall) \ |
| 141 ASM(InterpreterPushArgsAndCallFunction) \ | 142 ASM(InterpreterPushArgsAndCallFunction) \ |
| 143 ASM(InterpreterPushArgsAndCallWithFinalSpread) \ |
| 142 ASM(InterpreterPushArgsAndTailCall) \ | 144 ASM(InterpreterPushArgsAndTailCall) \ |
| 143 ASM(InterpreterPushArgsAndTailCallFunction) \ | 145 ASM(InterpreterPushArgsAndTailCallFunction) \ |
| 144 ASM(InterpreterPushArgsAndConstruct) \ | 146 ASM(InterpreterPushArgsAndConstruct) \ |
| 145 ASM(InterpreterPushArgsAndConstructFunction) \ | 147 ASM(InterpreterPushArgsAndConstructFunction) \ |
| 146 ASM(InterpreterPushArgsAndConstructArray) \ | 148 ASM(InterpreterPushArgsAndConstructArray) \ |
| 147 ASM(InterpreterPushArgsAndConstructWithFinalSpread) \ | 149 ASM(InterpreterPushArgsAndConstructWithFinalSpread) \ |
| 148 ASM(InterpreterEnterBytecodeAdvance) \ | 150 ASM(InterpreterEnterBytecodeAdvance) \ |
| 149 ASM(InterpreterEnterBytecodeDispatch) \ | 151 ASM(InterpreterEnterBytecodeDispatch) \ |
| 150 ASM(InterpreterOnStackReplacement) \ | 152 ASM(InterpreterOnStackReplacement) \ |
| 151 \ | 153 \ |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 #define BUILTIN_LIST_A(V) \ | 800 #define BUILTIN_LIST_A(V) \ |
| 799 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 801 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 800 V, V, V) | 802 V, V, V) |
| 801 | 803 |
| 802 #define BUILTIN_LIST_DBG(V) \ | 804 #define BUILTIN_LIST_DBG(V) \ |
| 803 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 805 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 804 IGNORE_BUILTIN, IGNORE_BUILTIN, V) | 806 IGNORE_BUILTIN, IGNORE_BUILTIN, V) |
| 805 | 807 |
| 806 // Forward declarations. | 808 // Forward declarations. |
| 807 class ObjectVisitor; | 809 class ObjectVisitor; |
| 808 enum class PushArgsConstructMode : unsigned; | 810 enum class InterpreterPushArgsMode : unsigned; |
| 809 namespace compiler { | 811 namespace compiler { |
| 810 class CodeAssemblerState; | 812 class CodeAssemblerState; |
| 811 } | 813 } |
| 812 | 814 |
| 813 class Builtins { | 815 class Builtins { |
| 814 public: | 816 public: |
| 815 ~Builtins(); | 817 ~Builtins(); |
| 816 | 818 |
| 817 // Generate all builtin code objects. Should be called once during | 819 // Generate all builtin code objects. Should be called once during |
| 818 // isolate initialization. | 820 // isolate initialization. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 840 // Convenience wrappers. | 842 // Convenience wrappers. |
| 841 Handle<Code> CallFunction( | 843 Handle<Code> CallFunction( |
| 842 ConvertReceiverMode = ConvertReceiverMode::kAny, | 844 ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 843 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 845 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 844 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 846 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 845 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 847 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 846 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 848 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
| 847 Handle<Code> NonPrimitiveToPrimitive( | 849 Handle<Code> NonPrimitiveToPrimitive( |
| 848 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 850 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
| 849 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); | 851 Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint); |
| 850 Handle<Code> InterpreterPushArgsAndCall( | 852 Handle<Code> InterpreterPushArgsAndCall(TailCallMode tail_call_mode, |
| 851 TailCallMode tail_call_mode, | 853 InterpreterPushArgsMode mode); |
| 852 CallableType function_type = CallableType::kAny); | 854 Handle<Code> InterpreterPushArgsAndConstruct(InterpreterPushArgsMode mode); |
| 853 Handle<Code> InterpreterPushArgsAndConstruct(PushArgsConstructMode mode); | |
| 854 Handle<Code> NewFunctionContext(ScopeType scope_type); | 855 Handle<Code> NewFunctionContext(ScopeType scope_type); |
| 855 Handle<Code> NewCloneShallowArray(AllocationSiteMode allocation_mode); | 856 Handle<Code> NewCloneShallowArray(AllocationSiteMode allocation_mode); |
| 856 Handle<Code> NewCloneShallowObject(int length); | 857 Handle<Code> NewCloneShallowObject(int length); |
| 857 | 858 |
| 858 Code* builtin(Name name) { | 859 Code* builtin(Name name) { |
| 859 // Code::cast cannot be used here since we access builtins | 860 // Code::cast cannot be used here since we access builtins |
| 860 // during the marking phase of mark sweep. See IC::Clear. | 861 // during the marking phase of mark sweep. See IC::Clear. |
| 861 return reinterpret_cast<Code*>(builtins_[name]); | 862 return reinterpret_cast<Code*>(builtins_[name]); |
| 862 } | 863 } |
| 863 | 864 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 TailCallMode tail_call_mode); | 899 TailCallMode tail_call_mode); |
| 899 | 900 |
| 900 static void Generate_CallBoundFunctionImpl(MacroAssembler* masm, | 901 static void Generate_CallBoundFunctionImpl(MacroAssembler* masm, |
| 901 TailCallMode tail_call_mode); | 902 TailCallMode tail_call_mode); |
| 902 | 903 |
| 903 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, | 904 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode, |
| 904 TailCallMode tail_call_mode); | 905 TailCallMode tail_call_mode); |
| 905 | 906 |
| 906 static void Generate_InterpreterPushArgsAndCallImpl( | 907 static void Generate_InterpreterPushArgsAndCallImpl( |
| 907 MacroAssembler* masm, TailCallMode tail_call_mode, | 908 MacroAssembler* masm, TailCallMode tail_call_mode, |
| 908 CallableType function_type); | 909 InterpreterPushArgsMode mode); |
| 909 | 910 |
| 910 static void Generate_InterpreterPushArgsAndConstructImpl( | 911 static void Generate_InterpreterPushArgsAndConstructImpl( |
| 911 MacroAssembler* masm, PushArgsConstructMode mode); | 912 MacroAssembler* masm, InterpreterPushArgsMode mode); |
| 912 | 913 |
| 913 enum class MathMaxMinKind { kMax, kMin }; | 914 enum class MathMaxMinKind { kMax, kMin }; |
| 914 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); | 915 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); |
| 915 | 916 |
| 916 #define DECLARE_ASM(Name, ...) \ | 917 #define DECLARE_ASM(Name, ...) \ |
| 917 static void Generate_##Name(MacroAssembler* masm); | 918 static void Generate_##Name(MacroAssembler* masm); |
| 918 #define DECLARE_TF(Name, ...) \ | 919 #define DECLARE_TF(Name, ...) \ |
| 919 static void Generate_##Name(compiler::CodeAssemblerState* state); | 920 static void Generate_##Name(compiler::CodeAssemblerState* state); |
| 920 | 921 |
| 921 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF, | 922 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 932 | 933 |
| 933 friend class Isolate; | 934 friend class Isolate; |
| 934 | 935 |
| 935 DISALLOW_COPY_AND_ASSIGN(Builtins); | 936 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 936 }; | 937 }; |
| 937 | 938 |
| 938 } // namespace internal | 939 } // namespace internal |
| 939 } // namespace v8 | 940 } // namespace v8 |
| 940 | 941 |
| 941 #endif // V8_BUILTINS_BUILTINS_H_ | 942 #endif // V8_BUILTINS_BUILTINS_H_ |
| OLD | NEW |