[builtins] Associate ASM builtins with descriptors
Post-stub-to-builtin migration, all explicit connection between descriptors and their associated ASM code has been lost. This restores the connection where possible. Builtins without an associated descriptor are marked with the DummyDescriptor. Drive-by: alpha-sort the descriptor list. Drive-by: use Builtins::CallableFor in code factory. Bug: v8:8562, v8:8553 Change-Id: If1f13bbaf7e42453b3235cc97c58ada91b5fa7b8 Reviewed-on: https://chromium-review.googlesource.com/c/1373552 Reviewed-by: Igor Sheludko <ishell@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#58212}
This commit is contained in:
parent
996cf21954
commit
e61d3564e7
1
BUILD.gn
1
BUILD.gn
@ -1700,7 +1700,6 @@ v8_source_set("v8_base") {
|
||||
"src/builtins/builtins-function.cc",
|
||||
"src/builtins/builtins-global.cc",
|
||||
"src/builtins/builtins-internal.cc",
|
||||
"src/builtins/builtins-interpreter.cc",
|
||||
"src/builtins/builtins-intl.cc",
|
||||
"src/builtins/builtins-json.cc",
|
||||
"src/builtins/builtins-math.cc",
|
||||
|
@ -28,7 +28,10 @@ namespace internal {
|
||||
// BCH: Bytecode Handlers, with bytecode dispatch linkage.
|
||||
// Args: name, OperandScale, Bytecode
|
||||
// ASM: Builtin in platform-dependent assembly.
|
||||
// Args: name
|
||||
// Args: name, interface descriptor
|
||||
|
||||
// TODO(jgruber): Remove DummyDescriptor once all ASM builtins have been
|
||||
// properly associated with their descriptor.
|
||||
|
||||
#define BUILTIN_LIST_BASE(CPP, API, TFJ, TFC, TFS, TFH, ASM) \
|
||||
/* GC write barrirer */ \
|
||||
@ -39,41 +42,41 @@ namespace internal {
|
||||
TFC(AdaptorWithBuiltinExitFrame, CppBuiltinAdaptor, 1) \
|
||||
\
|
||||
/* Calls */ \
|
||||
ASM(ArgumentsAdaptorTrampoline) \
|
||||
ASM(ArgumentsAdaptorTrampoline, ArgumentsAdaptor) \
|
||||
/* ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) */ \
|
||||
ASM(CallFunction_ReceiverIsNullOrUndefined) \
|
||||
ASM(CallFunction_ReceiverIsNotNullOrUndefined) \
|
||||
ASM(CallFunction_ReceiverIsAny) \
|
||||
ASM(CallFunction_ReceiverIsNullOrUndefined, CallTrampoline) \
|
||||
ASM(CallFunction_ReceiverIsNotNullOrUndefined, CallTrampoline) \
|
||||
ASM(CallFunction_ReceiverIsAny, CallTrampoline) \
|
||||
/* ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) */ \
|
||||
ASM(CallBoundFunction) \
|
||||
ASM(CallBoundFunction, Dummy) \
|
||||
/* ES6 section 7.3.12 Call(F, V, [argumentsList]) */ \
|
||||
ASM(Call_ReceiverIsNullOrUndefined) \
|
||||
ASM(Call_ReceiverIsNotNullOrUndefined) \
|
||||
ASM(Call_ReceiverIsAny) \
|
||||
ASM(Call_ReceiverIsNullOrUndefined, CallTrampoline) \
|
||||
ASM(Call_ReceiverIsNotNullOrUndefined, CallTrampoline) \
|
||||
ASM(Call_ReceiverIsAny, CallTrampoline) \
|
||||
\
|
||||
/* ES6 section 9.5.12[[Call]] ( thisArgument, argumentsList ) */ \
|
||||
TFC(CallProxy, CallTrampoline, 1) \
|
||||
ASM(CallVarargs) \
|
||||
ASM(CallVarargs, CallVarargs) \
|
||||
TFC(CallWithSpread, CallWithSpread, 1) \
|
||||
TFC(CallWithArrayLike, CallWithArrayLike, 1) \
|
||||
ASM(CallForwardVarargs) \
|
||||
ASM(CallFunctionForwardVarargs) \
|
||||
ASM(CallForwardVarargs, CallForwardVarargs) \
|
||||
ASM(CallFunctionForwardVarargs, CallForwardVarargs) \
|
||||
\
|
||||
/* Construct */ \
|
||||
/* ES6 section 9.2.2 [[Construct]] ( argumentsList, newTarget) */ \
|
||||
ASM(ConstructFunction) \
|
||||
ASM(ConstructFunction, JSTrampoline) \
|
||||
/* ES6 section 9.4.1.2 [[Construct]] (argumentsList, newTarget) */ \
|
||||
ASM(ConstructBoundFunction) \
|
||||
ASM(ConstructedNonConstructable) \
|
||||
ASM(ConstructBoundFunction, Dummy) \
|
||||
ASM(ConstructedNonConstructable, Dummy) \
|
||||
/* ES6 section 7.3.13 Construct (F, [argumentsList], [newTarget]) */ \
|
||||
ASM(Construct) \
|
||||
ASM(ConstructVarargs) \
|
||||
ASM(Construct, JSTrampoline) \
|
||||
ASM(ConstructVarargs, ConstructVarargs) \
|
||||
TFC(ConstructWithSpread, ConstructWithSpread, 1) \
|
||||
TFC(ConstructWithArrayLike, ConstructWithArrayLike, 1) \
|
||||
ASM(ConstructForwardVarargs) \
|
||||
ASM(ConstructFunctionForwardVarargs) \
|
||||
ASM(JSConstructStubGeneric) \
|
||||
ASM(JSBuiltinsConstructStub) \
|
||||
ASM(ConstructForwardVarargs, ConstructForwardVarargs) \
|
||||
ASM(ConstructFunctionForwardVarargs, ConstructForwardVarargs) \
|
||||
ASM(JSConstructStubGeneric, Dummy) \
|
||||
ASM(JSBuiltinsConstructStub, Dummy) \
|
||||
TFC(FastNewObject, FastNewObject, 1) \
|
||||
TFS(FastNewClosure, kSharedFunctionInfo, kFeedbackCell) \
|
||||
TFC(FastNewFunctionContextEval, FastNewFunctionContext, 1) \
|
||||
@ -87,16 +90,16 @@ namespace internal {
|
||||
TFC(ConstructProxy, JSTrampoline, 1) \
|
||||
\
|
||||
/* Apply and entries */ \
|
||||
ASM(JSEntry) \
|
||||
ASM(JSConstructEntry) \
|
||||
ASM(JSRunMicrotasksEntry) \
|
||||
ASM(JSEntryTrampoline) \
|
||||
ASM(JSConstructEntryTrampoline) \
|
||||
ASM(ResumeGeneratorTrampoline) \
|
||||
ASM(JSEntry, Dummy) \
|
||||
ASM(JSConstructEntry, Dummy) \
|
||||
ASM(JSRunMicrotasksEntry, Dummy) \
|
||||
ASM(JSEntryTrampoline, Dummy) \
|
||||
ASM(JSConstructEntryTrampoline, Dummy) \
|
||||
ASM(ResumeGeneratorTrampoline, ResumeGenerator) \
|
||||
\
|
||||
/* Stack and interrupt check */ \
|
||||
ASM(InterruptCheck) \
|
||||
ASM(StackCheck) \
|
||||
ASM(InterruptCheck, Dummy) \
|
||||
ASM(StackCheck, Dummy) \
|
||||
\
|
||||
/* String helpers */ \
|
||||
TFC(StringCharAt, StringAt, 1) \
|
||||
@ -115,22 +118,24 @@ namespace internal {
|
||||
TFS(OrderedHashTableHealIndex, kTable, kIndex) \
|
||||
\
|
||||
/* Interpreter */ \
|
||||
ASM(InterpreterEntryTrampoline) \
|
||||
ASM(InterpreterPushArgsThenCall) \
|
||||
ASM(InterpreterPushUndefinedAndArgsThenCall) \
|
||||
ASM(InterpreterPushArgsThenCallWithFinalSpread) \
|
||||
ASM(InterpreterPushArgsThenConstruct) \
|
||||
ASM(InterpreterPushArgsThenConstructArrayFunction) \
|
||||
ASM(InterpreterPushArgsThenConstructWithFinalSpread) \
|
||||
ASM(InterpreterEnterBytecodeAdvance) \
|
||||
ASM(InterpreterEnterBytecodeDispatch) \
|
||||
ASM(InterpreterOnStackReplacement) \
|
||||
ASM(InterpreterEntryTrampoline, Dummy) \
|
||||
ASM(InterpreterPushArgsThenCall, InterpreterPushArgsThenCall) \
|
||||
ASM(InterpreterPushUndefinedAndArgsThenCall, InterpreterPushArgsThenCall) \
|
||||
ASM(InterpreterPushArgsThenCallWithFinalSpread, InterpreterPushArgsThenCall) \
|
||||
ASM(InterpreterPushArgsThenConstruct, InterpreterPushArgsThenConstruct) \
|
||||
ASM(InterpreterPushArgsThenConstructArrayFunction, \
|
||||
InterpreterPushArgsThenConstruct) \
|
||||
ASM(InterpreterPushArgsThenConstructWithFinalSpread, \
|
||||
InterpreterPushArgsThenConstruct) \
|
||||
ASM(InterpreterEnterBytecodeAdvance, Dummy) \
|
||||
ASM(InterpreterEnterBytecodeDispatch, Dummy) \
|
||||
ASM(InterpreterOnStackReplacement, ContextOnly) \
|
||||
\
|
||||
/* Code life-cycle */ \
|
||||
TFC(CompileLazy, JSTrampoline, 1) \
|
||||
TFC(CompileLazyDeoptimizedCode, JSTrampoline, 1) \
|
||||
ASM(InstantiateAsmJs) \
|
||||
ASM(NotifyDeoptimized) \
|
||||
ASM(InstantiateAsmJs, Dummy) \
|
||||
ASM(NotifyDeoptimized, Dummy) \
|
||||
\
|
||||
/* Trampolines called when returning from a deoptimization that expects */ \
|
||||
/* to continue in a JavaScript builtin to finish the functionality of a */ \
|
||||
@ -152,14 +157,14 @@ namespace internal {
|
||||
/* stack parameter to the JavaScript builtin by the "WithResult" */ \
|
||||
/* trampoline variant. The plain variant is used in EAGER deopt contexts */ \
|
||||
/* and has no such special handling. */ \
|
||||
ASM(ContinueToCodeStubBuiltin) \
|
||||
ASM(ContinueToCodeStubBuiltinWithResult) \
|
||||
ASM(ContinueToJavaScriptBuiltin) \
|
||||
ASM(ContinueToJavaScriptBuiltinWithResult) \
|
||||
ASM(ContinueToCodeStubBuiltin, Dummy) \
|
||||
ASM(ContinueToCodeStubBuiltinWithResult, Dummy) \
|
||||
ASM(ContinueToJavaScriptBuiltin, Dummy) \
|
||||
ASM(ContinueToJavaScriptBuiltinWithResult, Dummy) \
|
||||
\
|
||||
/* API callback handling */ \
|
||||
ASM(CallApiCallback) \
|
||||
ASM(CallApiGetter) \
|
||||
ASM(CallApiCallback, ApiCallback) \
|
||||
ASM(CallApiGetter, ApiGetter) \
|
||||
API(HandleApiCall) \
|
||||
API(HandleApiCallAsFunction) \
|
||||
API(HandleApiCallAsConstructor) \
|
||||
@ -176,8 +181,8 @@ namespace internal {
|
||||
\
|
||||
/* Debugger */ \
|
||||
TFJ(DebugBreakTrampoline, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
|
||||
ASM(FrameDropperTrampoline) \
|
||||
ASM(HandleDebuggerStatement) \
|
||||
ASM(FrameDropperTrampoline, FrameDropperTrampoline) \
|
||||
ASM(HandleDebuggerStatement, ContextOnly) \
|
||||
\
|
||||
/* Type conversions */ \
|
||||
TFC(ToObject, TypeConversion, 1) \
|
||||
@ -301,8 +306,8 @@ namespace internal {
|
||||
TFC(ArraySingleArgumentConstructor_HoleyDouble_DisableAllocationSites, \
|
||||
ArraySingleArgumentConstructor, 1) \
|
||||
TFC(ArrayNArgumentsConstructor, ArrayNArgumentsConstructor, 1) \
|
||||
ASM(InternalArrayConstructor) \
|
||||
ASM(InternalArrayConstructorImpl) \
|
||||
ASM(InternalArrayConstructor, Dummy) \
|
||||
ASM(InternalArrayConstructorImpl, Dummy) \
|
||||
TFC(InternalArrayNoArgumentConstructor_Packed, ArrayNoArgumentConstructor, \
|
||||
1) \
|
||||
CPP(ArrayConcat) \
|
||||
@ -599,12 +604,12 @@ namespace internal {
|
||||
\
|
||||
/* Function */ \
|
||||
CPP(FunctionConstructor) \
|
||||
ASM(FunctionPrototypeApply) \
|
||||
ASM(FunctionPrototypeApply, Dummy) \
|
||||
CPP(FunctionPrototypeBind) \
|
||||
/* ES6 #sec-function.prototype.bind */ \
|
||||
TFJ(FastFunctionPrototypeBind, \
|
||||
SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
|
||||
ASM(FunctionPrototypeCall) \
|
||||
ASM(FunctionPrototypeCall, Dummy) \
|
||||
/* ES6 #sec-function.prototype-@@hasinstance */ \
|
||||
TFJ(FunctionPrototypeHasInstance, 1, kReceiver, kV) \
|
||||
/* ES6 #sec-function.prototype.tostring */ \
|
||||
@ -931,8 +936,8 @@ namespace internal {
|
||||
TFS(ProxySetProperty, kProxy, kName, kValue, kReceiverValue, kLanguageMode) \
|
||||
\
|
||||
/* Reflect */ \
|
||||
ASM(ReflectApply) \
|
||||
ASM(ReflectConstruct) \
|
||||
ASM(ReflectApply, Dummy) \
|
||||
ASM(ReflectConstruct, Dummy) \
|
||||
CPP(ReflectDefineProperty) \
|
||||
CPP(ReflectDeleteProperty) \
|
||||
CPP(ReflectGet) \
|
||||
@ -1237,7 +1242,7 @@ namespace internal {
|
||||
TFJ(TypedArrayFrom, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
|
||||
\
|
||||
/* Wasm */ \
|
||||
ASM(WasmCompileLazy) \
|
||||
ASM(WasmCompileLazy, Dummy) \
|
||||
TFC(WasmAllocateHeapNumber, AllocateHeapNumber, 1) \
|
||||
TFC(WasmAtomicWake, WasmAtomicWake, 1) \
|
||||
TFC(WasmI32AtomicWait, WasmI32AtomicWait, 1) \
|
||||
@ -1327,17 +1332,17 @@ namespace internal {
|
||||
TFJ(AsyncIteratorValueUnwrap, 1, kReceiver, kValue) \
|
||||
\
|
||||
/* CEntry */ \
|
||||
ASM(CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit) \
|
||||
ASM(CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit) \
|
||||
ASM(CEntry_Return1_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit) \
|
||||
ASM(CEntry_Return1_SaveFPRegs_ArgvOnStack_NoBuiltinExit) \
|
||||
ASM(CEntry_Return1_SaveFPRegs_ArgvOnStack_BuiltinExit) \
|
||||
ASM(CEntry_Return2_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit) \
|
||||
ASM(CEntry_Return2_DontSaveFPRegs_ArgvOnStack_BuiltinExit) \
|
||||
ASM(CEntry_Return2_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit) \
|
||||
ASM(CEntry_Return2_SaveFPRegs_ArgvOnStack_NoBuiltinExit) \
|
||||
ASM(CEntry_Return2_SaveFPRegs_ArgvOnStack_BuiltinExit) \
|
||||
ASM(DirectCEntry) \
|
||||
ASM(CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return1_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return1_SaveFPRegs_ArgvOnStack_NoBuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return1_SaveFPRegs_ArgvOnStack_BuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return2_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return2_DontSaveFPRegs_ArgvOnStack_BuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return2_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return2_SaveFPRegs_ArgvOnStack_NoBuiltinExit, Dummy) \
|
||||
ASM(CEntry_Return2_SaveFPRegs_ArgvOnStack_BuiltinExit, Dummy) \
|
||||
ASM(DirectCEntry, Dummy) \
|
||||
\
|
||||
/* String helpers */ \
|
||||
TFS(StringAdd_CheckNone, kLeft, kRight) \
|
||||
@ -1346,11 +1351,11 @@ namespace internal {
|
||||
TFS(SubString, kString, kFrom, kTo) \
|
||||
\
|
||||
/* Miscellaneous */ \
|
||||
ASM(DoubleToI) \
|
||||
ASM(DoubleToI, Dummy) \
|
||||
TFC(GetProperty, GetProperty, 1) \
|
||||
TFS(SetProperty, kReceiver, kKey, kValue) \
|
||||
TFS(SetPropertyInLiteral, kReceiver, kKey, kValue) \
|
||||
ASM(MathPowInternal) \
|
||||
ASM(MathPowInternal, Dummy) \
|
||||
\
|
||||
/* Trace */ \
|
||||
CPP(IsTraceCategoryEnabled) \
|
||||
|
@ -41,14 +41,19 @@ namespace internal {
|
||||
#define DEFINE_TFH_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor) \
|
||||
typedef InterfaceDescriptor##Descriptor Builtin_##Name##_InterfaceDescriptor;
|
||||
|
||||
#define DEFINE_ASM_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor) \
|
||||
typedef InterfaceDescriptor##Descriptor Builtin_##Name##_InterfaceDescriptor;
|
||||
|
||||
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DEFINE_TFJ_INTERFACE_DESCRIPTOR,
|
||||
DEFINE_TFC_INTERFACE_DESCRIPTOR, DEFINE_TFS_INTERFACE_DESCRIPTOR,
|
||||
DEFINE_TFH_INTERFACE_DESCRIPTOR, IGNORE_BUILTIN, IGNORE_BUILTIN)
|
||||
DEFINE_TFH_INTERFACE_DESCRIPTOR, IGNORE_BUILTIN,
|
||||
DEFINE_ASM_INTERFACE_DESCRIPTOR)
|
||||
|
||||
#undef DEFINE_TFJ_INTERFACE_DESCRIPTOR
|
||||
#undef DEFINE_TFC_INTERFACE_DESCRIPTOR
|
||||
#undef DEFINE_TFS_INTERFACE_DESCRIPTOR
|
||||
#undef DEFINE_TFH_INTERFACE_DESCRIPTOR
|
||||
#undef DEFINE_ASM_INTERFACE_DESCRIPTOR
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
@ -1,49 +0,0 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "src/builtins/builtins-utils.h"
|
||||
#include "src/builtins/builtins.h"
|
||||
#include "src/globals.h"
|
||||
#include "src/handles-inl.h"
|
||||
#include "src/objects-inl.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
Handle<Code> Builtins::InterpreterPushArgsThenCall(
|
||||
ConvertReceiverMode receiver_mode, InterpreterPushArgsMode mode) {
|
||||
switch (mode) {
|
||||
case InterpreterPushArgsMode::kArrayFunction:
|
||||
// There is no special-case handling of calls to Array. They will all go
|
||||
// through the kOther case below.
|
||||
UNREACHABLE();
|
||||
case InterpreterPushArgsMode::kWithFinalSpread:
|
||||
return builtin_handle(kInterpreterPushArgsThenCallWithFinalSpread);
|
||||
case InterpreterPushArgsMode::kOther:
|
||||
switch (receiver_mode) {
|
||||
case ConvertReceiverMode::kNullOrUndefined:
|
||||
return builtin_handle(kInterpreterPushUndefinedAndArgsThenCall);
|
||||
case ConvertReceiverMode::kNotNullOrUndefined:
|
||||
case ConvertReceiverMode::kAny:
|
||||
return builtin_handle(kInterpreterPushArgsThenCall);
|
||||
}
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
Handle<Code> Builtins::InterpreterPushArgsThenConstruct(
|
||||
InterpreterPushArgsMode mode) {
|
||||
switch (mode) {
|
||||
case InterpreterPushArgsMode::kArrayFunction:
|
||||
return builtin_handle(kInterpreterPushArgsThenConstructArrayFunction);
|
||||
case InterpreterPushArgsMode::kWithFinalSpread:
|
||||
return builtin_handle(kInterpreterPushArgsThenConstructWithFinalSpread);
|
||||
case InterpreterPushArgsMode::kOther:
|
||||
return builtin_handle(kInterpreterPushArgsThenConstruct);
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
@ -101,18 +101,6 @@ const char* Builtins::Lookup(Address pc) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Handle<Code> Builtins::NewFunctionContext(ScopeType scope_type) {
|
||||
switch (scope_type) {
|
||||
case ScopeType::EVAL_SCOPE:
|
||||
return builtin_handle(kFastNewFunctionContextEval);
|
||||
case ScopeType::FUNCTION_SCOPE:
|
||||
return builtin_handle(kFastNewFunctionContextFunction);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
return Handle<Code>::null();
|
||||
}
|
||||
|
||||
Handle<Code> Builtins::NonPrimitiveToPrimitive(ToPrimitiveHint hint) {
|
||||
switch (hint) {
|
||||
case ToPrimitiveHint::kDefault:
|
||||
@ -166,7 +154,7 @@ Callable Builtins::CallableFor(Isolate* isolate, Name name) {
|
||||
break; \
|
||||
}
|
||||
BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, CASE_OTHER,
|
||||
CASE_OTHER, CASE_OTHER, IGNORE_BUILTIN, IGNORE_BUILTIN)
|
||||
CASE_OTHER, CASE_OTHER, IGNORE_BUILTIN, CASE_OTHER)
|
||||
#undef CASE_OTHER
|
||||
default:
|
||||
Builtins::Kind kind = Builtins::KindOf(name);
|
||||
|
@ -76,10 +76,6 @@ class Builtins {
|
||||
Handle<Code> NonPrimitiveToPrimitive(
|
||||
ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
|
||||
Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint);
|
||||
Handle<Code> InterpreterPushArgsThenCall(ConvertReceiverMode receiver_mode,
|
||||
InterpreterPushArgsMode mode);
|
||||
Handle<Code> InterpreterPushArgsThenConstruct(InterpreterPushArgsMode mode);
|
||||
Handle<Code> NewFunctionContext(ScopeType scope_type);
|
||||
Handle<Code> JSConstructStubGeneric();
|
||||
|
||||
// Used by CreateOffHeapTrampolines in isolate.cc.
|
||||
|
@ -335,7 +335,7 @@ void SetupIsolateDelegate::SetupBuiltinsInternal(Isolate* isolate) {
|
||||
OperandScale, Bytecode); \
|
||||
AddBuiltin(builtins, index++, code);
|
||||
|
||||
#define BUILD_ASM(Name) \
|
||||
#define BUILD_ASM(Name, InterfaceDescriptor) \
|
||||
code = BuildWithMacroAssembler(isolate, index, Builtins::Generate_##Name, \
|
||||
#Name); \
|
||||
AddBuiltin(builtins, index++, code);
|
||||
|
@ -59,43 +59,41 @@ Handle<Code> CodeFactory::CEntry(Isolate* isolate, int result_size,
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ApiGetter(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallApiGetter), ApiGetterDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallApiGetter);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::CallApiCallback(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallApiCallback),
|
||||
ApiCallbackDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallApiCallback);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) {
|
||||
return Callable(
|
||||
typeof_mode == NOT_INSIDE_TYPEOF
|
||||
? BUILTIN_CODE(isolate, LoadGlobalICTrampoline)
|
||||
: BUILTIN_CODE(isolate, LoadGlobalICInsideTypeofTrampoline),
|
||||
LoadGlobalDescriptor{});
|
||||
return typeof_mode == NOT_INSIDE_TYPEOF
|
||||
? Builtins::CallableFor(isolate, Builtins::kLoadGlobalICTrampoline)
|
||||
: Builtins::CallableFor(
|
||||
isolate, Builtins::kLoadGlobalICInsideTypeofTrampoline);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate,
|
||||
TypeofMode typeof_mode) {
|
||||
return Callable(typeof_mode == NOT_INSIDE_TYPEOF
|
||||
? BUILTIN_CODE(isolate, LoadGlobalIC)
|
||||
: BUILTIN_CODE(isolate, LoadGlobalICInsideTypeof),
|
||||
LoadGlobalWithVectorDescriptor{});
|
||||
return typeof_mode == NOT_INSIDE_TYPEOF
|
||||
? Builtins::CallableFor(isolate, Builtins::kLoadGlobalIC)
|
||||
: Builtins::CallableFor(isolate,
|
||||
Builtins::kLoadGlobalICInsideTypeof);
|
||||
}
|
||||
|
||||
Callable CodeFactory::StoreOwnIC(Isolate* isolate) {
|
||||
// TODO(ishell): Currently we use StoreOwnIC only for storing properties that
|
||||
// already exist in the boilerplate therefore we can use StoreIC.
|
||||
return Callable(BUILTIN_CODE(isolate, StoreICTrampoline), StoreDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kStoreICTrampoline);
|
||||
}
|
||||
|
||||
Callable CodeFactory::StoreOwnICInOptimizedCode(Isolate* isolate) {
|
||||
// TODO(ishell): Currently we use StoreOwnIC only for storing properties that
|
||||
// already exist in the boilerplate therefore we can use StoreIC.
|
||||
return Callable(BUILTIN_CODE(isolate, StoreIC), StoreWithVectorDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kStoreIC);
|
||||
}
|
||||
|
||||
Callable CodeFactory::KeyedStoreIC_SloppyArguments(Isolate* isolate,
|
||||
@ -277,33 +275,37 @@ Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags) {
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ResumeGenerator(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ResumeGeneratorTrampoline),
|
||||
ResumeGeneratorDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kResumeGeneratorTrampoline);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::FrameDropperTrampoline(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, FrameDropperTrampoline),
|
||||
FrameDropperTrampolineDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kFrameDropperTrampoline);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::HandleDebuggerStatement(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, HandleDebuggerStatement),
|
||||
ContextOnlyDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kHandleDebuggerStatement);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
|
||||
ScopeType scope_type) {
|
||||
return Callable(isolate->builtins()->NewFunctionContext(scope_type),
|
||||
FastNewFunctionContextDescriptor{});
|
||||
switch (scope_type) {
|
||||
case ScopeType::EVAL_SCOPE:
|
||||
return Builtins::CallableFor(isolate,
|
||||
Builtins::kFastNewFunctionContextEval);
|
||||
case ScopeType::FUNCTION_SCOPE:
|
||||
return Builtins::CallableFor(isolate,
|
||||
Builtins::kFastNewFunctionContextFunction);
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ArgumentsAdaptorTrampoline),
|
||||
ArgumentsAdaptorDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kArgumentsAdaptorTrampoline);
|
||||
}
|
||||
|
||||
// static
|
||||
@ -313,14 +315,12 @@ Callable CodeFactory::Call(Isolate* isolate, ConvertReceiverMode mode) {
|
||||
|
||||
// static
|
||||
Callable CodeFactory::CallWithArrayLike(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallWithArrayLike),
|
||||
CallWithArrayLikeDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallWithArrayLike);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::CallWithSpread(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallWithSpread),
|
||||
CallWithSpreadDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallWithSpread);
|
||||
}
|
||||
|
||||
// static
|
||||
@ -331,70 +331,91 @@ Callable CodeFactory::CallFunction(Isolate* isolate, ConvertReceiverMode mode) {
|
||||
|
||||
// static
|
||||
Callable CodeFactory::CallVarargs(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallVarargs), CallVarargsDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallVarargs);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::CallForwardVarargs(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallForwardVarargs),
|
||||
CallForwardVarargsDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallForwardVarargs);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::CallFunctionForwardVarargs(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, CallFunctionForwardVarargs),
|
||||
CallForwardVarargsDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kCallFunctionForwardVarargs);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::Construct(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, Construct), JSTrampolineDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kConstruct);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ConstructWithSpread(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ConstructWithSpread),
|
||||
ConstructWithSpreadDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kConstructWithSpread);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ConstructFunction(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ConstructFunction),
|
||||
JSTrampolineDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kConstructFunction);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ConstructVarargs(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ConstructVarargs),
|
||||
ConstructVarargsDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kConstructVarargs);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ConstructForwardVarargs(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ConstructForwardVarargs),
|
||||
ConstructForwardVarargsDescriptor{});
|
||||
return Builtins::CallableFor(isolate, Builtins::kConstructForwardVarargs);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ConstructFunctionForwardVarargs(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, ConstructFunctionForwardVarargs),
|
||||
ConstructForwardVarargsDescriptor{});
|
||||
return Builtins::CallableFor(isolate,
|
||||
Builtins::kConstructFunctionForwardVarargs);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::InterpreterPushArgsThenCall(
|
||||
Isolate* isolate, ConvertReceiverMode receiver_mode,
|
||||
InterpreterPushArgsMode mode) {
|
||||
return Callable(
|
||||
isolate->builtins()->InterpreterPushArgsThenCall(receiver_mode, mode),
|
||||
InterpreterPushArgsThenCallDescriptor{});
|
||||
switch (mode) {
|
||||
case InterpreterPushArgsMode::kArrayFunction:
|
||||
// There is no special-case handling of calls to Array. They will all go
|
||||
// through the kOther case below.
|
||||
UNREACHABLE();
|
||||
case InterpreterPushArgsMode::kWithFinalSpread:
|
||||
return Builtins::CallableFor(
|
||||
isolate, Builtins::kInterpreterPushArgsThenCallWithFinalSpread);
|
||||
case InterpreterPushArgsMode::kOther:
|
||||
switch (receiver_mode) {
|
||||
case ConvertReceiverMode::kNullOrUndefined:
|
||||
return Builtins::CallableFor(
|
||||
isolate, Builtins::kInterpreterPushUndefinedAndArgsThenCall);
|
||||
case ConvertReceiverMode::kNotNullOrUndefined:
|
||||
case ConvertReceiverMode::kAny:
|
||||
return Builtins::CallableFor(isolate,
|
||||
Builtins::kInterpreterPushArgsThenCall);
|
||||
}
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::InterpreterPushArgsThenConstruct(
|
||||
Isolate* isolate, InterpreterPushArgsMode mode) {
|
||||
return Callable(isolate->builtins()->InterpreterPushArgsThenConstruct(mode),
|
||||
InterpreterPushArgsThenConstructDescriptor{});
|
||||
switch (mode) {
|
||||
case InterpreterPushArgsMode::kArrayFunction:
|
||||
return Builtins::CallableFor(
|
||||
isolate, Builtins::kInterpreterPushArgsThenConstructArrayFunction);
|
||||
case InterpreterPushArgsMode::kWithFinalSpread:
|
||||
return Builtins::CallableFor(
|
||||
isolate, Builtins::kInterpreterPushArgsThenConstructWithFinalSpread);
|
||||
case InterpreterPushArgsMode::kOther:
|
||||
return Builtins::CallableFor(isolate,
|
||||
Builtins::kInterpreterPushArgsThenConstruct);
|
||||
}
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
// static
|
||||
@ -413,20 +434,19 @@ Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) {
|
||||
|
||||
// static
|
||||
Callable CodeFactory::InterpreterOnStackReplacement(Isolate* isolate) {
|
||||
return Callable(BUILTIN_CODE(isolate, InterpreterOnStackReplacement),
|
||||
ContextOnlyDescriptor{});
|
||||
return Builtins::CallableFor(isolate,
|
||||
Builtins::kInterpreterOnStackReplacement);
|
||||
}
|
||||
|
||||
// static
|
||||
Callable CodeFactory::ArrayNoArgumentConstructor(
|
||||
Isolate* isolate, ElementsKind kind,
|
||||
AllocationSiteOverrideMode override_mode) {
|
||||
#define CASE(kind_caps, kind_camel, mode_camel) \
|
||||
case kind_caps: \
|
||||
return Callable( \
|
||||
BUILTIN_CODE(isolate, \
|
||||
ArrayNoArgumentConstructor_##kind_camel##_##mode_camel), \
|
||||
ArrayNoArgumentConstructorDescriptor{})
|
||||
#define CASE(kind_caps, kind_camel, mode_camel) \
|
||||
case kind_caps: \
|
||||
return Builtins::CallableFor( \
|
||||
isolate, \
|
||||
Builtins::kArrayNoArgumentConstructor_##kind_camel##_##mode_camel);
|
||||
if (override_mode == DONT_OVERRIDE && AllocationSite::ShouldTrack(kind)) {
|
||||
DCHECK(IsSmiElementsKind(kind));
|
||||
switch (kind) {
|
||||
@ -456,13 +476,11 @@ Callable CodeFactory::ArrayNoArgumentConstructor(
|
||||
Callable CodeFactory::ArraySingleArgumentConstructor(
|
||||
Isolate* isolate, ElementsKind kind,
|
||||
AllocationSiteOverrideMode override_mode) {
|
||||
#define CASE(kind_caps, kind_camel, mode_camel) \
|
||||
case kind_caps: \
|
||||
return Callable( \
|
||||
BUILTIN_CODE( \
|
||||
isolate, \
|
||||
ArraySingleArgumentConstructor_##kind_camel##_##mode_camel), \
|
||||
ArraySingleArgumentConstructorDescriptor{})
|
||||
#define CASE(kind_caps, kind_camel, mode_camel) \
|
||||
case kind_caps: \
|
||||
return Builtins::CallableFor( \
|
||||
isolate, \
|
||||
Builtins::kArraySingleArgumentConstructor_##kind_camel##_##mode_camel)
|
||||
if (override_mode == DONT_OVERRIDE && AllocationSite::ShouldTrack(kind)) {
|
||||
DCHECK(IsSmiElementsKind(kind));
|
||||
switch (kind) {
|
||||
|
@ -16,71 +16,71 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
#define INTERFACE_DESCRIPTOR_LIST(V) \
|
||||
V(CppBuiltinAdaptor) \
|
||||
V(CEntry1ArgvOnStack) \
|
||||
V(Allocate) \
|
||||
V(Void) \
|
||||
V(ContextOnly) \
|
||||
V(NoContext) \
|
||||
V(Load) \
|
||||
V(LoadWithVector) \
|
||||
V(LoadGlobal) \
|
||||
V(LoadGlobalWithVector) \
|
||||
V(Store) \
|
||||
V(StoreWithVector) \
|
||||
V(StoreTransition) \
|
||||
V(StoreGlobal) \
|
||||
V(StoreGlobalWithVector) \
|
||||
V(FastNewFunctionContext) \
|
||||
V(FastNewObject) \
|
||||
V(RecordWrite) \
|
||||
V(TypeConversion) \
|
||||
V(TypeConversionStackParameter) \
|
||||
V(Typeof) \
|
||||
V(AsyncFunctionStackParameter) \
|
||||
V(CallVarargs) \
|
||||
V(CallForwardVarargs) \
|
||||
V(CallWithSpread) \
|
||||
V(CallWithArrayLike) \
|
||||
V(CallTrampoline) \
|
||||
V(ConstructStub) \
|
||||
V(ConstructVarargs) \
|
||||
V(ConstructForwardVarargs) \
|
||||
V(ConstructWithSpread) \
|
||||
V(ConstructWithArrayLike) \
|
||||
V(JSTrampoline) \
|
||||
V(Abort) \
|
||||
V(Allocate) \
|
||||
V(AllocateHeapNumber) \
|
||||
V(ArrayConstructor) \
|
||||
V(ArrayNoArgumentConstructor) \
|
||||
V(ArraySingleArgumentConstructor) \
|
||||
V(ArrayNArgumentsConstructor) \
|
||||
V(Compare) \
|
||||
V(BinaryOp) \
|
||||
V(StringAt) \
|
||||
V(StringSubstring) \
|
||||
V(GetProperty) \
|
||||
V(ArgumentsAdaptor) \
|
||||
V(ApiCallback) \
|
||||
V(ApiGetter) \
|
||||
V(ArgumentsAdaptor) \
|
||||
V(ArrayConstructor) \
|
||||
V(ArrayNArgumentsConstructor) \
|
||||
V(ArrayNoArgumentConstructor) \
|
||||
V(ArraySingleArgumentConstructor) \
|
||||
V(AsyncFunctionStackParameter) \
|
||||
V(BigIntToI64) \
|
||||
V(BigIntToWasmI64) \
|
||||
V(BinaryOp) \
|
||||
V(CallForwardVarargs) \
|
||||
V(CallTrampoline) \
|
||||
V(CallVarargs) \
|
||||
V(CallWithArrayLike) \
|
||||
V(CallWithSpread) \
|
||||
V(CEntry1ArgvOnStack) \
|
||||
V(CloneObjectWithVector) \
|
||||
V(Compare) \
|
||||
V(ConstructForwardVarargs) \
|
||||
V(ConstructStub) \
|
||||
V(ConstructVarargs) \
|
||||
V(ConstructWithArrayLike) \
|
||||
V(ConstructWithSpread) \
|
||||
V(ContextOnly) \
|
||||
V(CppBuiltinAdaptor) \
|
||||
V(FastNewFunctionContext) \
|
||||
V(FastNewObject) \
|
||||
V(FrameDropperTrampoline) \
|
||||
V(GetProperty) \
|
||||
V(GrowArrayElements) \
|
||||
V(NewArgumentsElements) \
|
||||
V(InterpreterCEntry1) \
|
||||
V(InterpreterCEntry2) \
|
||||
V(InterpreterDispatch) \
|
||||
V(InterpreterPushArgsThenCall) \
|
||||
V(InterpreterPushArgsThenConstruct) \
|
||||
V(InterpreterCEntry1) \
|
||||
V(InterpreterCEntry2) \
|
||||
V(JSTrampoline) \
|
||||
V(Load) \
|
||||
V(LoadGlobal) \
|
||||
V(LoadGlobalWithVector) \
|
||||
V(LoadWithVector) \
|
||||
V(NewArgumentsElements) \
|
||||
V(NoContext) \
|
||||
V(RecordWrite) \
|
||||
V(ResumeGenerator) \
|
||||
V(FrameDropperTrampoline) \
|
||||
V(RunMicrotasks) \
|
||||
V(WasmMemoryGrow) \
|
||||
V(WasmThrow) \
|
||||
V(Store) \
|
||||
V(StoreGlobal) \
|
||||
V(StoreGlobalWithVector) \
|
||||
V(StoreTransition) \
|
||||
V(StoreWithVector) \
|
||||
V(StringAt) \
|
||||
V(StringSubstring) \
|
||||
V(TypeConversion) \
|
||||
V(TypeConversionStackParameter) \
|
||||
V(Typeof) \
|
||||
V(Void) \
|
||||
V(WasmAtomicWake) \
|
||||
V(WasmI32AtomicWait) \
|
||||
V(WasmI64AtomicWait) \
|
||||
V(CloneObjectWithVector) \
|
||||
V(BigIntToWasmI64) \
|
||||
V(BigIntToI64) \
|
||||
V(WasmMemoryGrow) \
|
||||
V(WasmThrow) \
|
||||
BUILTIN_LIST_TFS(V)
|
||||
|
||||
class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
|
||||
@ -444,6 +444,10 @@ class V8_EXPORT_PRIVATE VoidDescriptor : public CallInterfaceDescriptor {
|
||||
DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor)
|
||||
};
|
||||
|
||||
// Dummy descriptor used to mark builtins that don't yet have their proper
|
||||
// descriptor associated.
|
||||
typedef VoidDescriptor DummyDescriptor;
|
||||
|
||||
class AllocateDescriptor : public CallInterfaceDescriptor {
|
||||
public:
|
||||
DEFINE_PARAMETERS_NO_CONTEXT(kRequestedSize)
|
||||
|
Loading…
Reference in New Issue
Block a user