Commit 5abc73a1 authored by yangguo's avatar yangguo Committed by Commit bot

[builtins] unify builtins list.

Now builtins are sorted by use, not implementation.

R=bmeurer@chromium.org
BUG=v8:5197

Review-Url: https://codereview.chromium.org/2145413002
Cr-Commit-Position: refs/heads/master@{#37761}
parent 63449d21
...@@ -6314,7 +6314,7 @@ Builtins::Builtins() : initialized_(false) { ...@@ -6314,7 +6314,7 @@ Builtins::Builtins() : initialized_(false) {
Builtins::~Builtins() {} Builtins::~Builtins() {}
#define DEF_ENUM_C(name, ignore) FUNCTION_ADDR(Builtin_##name), #define DEF_ENUM_C(name) FUNCTION_ADDR(Builtin_##name),
Address const Builtins::c_functions_[cfunction_count] = { Address const Builtins::c_functions_[cfunction_count] = {
BUILTIN_LIST_C(DEF_ENUM_C)}; BUILTIN_LIST_C(DEF_ENUM_C)};
#undef DEF_ENUM_C #undef DEF_ENUM_C
...@@ -6437,73 +6437,80 @@ void Builtins::InitBuiltinFunctionTable() { ...@@ -6437,73 +6437,80 @@ void Builtins::InitBuiltinFunctionTable() {
functions[builtin_count].exit_frame_type = EXIT; functions[builtin_count].exit_frame_type = EXIT;
functions[builtin_count].argc = 0; functions[builtin_count].argc = 0;
#define DEF_FUNCTION_PTR_C(aname, aexit_frame_type) \ #define DEF_CPP(Name) \
functions->builder = &MacroAssemblerBuilder; \ functions->builder = &MacroAssemblerBuilder; \
functions->generator = FUNCTION_ADDR(Generate_Adaptor); \ functions->generator = FUNCTION_ADDR(Generate_Adaptor); \
functions->c_code = FUNCTION_ADDR(Builtin_##aname); \ functions->c_code = FUNCTION_ADDR(Builtin_##Name); \
functions->s_name = #aname; \ functions->s_name = #Name; \
functions->name = c_##aname; \ functions->name = c_##Name; \
functions->flags = Code::ComputeFlags(Code::BUILTIN); \ functions->flags = Code::ComputeFlags(Code::BUILTIN); \
functions->exit_frame_type = aexit_frame_type; \ functions->exit_frame_type = BUILTIN_EXIT; \
functions->argc = 0; \ functions->argc = 0; \
++functions; ++functions;
#define DEF_FUNCTION_PTR_A(aname, kind, extra) \ #define DEF_API(Name) \
functions->builder = &MacroAssemblerBuilder; \ functions->builder = &MacroAssemblerBuilder; \
functions->generator = FUNCTION_ADDR(Generate_##aname); \ functions->generator = FUNCTION_ADDR(Generate_Adaptor); \
functions->c_code = NULL; \ functions->c_code = FUNCTION_ADDR(Builtin_##Name); \
functions->s_name = #aname; \ functions->s_name = #Name; \
functions->name = k##aname; \ functions->name = c_##Name; \
functions->flags = Code::ComputeFlags(Code::kind, extra); \
functions->exit_frame_type = EXIT; \
functions->argc = 0; \
++functions;
#define DEF_FUNCTION_PTR_T(aname, aargc) \
functions->builder = &CodeStubAssemblerBuilderJS; \
functions->generator = FUNCTION_ADDR(Generate_##aname); \
functions->c_code = NULL; \
functions->s_name = #aname; \
functions->name = k##aname; \
functions->flags = Code::ComputeFlags(Code::BUILTIN); \ functions->flags = Code::ComputeFlags(Code::BUILTIN); \
functions->exit_frame_type = EXIT; \ functions->exit_frame_type = EXIT; \
functions->argc = aargc; \ functions->argc = 0; \
++functions; ++functions;
#define DEF_FUNCTION_PTR_S(aname, kind, extra, interface_descriptor) \ #define DEF_TFJ(Name, Argc) \
functions->builder = &CodeStubAssemblerBuilderCS; \ functions->builder = &CodeStubAssemblerBuilderJS; \
functions->generator = FUNCTION_ADDR(Generate_##aname); \ functions->generator = FUNCTION_ADDR(Generate_##Name); \
functions->c_code = NULL; \ functions->c_code = NULL; \
functions->s_name = #aname; \ functions->s_name = #Name; \
functions->name = k##aname; \ functions->name = k##Name; \
functions->flags = Code::ComputeFlags(Code::kind, extra); \ functions->flags = Code::ComputeFlags(Code::BUILTIN); \
functions->exit_frame_type = EXIT; \ functions->exit_frame_type = EXIT; \
functions->argc = CallDescriptors::interface_descriptor; \ functions->argc = Argc; \
++functions; ++functions;
#define DEF_FUNCTION_PTR_H(aname, kind) \ #define DEF_TFS(Name, Kind, Extra, InterfaceDescriptor) \
functions->builder = &CodeStubAssemblerBuilderCS; \
functions->generator = FUNCTION_ADDR(Generate_##Name); \
functions->c_code = NULL; \
functions->s_name = #Name; \
functions->name = k##Name; \
functions->flags = Code::ComputeFlags(Code::Kind, Extra); \
functions->exit_frame_type = EXIT; \
functions->argc = CallDescriptors::InterfaceDescriptor; \
++functions;
#define DEF_ASM(Name) \
functions->builder = &MacroAssemblerBuilder; \
functions->generator = FUNCTION_ADDR(Generate_##Name); \
functions->c_code = NULL; \
functions->s_name = #Name; \
functions->name = k##Name; \
functions->flags = Code::ComputeFlags(Code::BUILTIN); \
functions->exit_frame_type = EXIT; \
functions->argc = 0; \
++functions;
#define DEF_ASH(Name, Kind, Extra) \
functions->builder = &MacroAssemblerBuilder; \ functions->builder = &MacroAssemblerBuilder; \
functions->generator = FUNCTION_ADDR(Generate_##aname); \ functions->generator = FUNCTION_ADDR(Generate_##Name); \
functions->c_code = NULL; \ functions->c_code = NULL; \
functions->s_name = #aname; \ functions->s_name = #Name; \
functions->name = k##aname; \ functions->name = k##Name; \
functions->flags = Code::ComputeHandlerFlags(Code::kind); \ functions->flags = Code::ComputeFlags(Code::Kind, Extra); \
functions->exit_frame_type = EXIT; \ functions->exit_frame_type = EXIT; \
functions->argc = 0; \ functions->argc = 0; \
++functions; ++functions;
BUILTIN_LIST_C(DEF_FUNCTION_PTR_C) BUILTIN_LIST(DEF_CPP, DEF_API, DEF_TFJ, DEF_TFS, DEF_ASM, DEF_ASH, DEF_ASM)
BUILTIN_LIST_A(DEF_FUNCTION_PTR_A)
BUILTIN_LIST_T(DEF_FUNCTION_PTR_T)
BUILTIN_LIST_S(DEF_FUNCTION_PTR_S)
BUILTIN_LIST_H(DEF_FUNCTION_PTR_H)
BUILTIN_LIST_DEBUG_A(DEF_FUNCTION_PTR_A)
#undef DEF_FUNCTION_PTR_C #undef DEF_CPP
#undef DEF_FUNCTION_PTR_A #undef DEF_API
#undef DEF_FUNCTION_PTR_T #undef DEF_TFJ
#undef DEF_FUNCTION_PTR_S #undef DEF_TFS
#undef DEF_FUNCTION_PTR_H #undef DEF_ASM
#undef DEF_ASH
} }
void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
...@@ -6514,7 +6521,7 @@ void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { ...@@ -6514,7 +6521,7 @@ void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
#define INITIALIZE_CALL_DESCRIPTOR(name, kind, extra, interface_descriptor) \ #define INITIALIZE_CALL_DESCRIPTOR(name, kind, extra, interface_descriptor) \
{ interface_descriptor##Descriptor descriptor(isolate); } { interface_descriptor##Descriptor descriptor(isolate); }
BUILTIN_LIST_S(INITIALIZE_CALL_DESCRIPTOR) BUILTIN_LIST_TFS(INITIALIZE_CALL_DESCRIPTOR)
#undef INITIALIZE_CALL_DESCRIPTOR #undef INITIALIZE_CALL_DESCRIPTOR
const BuiltinDesc* functions = builtin_function_table.functions(); const BuiltinDesc* functions = builtin_function_table.functions();
...@@ -6814,42 +6821,13 @@ void Builtins::Generate_AtomicsStore(CodeStubAssembler* a) { ...@@ -6814,42 +6821,13 @@ void Builtins::Generate_AtomicsStore(CodeStubAssembler* a) {
a->Return(a->Int32Constant(0)); a->Return(a->Int32Constant(0));
} }
#define DEFINE_BUILTIN_ACCESSOR_C(name, ignore) \ #define DEFINE_BUILTIN_ACCESSOR(Name, ...) \
Handle<Code> Builtins::name() { \ Handle<Code> Builtins::Name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \ Code** code_address = reinterpret_cast<Code**>(builtin_address(k##Name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_A(name, kind, extra) \
Handle<Code> Builtins::name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_T(name, argc) \
Handle<Code> Builtins::name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_S(name, kind, extra, interface_descriptor) \
Handle<Code> Builtins::name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_H(name, kind) \
Handle<Code> Builtins::name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \ return Handle<Code>(code_address); \
} }
BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) BUILTIN_LIST_ALL(DEFINE_BUILTIN_ACCESSOR)
BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) #undef DEFINE_BUILTIN_ACCESSOR
BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)
BUILTIN_LIST_S(DEFINE_BUILTIN_ACCESSOR_S)
BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
#undef DEFINE_BUILTIN_ACCESSOR_C
#undef DEFINE_BUILTIN_ACCESSOR_A
#undef DEFINE_BUILTIN_ACCESSOR_T
#undef DEFINE_BUILTIN_ACCESSOR_S
#undef DEFINE_BUILTIN_ACCESSOR_H
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
// Forward declarations.
class CodeStubAssembler;
#define CODE_AGE_LIST_WITH_ARG(V, A) \ #define CODE_AGE_LIST_WITH_ARG(V, A) \
V(Quadragenarian, A) \ V(Quadragenarian, A) \
V(Quinquagenarian, A) \ V(Quinquagenarian, A) \
...@@ -32,366 +29,379 @@ class CodeStubAssembler; ...@@ -32,366 +29,379 @@ class CodeStubAssembler;
V(NoAge) \ V(NoAge) \
CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V) CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V)
#define DECLARE_CODE_AGE_BUILTIN(C, V) \ #define DECLARE_CODE_AGE_BUILTIN(C, V) \
V(Make##C##CodeYoungAgainOddMarking, BUILTIN, kNoExtraICState) \ V(Make##C##CodeYoungAgainOddMarking) \
V(Make##C##CodeYoungAgainEvenMarking, BUILTIN, kNoExtraICState) V(Make##C##CodeYoungAgainEvenMarking)
// Define list of builtins implemented in C++. // CPP: Builtin in C++. Entered via BUILTIN_EXIT frame.
#define BUILTIN_LIST_C(V) \ // Args: name
V(Illegal, BUILTIN_EXIT) \ // API: Builtin in C++ for API callbacks. Entered via EXIT frame.
\ // Args: name
V(EmptyFunction, BUILTIN_EXIT) \ // TFJ: Builtin in Turbofan, with JS linkage (callable as Javascript function).
\ // Args: name, arguments count
V(ArrayConcat, BUILTIN_EXIT) \ // TFS: Builtin in Turbofan, with CodeStub linkage.
V(ArrayPop, BUILTIN_EXIT) \ // Args: name, code kind, extra IC state, interface descriptor
V(ArrayPush, BUILTIN_EXIT) \ // ASM: Builtin in platform-dependent assembly.
V(ArrayShift, BUILTIN_EXIT) \ // Args: name
V(ArraySlice, BUILTIN_EXIT) \ // ASH: Handlers implemented in platform-dependent assembly.
V(ArraySplice, BUILTIN_EXIT) \ // Args: name, code kind, extra IC state
V(ArrayUnshift, BUILTIN_EXIT) \ // DBG: Builtin in platform-dependent assembly, used by the debugger.
\ // Args: name
V(ArrayBufferConstructor, BUILTIN_EXIT) \ #define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, DBG) \
V(ArrayBufferConstructor_ConstructStub, BUILTIN_EXIT) \ /* Handlers */ \
V(ArrayBufferPrototypeGetByteLength, BUILTIN_EXIT) \ ASM(KeyedLoadIC_Miss) \
V(ArrayBufferIsView, BUILTIN_EXIT) \ ASM(KeyedStoreIC_Miss) \
\ ASH(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \
V(BooleanConstructor, BUILTIN_EXIT) \ ASH(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \
V(BooleanConstructor_ConstructStub, BUILTIN_EXIT) \ ASH(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \
\ ASH(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \
V(DataViewConstructor, BUILTIN_EXIT) \ ASH(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \
V(DataViewConstructor_ConstructStub, BUILTIN_EXIT) \ StoreICState::kStrictModeState) \
V(DataViewPrototypeGetBuffer, BUILTIN_EXIT) \ ASH(KeyedLoadIC_Slow, HANDLER, Code::KEYED_LOAD_IC) \
V(DataViewPrototypeGetByteLength, BUILTIN_EXIT) \ ASH(KeyedStoreIC_Slow, HANDLER, Code::KEYED_STORE_IC) \
V(DataViewPrototypeGetByteOffset, BUILTIN_EXIT) \ ASH(LoadIC_Normal, HANDLER, Code::LOAD_IC) \
\ ASH(StoreIC_Normal, HANDLER, Code::STORE_IC) \
V(DateConstructor, BUILTIN_EXIT) \ TFS(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \
V(DateConstructor_ConstructStub, BUILTIN_EXIT) \ TFS(LoadGlobalIC_SlowNotInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \
V(DateNow, BUILTIN_EXIT) \ LoadGlobalWithVector) \
V(DateParse, BUILTIN_EXIT) \ TFS(LoadGlobalIC_SlowInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \
V(DateUTC, BUILTIN_EXIT) \ LoadGlobalWithVector) \
V(DatePrototypeSetDate, BUILTIN_EXIT) \ TFS(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \
V(DatePrototypeSetFullYear, BUILTIN_EXIT) \ TFS(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \
V(DatePrototypeSetHours, BUILTIN_EXIT) \ TFS(StoreIC_Miss, BUILTIN, kNoExtraICState, VectorStoreIC) \
V(DatePrototypeSetMilliseconds, BUILTIN_EXIT) \ TFS(StoreIC_SlowSloppy, HANDLER, Code::STORE_IC, VectorStoreIC) \
V(DatePrototypeSetMinutes, BUILTIN_EXIT) \ TFS(StoreIC_SlowStrict, HANDLER, Code::STORE_IC, VectorStoreIC) \
V(DatePrototypeSetMonth, BUILTIN_EXIT) \ /* Code aging */ \
V(DatePrototypeSetSeconds, BUILTIN_EXIT) \ CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, ASM) \
V(DatePrototypeSetTime, BUILTIN_EXIT) \ /* Calls */ \
V(DatePrototypeSetUTCDate, BUILTIN_EXIT) \ ASM(ArgumentsAdaptorTrampoline) \
V(DatePrototypeSetUTCFullYear, BUILTIN_EXIT) \ ASM(CallFunction_ReceiverIsNullOrUndefined) \
V(DatePrototypeSetUTCHours, BUILTIN_EXIT) \ ASM(CallFunction_ReceiverIsNotNullOrUndefined) \
V(DatePrototypeSetUTCMilliseconds, BUILTIN_EXIT) \ ASM(CallFunction_ReceiverIsAny) \
V(DatePrototypeSetUTCMinutes, BUILTIN_EXIT) \ ASM(TailCallFunction_ReceiverIsNullOrUndefined) \
V(DatePrototypeSetUTCMonth, BUILTIN_EXIT) \ ASM(TailCallFunction_ReceiverIsNotNullOrUndefined) \
V(DatePrototypeSetUTCSeconds, BUILTIN_EXIT) \ ASM(TailCallFunction_ReceiverIsAny) \
V(DatePrototypeToDateString, BUILTIN_EXIT) \ ASM(CallBoundFunction) \
V(DatePrototypeToISOString, BUILTIN_EXIT) \ ASM(TailCallBoundFunction) \
V(DatePrototypeToPrimitive, BUILTIN_EXIT) \ ASM(Call_ReceiverIsNullOrUndefined) \
V(DatePrototypeToUTCString, BUILTIN_EXIT) \ ASM(Call_ReceiverIsNotNullOrUndefined) \
V(DatePrototypeToString, BUILTIN_EXIT) \ ASM(Call_ReceiverIsAny) \
V(DatePrototypeToTimeString, BUILTIN_EXIT) \ ASM(TailCall_ReceiverIsNullOrUndefined) \
V(DatePrototypeValueOf, BUILTIN_EXIT) \ ASM(TailCall_ReceiverIsNotNullOrUndefined) \
V(DatePrototypeGetYear, BUILTIN_EXIT) \ ASM(TailCall_ReceiverIsAny) \
V(DatePrototypeSetYear, BUILTIN_EXIT) \ /* Construct */ \
V(DatePrototypeToJson, BUILTIN_EXIT) \ ASM(ConstructFunction) \
\ ASM(ConstructBoundFunction) \
V(FunctionConstructor, BUILTIN_EXIT) \ ASM(ConstructedNonConstructable) \
V(FunctionPrototypeBind, BUILTIN_EXIT) \ ASM(ConstructProxy) \
V(FunctionPrototypeToString, BUILTIN_EXIT) \ ASM(Construct) \
\ ASM(JSConstructStubApi) \
V(GeneratorFunctionConstructor, BUILTIN_EXIT) \ ASM(JSConstructStubGeneric) \
V(AsyncFunctionConstructor, BUILTIN_EXIT) \ ASM(JSBuiltinsConstructStub) \
\ ASM(JSBuiltinsConstructStubForDerived) \
V(GlobalDecodeURI, BUILTIN_EXIT) \ /* Apply and entries */ \
V(GlobalDecodeURIComponent, BUILTIN_EXIT) \ ASM(Apply) \
V(GlobalEncodeURI, BUILTIN_EXIT) \ ASM(JSEntryTrampoline) \
V(GlobalEncodeURIComponent, BUILTIN_EXIT) \ ASM(JSConstructEntryTrampoline) \
V(GlobalEscape, BUILTIN_EXIT) \ ASM(ResumeGeneratorTrampoline) \
V(GlobalUnescape, BUILTIN_EXIT) \ /* Stack and interrupt check */ \
\ ASM(InterruptCheck) \
V(GlobalEval, BUILTIN_EXIT) \ ASM(StackCheck) \
\ /* Interpreter */ \
V(JsonParse, BUILTIN_EXIT) \ ASM(InterpreterEntryTrampoline) \
V(JsonStringify, BUILTIN_EXIT) \ ASM(InterpreterMarkBaselineOnReturn) \
\ ASM(InterpreterPushArgsAndCallFunction) \
V(MathHypot, BUILTIN_EXIT) \ ASM(InterpreterPushArgsAndTailCallFunction) \
\ ASM(InterpreterPushArgsAndCall) \
V(NumberPrototypeToExponential, BUILTIN_EXIT) \ ASM(InterpreterPushArgsAndTailCall) \
V(NumberPrototypeToFixed, BUILTIN_EXIT) \ ASM(InterpreterPushArgsAndConstruct) \
V(NumberPrototypeToLocaleString, BUILTIN_EXIT) \ ASM(InterpreterEnterBytecodeDispatch) \
V(NumberPrototypeToPrecision, BUILTIN_EXIT) \ /* Code life-cycle */ \
V(NumberPrototypeToString, BUILTIN_EXIT) \ ASM(CompileLazy) \
\ ASM(CompileBaseline) \
V(ObjectAssign, BUILTIN_EXIT) \ ASM(CompileOptimized) \
V(ObjectCreate, BUILTIN_EXIT) \ ASM(CompileOptimizedConcurrent) \
V(ObjectDefineGetter, BUILTIN_EXIT) \ ASM(InOptimizationQueue) \
V(ObjectDefineProperties, BUILTIN_EXIT) \ ASM(InstantiateAsmJs) \
V(ObjectDefineProperty, BUILTIN_EXIT) \ ASM(MarkCodeAsToBeExecutedOnce) \
V(ObjectDefineSetter, BUILTIN_EXIT) \ ASM(MarkCodeAsExecutedOnce) \
V(ObjectEntries, BUILTIN_EXIT) \ ASM(MarkCodeAsExecutedTwice) \
V(ObjectFreeze, BUILTIN_EXIT) \ ASM(NotifyDeoptimized) \
V(ObjectGetOwnPropertyDescriptor, BUILTIN_EXIT) \ ASM(NotifySoftDeoptimized) \
V(ObjectGetOwnPropertyDescriptors, BUILTIN_EXIT) \ ASM(NotifyLazyDeoptimized) \
V(ObjectGetOwnPropertyNames, BUILTIN_EXIT) \ ASM(NotifyStubFailure) \
V(ObjectGetOwnPropertySymbols, BUILTIN_EXIT) \ ASM(NotifyStubFailureSaveDoubles) \
V(ObjectGetPrototypeOf, BUILTIN_EXIT) \ ASM(OnStackReplacement) \
V(ObjectIs, BUILTIN_EXIT) \ /* API callback handling */ \
V(ObjectIsExtensible, BUILTIN_EXIT) \ API(HandleApiCall) \
V(ObjectIsFrozen, BUILTIN_EXIT) \ API(HandleApiCallAsFunction) \
V(ObjectIsSealed, BUILTIN_EXIT) \ API(HandleApiCallAsConstructor) \
V(ObjectKeys, BUILTIN_EXIT) \ ASM(HandleFastApiCall) \
V(ObjectLookupGetter, BUILTIN_EXIT) \ /* Adapters for Turbofan into runtime */ \
V(ObjectLookupSetter, BUILTIN_EXIT) \ ASM(AllocateInNewSpace) \
V(ObjectPreventExtensions, BUILTIN_EXIT) \ ASM(AllocateInOldSpace) \
V(ObjectPrototypePropertyIsEnumerable, BUILTIN_EXIT) \ /* Debugger */ \
V(ObjectProtoToString, BUILTIN_EXIT) \ DBG(Return_DebugBreak) \
V(ObjectSeal, BUILTIN_EXIT) \ DBG(Slot_DebugBreak) \
V(ObjectValues, BUILTIN_EXIT) \ DBG(FrameDropper_LiveEdit) \
\ /* Primitives */ \
V(ProxyConstructor, BUILTIN_EXIT) \ ASM(StringToNumber) \
V(ProxyConstructor_ConstructStub, BUILTIN_EXIT) \ ASM(NonNumberToNumber) \
\ ASM(ToNumber) \
V(ReflectDefineProperty, BUILTIN_EXIT) \ TFS(OrdinaryToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \
V(ReflectDeleteProperty, BUILTIN_EXIT) \ TFS(OrdinaryToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) \
V(ReflectGet, BUILTIN_EXIT) \ TFS(NonPrimitiveToPrimitive_Default, BUILTIN, kNoExtraICState, \
V(ReflectGetOwnPropertyDescriptor, BUILTIN_EXIT) \ TypeConversion) \
V(ReflectGetPrototypeOf, BUILTIN_EXIT) \ TFS(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, \
V(ReflectHas, BUILTIN_EXIT) \ TypeConversion) \
V(ReflectIsExtensible, BUILTIN_EXIT) \ TFS(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, \
V(ReflectOwnKeys, BUILTIN_EXIT) \ TypeConversion) \
V(ReflectPreventExtensions, BUILTIN_EXIT) \ \
V(ReflectSet, BUILTIN_EXIT) \ /* Built-in functions for Javascript */ \
V(ReflectSetPrototypeOf, BUILTIN_EXIT) \ /* Special internal builtins */ \
\ CPP(EmptyFunction) \
V(SharedArrayBufferPrototypeGetByteLength, BUILTIN_EXIT) \ CPP(Illegal) \
\ CPP(RestrictedFunctionPropertiesThrower) \
V(StringFromCodePoint, BUILTIN_EXIT) \ CPP(RestrictedStrictArgumentsPropertiesThrower) \
\ /* Array */ \
V(StringPrototypeTrim, BUILTIN_EXIT) \ ASM(ArrayCode) \
V(StringPrototypeTrimLeft, BUILTIN_EXIT) \ ASM(InternalArrayCode) \
V(StringPrototypeTrimRight, BUILTIN_EXIT) \ CPP(ArrayConcat) \
\ TFJ(ArrayIsArray, 2) \
V(SymbolConstructor, BUILTIN_EXIT) \ CPP(ArrayPop) \
V(SymbolConstructor_ConstructStub, BUILTIN_EXIT) \ CPP(ArrayPush) \
\ CPP(ArrayShift) \
V(TypedArrayPrototypeBuffer, BUILTIN_EXIT) \ CPP(ArraySlice) \
\ CPP(ArraySplice) \
V(HandleApiCall, EXIT) \ CPP(ArrayUnshift) \
V(HandleApiCallAsFunction, EXIT) \ /* ArrayBuffer */ \
V(HandleApiCallAsConstructor, EXIT) \ CPP(ArrayBufferConstructor) \
\ CPP(ArrayBufferConstructor_ConstructStub) \
V(RestrictedFunctionPropertiesThrower, BUILTIN_EXIT) \ CPP(ArrayBufferPrototypeGetByteLength) \
V(RestrictedStrictArgumentsPropertiesThrower, BUILTIN_EXIT) CPP(ArrayBufferIsView) \
/* Boolean */ \
// Define list of builtins implemented in assembly. CPP(BooleanConstructor) \
#define BUILTIN_LIST_A(V) \ CPP(BooleanConstructor_ConstructStub) \
V(AllocateInNewSpace, BUILTIN, kNoExtraICState) \ TFJ(BooleanPrototypeToString, 1) \
V(AllocateInOldSpace, BUILTIN, kNoExtraICState) \ TFJ(BooleanPrototypeValueOf, 1) \
\ /* DataView */ \
V(ArgumentsAdaptorTrampoline, BUILTIN, kNoExtraICState) \ CPP(DataViewConstructor) \
\ CPP(DataViewConstructor_ConstructStub) \
V(ConstructedNonConstructable, BUILTIN, kNoExtraICState) \ CPP(DataViewPrototypeGetBuffer) \
\ CPP(DataViewPrototypeGetByteLength) \
V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DataViewPrototypeGetByteOffset) \
V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ /* Date */ \
V(CallFunction_ReceiverIsAny, BUILTIN, kNoExtraICState) \ CPP(DateConstructor) \
V(TailCallFunction_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DateConstructor_ConstructStub) \
V(TailCallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DateNow) \
V(TailCallFunction_ReceiverIsAny, BUILTIN, kNoExtraICState) \ CPP(DateParse) \
V(CallBoundFunction, BUILTIN, kNoExtraICState) \ CPP(DateUTC) \
V(TailCallBoundFunction, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetDate) \
V(Call_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetFullYear) \
V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetHours) \
V(Call_ReceiverIsAny, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetMilliseconds) \
V(TailCall_ReceiverIsNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetMinutes) \
V(TailCall_ReceiverIsNotNullOrUndefined, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetMonth) \
V(TailCall_ReceiverIsAny, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetSeconds) \
\ CPP(DatePrototypeSetTime) \
V(ConstructFunction, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetUTCDate) \
V(ConstructBoundFunction, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetUTCFullYear) \
V(ConstructProxy, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetUTCHours) \
V(Construct, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetUTCMilliseconds) \
\ CPP(DatePrototypeSetUTCMinutes) \
V(StringToNumber, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetUTCMonth) \
V(NonNumberToNumber, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetUTCSeconds) \
V(ToNumber, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeToDateString) \
\ CPP(DatePrototypeToISOString) \
V(Apply, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeToPrimitive) \
\ CPP(DatePrototypeToUTCString) \
V(HandleFastApiCall, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeToString) \
\ CPP(DatePrototypeToTimeString) \
V(InOptimizationQueue, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeValueOf) \
V(JSConstructStubGeneric, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetDate) \
V(JSBuiltinsConstructStub, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetDay) \
V(JSBuiltinsConstructStubForDerived, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetFullYear) \
V(JSConstructStubApi, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetHours) \
V(JSEntryTrampoline, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetMilliseconds) \
V(JSConstructEntryTrampoline, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetMinutes) \
V(ResumeGeneratorTrampoline, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetMonth) \
V(InstantiateAsmJs, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetSeconds) \
V(CompileLazy, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetTime) \
V(CompileBaseline, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetTimezoneOffset) \
V(CompileOptimized, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCDate) \
V(CompileOptimizedConcurrent, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCDay) \
V(NotifyDeoptimized, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCFullYear) \
V(NotifySoftDeoptimized, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCHours) \
V(NotifyLazyDeoptimized, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCMilliseconds) \
V(NotifyStubFailure, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCMinutes) \
V(NotifyStubFailureSaveDoubles, BUILTIN, kNoExtraICState) \ ASM(DatePrototypeGetUTCMonth) \
\ ASM(DatePrototypeGetUTCSeconds) \
V(InterpreterEntryTrampoline, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeGetYear) \
V(InterpreterMarkBaselineOnReturn, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeSetYear) \
V(InterpreterPushArgsAndCallFunction, BUILTIN, kNoExtraICState) \ CPP(DatePrototypeToJson) \
V(InterpreterPushArgsAndTailCallFunction, BUILTIN, kNoExtraICState) \ /* Function */ \
V(InterpreterPushArgsAndCall, BUILTIN, kNoExtraICState) \ CPP(FunctionConstructor) \
V(InterpreterPushArgsAndTailCall, BUILTIN, kNoExtraICState) \ ASM(FunctionPrototypeApply) \
V(InterpreterPushArgsAndConstruct, BUILTIN, kNoExtraICState) \ CPP(FunctionPrototypeBind) \
V(InterpreterEnterBytecodeDispatch, BUILTIN, kNoExtraICState) \ ASM(FunctionPrototypeCall) \
\ TFJ(FunctionPrototypeHasInstance, 2) \
V(KeyedLoadIC_Miss, BUILTIN, kNoExtraICState) \ CPP(FunctionPrototypeToString) \
V(KeyedStoreIC_Miss, BUILTIN, kNoExtraICState) \ /* Generator and Async */ \
V(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \ CPP(GeneratorFunctionConstructor) \
V(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ TFJ(GeneratorPrototypeNext, 2) \
\ TFJ(GeneratorPrototypeReturn, 2) \
V(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \ TFJ(GeneratorPrototypeThrow, 2) \
\ CPP(AsyncFunctionConstructor) \
V(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \ /* Encode and decode */ \
V(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \ CPP(GlobalDecodeURI) \
StoreICState::kStrictModeState) \ CPP(GlobalDecodeURIComponent) \
\ CPP(GlobalEncodeURI) \
V(DatePrototypeGetDate, BUILTIN, kNoExtraICState) \ CPP(GlobalEncodeURIComponent) \
V(DatePrototypeGetDay, BUILTIN, kNoExtraICState) \ CPP(GlobalEscape) \
V(DatePrototypeGetFullYear, BUILTIN, kNoExtraICState) \ CPP(GlobalUnescape) \
V(DatePrototypeGetHours, BUILTIN, kNoExtraICState) \ /* Eval */ \
V(DatePrototypeGetMilliseconds, BUILTIN, kNoExtraICState) \ CPP(GlobalEval) \
V(DatePrototypeGetMinutes, BUILTIN, kNoExtraICState) \ /* JSON */ \
V(DatePrototypeGetMonth, BUILTIN, kNoExtraICState) \ CPP(JsonParse) \
V(DatePrototypeGetSeconds, BUILTIN, kNoExtraICState) \ CPP(JsonStringify) \
V(DatePrototypeGetTime, BUILTIN, kNoExtraICState) \ /* Math */ \
V(DatePrototypeGetTimezoneOffset, BUILTIN, kNoExtraICState) \ TFJ(MathAcos, 2) \
V(DatePrototypeGetUTCDate, BUILTIN, kNoExtraICState) \ TFJ(MathAcosh, 2) \
V(DatePrototypeGetUTCDay, BUILTIN, kNoExtraICState) \ TFJ(MathAsin, 2) \
V(DatePrototypeGetUTCFullYear, BUILTIN, kNoExtraICState) \ TFJ(MathAsinh, 2) \
V(DatePrototypeGetUTCHours, BUILTIN, kNoExtraICState) \ TFJ(MathAtan, 2) \
V(DatePrototypeGetUTCMilliseconds, BUILTIN, kNoExtraICState) \ TFJ(MathAtanh, 2) \
V(DatePrototypeGetUTCMinutes, BUILTIN, kNoExtraICState) \ TFJ(MathAtan2, 3) \
V(DatePrototypeGetUTCMonth, BUILTIN, kNoExtraICState) \ TFJ(MathCeil, 2) \
V(DatePrototypeGetUTCSeconds, BUILTIN, kNoExtraICState) \ TFJ(MathCbrt, 2) \
\ TFJ(MathAbs, 2) \
V(FunctionPrototypeApply, BUILTIN, kNoExtraICState) \ TFJ(MathExpm1, 2) \
V(FunctionPrototypeCall, BUILTIN, kNoExtraICState) \ TFJ(MathClz32, 2) \
\ TFJ(MathCos, 2) \
V(ReflectApply, BUILTIN, kNoExtraICState) \ TFJ(MathCosh, 2) \
V(ReflectConstruct, BUILTIN, kNoExtraICState) \ TFJ(MathExp, 2) \
\ TFJ(MathFloor, 2) \
V(InternalArrayCode, BUILTIN, kNoExtraICState) \ TFJ(MathFround, 2) \
V(ArrayCode, BUILTIN, kNoExtraICState) \ CPP(MathHypot) \
\ TFJ(MathImul, 3) \
V(MathMax, BUILTIN, kNoExtraICState) \ TFJ(MathLog, 2) \
V(MathMin, BUILTIN, kNoExtraICState) \ TFJ(MathLog1p, 2) \
\ TFJ(MathLog10, 2) \
V(NumberConstructor, BUILTIN, kNoExtraICState) \ TFJ(MathLog2, 2) \
V(NumberConstructor_ConstructStub, BUILTIN, kNoExtraICState) \ ASM(MathMax) \
\ ASM(MathMin) \
V(StringConstructor, BUILTIN, kNoExtraICState) \ TFJ(MathRound, 2) \
V(StringConstructor_ConstructStub, BUILTIN, kNoExtraICState) \ TFJ(MathPow, 3) \
\ TFJ(MathSign, 2) \
V(OnStackReplacement, BUILTIN, kNoExtraICState) \ TFJ(MathSin, 2) \
V(InterruptCheck, BUILTIN, kNoExtraICState) \ TFJ(MathSinh, 2) \
V(StackCheck, BUILTIN, kNoExtraICState) \ TFJ(MathTan, 2) \
\ TFJ(MathTanh, 2) \
V(MarkCodeAsToBeExecutedOnce, BUILTIN, kNoExtraICState) \ TFJ(MathSqrt, 2) \
V(MarkCodeAsExecutedOnce, BUILTIN, kNoExtraICState) \ TFJ(MathTrunc, 2) \
V(MarkCodeAsExecutedTwice, BUILTIN, kNoExtraICState) \ /* Number */ \
CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) ASM(NumberConstructor) \
ASM(NumberConstructor_ConstructStub) \
// Define list of builtins implemented in TurboFan (with JS linkage). CPP(NumberPrototypeToExponential) \
#define BUILTIN_LIST_T(V) \ CPP(NumberPrototypeToFixed) \
V(BooleanPrototypeToString, 1) \ CPP(NumberPrototypeToLocaleString) \
V(BooleanPrototypeValueOf, 1) \ CPP(NumberPrototypeToPrecision) \
V(FunctionPrototypeHasInstance, 2) \ CPP(NumberPrototypeToString) \
V(GeneratorPrototypeNext, 2) \ TFJ(NumberPrototypeValueOf, 1) \
V(GeneratorPrototypeReturn, 2) \ /* Object */ \
V(GeneratorPrototypeThrow, 2) \ CPP(ObjectAssign) \
V(MathAcos, 2) \ CPP(ObjectCreate) \
V(MathAcosh, 2) \ CPP(ObjectDefineGetter) \
V(MathAsin, 2) \ CPP(ObjectDefineProperties) \
V(MathAsinh, 2) \ CPP(ObjectDefineProperty) \
V(MathAtan, 2) \ CPP(ObjectDefineSetter) \
V(MathAtanh, 2) \ CPP(ObjectEntries) \
V(MathAtan2, 3) \ CPP(ObjectFreeze) \
V(MathCeil, 2) \ CPP(ObjectGetOwnPropertyDescriptor) \
V(MathCbrt, 2) \ CPP(ObjectGetOwnPropertyDescriptors) \
V(MathAbs, 2) \ CPP(ObjectGetOwnPropertyNames) \
V(MathExpm1, 2) \ CPP(ObjectGetOwnPropertySymbols) \
V(MathClz32, 2) \ CPP(ObjectGetPrototypeOf) \
V(MathCos, 2) \ TFJ(ObjectHasOwnProperty, 2) \
V(MathCosh, 2) \ CPP(ObjectIs) \
V(MathExp, 2) \ CPP(ObjectIsExtensible) \
V(MathFloor, 2) \ CPP(ObjectIsFrozen) \
V(MathFround, 2) \ CPP(ObjectIsSealed) \
V(MathImul, 3) \ CPP(ObjectKeys) \
V(MathLog, 2) \ CPP(ObjectLookupGetter) \
V(MathLog1p, 2) \ CPP(ObjectLookupSetter) \
V(MathLog10, 2) \ CPP(ObjectPreventExtensions) \
V(MathLog2, 2) \ CPP(ObjectPrototypePropertyIsEnumerable) \
V(MathRound, 2) \ CPP(ObjectProtoToString) \
V(MathPow, 3) \ CPP(ObjectSeal) \
V(MathSign, 2) \ CPP(ObjectValues) \
V(MathSin, 2) \ /* Proxy */ \
V(MathSinh, 2) \ CPP(ProxyConstructor) \
V(MathTan, 2) \ CPP(ProxyConstructor_ConstructStub) \
V(MathTanh, 2) \ /* Reflect */ \
V(MathSqrt, 2) \ ASM(ReflectApply) \
V(MathTrunc, 2) \ ASM(ReflectConstruct) \
V(NumberPrototypeValueOf, 1) \ CPP(ReflectDefineProperty) \
V(ObjectHasOwnProperty, 2) \ CPP(ReflectDeleteProperty) \
V(ArrayIsArray, 2) \ CPP(ReflectGet) \
V(StringFromCharCode, 2) \ CPP(ReflectGetOwnPropertyDescriptor) \
V(StringPrototypeCharAt, 2) \ CPP(ReflectGetPrototypeOf) \
V(StringPrototypeCharCodeAt, 2) \ CPP(ReflectHas) \
V(StringPrototypeToString, 1) \ CPP(ReflectIsExtensible) \
V(StringPrototypeValueOf, 1) \ CPP(ReflectOwnKeys) \
V(SymbolPrototypeToPrimitive, 2) \ CPP(ReflectPreventExtensions) \
V(SymbolPrototypeToString, 1) \ CPP(ReflectSet) \
V(SymbolPrototypeValueOf, 1) \ CPP(ReflectSetPrototypeOf) \
V(TypedArrayPrototypeByteLength, 1) \ /* SharedArrayBuffer */ \
V(TypedArrayPrototypeByteOffset, 1) \ CPP(SharedArrayBufferPrototypeGetByteLength) \
V(TypedArrayPrototypeLength, 1) \ TFJ(AtomicsLoad, 3) \
V(AtomicsLoad, 3) \ TFJ(AtomicsStore, 4) \
V(AtomicsStore, 4) /* String */ \
ASM(StringConstructor) \
// Define list of builtins implemented in TurboFan (with CallStub linkage). ASM(StringConstructor_ConstructStub) \
#define BUILTIN_LIST_S(V) \ CPP(StringFromCodePoint) \
V(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \ TFJ(StringFromCharCode, 2) \
V(LoadGlobalIC_SlowNotInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \ TFJ(StringPrototypeCharAt, 2) \
LoadGlobalWithVector) \ TFJ(StringPrototypeCharCodeAt, 2) \
V(LoadGlobalIC_SlowInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \ TFJ(StringPrototypeToString, 1) \
LoadGlobalWithVector) \ CPP(StringPrototypeTrim) \
V(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \ CPP(StringPrototypeTrimLeft) \
V(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \ CPP(StringPrototypeTrimRight) \
V(StoreIC_Miss, BUILTIN, kNoExtraICState, VectorStoreIC) \ TFJ(StringPrototypeValueOf, 1) \
V(StoreIC_SlowSloppy, HANDLER, Code::STORE_IC, VectorStoreIC) \ /* Symbol */ \
V(StoreIC_SlowStrict, HANDLER, Code::STORE_IC, VectorStoreIC) \ CPP(SymbolConstructor) \
V(OrdinaryToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \ CPP(SymbolConstructor_ConstructStub) \
V(OrdinaryToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) \ TFJ(SymbolPrototypeToPrimitive, 2) \
V(NonPrimitiveToPrimitive_Default, BUILTIN, kNoExtraICState, TypeConversion) \ TFJ(SymbolPrototypeToString, 1) \
V(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \ TFJ(SymbolPrototypeValueOf, 1) \
V(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) /* TypedArray */ \
CPP(TypedArrayPrototypeBuffer) \
// Define list of builtin handlers implemented in assembly. TFJ(TypedArrayPrototypeByteLength, 1) \
#define BUILTIN_LIST_H(V) \ TFJ(TypedArrayPrototypeByteOffset, 1) \
V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ TFJ(TypedArrayPrototypeLength, 1)
V(KeyedStoreIC_Slow, KEYED_STORE_IC) \
V(LoadIC_Normal, LOAD_IC) \ #define IGNORE_BUILTIN(...)
V(StoreIC_Normal, STORE_IC)
#define BUILTIN_LIST_ALL(V) BUILTIN_LIST(V, V, V, V, V, V, V)
// Define list of builtins used by the debugger implemented in assembly.
#define BUILTIN_LIST_DEBUG_A(V) \ #define BUILTIN_LIST_C(V) \
V(Return_DebugBreak, BUILTIN, kNoExtraICState) \ BUILTIN_LIST(V, V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
V(Slot_DebugBreak, BUILTIN, kNoExtraICState) \ IGNORE_BUILTIN, IGNORE_BUILTIN)
V(FrameDropper_LiveEdit, BUILTIN, kNoExtraICState)
#define BUILTIN_LIST_A(V) \
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
V, V, V)
#define BUILTIN_LIST_TFS(V) \
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V, \
IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
#define BUILTIN_LIST_DBG(V) \
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
IGNORE_BUILTIN, IGNORE_BUILTIN, V)
// Forward declarations.
class CodeStubAssembler;
class BuiltinFunctionTable; class BuiltinFunctionTable;
class ObjectVisitor; class ObjectVisitor;
...@@ -411,49 +421,22 @@ class Builtins { ...@@ -411,49 +421,22 @@ class Builtins {
const char* Lookup(byte* pc); const char* Lookup(byte* pc);
enum Name { enum Name {
#define DEF_ENUM_C(name, ignore) k##name, #define DEF_ENUM(name, ...) k##name,
#define DEF_ENUM_A(name, kind, extra) k##name, BUILTIN_LIST_ALL(DEF_ENUM)
#define DEF_ENUM_T(name, argc) k##name, #undef DEF_ENUM
#define DEF_ENUM_S(name, kind, extra, interface_descriptor) k##name, builtin_count
#define DEF_ENUM_H(name, kind) k##name,
BUILTIN_LIST_C(DEF_ENUM_C)
BUILTIN_LIST_A(DEF_ENUM_A)
BUILTIN_LIST_T(DEF_ENUM_T)
BUILTIN_LIST_S(DEF_ENUM_S)
BUILTIN_LIST_H(DEF_ENUM_H)
BUILTIN_LIST_DEBUG_A(DEF_ENUM_A)
#undef DEF_ENUM_C
#undef DEF_ENUM_A
#undef DEF_ENUM_T
#undef DEF_ENUM_S
#undef DEF_ENUM_H
builtin_count
}; };
enum CFunctionId { enum CFunctionId {
#define DEF_ENUM_C(name, ignore) c_##name, #define DEF_ENUM(name) c_##name,
BUILTIN_LIST_C(DEF_ENUM_C) BUILTIN_LIST_C(DEF_ENUM)
#undef DEF_ENUM_C #undef DEF_ENUM
cfunction_count cfunction_count
}; };
#define DECLARE_BUILTIN_ACCESSOR_C(name, ignore) Handle<Code> name(); #define DECLARE_BUILTIN_ACCESSOR(name, ...) Handle<Code> name();
#define DECLARE_BUILTIN_ACCESSOR_A(name, kind, extra) Handle<Code> name(); BUILTIN_LIST_ALL(DECLARE_BUILTIN_ACCESSOR)
#define DECLARE_BUILTIN_ACCESSOR_T(name, argc) Handle<Code> name(); #undef DECLARE_BUILTIN_ACCESSOR
#define DECLARE_BUILTIN_ACCESSOR_S(name, kind, extra, interface_descriptor) \
Handle<Code> name();
#define DECLARE_BUILTIN_ACCESSOR_H(name, kind) Handle<Code> name();
BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C)
BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A)
BUILTIN_LIST_T(DECLARE_BUILTIN_ACCESSOR_T)
BUILTIN_LIST_S(DECLARE_BUILTIN_ACCESSOR_S)
BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H)
BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A)
#undef DECLARE_BUILTIN_ACCESSOR_C
#undef DECLARE_BUILTIN_ACCESSOR_A
#undef DECLARE_BUILTIN_ACCESSOR_T
#undef DECLARE_BUILTIN_ACCESSOR_S
#undef DECLARE_BUILTIN_ACCESSOR_H
// Convenience wrappers. // Convenience wrappers.
Handle<Code> CallFunction( Handle<Code> CallFunction(
......
...@@ -318,7 +318,7 @@ void RuntimeCallStats::Print(std::ostream& os) { ...@@ -318,7 +318,7 @@ void RuntimeCallStats::Print(std::ostream& os) {
FOR_EACH_INTRINSIC(PRINT_COUNTER) FOR_EACH_INTRINSIC(PRINT_COUNTER)
#undef PRINT_COUNTER #undef PRINT_COUNTER
#define PRINT_COUNTER(name, ignore) entries.Add(&this->Builtin_##name); #define PRINT_COUNTER(name) entries.Add(&this->Builtin_##name);
BUILTIN_LIST_C(PRINT_COUNTER) BUILTIN_LIST_C(PRINT_COUNTER)
#undef PRINT_COUNTER #undef PRINT_COUNTER
...@@ -343,7 +343,7 @@ void RuntimeCallStats::Reset() { ...@@ -343,7 +343,7 @@ void RuntimeCallStats::Reset() {
FOR_EACH_INTRINSIC(RESET_COUNTER) FOR_EACH_INTRINSIC(RESET_COUNTER)
#undef RESET_COUNTER #undef RESET_COUNTER
#define RESET_COUNTER(name, ignore) this->Builtin_##name.Reset(); #define RESET_COUNTER(name) this->Builtin_##name.Reset();
BUILTIN_LIST_C(RESET_COUNTER) BUILTIN_LIST_C(RESET_COUNTER)
#undef RESET_COUNTER #undef RESET_COUNTER
......
...@@ -748,7 +748,7 @@ class RuntimeCallStats { ...@@ -748,7 +748,7 @@ class RuntimeCallStats {
RuntimeCallCounter Runtime_##name = RuntimeCallCounter(#name); RuntimeCallCounter Runtime_##name = RuntimeCallCounter(#name);
FOR_EACH_INTRINSIC(CALL_RUNTIME_COUNTER) FOR_EACH_INTRINSIC(CALL_RUNTIME_COUNTER)
#undef CALL_RUNTIME_COUNTER #undef CALL_RUNTIME_COUNTER
#define CALL_BUILTIN_COUNTER(name, ignore) \ #define CALL_BUILTIN_COUNTER(name) \
RuntimeCallCounter Builtin_##name = RuntimeCallCounter(#name); RuntimeCallCounter Builtin_##name = RuntimeCallCounter(#name);
BUILTIN_LIST_C(CALL_BUILTIN_COUNTER) BUILTIN_LIST_C(CALL_BUILTIN_COUNTER)
#undef CALL_BUILTIN_COUNTER #undef CALL_BUILTIN_COUNTER
......
...@@ -248,9 +248,9 @@ ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) { ...@@ -248,9 +248,9 @@ ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) {
}; };
static const RefTableEntry c_builtins[] = { static const RefTableEntry c_builtins[] = {
#define DEF_ENTRY_C(name, ignore) {Builtins::c_##name, "Builtins::" #name}, #define DEF_ENTRY(name) {Builtins::c_##name, "Builtins::" #name},
BUILTIN_LIST_C(DEF_ENTRY_C) BUILTIN_LIST_C(DEF_ENTRY)
#undef DEF_ENTRY_C #undef DEF_ENTRY
}; };
for (unsigned i = 0; i < arraysize(c_builtins); ++i) { for (unsigned i = 0; i < arraysize(c_builtins); ++i) {
...@@ -260,12 +260,9 @@ ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) { ...@@ -260,12 +260,9 @@ ExternalReferenceTable::ExternalReferenceTable(Isolate* isolate) {
} }
static const RefTableEntry builtins[] = { static const RefTableEntry builtins[] = {
#define DEF_ENTRY_C(name, ignore) {Builtins::k##name, "Builtins::" #name}, #define DEF_ENTRY(name, ...) {Builtins::k##name, "Builtins::" #name},
#define DEF_ENTRY_A(name, i1, i2) {Builtins::k##name, "Builtins::" #name}, BUILTIN_LIST_C(DEF_ENTRY) BUILTIN_LIST_A(DEF_ENTRY)
BUILTIN_LIST_C(DEF_ENTRY_C) BUILTIN_LIST_A(DEF_ENTRY_A) #undef DEF_ENTRY
BUILTIN_LIST_DEBUG_A(DEF_ENTRY_A)
#undef DEF_ENTRY_C
#undef DEF_ENTRY_A
}; };
for (unsigned i = 0; i < arraysize(builtins); ++i) { for (unsigned i = 0; i < arraysize(builtins); ++i) {
......
...@@ -5172,8 +5172,8 @@ bool Code::is_inline_cache_stub() { ...@@ -5172,8 +5172,8 @@ bool Code::is_inline_cache_stub() {
bool Code::is_debug_stub() { bool Code::is_debug_stub() {
if (kind() != BUILTIN) return false; if (kind() != BUILTIN) return false;
switch (builtin_index()) { switch (builtin_index()) {
#define CASE_DEBUG_BUILTIN(name, kind, extra) case Builtins::k##name: #define CASE_DEBUG_BUILTIN(name) case Builtins::k##name:
BUILTIN_LIST_DEBUG_A(CASE_DEBUG_BUILTIN) BUILTIN_LIST_DBG(CASE_DEBUG_BUILTIN)
#undef CASE_DEBUG_BUILTIN #undef CASE_DEBUG_BUILTIN
return true; return true;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment