| 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 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 // Forward declarations. | |
| 15 class CodeStubAssembler; | |
| 16 | |
| 17 #define CODE_AGE_LIST_WITH_ARG(V, A) \ | 14 #define CODE_AGE_LIST_WITH_ARG(V, A) \ |
| 18 V(Quadragenarian, A) \ | 15 V(Quadragenarian, A) \ |
| 19 V(Quinquagenarian, A) \ | 16 V(Quinquagenarian, A) \ |
| 20 V(Sexagenarian, A) \ | 17 V(Sexagenarian, A) \ |
| 21 V(Septuagenarian, A) \ | 18 V(Septuagenarian, A) \ |
| 22 V(Octogenarian, A) | 19 V(Octogenarian, A) |
| 23 | 20 |
| 24 #define CODE_AGE_LIST_IGNORE_ARG(X, V) V(X) | 21 #define CODE_AGE_LIST_IGNORE_ARG(X, V) V(X) |
| 25 | 22 |
| 26 #define CODE_AGE_LIST(V) CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) | 23 #define CODE_AGE_LIST(V) CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) |
| 27 | 24 |
| 28 #define CODE_AGE_LIST_COMPLETE(V) \ | 25 #define CODE_AGE_LIST_COMPLETE(V) \ |
| 29 V(ToBeExecutedOnce) \ | 26 V(ToBeExecutedOnce) \ |
| 30 V(NotExecuted) \ | 27 V(NotExecuted) \ |
| 31 V(ExecutedOnce) \ | 28 V(ExecutedOnce) \ |
| 32 V(NoAge) \ | 29 V(NoAge) \ |
| 33 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) | 30 CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) |
| 34 | 31 |
| 35 #define DECLARE_CODE_AGE_BUILTIN(C, V) \ | 32 #define DECLARE_CODE_AGE_BUILTIN(C, V) \ |
| 36 V(Make##C##CodeYoungAgainOddMarking, BUILTIN, kNoExtraICState) \ | 33 V(Make##C##CodeYoungAgainOddMarking) \ |
| 37 V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, kNoExtraICState) | 34 V(Make##C##CodeYoungAgainEvenMarking) |
| 38 | 35 |
| 39 // Define list of builtins implemented in C++. | 36 // CPP: Builtin in C++. Entered via BUILTIN_EXIT frame. |
| 40 #define BUILTIN_LIST_C(V) \ | 37 // Args: name |
| 41 V(Illegal, BUILTIN_EXIT) \ | 38 // API: Builtin in C++ for API callbacks. Entered via EXIT frame. |
| 42 \ | 39 // Args: name |
| 43 V(EmptyFunction, BUILTIN_EXIT) \ | 40 // TFJ: Builtin in Turbofan, with JS linkage (callable as Javascript function). |
| 44 \ | 41 // Args: name, arguments count |
| 45 V(ArrayConcat, BUILTIN_EXIT) \ | 42 // TFS: Builtin in Turbofan, with CodeStub linkage. |
| 46 V(ArrayPop, BUILTIN_EXIT) \ | 43 // Args: name, code kind, extra IC state, interface descriptor |
| 47 V(ArrayPush, BUILTIN_EXIT) \ | 44 // ASM: Builtin in platform-dependent assembly. |
| 48 V(ArrayShift, BUILTIN_EXIT) \ | 45 // Args: name |
| 49 V(ArraySlice, BUILTIN_EXIT) \ | 46 // ASH: Handlers implemented in platform-dependent assembly. |
| 50 V(ArraySplice, BUILTIN_EXIT) \ | 47 // Args: name, code kind, extra IC state |
| 51 V(ArrayUnshift, BUILTIN_EXIT) \ | 48 // DBG: Builtin in platform-dependent assembly, used by the debugger. |
| 52 \ | 49 // Args: name |
| 53 V(ArrayBufferConstructor, BUILTIN_EXIT) \ | 50 #define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, DBG) \ |
| 54 V(ArrayBufferConstructor_ConstructStub, BUILTIN_EXIT) \ | 51 /* Handlers */ \ |
| 55 V(ArrayBufferPrototypeGetByteLength, BUILTIN_EXIT) \ | 52 ASM(KeyedLoadIC_Miss) \ |
| 56 V(ArrayBufferIsView, BUILTIN_EXIT) \ | 53 ASM(KeyedStoreIC_Miss) \ |
| 57 \ | 54 ASH(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ |
| 58 V(BooleanConstructor, BUILTIN_EXIT) \ | 55 ASH(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ |
| 59 V(BooleanConstructor_ConstructStub, BUILTIN_EXIT) \ | 56 ASH(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \ |
| 60 \ | 57 ASH(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \ |
| 61 V(DataViewConstructor, BUILTIN_EXIT) \ | 58 ASH(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \ |
| 62 V(DataViewConstructor_ConstructStub, BUILTIN_EXIT) \ | 59 StoreICState::kStrictModeState) \ |
| 63 V(DataViewPrototypeGetBuffer, BUILTIN_EXIT) \ | 60 ASH(KeyedLoadIC_Slow, HANDLER, Code::KEYED_LOAD_IC) \ |
| 64 V(DataViewPrototypeGetByteLength, BUILTIN_EXIT) \ | 61 ASH(KeyedStoreIC_Slow, HANDLER, Code::KEYED_STORE_IC) \ |
| 65 V(DataViewPrototypeGetByteOffset, BUILTIN_EXIT) \ | 62 ASH(LoadIC_Normal, HANDLER, Code::LOAD_IC) \ |
| 66 \ | 63 ASH(StoreIC_Normal, HANDLER, Code::STORE_IC) \ |
| 67 V(DateConstructor, BUILTIN_EXIT) \ | 64 TFS(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \ |
| 68 V(DateConstructor_ConstructStub, BUILTIN_EXIT) \ | 65 TFS(LoadGlobalIC_SlowNotInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \ |
| 69 V(DateNow, BUILTIN_EXIT) \ | 66 LoadGlobalWithVector) \ |
| 70 V(DateParse, BUILTIN_EXIT) \ | 67 TFS(LoadGlobalIC_SlowInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \ |
| 71 V(DateUTC, BUILTIN_EXIT) \ | 68 LoadGlobalWithVector) \ |
| 72 V(DatePrototypeSetDate, BUILTIN_EXIT) \ | 69 TFS(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \ |
| 73 V(DatePrototypeSetFullYear, BUILTIN_EXIT) \ | 70 TFS(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \ |
| 74 V(DatePrototypeSetHours, BUILTIN_EXIT) \ | 71 TFS(StoreIC_Miss, BUILTIN, kNoExtraICState, VectorStoreIC) \ |
| 75 V(DatePrototypeSetMilliseconds, BUILTIN_EXIT) \ | 72 TFS(StoreIC_SlowSloppy, HANDLER, Code::STORE_IC, VectorStoreIC) \ |
| 76 V(DatePrototypeSetMinutes, BUILTIN_EXIT) \ | 73 TFS(StoreIC_SlowStrict, HANDLER, Code::STORE_IC, VectorStoreIC) \ |
| 77 V(DatePrototypeSetMonth, BUILTIN_EXIT) \ | 74 /* Code aging */ \ |
| 78 V(DatePrototypeSetSeconds, BUILTIN_EXIT) \ | 75 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, ASM) \ |
| 79 V(DatePrototypeSetTime, BUILTIN_EXIT) \ | 76 /* Calls */ \ |
| 80 V(DatePrototypeSetUTCDate, BUILTIN_EXIT) \ | 77 ASM(ArgumentsAdaptorTrampoline) \ |
| 81 V(DatePrototypeSetUTCFullYear, BUILTIN_EXIT) \ | 78 ASM(CallFunction_ReceiverIsNullOrUndefined) \ |
| 82 V(DatePrototypeSetUTCHours, BUILTIN_EXIT) \ | 79 ASM(CallFunction_ReceiverIsNotNullOrUndefined) \ |
| 83 V(DatePrototypeSetUTCMilliseconds, BUILTIN_EXIT) \ | 80 ASM(CallFunction_ReceiverIsAny) \ |
| 84 V(DatePrototypeSetUTCMinutes, BUILTIN_EXIT) \ | 81 ASM(TailCallFunction_ReceiverIsNullOrUndefined) \ |
| 85 V(DatePrototypeSetUTCMonth, BUILTIN_EXIT) \ | 82 ASM(TailCallFunction_ReceiverIsNotNullOrUndefined) \ |
| 86 V(DatePrototypeSetUTCSeconds, BUILTIN_EXIT) \ | 83 ASM(TailCallFunction_ReceiverIsAny) \ |
| 87 V(DatePrototypeToDateString, BUILTIN_EXIT) \ | 84 ASM(CallBoundFunction) \ |
| 88 V(DatePrototypeToISOString, BUILTIN_EXIT) \ | 85 ASM(TailCallBoundFunction) \ |
| 89 V(DatePrototypeToPrimitive, BUILTIN_EXIT) \ | 86 ASM(Call_ReceiverIsNullOrUndefined) \ |
| 90 V(DatePrototypeToUTCString, BUILTIN_EXIT) \ | 87 ASM(Call_ReceiverIsNotNullOrUndefined) \ |
| 91 V(DatePrototypeToString, BUILTIN_EXIT) \ | 88 ASM(Call_ReceiverIsAny) \ |
| 92 V(DatePrototypeToTimeString, BUILTIN_EXIT) \ | 89 ASM(TailCall_ReceiverIsNullOrUndefined) \ |
| 93 V(DatePrototypeValueOf, BUILTIN_EXIT) \ | 90 ASM(TailCall_ReceiverIsNotNullOrUndefined) \ |
| 94 V(DatePrototypeGetYear, BUILTIN_EXIT) \ | 91 ASM(TailCall_ReceiverIsAny) \ |
| 95 V(DatePrototypeSetYear, BUILTIN_EXIT) \ | 92 /* Construct */ \ |
| 96 V(DatePrototypeToJson, BUILTIN_EXIT) \ | 93 ASM(ConstructFunction) \ |
| 97 \ | 94 ASM(ConstructBoundFunction) \ |
| 98 V(FunctionConstructor, BUILTIN_EXIT) \ | 95 ASM(ConstructedNonConstructable) \ |
| 99 V(FunctionPrototypeBind, BUILTIN_EXIT) \ | 96 ASM(ConstructProxy) \ |
| 100 V(FunctionPrototypeToString, BUILTIN_EXIT) \ | 97 ASM(Construct) \ |
| 101 \ | 98 ASM(JSConstructStubApi) \ |
| 102 V(GeneratorFunctionConstructor, BUILTIN_EXIT) \ | 99 ASM(JSConstructStubGeneric) \ |
| 103 V(AsyncFunctionConstructor, BUILTIN_EXIT) \ | 100 ASM(JSBuiltinsConstructStub) \ |
| 104 \ | 101 ASM(JSBuiltinsConstructStubForDerived) \ |
| 105 V(GlobalDecodeURI, BUILTIN_EXIT) \ | 102 /* Apply and entries */ \ |
| 106 V(GlobalDecodeURIComponent, BUILTIN_EXIT) \ | 103 ASM(Apply) \ |
| 107 V(GlobalEncodeURI, BUILTIN_EXIT) \ | 104 ASM(JSEntryTrampoline) \ |
| 108 V(GlobalEncodeURIComponent, BUILTIN_EXIT) \ | 105 ASM(JSConstructEntryTrampoline) \ |
| 109 V(GlobalEscape, BUILTIN_EXIT) \ | 106 ASM(ResumeGeneratorTrampoline) \ |
| 110 V(GlobalUnescape, BUILTIN_EXIT) \ | 107 /* Stack and interrupt check */ \ |
| 111 \ | 108 ASM(InterruptCheck) \ |
| 112 V(GlobalEval, BUILTIN_EXIT) \ | 109 ASM(StackCheck) \ |
| 113 \ | 110 /* Interpreter */ \ |
| 114 V(JsonParse, BUILTIN_EXIT) \ | 111 ASM(InterpreterEntryTrampoline) \ |
| 115 V(JsonStringify, BUILTIN_EXIT) \ | 112 ASM(InterpreterMarkBaselineOnReturn) \ |
| 116 \ | 113 ASM(InterpreterPushArgsAndCallFunction) \ |
| 117 V(MathHypot, BUILTIN_EXIT) \ | 114 ASM(InterpreterPushArgsAndTailCallFunction) \ |
| 118 \ | 115 ASM(InterpreterPushArgsAndCall) \ |
| 119 V(NumberPrototypeToExponential, BUILTIN_EXIT) \ | 116 ASM(InterpreterPushArgsAndTailCall) \ |
| 120 V(NumberPrototypeToFixed, BUILTIN_EXIT) \ | 117 ASM(InterpreterPushArgsAndConstruct) \ |
| 121 V(NumberPrototypeToLocaleString, BUILTIN_EXIT) \ | 118 ASM(InterpreterEnterBytecodeDispatch) \ |
| 122 V(NumberPrototypeToPrecision, BUILTIN_EXIT) \ | 119 /* Code life-cycle */ \ |
| 123 V(NumberPrototypeToString, BUILTIN_EXIT) \ | 120 ASM(CompileLazy) \ |
| 124 \ | 121 ASM(CompileBaseline) \ |
| 125 V(ObjectAssign, BUILTIN_EXIT) \ | 122 ASM(CompileOptimized) \ |
| 126 V(ObjectCreate, BUILTIN_EXIT) \ | 123 ASM(CompileOptimizedConcurrent) \ |
| 127 V(ObjectDefineGetter, BUILTIN_EXIT) \ | 124 ASM(InOptimizationQueue) \ |
| 128 V(ObjectDefineProperties, BUILTIN_EXIT) \ | 125 ASM(InstantiateAsmJs) \ |
| 129 V(ObjectDefineProperty, BUILTIN_EXIT) \ | 126 ASM(MarkCodeAsToBeExecutedOnce) \ |
| 130 V(ObjectDefineSetter, BUILTIN_EXIT) \ | 127 ASM(MarkCodeAsExecutedOnce) \ |
| 131 V(ObjectEntries, BUILTIN_EXIT) \ | 128 ASM(MarkCodeAsExecutedTwice) \ |
| 132 V(ObjectFreeze, BUILTIN_EXIT) \ | 129 ASM(NotifyDeoptimized) \ |
| 133 V(ObjectGetOwnPropertyDescriptor, BUILTIN_EXIT) \ | 130 ASM(NotifySoftDeoptimized) \ |
| 134 V(ObjectGetOwnPropertyDescriptors, BUILTIN_EXIT) \ | 131 ASM(NotifyLazyDeoptimized) \ |
| 135 V(ObjectGetOwnPropertyNames, BUILTIN_EXIT) \ | 132 ASM(NotifyStubFailure) \ |
| 136 V(ObjectGetOwnPropertySymbols, BUILTIN_EXIT) \ | 133 ASM(NotifyStubFailureSaveDoubles) \ |
| 137 V(ObjectGetPrototypeOf, BUILTIN_EXIT) \ | 134 ASM(OnStackReplacement) \ |
| 138 V(ObjectIs, BUILTIN_EXIT) \ | 135 /* API callback handling */ \ |
| 139 V(ObjectIsExtensible, BUILTIN_EXIT) \ | 136 API(HandleApiCall) \ |
| 140 V(ObjectIsFrozen, BUILTIN_EXIT) \ | 137 API(HandleApiCallAsFunction) \ |
| 141 V(ObjectIsSealed, BUILTIN_EXIT) \ | 138 API(HandleApiCallAsConstructor) \ |
| 142 V(ObjectKeys, BUILTIN_EXIT) \ | 139 ASM(HandleFastApiCall) \ |
| 143 V(ObjectLookupGetter, BUILTIN_EXIT) \ | 140 /* Adapters for Turbofan into runtime */ \ |
| 144 V(ObjectLookupSetter, BUILTIN_EXIT) \ | 141 ASM(AllocateInNewSpace) \ |
| 145 V(ObjectPreventExtensions, BUILTIN_EXIT) \ | 142 ASM(AllocateInOldSpace) \ |
| 146 V(ObjectPrototypePropertyIsEnumerable, BUILTIN_EXIT) \ | 143 /* Debugger */ \ |
| 147 V(ObjectProtoToString, BUILTIN_EXIT) \ | 144 DBG(Return_DebugBreak) \ |
| 148 V(ObjectSeal, BUILTIN_EXIT) \ | 145 DBG(Slot_DebugBreak) \ |
| 149 V(ObjectValues, BUILTIN_EXIT) \ | 146 DBG(FrameDropper_LiveEdit) \ |
| 150 \ | 147 /* Primitives */ \ |
| 151 V(ProxyConstructor, BUILTIN_EXIT) \ | 148 ASM(StringToNumber) \ |
| 152 V(ProxyConstructor_ConstructStub, BUILTIN_EXIT) \ | 149 ASM(NonNumberToNumber) \ |
| 153 \ | 150 ASM(ToNumber) \ |
| 154 V(ReflectDefineProperty, BUILTIN_EXIT) \ | 151 TFS(OrdinaryToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \ |
| 155 V(ReflectDeleteProperty, BUILTIN_EXIT) \ | 152 TFS(OrdinaryToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) \ |
| 156 V(ReflectGet, BUILTIN_EXIT) \ | 153 TFS(NonPrimitiveToPrimitive_Default, BUILTIN, kNoExtraICState, \ |
| 157 V(ReflectGetOwnPropertyDescriptor, BUILTIN_EXIT) \ | 154 TypeConversion) \ |
| 158 V(ReflectGetPrototypeOf, BUILTIN_EXIT) \ | 155 TFS(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, \ |
| 159 V(ReflectHas, BUILTIN_EXIT) \ | 156 TypeConversion) \ |
| 160 V(ReflectIsExtensible, BUILTIN_EXIT) \ | 157 TFS(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, \ |
| 161 V(ReflectOwnKeys, BUILTIN_EXIT) \ | 158 TypeConversion) \ |
| 162 V(ReflectPreventExtensions, BUILTIN_EXIT) \ | 159 \ |
| 163 V(ReflectSet, BUILTIN_EXIT) \ | 160 /* Built-in functions for Javascript */ \ |
| 164 V(ReflectSetPrototypeOf, BUILTIN_EXIT) \ | 161 /* Special internal builtins */ \ |
| 165 \ | 162 CPP(EmptyFunction) \ |
| 166 V(SharedArrayBufferPrototypeGetByteLength, BUILTIN_EXIT) \ | 163 CPP(Illegal) \ |
| 167 \ | 164 CPP(RestrictedFunctionPropertiesThrower) \ |
| 168 V(StringFromCodePoint, BUILTIN_EXIT) \ | 165 CPP(RestrictedStrictArgumentsPropertiesThrower) \ |
| 169 \ | 166 /* Array */ \ |
| 170 V(StringPrototypeTrim, BUILTIN_EXIT) \ | 167 ASM(ArrayCode) \ |
| 171 V(StringPrototypeTrimLeft, BUILTIN_EXIT) \ | 168 ASM(InternalArrayCode) \ |
| 172 V(StringPrototypeTrimRight, BUILTIN_EXIT) \ | 169 CPP(ArrayConcat) \ |
| 173 \ | 170 TFJ(ArrayIsArray, 2) \ |
| 174 V(SymbolConstructor, BUILTIN_EXIT) \ | 171 CPP(ArrayPop) \ |
| 175 V(SymbolConstructor_ConstructStub, BUILTIN_EXIT) \ | 172 CPP(ArrayPush) \ |
| 176 \ | 173 CPP(ArrayShift) \ |
| 177 V(TypedArrayPrototypeBuffer, BUILTIN_EXIT) \ | 174 CPP(ArraySlice) \ |
| 178 \ | 175 CPP(ArraySplice) \ |
| 179 V(HandleApiCall, EXIT) \ | 176 CPP(ArrayUnshift) \ |
| 180 V(HandleApiCallAsFunction, EXIT) \ | 177 /* ArrayBuffer */ \ |
| 181 V(HandleApiCallAsConstructor, EXIT) \ | 178 CPP(ArrayBufferConstructor) \ |
| 182 \ | 179 CPP(ArrayBufferConstructor_ConstructStub) \ |
| 183 V(RestrictedFunctionPropertiesThrower, BUILTIN_EXIT) \ | 180 CPP(ArrayBufferPrototypeGetByteLength) \ |
| 184 V(RestrictedStrictArgumentsPropertiesThrower, BUILTIN_EXIT) | 181 CPP(ArrayBufferIsView) \ |
| 185 | 182 /* Boolean */ \ |
| 186 // Define list of builtins implemented in assembly. | 183 CPP(BooleanConstructor) \ |
| 187 #define BUILTIN_LIST_A(V) \ | 184 CPP(BooleanConstructor_ConstructStub) \ |
| 188 V(AllocateInNewSpace, BUILTIN, kNoExtraICState) \ | 185 TFJ(BooleanPrototypeToString, 1) \ |
| 189 V(AllocateInOldSpace, BUILTIN, kNoExtraICState) \ | 186 TFJ(BooleanPrototypeValueOf, 1) \ |
| 190 \ | 187 /* DataView */ \ |
| 191 V(ArgumentsAdaptorTrampoline, BUILTIN, kNoExtraICState) \ | 188 CPP(DataViewConstructor) \ |
| 192 \ | 189 CPP(DataViewConstructor_ConstructStub) \ |
| 193 V(ConstructedNonConstructable, BUILTIN, kNoExtraICState) \ | 190 CPP(DataViewPrototypeGetBuffer) \ |
| 194 \ | 191 CPP(DataViewPrototypeGetByteLength) \ |
| 195 V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ | 192 CPP(DataViewPrototypeGetByteOffset) \ |
| 196 V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ | 193 /* Date */ \ |
| 197 V(CallFunction_ReceiverIsAny, BUILTIN, kNoExtraICState) \ | 194 CPP(DateConstructor) \ |
| 198 V(TailCallFunction_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ | 195 CPP(DateConstructor_ConstructStub) \ |
| 199 V(TailCallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ | 196 CPP(DateNow) \ |
| 200 V(TailCallFunction_ReceiverIsAny, BUILTIN, kNoExtraICState) \ | 197 CPP(DateParse) \ |
| 201 V(CallBoundFunction, BUILTIN, kNoExtraICState) \ | 198 CPP(DateUTC) \ |
| 202 V(TailCallBoundFunction, BUILTIN, kNoExtraICState) \ | 199 CPP(DatePrototypeSetDate) \ |
| 203 V(Call_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ | 200 CPP(DatePrototypeSetFullYear) \ |
| 204 V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ | 201 CPP(DatePrototypeSetHours) \ |
| 205 V(Call_ReceiverIsAny, BUILTIN, kNoExtraICState) \ | 202 CPP(DatePrototypeSetMilliseconds) \ |
| 206 V(TailCall_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ | 203 CPP(DatePrototypeSetMinutes) \ |
| 207 V(TailCall_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ | 204 CPP(DatePrototypeSetMonth) \ |
| 208 V(TailCall_ReceiverIsAny, BUILTIN, kNoExtraICState) \ | 205 CPP(DatePrototypeSetSeconds) \ |
| 209 \ | 206 CPP(DatePrototypeSetTime) \ |
| 210 V(ConstructFunction, BUILTIN, kNoExtraICState) \ | 207 CPP(DatePrototypeSetUTCDate) \ |
| 211 V(ConstructBoundFunction, BUILTIN, kNoExtraICState) \ | 208 CPP(DatePrototypeSetUTCFullYear) \ |
| 212 V(ConstructProxy, BUILTIN, kNoExtraICState) \ | 209 CPP(DatePrototypeSetUTCHours) \ |
| 213 V(Construct, BUILTIN, kNoExtraICState) \ | 210 CPP(DatePrototypeSetUTCMilliseconds) \ |
| 214 \ | 211 CPP(DatePrototypeSetUTCMinutes) \ |
| 215 V(StringToNumber, BUILTIN, kNoExtraICState) \ | 212 CPP(DatePrototypeSetUTCMonth) \ |
| 216 V(NonNumberToNumber, BUILTIN, kNoExtraICState) \ | 213 CPP(DatePrototypeSetUTCSeconds) \ |
| 217 V(ToNumber, BUILTIN, kNoExtraICState) \ | 214 CPP(DatePrototypeToDateString) \ |
| 218 \ | 215 CPP(DatePrototypeToISOString) \ |
| 219 V(Apply, BUILTIN, kNoExtraICState) \ | 216 CPP(DatePrototypeToPrimitive) \ |
| 220 \ | 217 CPP(DatePrototypeToUTCString) \ |
| 221 V(HandleFastApiCall, BUILTIN, kNoExtraICState) \ | 218 CPP(DatePrototypeToString) \ |
| 222 \ | 219 CPP(DatePrototypeToTimeString) \ |
| 223 V(InOptimizationQueue, BUILTIN, kNoExtraICState) \ | 220 CPP(DatePrototypeValueOf) \ |
| 224 V(JSConstructStubGeneric, BUILTIN, kNoExtraICState) \ | 221 ASM(DatePrototypeGetDate) \ |
| 225 V(JSBuiltinsConstructStub, BUILTIN, kNoExtraICState) \ | 222 ASM(DatePrototypeGetDay) \ |
| 226 V(JSBuiltinsConstructStubForDerived, BUILTIN, kNoExtraICState) \ | 223 ASM(DatePrototypeGetFullYear) \ |
| 227 V(JSConstructStubApi, BUILTIN, kNoExtraICState) \ | 224 ASM(DatePrototypeGetHours) \ |
| 228 V(JSEntryTrampoline, BUILTIN, kNoExtraICState) \ | 225 ASM(DatePrototypeGetMilliseconds) \ |
| 229 V(JSConstructEntryTrampoline, BUILTIN, kNoExtraICState) \ | 226 ASM(DatePrototypeGetMinutes) \ |
| 230 V(ResumeGeneratorTrampoline, BUILTIN, kNoExtraICState) \ | 227 ASM(DatePrototypeGetMonth) \ |
| 231 V(InstantiateAsmJs, BUILTIN, kNoExtraICState) \ | 228 ASM(DatePrototypeGetSeconds) \ |
| 232 V(CompileLazy, BUILTIN, kNoExtraICState) \ | 229 ASM(DatePrototypeGetTime) \ |
| 233 V(CompileBaseline, BUILTIN, kNoExtraICState) \ | 230 ASM(DatePrototypeGetTimezoneOffset) \ |
| 234 V(CompileOptimized, BUILTIN, kNoExtraICState) \ | 231 ASM(DatePrototypeGetUTCDate) \ |
| 235 V(CompileOptimizedConcurrent, BUILTIN, kNoExtraICState) \ | 232 ASM(DatePrototypeGetUTCDay) \ |
| 236 V(NotifyDeoptimized, BUILTIN, kNoExtraICState) \ | 233 ASM(DatePrototypeGetUTCFullYear) \ |
| 237 V(NotifySoftDeoptimized, BUILTIN, kNoExtraICState) \ | 234 ASM(DatePrototypeGetUTCHours) \ |
| 238 V(NotifyLazyDeoptimized, BUILTIN, kNoExtraICState) \ | 235 ASM(DatePrototypeGetUTCMilliseconds) \ |
| 239 V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ | 236 ASM(DatePrototypeGetUTCMinutes) \ |
| 240 V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ | 237 ASM(DatePrototypeGetUTCMonth) \ |
| 241 \ | 238 ASM(DatePrototypeGetUTCSeconds) \ |
| 242 V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ | 239 CPP(DatePrototypeGetYear) \ |
| 243 V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ | 240 CPP(DatePrototypeSetYear) \ |
| 244 V(InterpreterPushArgsAndCallFunction, BUILTIN, kNoExtraICState) \ | 241 CPP(DatePrototypeToJson) \ |
| 245 V(InterpreterPushArgsAndTailCallFunction, BUILTIN, kNoExtraICState) \ | 242 /* Function */ \ |
| 246 V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ | 243 CPP(FunctionConstructor) \ |
| 247 V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ | 244 ASM(FunctionPrototypeApply) \ |
| 248 V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ | 245 CPP(FunctionPrototypeBind) \ |
| 249 V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ | 246 ASM(FunctionPrototypeCall) \ |
| 250 \ | 247 TFJ(FunctionPrototypeHasInstance, 2) \ |
| 251 V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ | 248 CPP(FunctionPrototypeToString) \ |
| 252 V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ | 249 /* Generator and Async */ \ |
| 253 V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ | 250 CPP(GeneratorFunctionConstructor) \ |
| 254 V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ | 251 TFJ(GeneratorPrototypeNext, 2) \ |
| 255 \ | 252 TFJ(GeneratorPrototypeReturn, 2) \ |
| 256 V(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \ | 253 TFJ(GeneratorPrototypeThrow, 2) \ |
| 257 \ | 254 CPP(AsyncFunctionConstructor) \ |
| 258 V(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \ | 255 /* Encode and decode */ \ |
| 259 V(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \ | 256 CPP(GlobalDecodeURI) \ |
| 260 StoreICState::kStrictModeState) \ | 257 CPP(GlobalDecodeURIComponent) \ |
| 261 \ | 258 CPP(GlobalEncodeURI) \ |
| 262 V(DatePrototypeGetDate, BUILTIN, kNoExtraICState) \ | 259 CPP(GlobalEncodeURIComponent) \ |
| 263 V(DatePrototypeGetDay, BUILTIN, kNoExtraICState) \ | 260 CPP(GlobalEscape) \ |
| 264 V(DatePrototypeGetFullYear, BUILTIN, kNoExtraICState) \ | 261 CPP(GlobalUnescape) \ |
| 265 V(DatePrototypeGetHours, BUILTIN, kNoExtraICState) \ | 262 /* Eval */ \ |
| 266 V(DatePrototypeGetMilliseconds, BUILTIN, kNoExtraICState) \ | 263 CPP(GlobalEval) \ |
| 267 V(DatePrototypeGetMinutes, BUILTIN, kNoExtraICState) \ | 264 /* JSON */ \ |
| 268 V(DatePrototypeGetMonth, BUILTIN, kNoExtraICState) \ | 265 CPP(JsonParse) \ |
| 269 V(DatePrototypeGetSeconds, BUILTIN, kNoExtraICState) \ | 266 CPP(JsonStringify) \ |
| 270 V(DatePrototypeGetTime, BUILTIN, kNoExtraICState) \ | 267 /* Math */ \ |
| 271 V(DatePrototypeGetTimezoneOffset, BUILTIN, kNoExtraICState) \ | 268 TFJ(MathAcos, 2) \ |
| 272 V(DatePrototypeGetUTCDate, BUILTIN, kNoExtraICState) \ | 269 TFJ(MathAcosh, 2) \ |
| 273 V(DatePrototypeGetUTCDay, BUILTIN, kNoExtraICState) \ | 270 TFJ(MathAsin, 2) \ |
| 274 V(DatePrototypeGetUTCFullYear, BUILTIN, kNoExtraICState) \ | 271 TFJ(MathAsinh, 2) \ |
| 275 V(DatePrototypeGetUTCHours, BUILTIN, kNoExtraICState) \ | 272 TFJ(MathAtan, 2) \ |
| 276 V(DatePrototypeGetUTCMilliseconds, BUILTIN, kNoExtraICState) \ | 273 TFJ(MathAtanh, 2) \ |
| 277 V(DatePrototypeGetUTCMinutes, BUILTIN, kNoExtraICState) \ | 274 TFJ(MathAtan2, 3) \ |
| 278 V(DatePrototypeGetUTCMonth, BUILTIN, kNoExtraICState) \ | 275 TFJ(MathCeil, 2) \ |
| 279 V(DatePrototypeGetUTCSeconds, BUILTIN, kNoExtraICState) \ | 276 TFJ(MathCbrt, 2) \ |
| 280 \ | 277 TFJ(MathAbs, 2) \ |
| 281 V(FunctionPrototypeApply, BUILTIN, kNoExtraICState) \ | 278 TFJ(MathExpm1, 2) \ |
| 282 V(FunctionPrototypeCall, BUILTIN, kNoExtraICState) \ | 279 TFJ(MathClz32, 2) \ |
| 283 \ | 280 TFJ(MathCos, 2) \ |
| 284 V(ReflectApply, BUILTIN, kNoExtraICState) \ | 281 TFJ(MathCosh, 2) \ |
| 285 V(ReflectConstruct, BUILTIN, kNoExtraICState) \ | 282 TFJ(MathExp, 2) \ |
| 286 \ | 283 TFJ(MathFloor, 2) \ |
| 287 V(InternalArrayCode, BUILTIN, kNoExtraICState) \ | 284 TFJ(MathFround, 2) \ |
| 288 V(ArrayCode, BUILTIN, kNoExtraICState) \ | 285 CPP(MathHypot) \ |
| 289 \ | 286 TFJ(MathImul, 3) \ |
| 290 V(MathMax, BUILTIN, kNoExtraICState) \ | 287 TFJ(MathLog, 2) \ |
| 291 V(MathMin, BUILTIN, kNoExtraICState) \ | 288 TFJ(MathLog1p, 2) \ |
| 292 \ | 289 TFJ(MathLog10, 2) \ |
| 293 V(NumberConstructor, BUILTIN, kNoExtraICState) \ | 290 TFJ(MathLog2, 2) \ |
| 294 V(NumberConstructor_ConstructStub, BUILTIN, kNoExtraICState) \ | 291 ASM(MathMax) \ |
| 295 \ | 292 ASM(MathMin) \ |
| 296 V(StringConstructor, BUILTIN, kNoExtraICState) \ | 293 TFJ(MathRound, 2) \ |
| 297 V(StringConstructor_ConstructStub, BUILTIN, kNoExtraICState) \ | 294 TFJ(MathPow, 3) \ |
| 298 \ | 295 TFJ(MathSign, 2) \ |
| 299 V(OnStackReplacement, BUILTIN, kNoExtraICState) \ | 296 TFJ(MathSin, 2) \ |
| 300 V(InterruptCheck, BUILTIN, kNoExtraICState) \ | 297 TFJ(MathSinh, 2) \ |
| 301 V(StackCheck, BUILTIN, kNoExtraICState) \ | 298 TFJ(MathTan, 2) \ |
| 302 \ | 299 TFJ(MathTanh, 2) \ |
| 303 V(MarkCodeAsToBeExecutedOnce, BUILTIN, kNoExtraICState) \ | 300 TFJ(MathSqrt, 2) \ |
| 304 V(MarkCodeAsExecutedOnce, BUILTIN, kNoExtraICState) \ | 301 TFJ(MathTrunc, 2) \ |
| 305 V(MarkCodeAsExecutedTwice, BUILTIN, kNoExtraICState) \ | 302 /* Number */ \ |
| 306 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) | 303 ASM(NumberConstructor) \ |
| 307 | 304 ASM(NumberConstructor_ConstructStub) \ |
| 308 // Define list of builtins implemented in TurboFan (with JS linkage). | 305 CPP(NumberPrototypeToExponential) \ |
| 309 #define BUILTIN_LIST_T(V) \ | 306 CPP(NumberPrototypeToFixed) \ |
| 310 V(BooleanPrototypeToString, 1) \ | 307 CPP(NumberPrototypeToLocaleString) \ |
| 311 V(BooleanPrototypeValueOf, 1) \ | 308 CPP(NumberPrototypeToPrecision) \ |
| 312 V(FunctionPrototypeHasInstance, 2) \ | 309 CPP(NumberPrototypeToString) \ |
| 313 V(GeneratorPrototypeNext, 2) \ | 310 TFJ(NumberPrototypeValueOf, 1) \ |
| 314 V(GeneratorPrototypeReturn, 2) \ | 311 /* Object */ \ |
| 315 V(GeneratorPrototypeThrow, 2) \ | 312 CPP(ObjectAssign) \ |
| 316 V(MathAcos, 2) \ | 313 CPP(ObjectCreate) \ |
| 317 V(MathAcosh, 2) \ | 314 CPP(ObjectDefineGetter) \ |
| 318 V(MathAsin, 2) \ | 315 CPP(ObjectDefineProperties) \ |
| 319 V(MathAsinh, 2) \ | 316 CPP(ObjectDefineProperty) \ |
| 320 V(MathAtan, 2) \ | 317 CPP(ObjectDefineSetter) \ |
| 321 V(MathAtanh, 2) \ | 318 CPP(ObjectEntries) \ |
| 322 V(MathAtan2, 3) \ | 319 CPP(ObjectFreeze) \ |
| 323 V(MathCeil, 2) \ | 320 CPP(ObjectGetOwnPropertyDescriptor) \ |
| 324 V(MathCbrt, 2) \ | 321 CPP(ObjectGetOwnPropertyDescriptors) \ |
| 325 V(MathAbs, 2) \ | 322 CPP(ObjectGetOwnPropertyNames) \ |
| 326 V(MathExpm1, 2) \ | 323 CPP(ObjectGetOwnPropertySymbols) \ |
| 327 V(MathClz32, 2) \ | 324 CPP(ObjectGetPrototypeOf) \ |
| 328 V(MathCos, 2) \ | 325 TFJ(ObjectHasOwnProperty, 2) \ |
| 329 V(MathCosh, 2) \ | 326 CPP(ObjectIs) \ |
| 330 V(MathExp, 2) \ | 327 CPP(ObjectIsExtensible) \ |
| 331 V(MathFloor, 2) \ | 328 CPP(ObjectIsFrozen) \ |
| 332 V(MathFround, 2) \ | 329 CPP(ObjectIsSealed) \ |
| 333 V(MathImul, 3) \ | 330 CPP(ObjectKeys) \ |
| 334 V(MathLog, 2) \ | 331 CPP(ObjectLookupGetter) \ |
| 335 V(MathLog1p, 2) \ | 332 CPP(ObjectLookupSetter) \ |
| 336 V(MathLog10, 2) \ | 333 CPP(ObjectPreventExtensions) \ |
| 337 V(MathLog2, 2) \ | 334 CPP(ObjectPrototypePropertyIsEnumerable) \ |
| 338 V(MathRound, 2) \ | 335 CPP(ObjectProtoToString) \ |
| 339 V(MathPow, 3) \ | 336 CPP(ObjectSeal) \ |
| 340 V(MathSign, 2) \ | 337 CPP(ObjectValues) \ |
| 341 V(MathSin, 2) \ | 338 /* Proxy */ \ |
| 342 V(MathSinh, 2) \ | 339 CPP(ProxyConstructor) \ |
| 343 V(MathTan, 2) \ | 340 CPP(ProxyConstructor_ConstructStub) \ |
| 344 V(MathTanh, 2) \ | 341 /* Reflect */ \ |
| 345 V(MathSqrt, 2) \ | 342 ASM(ReflectApply) \ |
| 346 V(MathTrunc, 2) \ | 343 ASM(ReflectConstruct) \ |
| 347 V(NumberPrototypeValueOf, 1) \ | 344 CPP(ReflectDefineProperty) \ |
| 348 V(ObjectHasOwnProperty, 2) \ | 345 CPP(ReflectDeleteProperty) \ |
| 349 V(ArrayIsArray, 2) \ | 346 CPP(ReflectGet) \ |
| 350 V(StringFromCharCode, 2) \ | 347 CPP(ReflectGetOwnPropertyDescriptor) \ |
| 351 V(StringPrototypeCharAt, 2) \ | 348 CPP(ReflectGetPrototypeOf) \ |
| 352 V(StringPrototypeCharCodeAt, 2) \ | 349 CPP(ReflectHas) \ |
| 353 V(StringPrototypeToString, 1) \ | 350 CPP(ReflectIsExtensible) \ |
| 354 V(StringPrototypeValueOf, 1) \ | 351 CPP(ReflectOwnKeys) \ |
| 355 V(SymbolPrototypeToPrimitive, 2) \ | 352 CPP(ReflectPreventExtensions) \ |
| 356 V(SymbolPrototypeToString, 1) \ | 353 CPP(ReflectSet) \ |
| 357 V(SymbolPrototypeValueOf, 1) \ | 354 CPP(ReflectSetPrototypeOf) \ |
| 358 V(TypedArrayPrototypeByteLength, 1) \ | 355 /* SharedArrayBuffer */ \ |
| 359 V(TypedArrayPrototypeByteOffset, 1) \ | 356 CPP(SharedArrayBufferPrototypeGetByteLength) \ |
| 360 V(TypedArrayPrototypeLength, 1) \ | 357 TFJ(AtomicsLoad, 3) \ |
| 361 V(AtomicsLoad, 3) \ | 358 TFJ(AtomicsStore, 4) \ |
| 362 V(AtomicsStore, 4) | 359 /* String */ \ |
| 363 | 360 ASM(StringConstructor) \ |
| 364 // Define list of builtins implemented in TurboFan (with CallStub linkage). | 361 ASM(StringConstructor_ConstructStub) \ |
| 365 #define BUILTIN_LIST_S(V) \ | 362 CPP(StringFromCodePoint) \ |
| 366 V(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \ | 363 TFJ(StringFromCharCode, 2) \ |
| 367 V(LoadGlobalIC_SlowNotInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \ | 364 TFJ(StringPrototypeCharAt, 2) \ |
| 368 LoadGlobalWithVector) \ | 365 TFJ(StringPrototypeCharCodeAt, 2) \ |
| 369 V(LoadGlobalIC_SlowInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \ | 366 TFJ(StringPrototypeToString, 1) \ |
| 370 LoadGlobalWithVector) \ | 367 CPP(StringPrototypeTrim) \ |
| 371 V(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \ | 368 CPP(StringPrototypeTrimLeft) \ |
| 372 V(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \ | 369 CPP(StringPrototypeTrimRight) \ |
| 373 V(StoreIC_Miss, BUILTIN, kNoExtraICState, VectorStoreIC) \ | 370 TFJ(StringPrototypeValueOf, 1) \ |
| 374 V(StoreIC_SlowSloppy, HANDLER, Code::STORE_IC, VectorStoreIC) \ | 371 /* Symbol */ \ |
| 375 V(StoreIC_SlowStrict, HANDLER, Code::STORE_IC, VectorStoreIC) \ | 372 CPP(SymbolConstructor) \ |
| 376 V(OrdinaryToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \ | 373 CPP(SymbolConstructor_ConstructStub) \ |
| 377 V(OrdinaryToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) \ | 374 TFJ(SymbolPrototypeToPrimitive, 2) \ |
| 378 V(NonPrimitiveToPrimitive_Default, BUILTIN, kNoExtraICState, TypeConversion) \ | 375 TFJ(SymbolPrototypeToString, 1) \ |
| 379 V(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \ | 376 TFJ(SymbolPrototypeValueOf, 1) \ |
| 380 V(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) | 377 /* TypedArray */ \ |
| 381 | 378 CPP(TypedArrayPrototypeBuffer) \ |
| 382 // Define list of builtin handlers implemented in assembly. | 379 TFJ(TypedArrayPrototypeByteLength, 1) \ |
| 383 #define BUILTIN_LIST_H(V) \ | 380 TFJ(TypedArrayPrototypeByteOffset, 1) \ |
| 384 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ | 381 TFJ(TypedArrayPrototypeLength, 1) |
| 385 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ | 382 |
| 386 V(LoadIC_Normal, LOAD_IC) \ | 383 #define IGNORE_BUILTIN(...) |
| 387 V(StoreIC_Normal, STORE_IC) | 384 |
| 388 | 385 #define BUILTIN_LIST_ALL(V) BUILTIN_LIST(V, V, V, V, V, V, V) |
| 389 // Define list of builtins used by the debugger implemented in assembly. | 386 |
| 390 #define BUILTIN_LIST_DEBUG_A(V) \ | 387 #define BUILTIN_LIST_C(V) \ |
| 391 V(Return_DebugBreak, BUILTIN, kNoExtraICState) \ | 388 BUILTIN_LIST(V, V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 392 V(Slot_DebugBreak, BUILTIN, kNoExtraICState) \ | 389 IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 393 V(FrameDropper_LiveEdit, BUILTIN, kNoExtraICState) | 390 |
| 394 | 391 #define BUILTIN_LIST_A(V) \ |
| 392 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 393 V, V, V) |
| 394 |
| 395 #define BUILTIN_LIST_TFS(V) \ |
| 396 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V, \ |
| 397 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 398 |
| 399 #define BUILTIN_LIST_DBG(V) \ |
| 400 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 401 IGNORE_BUILTIN, IGNORE_BUILTIN, V) |
| 402 |
| 403 // Forward declarations. |
| 404 class CodeStubAssembler; |
| 395 class BuiltinFunctionTable; | 405 class BuiltinFunctionTable; |
| 396 class ObjectVisitor; | 406 class ObjectVisitor; |
| 397 | 407 |
| 398 class Builtins { | 408 class Builtins { |
| 399 public: | 409 public: |
| 400 ~Builtins(); | 410 ~Builtins(); |
| 401 | 411 |
| 402 // Generate all builtin code objects. Should be called once during | 412 // Generate all builtin code objects. Should be called once during |
| 403 // isolate initialization. | 413 // isolate initialization. |
| 404 void SetUp(Isolate* isolate, bool create_heap_objects); | 414 void SetUp(Isolate* isolate, bool create_heap_objects); |
| 405 void TearDown(); | 415 void TearDown(); |
| 406 | 416 |
| 407 // Garbage collection support. | 417 // Garbage collection support. |
| 408 void IterateBuiltins(ObjectVisitor* v); | 418 void IterateBuiltins(ObjectVisitor* v); |
| 409 | 419 |
| 410 // Disassembler support. | 420 // Disassembler support. |
| 411 const char* Lookup(byte* pc); | 421 const char* Lookup(byte* pc); |
| 412 | 422 |
| 413 enum Name { | 423 enum Name { |
| 414 #define DEF_ENUM_C(name, ignore) k##name, | 424 #define DEF_ENUM(name, ...) k##name, |
| 415 #define DEF_ENUM_A(name, kind, extra) k##name, | 425 BUILTIN_LIST_ALL(DEF_ENUM) |
| 416 #define DEF_ENUM_T(name, argc) k##name, | 426 #undef DEF_ENUM |
| 417 #define DEF_ENUM_S(name, kind, extra, interface_descriptor) k##name, | 427 builtin_count |
| 418 #define DEF_ENUM_H(name, kind) k##name, | |
| 419 BUILTIN_LIST_C(DEF_ENUM_C) | |
| 420 BUILTIN_LIST_A(DEF_ENUM_A) | |
| 421 BUILTIN_LIST_T(DEF_ENUM_T) | |
| 422 BUILTIN_LIST_S(DEF_ENUM_S) | |
| 423 BUILTIN_LIST_H(DEF_ENUM_H) | |
| 424 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) | |
| 425 #undef DEF_ENUM_C | |
| 426 #undef DEF_ENUM_A | |
| 427 #undef DEF_ENUM_T | |
| 428 #undef DEF_ENUM_S | |
| 429 #undef DEF_ENUM_H | |
| 430 builtin_count | |
| 431 }; | 428 }; |
| 432 | 429 |
| 433 enum CFunctionId { | 430 enum CFunctionId { |
| 434 #define DEF_ENUM_C(name, ignore) c_##name, | 431 #define DEF_ENUM(name) c_##name, |
| 435 BUILTIN_LIST_C(DEF_ENUM_C) | 432 BUILTIN_LIST_C(DEF_ENUM) |
| 436 #undef DEF_ENUM_C | 433 #undef DEF_ENUM |
| 437 cfunction_count | 434 cfunction_count |
| 438 }; | 435 }; |
| 439 | 436 |
| 440 #define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); | 437 #define DECLARE_BUILTIN_ACCESSOR(name, ...) Handle<Code> name(); |
| 441 #define DECLARE_BUILTIN_ACCESSOR_A(name, kind, extra) Handle<Code> name(); | 438 BUILTIN_LIST_ALL(DECLARE_BUILTIN_ACCESSOR) |
| 442 #define DECLARE_BUILTIN_ACCESSOR_T(name, argc) Handle<Code> name(); | 439 #undef DECLARE_BUILTIN_ACCESSOR |
| 443 #define DECLARE_BUILTIN_ACCESSOR_S(name, kind, extra, interface_descriptor) \ | |
| 444 Handle<Code> name(); | |
| 445 #define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name(); | |
| 446 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) | |
| 447 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) | |
| 448 BUILTIN_LIST_T(DECLARE_BUILTIN_ACCESSOR_T) | |
| 449 BUILTIN_LIST_S(DECLARE_BUILTIN_ACCESSOR_S) | |
| 450 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) | |
| 451 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) | |
| 452 #undef DECLARE_BUILTIN_ACCESSOR_C | |
| 453 #undef DECLARE_BUILTIN_ACCESSOR_A | |
| 454 #undef DECLARE_BUILTIN_ACCESSOR_T | |
| 455 #undef DECLARE_BUILTIN_ACCESSOR_S | |
| 456 #undef DECLARE_BUILTIN_ACCESSOR_H | |
| 457 | 440 |
| 458 // Convenience wrappers. | 441 // Convenience wrappers. |
| 459 Handle<Code> CallFunction( | 442 Handle<Code> CallFunction( |
| 460 ConvertReceiverMode = ConvertReceiverMode::kAny, | 443 ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 461 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 444 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 462 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, | 445 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny, |
| 463 TailCallMode tail_call_mode = TailCallMode::kDisallow); | 446 TailCallMode tail_call_mode = TailCallMode::kDisallow); |
| 464 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); | 447 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode); |
| 465 Handle<Code> NonPrimitiveToPrimitive( | 448 Handle<Code> NonPrimitiveToPrimitive( |
| 466 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 449 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 friend class BuiltinFunctionTable; | 831 friend class BuiltinFunctionTable; |
| 849 friend class Isolate; | 832 friend class Isolate; |
| 850 | 833 |
| 851 DISALLOW_COPY_AND_ASSIGN(Builtins); | 834 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 852 }; | 835 }; |
| 853 | 836 |
| 854 } // namespace internal | 837 } // namespace internal |
| 855 } // namespace v8 | 838 } // namespace v8 |
| 856 | 839 |
| 857 #endif // V8_BUILTINS_BUILTINS_H_ | 840 #endif // V8_BUILTINS_BUILTINS_H_ |
| OLD | NEW |