Make CallInterfaceDescriptor isolate-independent

Currently each isolate stores its own array of
{CallInterfaceDescriptorData}. This array has size 173, and each entry
has 40 bytes. That's already 7kB per isolate.
Additionally, each {CallInterfaceDescriptorData} allocates two
heap-allocated arrays, which probably add up to more than the static
size of the {CallInterfaceDescriptorData}. Note that all the
{CallInterfaceDescriptorData} instances are initialized eagerly on
isolate creation.

Since {CallInterfaceDescriptor} is totally isolate independent itself,
this CL refactors the current design to avoid a copy of them per
isolate, and instead shares them process-wide. Still, we need to free
the allocated heap arrays when the last isolate dies to avoid leaks.
This can probably be refactored later by statically initializing more
and avoiding the heap allocations all together.

This refactoring will also allow us to use {CallInterfaceDescriptor}s
from wasm background compilation threads, which are not bound to any
isolate.

R=mstarzinger@chromium.org, titzer@chromium.org

Bug: v8:6600
Change-Id: If8625b89951eec8fa8986b49a5c166e874a72494
Reviewed-on: https://chromium-review.googlesource.com/1100879
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53803}
This commit is contained in:
Clemens Hammacher 2018-06-18 17:14:29 +02:00 committed by Commit Bot
parent 467eb1497e
commit 3cb376dc83
36 changed files with 270 additions and 283 deletions

View File

@ -4066,9 +4066,8 @@ void ArrayBuiltinsAssembler::TailCallArrayConstructorStub(
// pops the current frame but leaves all the incoming JS arguments on the
// expression stack so that the target builtin can still find them where it
// expects.
ArrayNArgumentsConstructorDescriptor descriptor(isolate());
TailCallStub(descriptor, code, context, target, allocation_site_or_undefined,
argc);
TailCallStub(ArrayNArgumentsConstructorDescriptor{}, code, context, target,
allocation_site_or_undefined, argc);
}
void ArrayBuiltinsAssembler::CreateArrayDispatchNoArgument(

View File

@ -33,7 +33,7 @@ TF_BUILTIN(WasmArgumentsAdaptor, CodeStubAssembler) {
MachineType::TaggedPointer(), roots,
IntPtrConstant(Heap::roots_to_builtins_offset() +
Builtins::kArgumentsAdaptorTrampoline * kPointerSize)));
TailCallStub(ArgumentAdaptorDescriptor(isolate()), target, context, function,
TailCallStub(ArgumentAdaptorDescriptor{}, target, context, function,
new_target, argc1, argc2);
}
@ -54,8 +54,7 @@ TF_BUILTIN(WasmCallJavaScript, CodeStubAssembler) {
Load(MachineType::TaggedPointer(), roots,
IntPtrConstant(Heap::roots_to_builtins_offset() +
Builtins::kCall_ReceiverIsAny * kPointerSize)));
TailCallStub(CallTrampolineDescriptor(isolate()), target, context, function,
argc);
TailCallStub(CallTrampolineDescriptor{}, target, context, function, argc);
}
TF_BUILTIN(WasmStackGuard, CodeStubAssembler) {

View File

@ -159,11 +159,11 @@ Callable Builtins::CallableFor(Isolate* isolate, Name name) {
default:
Builtins::Kind kind = Builtins::KindOf(name);
if (kind == TFJ || kind == CPP) {
return Callable(code, BuiltinDescriptor(isolate));
return Callable(code, BuiltinDescriptor{});
}
UNREACHABLE();
}
CallInterfaceDescriptor descriptor(isolate, key);
CallInterfaceDescriptor descriptor(key);
return Callable(code, descriptor);
}

View File

@ -139,7 +139,7 @@ Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, int32_t builtin_index,
Zone zone(isolate->allocator(), ZONE_NAME, segment_size);
// The interface descriptor with given key must be initialized at this point
// and this construction just queries the details from the descriptors table.
CallInterfaceDescriptor descriptor(isolate, interface_descriptor);
CallInterfaceDescriptor descriptor(interface_descriptor);
// Ensure descriptor is already initialized.
DCHECK_LE(0, descriptor.GetRegisterParameterCount());
compiler::CodeAssemblerState state(
@ -233,7 +233,6 @@ void SetupIsolateDelegate::SetupBuiltinsInternal(Isolate* isolate) {
isolate, index, &Builtins::Generate_##Name, Argc, #Name); \
AddBuiltin(builtins, index++, code);
#define BUILD_TFC(Name, InterfaceDescriptor, result_size) \
{ InterfaceDescriptor##Descriptor descriptor(isolate); } \
code = BuildWithCodeStubAssemblerCS( \
isolate, index, &Builtins::Generate_##Name, \
CallDescriptors::InterfaceDescriptor, #Name, result_size); \
@ -245,7 +244,6 @@ void SetupIsolateDelegate::SetupBuiltinsInternal(Isolate* isolate) {
CallDescriptors::Name, #Name, 1); \
AddBuiltin(builtins, index++, code);
#define BUILD_TFH(Name, InterfaceDescriptor) \
{ InterfaceDescriptor##Descriptor descriptor(isolate); } \
/* Return size for IC builtins/handlers is always 1. */ \
code = BuildWithCodeStubAssemblerCS( \
isolate, index, &Builtins::Generate_##Name, \

View File

@ -18,7 +18,7 @@ namespace {
template <typename Stub>
Callable make_callable(Stub& stub) {
typedef typename Stub::Descriptor Descriptor;
return Callable(stub.GetCode(), Descriptor(stub.isolate()));
return Callable(stub.GetCode(), Descriptor{});
}
} // namespace
@ -70,8 +70,7 @@ Handle<Code> CodeFactory::CEntry(Isolate* isolate, int result_size,
// static
Callable CodeFactory::ApiGetter(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CallApiGetter),
ApiGetterDescriptor(isolate));
return Callable(BUILTIN_CODE(isolate, CallApiGetter), ApiGetterDescriptor{});
}
// static
@ -79,10 +78,10 @@ Callable CodeFactory::CallApiCallback(Isolate* isolate, int argc) {
switch (argc) {
case 0:
return Callable(BUILTIN_CODE(isolate, CallApiCallback_Argc0),
ApiCallbackDescriptor(isolate));
ApiCallbackDescriptor{});
case 1:
return Callable(BUILTIN_CODE(isolate, CallApiCallback_Argc1),
ApiCallbackDescriptor(isolate));
ApiCallbackDescriptor{});
default: {
CallApiCallbackStub stub(isolate, argc);
return make_callable(stub);
@ -97,7 +96,7 @@ Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) {
typeof_mode == NOT_INSIDE_TYPEOF
? BUILTIN_CODE(isolate, LoadGlobalICTrampoline)
: BUILTIN_CODE(isolate, LoadGlobalICInsideTypeofTrampoline),
LoadGlobalDescriptor(isolate));
LoadGlobalDescriptor{});
}
// static
@ -106,21 +105,19 @@ Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate,
return Callable(typeof_mode == NOT_INSIDE_TYPEOF
? BUILTIN_CODE(isolate, LoadGlobalIC)
: BUILTIN_CODE(isolate, LoadGlobalICInsideTypeof),
LoadGlobalWithVectorDescriptor(isolate));
LoadGlobalWithVectorDescriptor{});
}
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(isolate));
return Callable(BUILTIN_CODE(isolate, StoreICTrampoline), StoreDescriptor{});
}
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(isolate));
return Callable(BUILTIN_CODE(isolate, StoreIC), StoreWithVectorDescriptor{});
}
// static
@ -158,14 +155,14 @@ Callable CodeFactory::BinaryOperation(Isolate* isolate, Operation op) {
Callable CodeFactory::NonPrimitiveToPrimitive(Isolate* isolate,
ToPrimitiveHint hint) {
return Callable(isolate->builtins()->NonPrimitiveToPrimitive(hint),
TypeConversionDescriptor(isolate));
TypeConversionDescriptor{});
}
// static
Callable CodeFactory::OrdinaryToPrimitive(Isolate* isolate,
OrdinaryToPrimitiveHint hint) {
return Callable(isolate->builtins()->OrdinaryToPrimitive(hint),
TypeConversionDescriptor(isolate));
TypeConversionDescriptor{});
}
// static
@ -196,110 +193,107 @@ Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags,
// static
Callable CodeFactory::ResumeGenerator(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ResumeGeneratorTrampoline),
ResumeGeneratorDescriptor(isolate));
ResumeGeneratorDescriptor{});
}
// static
Callable CodeFactory::FrameDropperTrampoline(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, FrameDropperTrampoline),
FrameDropperTrampolineDescriptor(isolate));
FrameDropperTrampolineDescriptor{});
}
// static
Callable CodeFactory::HandleDebuggerStatement(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, HandleDebuggerStatement),
ContextOnlyDescriptor(isolate));
ContextOnlyDescriptor{});
}
// static
Callable CodeFactory::FastNewFunctionContext(Isolate* isolate,
ScopeType scope_type) {
return Callable(isolate->builtins()->NewFunctionContext(scope_type),
FastNewFunctionContextDescriptor(isolate));
FastNewFunctionContextDescriptor{});
}
// static
Callable CodeFactory::ArgumentAdaptor(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ArgumentsAdaptorTrampoline),
ArgumentAdaptorDescriptor(isolate));
ArgumentAdaptorDescriptor{});
}
// static
Callable CodeFactory::Call(Isolate* isolate, ConvertReceiverMode mode) {
return Callable(isolate->builtins()->Call(mode),
CallTrampolineDescriptor(isolate));
return Callable(isolate->builtins()->Call(mode), CallTrampolineDescriptor{});
}
// static
Callable CodeFactory::CallWithArrayLike(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CallWithArrayLike),
CallWithArrayLikeDescriptor(isolate));
CallWithArrayLikeDescriptor{});
}
// static
Callable CodeFactory::CallWithSpread(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CallWithSpread),
CallWithSpreadDescriptor(isolate));
CallWithSpreadDescriptor{});
}
// static
Callable CodeFactory::CallFunction(Isolate* isolate, ConvertReceiverMode mode) {
return Callable(isolate->builtins()->CallFunction(mode),
CallTrampolineDescriptor(isolate));
CallTrampolineDescriptor{});
}
// static
Callable CodeFactory::CallVarargs(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CallVarargs),
CallVarargsDescriptor(isolate));
return Callable(BUILTIN_CODE(isolate, CallVarargs), CallVarargsDescriptor{});
}
// static
Callable CodeFactory::CallForwardVarargs(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CallForwardVarargs),
CallForwardVarargsDescriptor(isolate));
CallForwardVarargsDescriptor{});
}
// static
Callable CodeFactory::CallFunctionForwardVarargs(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CallFunctionForwardVarargs),
CallForwardVarargsDescriptor(isolate));
CallForwardVarargsDescriptor{});
}
// static
Callable CodeFactory::Construct(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, Construct),
JSTrampolineDescriptor(isolate));
return Callable(BUILTIN_CODE(isolate, Construct), JSTrampolineDescriptor{});
}
// static
Callable CodeFactory::ConstructWithSpread(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ConstructWithSpread),
ConstructWithSpreadDescriptor(isolate));
ConstructWithSpreadDescriptor{});
}
// static
Callable CodeFactory::ConstructFunction(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ConstructFunction),
JSTrampolineDescriptor(isolate));
JSTrampolineDescriptor{});
}
// static
Callable CodeFactory::ConstructVarargs(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ConstructVarargs),
ConstructVarargsDescriptor(isolate));
ConstructVarargsDescriptor{});
}
// static
Callable CodeFactory::ConstructForwardVarargs(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ConstructForwardVarargs),
ConstructForwardVarargsDescriptor(isolate));
ConstructForwardVarargsDescriptor{});
}
// static
Callable CodeFactory::ConstructFunctionForwardVarargs(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ConstructFunctionForwardVarargs),
ConstructForwardVarargsDescriptor(isolate));
ConstructForwardVarargsDescriptor{});
}
// static
@ -308,14 +302,14 @@ Callable CodeFactory::InterpreterPushArgsThenCall(
InterpreterPushArgsMode mode) {
return Callable(
isolate->builtins()->InterpreterPushArgsThenCall(receiver_mode, mode),
InterpreterPushArgsThenCallDescriptor(isolate));
InterpreterPushArgsThenCallDescriptor{});
}
// static
Callable CodeFactory::InterpreterPushArgsThenConstruct(
Isolate* isolate, InterpreterPushArgsMode mode) {
return Callable(isolate->builtins()->InterpreterPushArgsThenConstruct(mode),
InterpreterPushArgsThenConstructDescriptor(isolate));
InterpreterPushArgsThenConstructDescriptor{});
}
// static
@ -324,13 +318,13 @@ Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) {
// save fpregs too.
Handle<Code> code = CodeFactory::CEntry(isolate, result_size, kDontSaveFPRegs,
kArgvInRegister);
return Callable(code, InterpreterCEntryDescriptor(isolate));
return Callable(code, InterpreterCEntryDescriptor{});
}
// static
Callable CodeFactory::InterpreterOnStackReplacement(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, InterpreterOnStackReplacement),
ContextOnlyDescriptor(isolate));
ContextOnlyDescriptor{});
}
// static
@ -342,7 +336,7 @@ Callable CodeFactory::ArrayNoArgumentConstructor(
return Callable( \
BUILTIN_CODE(isolate, \
ArrayNoArgumentConstructor_##kind_camel##_##mode_camel), \
ArrayNoArgumentConstructorDescriptor(isolate))
ArrayNoArgumentConstructorDescriptor{})
if (override_mode == DONT_OVERRIDE && AllocationSite::ShouldTrack(kind)) {
DCHECK(IsSmiElementsKind(kind));
switch (kind) {
@ -378,7 +372,7 @@ Callable CodeFactory::ArraySingleArgumentConstructor(
BUILTIN_CODE( \
isolate, \
ArraySingleArgumentConstructor_##kind_camel##_##mode_camel), \
ArraySingleArgumentConstructorDescriptor(isolate))
ArraySingleArgumentConstructorDescriptor{})
if (override_mode == DONT_OVERRIDE && AllocationSite::ShouldTrack(kind)) {
DCHECK(IsSmiElementsKind(kind));
switch (kind) {
@ -411,11 +405,11 @@ Callable CodeFactory::InternalArrayNoArgumentConstructor(Isolate* isolate,
case PACKED_ELEMENTS:
return Callable(
BUILTIN_CODE(isolate, InternalArrayNoArgumentConstructor_Packed),
ArrayNoArgumentConstructorDescriptor(isolate));
ArrayNoArgumentConstructorDescriptor{});
case HOLEY_ELEMENTS:
return Callable(
BUILTIN_CODE(isolate, InternalArrayNoArgumentConstructor_Holey),
ArrayNoArgumentConstructorDescriptor(isolate));
ArrayNoArgumentConstructorDescriptor{});
default:
UNREACHABLE();
}
@ -428,11 +422,11 @@ Callable CodeFactory::InternalArraySingleArgumentConstructor(
case PACKED_ELEMENTS:
return Callable(
BUILTIN_CODE(isolate, InternalArraySingleArgumentConstructor_Packed),
ArraySingleArgumentConstructorDescriptor(isolate));
ArraySingleArgumentConstructorDescriptor{});
case HOLEY_ELEMENTS:
return Callable(
BUILTIN_CODE(isolate, InternalArraySingleArgumentConstructor_Holey),
ArraySingleArgumentConstructorDescriptor(isolate));
ArraySingleArgumentConstructorDescriptor{});
default:
UNREACHABLE();
}
@ -440,36 +434,35 @@ Callable CodeFactory::InternalArraySingleArgumentConstructor(
// static
Callable CodeFactory::ArrayPop(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ArrayPop), BuiltinDescriptor(isolate));
return Callable(BUILTIN_CODE(isolate, ArrayPop), BuiltinDescriptor{});
}
// static
Callable CodeFactory::ArrayShift(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ArrayShift),
BuiltinDescriptor(isolate));
return Callable(BUILTIN_CODE(isolate, ArrayShift), BuiltinDescriptor{});
}
// static
Callable CodeFactory::ExtractFastJSArray(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ExtractFastJSArray),
ExtractFastJSArrayDescriptor(isolate));
ExtractFastJSArrayDescriptor{});
}
// static
Callable CodeFactory::CloneFastJSArray(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, CloneFastJSArray),
CloneFastJSArrayDescriptor(isolate));
CloneFastJSArrayDescriptor{});
}
// static
Callable CodeFactory::ArrayPush(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, ArrayPush), BuiltinDescriptor(isolate));
return Callable(BUILTIN_CODE(isolate, ArrayPush), BuiltinDescriptor{});
}
// static
Callable CodeFactory::FunctionPrototypeBind(Isolate* isolate) {
return Callable(BUILTIN_CODE(isolate, FunctionPrototypeBind),
BuiltinDescriptor(isolate));
BuiltinDescriptor{});
}
} // namespace internal

View File

@ -11240,7 +11240,7 @@ Node* CodeStubAssembler::InstanceOf(Node* object, Node* callable,
//
// Call to Function.prototype[@@hasInstance] directly.
Callable builtin(BUILTIN_CODE(isolate(), FunctionPrototypeHasInstance),
CallTrampolineDescriptor(isolate()));
CallTrampolineDescriptor{});
Node* result = CallJS(builtin, context, inst_of_handler, callable, object);
var_result.Bind(result);
Goto(&return_result);

View File

@ -241,7 +241,7 @@ class CodeStub : public ZoneObject {
public: \
typedef NAME##Descriptor Descriptor; \
CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \
return Descriptor(isolate()); \
return Descriptor(); \
}
// There are some code stubs we just can't describe right now with a

View File

@ -50,7 +50,7 @@ CodeAssemblerState::CodeAssemblerState(
: CodeAssemblerState(
isolate, zone,
Linkage::GetStubCallDescriptor(
isolate, zone, descriptor, descriptor.GetStackParameterCount(),
zone, descriptor, descriptor.GetStackParameterCount(),
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), result_size),
kind, name, poisoning_level, stub_key, builtin_index) {}
@ -1140,9 +1140,8 @@ Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor,
int stack_parameter_count = argc - descriptor.GetRegisterParameterCount();
DCHECK_LE(descriptor.GetStackParameterCount(), stack_parameter_count);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, stack_parameter_count,
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), result_size,
zone(), descriptor, stack_parameter_count, CallDescriptor::kNoFlags,
Operator::kNoProperties, MachineType::AnyTagged(), result_size,
pass_context ? Linkage::kPassContext : Linkage::kNoContext);
CallPrologue();
@ -1160,7 +1159,7 @@ void CodeAssembler::TailCallStubImpl(const CallInterfaceDescriptor& descriptor,
DCHECK_EQ(descriptor.GetParameterCount(), args.size());
size_t result_size = 1;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
zone(), descriptor, descriptor.GetStackParameterCount(),
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), result_size);
@ -1200,9 +1199,8 @@ Node* CodeAssembler::TailCallStubThenBytecodeDispatchImpl(
int stack_parameter_count = argc - descriptor.GetRegisterParameterCount();
DCHECK_LE(descriptor.GetStackParameterCount(), stack_parameter_count);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, stack_parameter_count,
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), 0);
zone(), descriptor, stack_parameter_count, CallDescriptor::kNoFlags,
Operator::kNoProperties, MachineType::AnyTagged(), 0);
NodeArray<kMaxNumArgs + 2> inputs;
inputs.Add(target);
@ -1218,7 +1216,7 @@ Node* CodeAssembler::TailCallBytecodeDispatch(
const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args) {
DCHECK_EQ(descriptor.GetParameterCount(), sizeof...(args));
auto call_descriptor = Linkage::GetBytecodeDispatchCallDescriptor(
isolate(), zone(), descriptor, descriptor.GetStackParameterCount());
zone(), descriptor, descriptor.GetStackParameterCount());
Node* nodes[] = {target, args...};
CHECK_EQ(descriptor.GetParameterCount() + 1, arraysize(nodes));
@ -1236,10 +1234,10 @@ TNode<Object> CodeAssembler::TailCallJSCode(TNode<Code> code,
TNode<JSFunction> function,
TNode<Object> new_target,
TNode<Int32T> arg_count) {
JSTrampolineDescriptor descriptor(isolate());
JSTrampolineDescriptor descriptor;
size_t result_size = 1;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
zone(), descriptor, descriptor.GetStackParameterCount(),
CallDescriptor::kFixedTargetRegister, Operator::kNoProperties,
MachineType::AnyTagged(), result_size);

View File

@ -2042,7 +2042,7 @@ Node* EffectControlLinearizer::LowerNumberToString(Node* node) {
Operator::Properties properties = Operator::kEliminatable;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), argument,
__ NoContextConstant());
}
@ -2498,7 +2498,7 @@ Node* EffectControlLinearizer::LowerTypeOf(Node* node) {
Operator::Properties const properties = Operator::kEliminatable;
CallDescriptor::Flags const flags = CallDescriptor::kNoAllocate;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), obj,
__ NoContextConstant());
}
@ -2510,7 +2510,7 @@ Node* EffectControlLinearizer::LowerToBoolean(Node* node) {
Operator::Properties const properties = Operator::kEliminatable;
CallDescriptor::Flags const flags = CallDescriptor::kNoAllocate;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), obj,
__ NoContextConstant());
}
@ -2698,7 +2698,7 @@ Node* EffectControlLinearizer::LowerNewArgumentsElements(Node* node) {
Operator::Properties const properties = node->op()->properties();
CallDescriptor::Flags const flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), frame,
length, __ SmiConstant(mapped_count), __ NoContextConstant());
}
@ -2771,7 +2771,7 @@ Node* EffectControlLinearizer::LowerSameValue(Node* node) {
Operator::Properties properties = Operator::kEliminatable;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs, rhs,
__ NoContextConstant());
}
@ -2793,7 +2793,7 @@ Node* EffectControlLinearizer::LowerStringToNumber(Node* node) {
Operator::Properties properties = Operator::kEliminatable;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), string,
__ NoContextConstant());
}
@ -2951,7 +2951,7 @@ Node* EffectControlLinearizer::LowerStringCodePointAt(
Operator::Properties properties = Operator::kNoThrow | Operator::kNoWrite;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties,
graph()->zone(), callable.descriptor(), 0, flags, properties,
MachineType::TaggedSigned());
return __ Call(call_descriptor, __ HeapConstant(callable.code()), receiver,
position, __ NoContextConstant());
@ -3061,7 +3061,7 @@ Node* EffectControlLinearizer::LowerStringToLowerCaseIntl(Node* node) {
Operator::Properties properties = Operator::kNoDeopt | Operator::kNoThrow;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), receiver,
__ NoContextConstant());
}
@ -3230,7 +3230,7 @@ Node* EffectControlLinearizer::LowerStringIndexOf(Node* node) {
Operator::Properties properties = Operator::kEliminatable;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), subject,
search_string, position, __ NoContextConstant());
}
@ -3249,7 +3249,7 @@ Node* EffectControlLinearizer::LowerStringComparison(Callable const& callable,
Operator::Properties properties = Operator::kEliminatable;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), lhs, rhs,
__ NoContextConstant());
}
@ -3264,7 +3264,7 @@ Node* EffectControlLinearizer::LowerStringSubstring(Node* node) {
Operator::Properties properties = Operator::kEliminatable;
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), receiver,
start, end, __ NoContextConstant());
}
@ -3551,7 +3551,7 @@ Node* EffectControlLinearizer::LowerEnsureWritableFastElements(Node* node) {
Builtins::CallableFor(isolate(), Builtins::kCopyFastSmiOrObjectElements);
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
Node* result = __ Call(call_descriptor, __ HeapConstant(callable.code()),
object, __ NoContextConstant());
__ Goto(&done, result);
@ -3587,8 +3587,7 @@ Node* EffectControlLinearizer::LowerMaybeGrowFastElements(Node* node,
Builtins::kGrowFastSmiOrObjectElements);
CallDescriptor::Flags call_flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, call_flags,
properties);
graph()->zone(), callable.descriptor(), 0, call_flags, properties);
Node* new_elements =
__ Call(call_descriptor, __ HeapConstant(callable.code()), object,
ChangeInt32ToSmi(index), __ NoContextConstant());
@ -4193,8 +4192,7 @@ Node* EffectControlLinearizer::LowerConvertReceiver(Node* node) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags,
properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
Node* native_context = __ LoadField(
AccessBuilder::ForJSGlobalProxyNativeContext(), global_proxy);
Node* result = __ Call(call_descriptor, __ HeapConstant(callable.code()),
@ -4229,8 +4227,7 @@ Node* EffectControlLinearizer::LowerConvertReceiver(Node* node) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags,
properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
Node* native_context = __ LoadField(
AccessBuilder::ForJSGlobalProxyNativeContext(), global_proxy);
Node* result = __ Call(call_descriptor, __ HeapConstant(callable.code()),
@ -4591,8 +4588,7 @@ Node* EffectControlLinearizer::LowerFindOrderedHashMapEntry(Node* node) {
Operator::Properties const properties = node->op()->properties();
CallDescriptor::Flags const flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags,
properties);
graph()->zone(), callable.descriptor(), 0, flags, properties);
return __ Call(call_descriptor, __ HeapConstant(callable.code()), table,
key, __ NoContextConstant());
}

View File

@ -247,9 +247,9 @@ Operator const* GraphAssembler::ToNumberOperator() {
Callable callable =
Builtins::CallableFor(jsgraph()->isolate(), Builtins::kToNumber);
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
auto call_descriptor = Linkage::GetStubCallDescriptor(
jsgraph()->isolate(), graph()->zone(), callable.descriptor(), 0, flags,
Operator::kEliminatable);
auto call_descriptor =
Linkage::GetStubCallDescriptor(graph()->zone(), callable.descriptor(),
0, flags, Operator::kEliminatable);
to_number_operator_.set(common()->Call(call_descriptor));
}
return to_number_operator_.get();

View File

@ -862,7 +862,7 @@ Reduction JSCallReducer::ReduceReflectGet(Node* node) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kGetProperty);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties,
MachineType::AnyTagged(), 1);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
@ -2554,8 +2554,8 @@ Reduction JSCallReducer::ReduceArrayIndexOfIncludes(
: GetCallableForArrayIncludes(receiver_map->elements_kind(),
isolate());
CallDescriptor const* const desc = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags, Operator::kEliminatable);
graph()->zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags,
Operator::kEliminatable);
// The stub expects the following arguments: the receiver array, its elements,
// the search_element, the array length, and the index to start searching
// from.
@ -2909,7 +2909,7 @@ Reduction JSCallReducer::ReduceCallApiFunction(
Callable call_api_callback = CodeFactory::CallApiCallback(isolate(), argc);
CallInterfaceDescriptor cid = call_api_callback.descriptor();
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), cid,
graph()->zone(), cid,
cid.GetStackParameterCount() + argc + 1 /* implicit receiver */,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties,
MachineType::AnyTagged(), 1, Linkage::kNoContext);
@ -5286,10 +5286,10 @@ Reduction JSCallReducer::ReduceStringPrototypeConcat(
Callable const callable =
CodeFactory::StringAdd(isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNeedsFrameState,
Operator::kNoDeopt | Operator::kNoWrite);
auto call_descriptor =
Linkage::GetStubCallDescriptor(graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNeedsFrameState,
Operator::kNoDeopt | Operator::kNoWrite);
// TODO(turbofan): Massage the FrameState of the {node} here once we
// have an artificial builtin frame type, so that it looks like the
@ -6420,8 +6420,8 @@ Reduction JSCallReducer::ReduceCollectionIteratorPrototypeNext(
Callable const callable =
Builtins::CallableFor(isolate(), Builtins::kOrderedHashTableHealIndex);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags, Operator::kEliminatable);
graph()->zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags,
Operator::kEliminatable);
index = effect =
graph()->NewNode(common()->Call(call_descriptor),
jsgraph()->HeapConstant(callable.code()), table, index,

View File

@ -730,7 +730,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
Callable callable = CodeFactory::ArrayNoArgumentConstructor(
isolate(), elements_kind, override_mode);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), arity + 1,
graph()->zone(), callable.descriptor(), arity + 1,
CallDescriptor::kNeedsFrameState, properties);
node->ReplaceInput(0, jsgraph()->HeapConstant(callable.code()));
node->InsertInput(graph()->zone(), 2, type_info);
@ -742,7 +742,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
Callable callable = CodeFactory::ArraySingleArgumentConstructor(
isolate(), GetHoleyElementsKind(elements_kind), override_mode);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), arity + 1,
graph()->zone(), callable.descriptor(), arity + 1,
CallDescriptor::kNeedsFrameState, properties);
node->ReplaceInput(0, jsgraph()->HeapConstant(callable.code()));
node->InsertInput(graph()->zone(), 2, type_info);
@ -753,8 +753,7 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
DCHECK_GT(arity, 1);
Handle<Code> code = BUILTIN_CODE(isolate(), ArrayNArgumentsConstructor);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(),
ArrayNArgumentsConstructorDescriptor(isolate()), arity + 1,
graph()->zone(), ArrayNArgumentsConstructorDescriptor{}, arity + 1,
CallDescriptor::kNeedsFrameState);
node->ReplaceInput(0, jsgraph()->HeapConstant(code));
node->InsertInput(graph()->zone(), 2, type_info);

View File

@ -105,7 +105,7 @@ void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
int result_size) {
const CallInterfaceDescriptor& descriptor = callable.descriptor();
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, descriptor.GetStackParameterCount(), flags,
zone(), descriptor, descriptor.GetStackParameterCount(), flags,
properties, MachineType::AnyTagged(), result_size);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
node->InsertInput(zone(), 0, stub_code);
@ -360,9 +360,8 @@ void JSGenericLowering::LowerJSCreateArray(Node* node) {
CreateArrayParameters const& p = CreateArrayParametersOf(node->op());
int const arity = static_cast<int>(p.arity());
Handle<AllocationSite> const site = p.site();
ArrayConstructorDescriptor descriptor(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, arity + 1,
zone(), ArrayConstructorDescriptor{}, arity + 1,
CallDescriptor::kNeedsFrameState, node->op()->properties(),
MachineType::AnyTagged());
Node* stub_code = jsgraph()->ArrayConstructorStubConstant();
@ -573,7 +572,7 @@ void JSGenericLowering::LowerJSConstructForwardVarargs(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::ConstructForwardVarargs(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* start_index = jsgraph()->Uint32Constant(p.start_index());
@ -594,7 +593,7 @@ void JSGenericLowering::LowerJSConstruct(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::Construct(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* new_target = node->InputAt(arg_count + 1);
@ -611,8 +610,8 @@ void JSGenericLowering::LowerJSConstructWithArrayLike(Node* node) {
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kConstructWithArrayLike);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 1, flags);
auto call_descriptor =
Linkage::GetStubCallDescriptor(zone(), callable.descriptor(), 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* receiver = jsgraph()->UndefinedConstant();
Node* arguments_list = node->InputAt(1);
@ -632,7 +631,7 @@ void JSGenericLowering::LowerJSConstructWithSpread(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::ConstructWithSpread(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count, flags);
zone(), callable.descriptor(), arg_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stack_arg_count = jsgraph()->Int32Constant(arg_count - 1);
Node* new_target = node->InputAt(new_target_index);
@ -656,7 +655,7 @@ void JSGenericLowering::LowerJSCallForwardVarargs(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::CallForwardVarargs(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* start_index = jsgraph()->Uint32Constant(p.start_index());
@ -673,7 +672,7 @@ void JSGenericLowering::LowerJSCall(Node* node) {
Callable callable = CodeFactory::Call(isolate(), mode);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
node->InsertInput(zone(), 0, stub_code);
@ -684,8 +683,8 @@ void JSGenericLowering::LowerJSCall(Node* node) {
void JSGenericLowering::LowerJSCallWithArrayLike(Node* node) {
Callable callable = CodeFactory::CallWithArrayLike(isolate());
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 1, flags);
auto call_descriptor =
Linkage::GetStubCallDescriptor(zone(), callable.descriptor(), 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* receiver = node->InputAt(1);
Node* arguments_list = node->InputAt(2);
@ -702,7 +701,7 @@ void JSGenericLowering::LowerJSCallWithSpread(Node* node) {
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::CallWithSpread(isolate());
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), arg_count, flags);
zone(), callable.descriptor(), arg_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
// We pass the spread in a register, not on the stack.
Node* stack_arg_count = jsgraph()->Int32Constant(arg_count - 1);

View File

@ -420,7 +420,7 @@ Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
Reduction JSIntrinsicLowering::Change(Node* node, Callable const& callable,
int stack_parameter_count) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), stack_parameter_count,
graph()->zone(), callable.descriptor(), stack_parameter_count,
CallDescriptor::kNeedsFrameState, node->op()->properties());
node->InsertInput(graph()->zone(), 0,
jsgraph()->HeapConstant(callable.code()));

View File

@ -1745,7 +1745,7 @@ Node* JSNativeContextSpecialization::InlineApiCall(
CallInterfaceDescriptor call_interface_descriptor =
call_api_callback.descriptor();
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), call_interface_descriptor,
graph()->zone(), call_interface_descriptor,
call_interface_descriptor.GetStackParameterCount() + argc +
1 /* implicit receiver */,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties,

View File

@ -583,7 +583,7 @@ Reduction JSTypedLowering::ReduceJSAdd(Node* node) {
Callable const callable =
CodeFactory::StringAdd(isolate(), flags, NOT_TENURED);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNeedsFrameState, properties);
DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op()));
node->InsertInput(graph()->zone(), 0,
@ -1104,7 +1104,7 @@ Reduction JSTypedLowering::ReduceJSToObject(Node* node) {
// Convert {receiver} using the ToObjectStub.
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNeedsFrameState, node->op()->properties());
rfalse = efalse = if_false =
graph()->NewNode(common()->Call(call_descriptor),
@ -1547,7 +1547,7 @@ Reduction JSTypedLowering::ReduceJSConstructForwardVarargs(Node* node) {
node->InsertInput(graph()->zone(), 5, jsgraph()->UndefinedConstant());
NodeProperties::ChangeOp(
node, common()->Call(Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), arity + 1,
graph()->zone(), callable.descriptor(), arity + 1,
CallDescriptor::kNeedsFrameState)));
return Changed(node);
}
@ -1590,9 +1590,9 @@ Reduction JSTypedLowering::ReduceJSConstruct(Node* node) {
node->InsertInput(graph()->zone(), 4, jsgraph()->UndefinedConstant());
node->InsertInput(graph()->zone(), 5, jsgraph()->UndefinedConstant());
NodeProperties::ChangeOp(
node, common()->Call(Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(),
ConstructStubDescriptor(isolate()), 1 + arity, flags)));
node,
common()->Call(Linkage::GetStubCallDescriptor(
graph()->zone(), ConstructStubDescriptor{}, 1 + arity, flags)));
return Changed(node);
}
@ -1621,8 +1621,7 @@ Reduction JSTypedLowering::ReduceJSCallForwardVarargs(Node* node) {
node->InsertInput(graph()->zone(), 3, jsgraph()->Constant(start_index));
NodeProperties::ChangeOp(
node, common()->Call(Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), arity + 1,
flags)));
graph()->zone(), callable.descriptor(), arity + 1, flags)));
return Changed(node);
}
@ -1701,8 +1700,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
jsgraph()->Constant(shared->internal_formal_parameter_count()));
NodeProperties::ChangeOp(
node, common()->Call(Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(),
1 + arity, flags)));
graph()->zone(), callable.descriptor(), 1 + arity, flags)));
} else if (shared->HasBuiltinId() &&
Builtins::HasCppImplementation(shared->builtin_id())) {
// Patch {node} to a direct CEntry call.
@ -1717,7 +1715,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
const CallInterfaceDescriptor& descriptor = callable.descriptor();
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), descriptor, 1 + arity, flags);
graph()->zone(), descriptor, 1 + arity, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
node->InsertInput(graph()->zone(), 0, stub_code); // Code object.
node->InsertInput(graph()->zone(), 2, new_target);
@ -1745,8 +1743,7 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
node->InsertInput(graph()->zone(), 2, jsgraph()->Constant(arity));
NodeProperties::ChangeOp(
node, common()->Call(Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 1 + arity,
flags)));
graph()->zone(), callable.descriptor(), 1 + arity, flags)));
return Changed(node);
}
@ -1835,7 +1832,7 @@ Reduction JSTypedLowering::ReduceJSForInNext(Node* node) {
Callable const callable =
Builtins::CallableFor(isolate(), Builtins::kForInFilter);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0,
graph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNeedsFrameState);
vfalse = efalse = if_false =
graph()->NewNode(common()->Call(call_descriptor),

View File

@ -344,7 +344,7 @@ CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
// CallInterfaceDescriptor.
// TODO(turbofan): cache call descriptors for code stub calls.
CallDescriptor* Linkage::GetStubCallDescriptor(
Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
Zone* zone, const CallInterfaceDescriptor& descriptor,
int stack_parameter_count, CallDescriptor::Flags flags,
Operator::Properties properties, MachineType return_type,
size_t return_count, Linkage::ContextSpecification context_spec,
@ -396,23 +396,23 @@ CallDescriptor* Linkage::GetStubCallDescriptor(
? MachineType::Pointer()
: MachineType::AnyTagged();
LinkageLocation target_loc = LinkageLocation::ForAnyRegister(target_type);
return new (zone) CallDescriptor( // --
kind, // kind
target_type, // target MachineType
target_loc, // target location
locations.Build(), // location_sig
stack_parameter_count, // stack_parameter_count
properties, // properties
kNoCalleeSaved, // callee-saved registers
kNoCalleeSaved, // callee-saved fp
CallDescriptor::kCanUseRoots | // flags
flags, // flags
descriptor.DebugName(isolate), descriptor.allocatable_registers());
return new (zone) CallDescriptor( // --
kind, // kind
target_type, // target MachineType
target_loc, // target location
locations.Build(), // location_sig
stack_parameter_count, // stack_parameter_count
properties, // properties
kNoCalleeSaved, // callee-saved registers
kNoCalleeSaved, // callee-saved fp
CallDescriptor::kCanUseRoots | flags, // flags
descriptor.DebugName(), // debug name
descriptor.allocatable_registers());
}
// static
CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor(
Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
Zone* zone, const CallInterfaceDescriptor& descriptor,
int stack_parameter_count) {
const int register_parameter_count = descriptor.GetRegisterParameterCount();
const int parameter_count = register_parameter_count + stack_parameter_count;
@ -449,7 +449,7 @@ CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor(
kNoCalleeSaved, // callee-saved registers
kNoCalleeSaved, // callee-saved fp
kFlags, // flags
descriptor.DebugName(isolate));
descriptor.DebugName());
}
LinkageLocation Linkage::GetOsrValueLocation(int index) const {

View File

@ -390,7 +390,7 @@ class V8_EXPORT_PRIVATE Linkage : public NON_EXPORTED_BASE(ZoneObject) {
CallDescriptor::Flags flags);
static CallDescriptor* GetStubCallDescriptor(
Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
Zone* zone, const CallInterfaceDescriptor& descriptor,
int stack_parameter_count, CallDescriptor::Flags flags,
Operator::Properties properties = Operator::kNoProperties,
MachineType return_type = MachineType::AnyTagged(),
@ -398,7 +398,7 @@ class V8_EXPORT_PRIVATE Linkage : public NON_EXPORTED_BASE(ZoneObject) {
StubCallMode stub_mode = StubCallMode::kCallOnHeapBuiltin);
static CallDescriptor* GetBytecodeDispatchCallDescriptor(
Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
Zone* zone, const CallInterfaceDescriptor& descriptor,
int stack_parameter_count);
// Creates a call descriptor for simplified C calls that is appropriate

View File

@ -237,7 +237,7 @@ void MemoryOptimizer::VisitAllocateRaw(Node* node,
AllocateInOldSpaceStubConstant();
if (!allocate_operator_.is_set()) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), AllocateDescriptor(isolate()), 0,
graph()->zone(), AllocateDescriptor{}, 0,
CallDescriptor::kCanUseRoots, Operator::kNoThrow,
MachineType::AnyTagged(), 1, Linkage::kNoContext);
allocate_operator_.set(common()->Call(call_descriptor));
@ -294,7 +294,7 @@ void MemoryOptimizer::VisitAllocateRaw(Node* node,
AllocateInOldSpaceStubConstant();
if (!allocate_operator_.is_set()) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), AllocateDescriptor(isolate()), 0,
graph()->zone(), AllocateDescriptor{}, 0,
CallDescriptor::kCanUseRoots, Operator::kNoThrow,
MachineType::AnyTagged(), 1, Linkage::kNoContext);
allocate_operator_.set(common()->Call(call_descriptor));

View File

@ -3910,9 +3910,9 @@ Operator const* SimplifiedLowering::ToNumberOperator() {
if (!to_number_operator_.is_set()) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToNumber);
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags,
Operator::kNoProperties);
auto call_descriptor =
Linkage::GetStubCallDescriptor(graph()->zone(), callable.descriptor(),
0, flags, Operator::kNoProperties);
to_number_operator_.set(common()->Call(call_descriptor));
}
return to_number_operator_.get();
@ -3922,9 +3922,9 @@ Operator const* SimplifiedLowering::ToNumericOperator() {
if (!to_numeric_operator_.is_set()) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToNumeric);
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState;
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), graph()->zone(), callable.descriptor(), 0, flags,
Operator::kNoProperties);
auto call_descriptor =
Linkage::GetStubCallDescriptor(graph()->zone(), callable.descriptor(),
0, flags, Operator::kNoProperties);
to_numeric_operator_.set(common()->Call(call_descriptor));
}
return to_numeric_operator_.get();

View File

@ -4020,9 +4020,8 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
Node* target = jsgraph()->HeapConstant(callable.code());
if (!allocate_heap_number_operator_.is_set()) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate_, mcgraph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags, Operator::kNoThrow,
MachineType::AnyTagged(), 1, Linkage::kNoContext);
mcgraph()->zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags,
Operator::kNoThrow, MachineType::AnyTagged(), 1, Linkage::kNoContext);
allocate_heap_number_operator_.set(common->Call(call_descriptor));
}
Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(),
@ -4183,8 +4182,8 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
Node* BuildJavaScriptToNumber(Node* node, Node* js_context) {
Callable callable = Builtins::CallableFor(isolate_, Builtins::kToNumber);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate_, mcgraph()->zone(), callable.descriptor(), 0,
CallDescriptor::kNoFlags, Operator::kNoProperties);
mcgraph()->zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags,
Operator::kNoProperties);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* result =
@ -4498,8 +4497,8 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
}
call_descriptor = Linkage::GetStubCallDescriptor(
isolate_, mcgraph()->zone(), ArgumentAdaptorDescriptor(isolate_),
1 + wasm_count, CallDescriptor::kNoFlags, Operator::kNoProperties,
mcgraph()->zone(), ArgumentAdaptorDescriptor{}, 1 + wasm_count,
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), 1, Linkage::kPassContext,
StubCallMode::kCallWasmRuntimeStub);
@ -4524,8 +4523,8 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
args[pos++] = undefined_node; // receiver
call_descriptor = Linkage::GetStubCallDescriptor(
isolate_, graph()->zone(), CallTrampolineDescriptor(isolate_),
wasm_count + 1, CallDescriptor::kNoFlags, Operator::kNoProperties,
graph()->zone(), CallTrampolineDescriptor{}, wasm_count + 1,
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), 1, Linkage::kPassContext,
StubCallMode::kCallWasmRuntimeStub);

View File

@ -202,8 +202,7 @@ void AccessorAssembler::HandleLoadICHandlerCase(
BIND(&call_handler);
{
typedef LoadWithVectorDescriptor Descriptor;
exit_point->ReturnCallStub(Descriptor(isolate()), handler, p->context,
exit_point->ReturnCallStub(LoadWithVectorDescriptor{}, handler, p->context,
p->receiver, p->name, p->slot, p->vector);
}
}
@ -885,9 +884,9 @@ void AccessorAssembler::HandleStoreICHandlerCase(
// |handler| is a heap object. Must be code, call it.
BIND(&call_handler);
{
StoreWithVectorDescriptor descriptor(isolate());
TailCallStub(descriptor, CAST(strong_handler), CAST(p->context),
p->receiver, p->name, p->value, p->slot, p->vector);
TailCallStub(StoreWithVectorDescriptor{}, CAST(strong_handler),
CAST(p->context), p->receiver, p->name, p->value, p->slot,
p->vector);
}
}
@ -1225,9 +1224,8 @@ void AccessorAssembler::HandleStoreICProtoHandler(
&if_transitioning_element_store);
BIND(&if_element_store);
{
StoreWithVectorDescriptor descriptor(isolate());
TailCallStub(descriptor, code_handler, p->context, p->receiver, p->name,
p->value, p->slot, p->vector);
TailCallStub(StoreWithVectorDescriptor{}, code_handler, p->context,
p->receiver, p->name, p->value, p->slot, p->vector);
}
BIND(&if_transitioning_element_store);
@ -1239,9 +1237,9 @@ void AccessorAssembler::HandleStoreICProtoHandler(
GotoIf(IsDeprecatedMap(transition_map), miss);
StoreTransitionDescriptor descriptor(isolate());
TailCallStub(descriptor, code_handler, p->context, p->receiver, p->name,
transition_map, p->value, p->slot, p->vector);
TailCallStub(StoreTransitionDescriptor{}, code_handler, p->context,
p->receiver, p->name, transition_map, p->value, p->slot,
p->vector);
}
};
}
@ -3076,9 +3074,8 @@ void AccessorAssembler::StoreInArrayLiteralIC(const StoreICParameters* p) {
TNode<HeapObject> handler = CAST(var_handler.value());
Label if_transitioning_element_store(this);
GotoIfNot(IsCode(handler), &if_transitioning_element_store);
StoreWithVectorDescriptor descriptor(isolate());
TailCallStub(descriptor, CAST(handler), CAST(p->context), p->receiver,
p->name, p->value, p->slot, p->vector);
TailCallStub(StoreWithVectorDescriptor{}, CAST(handler), CAST(p->context),
p->receiver, p->name, p->value, p->slot, p->vector);
BIND(&if_transitioning_element_store);
{
@ -3089,9 +3086,8 @@ void AccessorAssembler::StoreInArrayLiteralIC(const StoreICParameters* p) {
GotoIf(IsDeprecatedMap(transition_map), &miss);
Node* code = LoadObjectField(handler, StoreHandler::kSmiHandlerOffset);
CSA_ASSERT(this, IsCode(code));
StoreTransitionDescriptor descriptor(isolate());
TailCallStub(descriptor, code, p->context, p->receiver, p->name,
transition_map, p->value, p->slot, p->vector);
TailCallStub(StoreTransitionDescriptor{}, code, p->context, p->receiver,
p->name, transition_map, p->value, p->slot, p->vector);
}
}

View File

@ -15,7 +15,7 @@ void CallInterfaceDescriptorData::InitializePlatformSpecific(
register_param_count_ = register_parameter_count;
// InterfaceDescriptor owns a copy of the registers array.
register_params_.reset(NewArray<Register>(register_parameter_count, no_reg));
register_params_ = NewArray<Register>(register_parameter_count, no_reg);
for (int i = 0; i < register_parameter_count; i++) {
register_params_[i] = registers[i];
}
@ -27,7 +27,7 @@ void CallInterfaceDescriptorData::InitializePlatformIndependent(
// InterfaceDescriptor owns a copy of the MachineType array.
// We only care about parameters, not receiver and result.
param_count_ = parameter_count + extra_parameter_count;
machine_types_.reset(NewArray<MachineType>(param_count_));
machine_types_ = NewArray<MachineType>(param_count_);
for (int i = 0; i < param_count_; i++) {
if (machine_types == nullptr || i >= parameter_count) {
machine_types_[i] = MachineType::AnyTagged();
@ -37,6 +37,30 @@ void CallInterfaceDescriptorData::InitializePlatformIndependent(
}
}
void CallInterfaceDescriptorData::Reset() {
delete[] machine_types_;
machine_types_ = nullptr;
delete[] register_params_;
register_params_ = nullptr;
}
// static
CallInterfaceDescriptorData
CallDescriptors::call_descriptor_data_[NUMBER_OF_DESCRIPTORS];
void CallDescriptors::InitializeOncePerProcess() {
#define INTERFACE_DESCRIPTOR(name, ...) \
name##Descriptor().Initialize(&call_descriptor_data_[CallDescriptors::name]);
INTERFACE_DESCRIPTOR_LIST(INTERFACE_DESCRIPTOR)
#undef INTERFACE_DESCRIPTOR
}
void CallDescriptors::TearDown() {
for (CallInterfaceDescriptorData& data : call_descriptor_data_) {
data.Reset();
}
}
void CallInterfaceDescriptor::JSDefaultInitializePlatformSpecific(
CallInterfaceDescriptorData* data, int non_js_register_parameter_count) {
DCHECK_LE(static_cast<unsigned>(non_js_register_parameter_count), 1);
@ -58,15 +82,12 @@ void CallInterfaceDescriptor::JSDefaultInitializePlatformSpecific(
default_js_stub_registers);
}
const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const {
CallInterfaceDescriptorData* start = isolate->call_descriptor_data(0);
size_t index = data_ - start;
DCHECK(index < CallDescriptors::NUMBER_OF_DESCRIPTORS);
CallDescriptors::Key key = static_cast<CallDescriptors::Key>(index);
const char* CallInterfaceDescriptor::DebugName() const {
CallDescriptors::Key key = CallDescriptors::GetKey(data_);
switch (key) {
#define DEF_CASE(NAME, ...) \
case CallDescriptors::NAME: \
return #NAME " Descriptor";
#define DEF_CASE(name, ...) \
case CallDescriptors::name: \
return #name " Descriptor";
INTERFACE_DESCRIPTOR_LIST(DEF_CASE)
#undef DEF_CASE
case CallDescriptors::NUMBER_OF_DESCRIPTORS:

View File

@ -76,10 +76,7 @@ class PlatformInterfaceDescriptor;
class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
public:
CallInterfaceDescriptorData()
: register_param_count_(-1),
param_count_(-1),
allocatable_registers_(0) {}
CallInterfaceDescriptorData() = default;
// A copy of the passed in registers and param_representations is made
// and owned by the CallInterfaceDescriptorData.
@ -99,6 +96,8 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
int extra_parameter_count,
const MachineType* machine_types);
void Reset();
bool IsInitialized() const {
return register_param_count_ >= 0 && param_count_ >= 0;
}
@ -106,7 +105,7 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
int param_count() const { return param_count_; }
int register_param_count() const { return register_param_count_; }
Register register_param(int index) const { return register_params_[index]; }
Register* register_params() const { return register_params_.get(); }
Register* register_params() const { return register_params_; }
MachineType param_type(int index) const { return machine_types_[index]; }
PlatformInterfaceDescriptor* platform_specific_descriptor() const {
return platform_specific_descriptor_;
@ -123,27 +122,26 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptorData {
RegList allocatable_registers() const { return allocatable_registers_; }
private:
int register_param_count_;
int param_count_;
int register_param_count_ = -1;
int param_count_ = -1;
// Specifying the set of registers that could be used by the register
// allocator. Currently, it's only used by RecordWrite code stub.
RegList allocatable_registers_;
RegList allocatable_registers_ = 0;
// The Register params are allocated dynamically by the
// InterfaceDescriptor, and freed on destruction. This is because static
// arrays of Registers cause creation of runtime static initializers
// which we don't want.
std::unique_ptr<Register[]> register_params_;
std::unique_ptr<MachineType[]> machine_types_;
Register* register_params_ = nullptr;
MachineType* machine_types_ = nullptr;
PlatformInterfaceDescriptor* platform_specific_descriptor_;
PlatformInterfaceDescriptor* platform_specific_descriptor_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData);
};
class CallDescriptors {
class V8_EXPORT_PRIVATE CallDescriptors : public AllStatic {
public:
enum Key {
#define DEF_ENUM(name, ...) name,
@ -151,6 +149,25 @@ class CallDescriptors {
#undef DEF_ENUM
NUMBER_OF_DESCRIPTORS
};
static void InitializeOncePerProcess();
static void TearDown();
static CallInterfaceDescriptorData* call_descriptor_data(
CallDescriptors::Key key) {
return &call_descriptor_data_[key];
}
static Key GetKey(const CallInterfaceDescriptorData* data) {
ptrdiff_t index = data - call_descriptor_data_;
DCHECK_LE(0, index);
DCHECK_LT(index, CallDescriptors::NUMBER_OF_DESCRIPTORS);
return static_cast<CallDescriptors::Key>(index);
}
private:
static CallInterfaceDescriptorData
call_descriptor_data_[NUMBER_OF_DESCRIPTORS];
};
class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
@ -158,8 +175,8 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
CallInterfaceDescriptor() : data_(nullptr) {}
virtual ~CallInterfaceDescriptor() {}
CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key)
: data_(isolate->call_descriptor_data(key)) {}
CallInterfaceDescriptor(CallDescriptors::Key key)
: data_(CallDescriptors::call_descriptor_data(key)) {}
int GetParameterCount() const { return data()->param_count(); }
@ -191,7 +208,7 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
static const Register ContextRegister();
const char* DebugName(Isolate* isolate) const;
const char* DebugName() const;
protected:
const CallInterfaceDescriptorData* data() const { return data_; }
@ -206,17 +223,6 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
nullptr);
}
void Initialize(Isolate* isolate, CallDescriptors::Key key) {
if (!data()->IsInitialized()) {
// We should only initialize descriptors on the isolate's main thread.
DCHECK(ThreadId::Current().Equals(isolate->thread_id()));
CallInterfaceDescriptorData* d = isolate->call_descriptor_data(key);
DCHECK(d == data()); // d should be a modifiable pointer to data().
InitializePlatformSpecific(d);
InitializePlatformIndependent(d);
}
}
// Initializes |data| using the platform dependent default set of registers.
// It is intended to be used for TurboFan stubs when particular set of
// registers does not matter.
@ -231,14 +237,24 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
CallInterfaceDescriptorData* data, int non_js_register_parameter_count);
private:
// {CallDescriptors} is allowed to call the private {Initialize} method.
friend class CallDescriptors;
const CallInterfaceDescriptorData* data_;
void Initialize(CallInterfaceDescriptorData* data) {
// The passed pointer should be a modifiable pointer to our own data.
DCHECK_EQ(data, data_);
DCHECK(!data->IsInitialized());
InitializePlatformSpecific(data);
InitializePlatformIndependent(data);
DCHECK(data->IsInitialized());
}
};
#define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
public: \
explicit name(Isolate* isolate) : base(isolate, key()) { \
Initialize(isolate, key()); \
} \
#define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
public: \
explicit name() : base(key()) {} \
static inline CallDescriptors::Key key();
constexpr int kMaxBuiltinRegisterParams = 5;
@ -259,7 +275,7 @@ constexpr int kMaxBuiltinRegisterParams = 5;
data->InitializePlatformIndependent(kRegisterParams, kStackParams, \
nullptr); \
} \
name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
name(CallDescriptors::Key key) : base(key) {} \
\
public:
@ -271,7 +287,7 @@ constexpr int kMaxBuiltinRegisterParams = 5;
override { \
JSDefaultInitializePlatformSpecific(data, non_js_reg_parameters_count); \
} \
name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
name(CallDescriptors::Key key) : base(key) {} \
\
public:
@ -293,7 +309,7 @@ constexpr int kMaxBuiltinRegisterParams = 5;
DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
protected: \
void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \
name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \
name(CallDescriptors::Key key) : base(key) {} \
\
public:

View File

@ -1423,12 +1423,12 @@ Node* InterpreterAssembler::DispatchToBytecodeHandler(Node* handler,
Node* InterpreterAssembler::DispatchToBytecodeHandlerEntry(
Node* handler_entry, Node* bytecode_offset, Node* target_bytecode) {
InterpreterDispatchDescriptor descriptor(isolate());
// Propagate speculation poisoning.
Node* poisoned_handler_entry = WordPoisonOnSpeculation(handler_entry);
return TailCallBytecodeDispatch(
descriptor, poisoned_handler_entry, GetAccumulatorUnchecked(),
bytecode_offset, BytecodeArrayTaggedPointer(), DispatchTableRawPointer());
InterpreterDispatchDescriptor{}, poisoned_handler_entry,
GetAccumulatorUnchecked(), bytecode_offset, BytecodeArrayTaggedPointer(),
DispatchTableRawPointer());
}
void InterpreterAssembler::DispatchWide(OperandScale operand_scale) {

View File

@ -3107,9 +3107,8 @@ IGNITION_HANDLER(ResumeGenerator, InterpreterAssembler) {
Handle<Code> GenerateBytecodeHandler(Isolate* isolate, Bytecode bytecode,
OperandScale operand_scale) {
Zone zone(isolate->allocator(), ZONE_NAME);
InterpreterDispatchDescriptor descriptor(isolate);
compiler::CodeAssemblerState state(
isolate, &zone, descriptor, Code::BYTECODE_HANDLER,
isolate, &zone, InterpreterDispatchDescriptor{}, Code::BYTECODE_HANDLER,
Bytecodes::ToString(bytecode),
FLAG_untrusted_code_mitigations
? PoisoningMitigationLevel::kPoisonCriticalOnly
@ -3183,9 +3182,9 @@ Handle<Code> GenerateDeserializeLazyHandler(Isolate* isolate,
debug_name = debug_name.append(Bytecodes::ToString(prefix_bytecode));
}
InterpreterDispatchDescriptor descriptor(isolate);
compiler::CodeAssemblerState state(
isolate, &zone, descriptor, Code::BYTECODE_HANDLER, debug_name.c_str(),
isolate, &zone, InterpreterDispatchDescriptor{}, Code::BYTECODE_HANDLER,
debug_name.c_str(),
FLAG_untrusted_code_mitigations
? PoisoningMitigationLevel::kPoisonCriticalOnly
: PoisoningMitigationLevel::kDontPoison,

View File

@ -2508,7 +2508,6 @@ Isolate::Isolate()
setup_delegate_(nullptr),
regexp_stack_(nullptr),
date_cache_(nullptr),
call_descriptor_data_(nullptr),
// TODO(bmeurer) Initialized lazily because it depends on flags; can
// be fixed once the default isolate cleanup is done.
random_number_generator_(nullptr),
@ -2727,9 +2726,6 @@ Isolate::~Isolate() {
delete date_cache_;
date_cache_ = nullptr;
delete[] call_descriptor_data_;
call_descriptor_data_ = nullptr;
delete regexp_stack_;
regexp_stack_ = nullptr;
@ -2961,8 +2957,6 @@ bool Isolate::Init(StartupDeserializer* des) {
regexp_stack_ = new RegExpStack();
regexp_stack_->isolate_ = this;
date_cache_ = new DateCache();
call_descriptor_data_ =
new CallInterfaceDescriptorData[CallDescriptors::NUMBER_OF_DESCRIPTORS];
heap_profiler_ = new HeapProfiler(heap());
interpreter_ = new interpreter::Interpreter(this);
compiler_dispatcher_ =
@ -3006,12 +3000,6 @@ bool Isolate::Init(StartupDeserializer* des) {
wasm_engine_->code_manager()->SetModuleCodeSizeHistogram(
counters()->wasm_module_code_size_mb());
// Initialize the interface descriptors ahead of time.
#define INTERFACE_DESCRIPTOR(Name, ...) \
{ Name##Descriptor(this); }
INTERFACE_DESCRIPTOR_LIST(INTERFACE_DESCRIPTOR)
#undef INTERFACE_DESCRIPTOR
deoptimizer_data_ = new DeoptimizerData(heap());
const bool create_heap_objects = (des == nullptr);
@ -3604,12 +3592,6 @@ bool Isolate::IsAnyInitialArrayPrototype(Handle<JSArray> array) {
return IsInAnyContext(*array, Context::INITIAL_ARRAY_PROTOTYPE_INDEX);
}
CallInterfaceDescriptorData* Isolate::call_descriptor_data(int index) {
DCHECK(0 <= index && index < CallDescriptors::NUMBER_OF_DESCRIPTORS);
return &call_descriptor_data_[index];
}
static base::RandomNumberGenerator* ensure_rng_exists(
base::RandomNumberGenerator** rng, int seed) {
if (*rng == nullptr) {

View File

@ -54,7 +54,6 @@ class AstStringConstants;
class BasicBlockProfiler;
class Bootstrapper;
class BuiltinsConstantsTableBuilder;
class CallInterfaceDescriptorData;
class CancelableTaskManager;
class CodeEventDispatcher;
class ExternalCodeEventListener;
@ -1144,9 +1143,6 @@ class Isolate : private HiddenFactory {
// Returns true if array is the initial array prototype in any native context.
bool IsAnyInitialArrayPrototype(Handle<JSArray> array);
V8_EXPORT_PRIVATE CallInterfaceDescriptorData* call_descriptor_data(
int index);
void IterateDeferredHandles(RootVisitor* visitor);
void LinkDeferredHandles(DeferredHandles* deferred_handles);
void UnlinkDeferredHandles(DeferredHandles* deferred_handles);
@ -1562,7 +1558,6 @@ class Isolate : private HiddenFactory {
RegExpStack* regexp_stack_;
std::vector<int> regexp_indices_;
DateCache* date_cache_;
CallInterfaceDescriptorData* call_descriptor_data_;
base::RandomNumberGenerator* random_number_generator_;
base::RandomNumberGenerator* fuzzer_rng_;
base::AtomicValue<RAILMode> rail_mode_;

View File

@ -14,6 +14,7 @@
#include "src/deoptimizer.h"
#include "src/elements.h"
#include "src/frames.h"
#include "src/interface-descriptors.h"
#include "src/isolate.h"
#include "src/libsampler/sampler.h"
#include "src/objects-inl.h"
@ -46,6 +47,7 @@ void V8::TearDown() {
#if defined(USE_SIMULATOR)
Simulator::GlobalTearDown();
#endif
CallDescriptors::TearDown();
Bootstrapper::TearDownExtensions();
ElementsAccessor::TearDown();
RegisteredExtension::UnregisterAll();
@ -81,6 +83,7 @@ void V8::InitializeOncePerProcessImpl() {
CpuFeatures::Probe(false);
ElementsAccessor::InitializeOncePerProcess();
Bootstrapper::InitializeOncePerProcess();
CallDescriptors::InitializeOncePerProcess();
}

View File

@ -22,7 +22,7 @@ class CodeAssemblerTester {
explicit CodeAssemblerTester(Isolate* isolate, const char* name = "test")
: zone_(isolate->allocator(), ZONE_NAME),
scope_(isolate),
state_(isolate, &zone_, VoidDescriptor(isolate), Code::STUB, name,
state_(isolate, &zone_, VoidDescriptor{}, Code::STUB, name,
PoisoningMitigationLevel::kDontPoison) {}
// Test generating code for a JS function (e.g. builtins).

View File

@ -108,7 +108,7 @@ TEST(TestLinkageStubCall) {
Callable callable = Builtins::CallableFor(isolate, Builtins::kToNumber);
OptimizedCompilationInfo info(ArrayVector("test"), &zone, Code::STUB);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate, &zone, callable.descriptor(), 0, CallDescriptor::kNoFlags,
&zone, callable.descriptor(), 0, CallDescriptor::kNoFlags,
Operator::kNoProperties);
CHECK(call_descriptor);
CHECK_EQ(0, static_cast<int>(call_descriptor->StackParameterCount()));

View File

@ -27,9 +27,8 @@ class StubTester {
info_(ArrayVector("test"), zone, Code::STUB),
interface_descriptor_(stub->GetCallInterfaceDescriptor()),
descriptor_(Linkage::GetStubCallDescriptor(
isolate, zone, interface_descriptor_,
stub->GetStackParameterCount(), CallDescriptor::kNoFlags,
Operator::kNoProperties)),
zone, interface_descriptor_, stub->GetStackParameterCount(),
CallDescriptor::kNoFlags, Operator::kNoProperties)),
graph_(zone_),
common_(zone_),
tester_(InitializeFunctionTester(stub->GetCode()),
@ -41,7 +40,7 @@ class StubTester {
interface_descriptor_(
Builtins::CallableFor(isolate, name).descriptor()),
descriptor_(Linkage::GetStubCallDescriptor(
isolate, zone, interface_descriptor_,
zone, interface_descriptor_,
interface_descriptor_.GetStackParameterCount(),
CallDescriptor::kNoFlags, Operator::kNoProperties)),
graph_(zone_),

View File

@ -31,8 +31,8 @@ namespace internal {
CodeStubAssemblerTestState::CodeStubAssemblerTestState(
CodeStubAssemblerTest* test)
: compiler::CodeAssemblerState(
test->isolate(), test->zone(), VoidDescriptor(test->isolate()),
Code::STUB, "test", PoisoningMitigationLevel::kPoisonCriticalOnly) {}
test->isolate(), test->zone(), VoidDescriptor{}, Code::STUB, "test",
PoisoningMitigationLevel::kPoisonCriticalOnly) {}
TARGET_TEST_F(CodeStubAssemblerTest, SmiTag) {
CodeStubAssemblerTestState state(this);

View File

@ -19,8 +19,8 @@ namespace internal {
namespace compiler {
CodeAssemblerTestState::CodeAssemblerTestState(CodeAssemblerTest* test)
: CodeAssemblerState(test->isolate(), test->zone(),
VoidDescriptor(test->isolate()), Code::STUB, "test",
: CodeAssemblerState(test->isolate(), test->zone(), VoidDescriptor{},
Code::STUB, "test",
PoisoningMitigationLevel::kPoisonCriticalOnly) {}
TARGET_TEST_F(CodeAssemblerTest, IntPtrAdd) {

View File

@ -422,8 +422,8 @@ TARGET_TEST_F(InstructionSelectorTest, CallStubWithDeopt) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 1,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
zone(), callable.descriptor(), 1, CallDescriptor::kNeedsFrameState,
Operator::kNoProperties);
// Build frame state for the state before the call.
Node* parameters = m.AddNode(
@ -517,8 +517,8 @@ TARGET_TEST_F(InstructionSelectorTest, CallStubWithDeoptRecursiveFrameState) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject);
auto call_descriptor = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 1,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
zone(), callable.descriptor(), 1, CallDescriptor::kNeedsFrameState,
Operator::kNoProperties);
// Build frame state for the state before the call.
Node* parameters = m.AddNode(

View File

@ -25,8 +25,7 @@ namespace interpreter_assembler_unittest {
InterpreterAssemblerTestState::InterpreterAssemblerTestState(
InterpreterAssemblerTest* test, Bytecode bytecode)
: compiler::CodeAssemblerState(
test->isolate(), test->zone(),
InterpreterDispatchDescriptor(test->isolate()),
test->isolate(), test->zone(), InterpreterDispatchDescriptor{},
Code::BYTECODE_HANDLER, Bytecodes::ToString(bytecode),
PoisoningMitigationLevel::kPoisonCriticalOnly,
Bytecodes::ReturnCount(bytecode)) {}