[cleanup] Consistently use UintPtrT as type for feedback vector slot

Change-Id: I9eb86c5ca40734ec61864bce7d0f757fcd4b7d93
Bug: v8:11429
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2697205
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72800}
This commit is contained in:
Victor Gomes 2021-02-16 15:53:42 +01:00 committed by Commit Bot
parent a5bebe6535
commit c7c5fabf92
4 changed files with 44 additions and 68 deletions

View File

@ -70,9 +70,8 @@ TF_BUILTIN(Call_ReceiverIsNullOrUndefined_Baseline,
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = LoadContextFromBaseline();
auto feedback_vector = LoadFeedbackVectorFromBaseline();
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
TailCallBuiltin(Builtins::kCall_ReceiverIsNullOrUndefined, context, target,
argc);
}
@ -83,9 +82,8 @@ TF_BUILTIN(Call_ReceiverIsNotNullOrUndefined_Baseline,
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = LoadContextFromBaseline();
auto feedback_vector = LoadFeedbackVectorFromBaseline();
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
TailCallBuiltin(Builtins::kCall_ReceiverIsNotNullOrUndefined, context, target,
argc);
}
@ -95,9 +93,8 @@ TF_BUILTIN(Call_ReceiverIsAny_Baseline, CallOrConstructBuiltinsAssembler) {
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = LoadContextFromBaseline();
auto feedback_vector = LoadFeedbackVectorFromBaseline();
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
TailCallBuiltin(Builtins::kCall_ReceiverIsAny, context, target, argc);
}
@ -107,9 +104,8 @@ TF_BUILTIN(Call_ReceiverIsNullOrUndefined_WithFeedback,
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
TailCallBuiltin(Builtins::kCall_ReceiverIsNullOrUndefined, context, target,
argc);
}
@ -120,9 +116,8 @@ TF_BUILTIN(Call_ReceiverIsNotNullOrUndefined_WithFeedback,
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
TailCallBuiltin(Builtins::kCall_ReceiverIsNotNullOrUndefined, context, target,
argc);
}
@ -132,9 +127,8 @@ TF_BUILTIN(Call_ReceiverIsAny_WithFeedback, CallOrConstructBuiltinsAssembler) {
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
TailCallBuiltin(Builtins::kCall_ReceiverIsAny, context, target, argc);
}
@ -469,9 +463,8 @@ TF_BUILTIN(CallWithArrayLike_WithFeedback, CallOrConstructBuiltinsAssembler) {
auto arguments_list = Parameter<Object>(Descriptor::kArgumentsList);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
CallOrConstructWithArrayLike(target, new_target, arguments_list, context);
}
@ -491,9 +484,8 @@ TF_BUILTIN(CallWithSpread_Baseline, CallOrConstructBuiltinsAssembler) {
auto args_count = UncheckedParameter<Int32T>(Descriptor::kArgumentsCount);
auto context = LoadContextFromBaseline();
auto feedback_vector = LoadFeedbackVectorFromBaseline();
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
CallOrConstructWithSpread(target, new_target, spread, args_count, context);
}
@ -504,9 +496,8 @@ TF_BUILTIN(CallWithSpread_WithFeedback, CallOrConstructBuiltinsAssembler) {
auto args_count = UncheckedParameter<Int32T>(Descriptor::kArgumentsCount);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)));
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
CollectCallFeedback(target, context, feedback_vector, slot);
CallOrConstructWithSpread(target, new_target, spread, args_count, context);
}

View File

@ -43,7 +43,7 @@ TF_BUILTIN(Construct_Baseline, CallOrConstructBuiltinsAssembler) {
auto target = Parameter<Object>(Descriptor::kTarget);
auto new_target = Parameter<Object>(Descriptor::kNewTarget);
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
// TODO(verwaest): Only emit context loads where necessary
auto context = LoadContextFromBaseline();
@ -53,8 +53,7 @@ TF_BUILTIN(Construct_Baseline, CallOrConstructBuiltinsAssembler) {
TVARIABLE(AllocationSite, allocation_site);
Label if_construct_generic(this), if_construct_array(this);
CollectConstructFeedback(context, target, new_target, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)),
CollectConstructFeedback(context, target, new_target, feedback_vector, slot,
&if_construct_generic, &if_construct_array,
&allocation_site);
@ -72,12 +71,11 @@ TF_BUILTIN(Construct_WithFeedback, CallOrConstructBuiltinsAssembler) {
auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
TVARIABLE(AllocationSite, allocation_site);
Label if_construct_generic(this), if_construct_array(this);
CollectConstructFeedback(context, target, new_target, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)),
CollectConstructFeedback(context, target, new_target, feedback_vector, slot,
&if_construct_generic, &if_construct_array,
&allocation_site);
@ -104,12 +102,11 @@ TF_BUILTIN(ConstructWithArrayLike_WithFeedback,
auto arguments_list = Parameter<Object>(Descriptor::kArgumentsList);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<FeedbackVector>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
TVARIABLE(AllocationSite, allocation_site);
Label if_construct_generic(this), if_construct_array(this);
CollectConstructFeedback(context, target, new_target, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)),
CollectConstructFeedback(context, target, new_target, feedback_vector, slot,
&if_construct_generic, &if_construct_array,
&allocation_site);
@ -136,7 +133,7 @@ TF_BUILTIN(ConstructWithSpread_Baseline, CallOrConstructBuiltinsAssembler) {
auto spread = Parameter<Object>(Descriptor::kSpread);
auto args_count =
UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
// TODO(verwaest): Only emit context loads where necessary
auto context = LoadContextFromBaseline();
@ -146,8 +143,7 @@ TF_BUILTIN(ConstructWithSpread_Baseline, CallOrConstructBuiltinsAssembler) {
TVARIABLE(AllocationSite, allocation_site);
Label if_construct_generic(this), if_construct_array(this);
CollectConstructFeedback(context, target, new_target, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)),
CollectConstructFeedback(context, target, new_target, feedback_vector, slot,
&if_construct_generic, &if_construct_array,
&allocation_site);
@ -166,12 +162,11 @@ TF_BUILTIN(ConstructWithSpread_WithFeedback, CallOrConstructBuiltinsAssembler) {
UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
auto context = Parameter<Context>(Descriptor::kContext);
auto feedback_vector = Parameter<HeapObject>(Descriptor::kFeedbackVector);
auto slot = UncheckedParameter<Int32T>(Descriptor::kSlot);
auto slot = UncheckedParameter<UintPtrT>(Descriptor::kSlot);
TVARIABLE(AllocationSite, allocation_site);
Label if_construct_generic(this), if_construct_array(this);
CollectConstructFeedback(context, target, new_target, feedback_vector,
Unsigned(ChangeInt32ToIntPtr(slot)),
CollectConstructFeedback(context, target, new_target, feedback_vector, slot,
&if_construct_generic, &if_construct_array,
&allocation_site);

View File

@ -1140,18 +1140,16 @@ class CallWithSpreadDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(CallWithSpreadDescriptor, CallInterfaceDescriptor)
};
// TODO(v8:11429,jgruber): Pass the slot as UintPtr.
class CallWithSpread_BaselineDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS_VARARGS(kTarget, kArgumentsCount, kSpread, kSlot)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget
MachineType::Int32(), // kArgumentsCount
MachineType::AnyTagged(), // kSpread
MachineType::Int32()) // kSlot
MachineType::UintPtr()) // kSlot
DECLARE_DESCRIPTOR(CallWithSpread_BaselineDescriptor, CallInterfaceDescriptor)
};
// TODO(jgruber): Pass the slot as UintPtr.
class CallWithSpread_WithFeedbackDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS_VARARGS(kTarget, kArgumentsCount, kSpread, kSlot,
@ -1159,7 +1157,7 @@ class CallWithSpread_WithFeedbackDescriptor : public CallInterfaceDescriptor {
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget
MachineType::Int32(), // kArgumentsCount
MachineType::AnyTagged(), // kSpread
MachineType::Int32(), // kSlot
MachineType::UintPtr(), // kSlot
MachineType::AnyTagged()) // kFeedbackVector
DECLARE_DESCRIPTOR(CallWithSpread_WithFeedbackDescriptor,
CallInterfaceDescriptor)
@ -1173,14 +1171,13 @@ class CallWithArrayLikeDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(CallWithArrayLikeDescriptor, CallInterfaceDescriptor)
};
// TODO(jgruber): Pass the slot as UintPtr.
class CallWithArrayLike_WithFeedbackDescriptor
: public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS(kTarget, kArgumentsList, kSlot, kFeedbackVector)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget
MachineType::AnyTagged(), // kArgumentsList
MachineType::Int32(), // kSlot
MachineType::UintPtr(), // kSlot
MachineType::AnyTagged()) // kFeedbackVector
DECLARE_DESCRIPTOR(CallWithArrayLike_WithFeedbackDescriptor,
CallInterfaceDescriptor)
@ -1209,13 +1206,12 @@ class ConstructWithSpreadDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(ConstructWithSpreadDescriptor, CallInterfaceDescriptor)
};
// TODO(v8:11429,jgruber): Pass the slot as UintPtr.
class ConstructWithSpread_BaselineDescriptor : public CallInterfaceDescriptor {
public:
// Note: kSlot comes before kSpread since as an untagged value it must be
// passed in a register.
DEFINE_JS_PARAMETERS(kSlot, kSpread)
DEFINE_JS_PARAMETER_TYPES(MachineType::Int32(), // kSlot
DEFINE_JS_PARAMETER_TYPES(MachineType::UintPtr(), // kSlot
MachineType::AnyTagged()) // kSpread
DECLARE_DESCRIPTOR(ConstructWithSpread_BaselineDescriptor,
CallInterfaceDescriptor)
@ -1230,14 +1226,13 @@ class ConstructWithSpread_BaselineDescriptor : public CallInterfaceDescriptor {
static const int kStackArgumentsCount = kPassLastArgsOnStack ? 1 : 0;
};
// TODO(jgruber): Pass the slot as UintPtr.
class ConstructWithSpread_WithFeedbackDescriptor
: public CallInterfaceDescriptor {
public:
// Note: kSlot comes before kSpread since as an untagged value it must be
// passed in a register.
DEFINE_JS_PARAMETERS(kSlot, kSpread, kFeedbackVector)
DEFINE_JS_PARAMETER_TYPES(MachineType::Int32(), // kSlot
DEFINE_JS_PARAMETER_TYPES(MachineType::UintPtr(), // kSlot
MachineType::AnyTagged(), // kSpread
MachineType::AnyTagged()) // kFeedbackVector
DECLARE_DESCRIPTOR(ConstructWithSpread_WithFeedbackDescriptor,
@ -1253,7 +1248,6 @@ class ConstructWithArrayLikeDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(ConstructWithArrayLikeDescriptor, CallInterfaceDescriptor)
};
// TODO(jgruber): Pass the slot as UintPtr.
class ConstructWithArrayLike_WithFeedbackDescriptor
: public CallInterfaceDescriptor {
public:
@ -1261,7 +1255,7 @@ class ConstructWithArrayLike_WithFeedbackDescriptor
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kTarget
MachineType::AnyTagged(), // kNewTarget
MachineType::AnyTagged(), // kArgumentsList
MachineType::Int32(), // kSlot
MachineType::UintPtr(), // kSlot
MachineType::AnyTagged()) // kFeedbackVector
DECLARE_DESCRIPTOR(ConstructWithArrayLike_WithFeedbackDescriptor,
CallInterfaceDescriptor)
@ -1726,24 +1720,22 @@ class BinaryOp_WithFeedbackDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(BinaryOp_WithFeedbackDescriptor, CallInterfaceDescriptor)
};
// TODO(v8:11429,jgruber): Pass the slot as UintPtr.
class CallTrampoline_BaselineDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS_VARARGS(kFunction, kActualArgumentsCount, kSlot)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction
MachineType::Int32(), // kActualArgumentsCount
MachineType::Int32()) // kSlot
MachineType::UintPtr()) // kSlot
DECLARE_DESCRIPTOR(CallTrampoline_BaselineDescriptor, CallInterfaceDescriptor)
};
// TODO(jgruber): Pass the slot as UintPtr.
class CallTrampoline_WithFeedbackDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_PARAMETERS_VARARGS(kFunction, kActualArgumentsCount, kSlot,
kFeedbackVector)
DEFINE_PARAMETER_TYPES(MachineType::AnyTagged(), // kFunction
MachineType::Int32(), // kActualArgumentsCount
MachineType::Int32(), // kSlot
MachineType::UintPtr(), // kSlot
MachineType::AnyTagged()) // kFeedbackVector
DECLARE_DESCRIPTOR(CallTrampoline_WithFeedbackDescriptor,
CallInterfaceDescriptor)
@ -1768,21 +1760,19 @@ class Compare_BaselineDescriptor : public CallInterfaceDescriptor {
DECLARE_DESCRIPTOR(Compare_BaselineDescriptor, CallInterfaceDescriptor)
};
// TODO(v8:11429,jgruber): Pass the slot as UintPtr.
class Construct_BaselineDescriptor : public CallInterfaceDescriptor {
public:
DEFINE_JS_PARAMETERS_NO_CONTEXT(kSlot)
DEFINE_JS_PARAMETER_TYPES(MachineType::Int32()) // kSlot
DEFINE_JS_PARAMETER_TYPES(MachineType::UintPtr()) // kSlot
DECLARE_JS_COMPATIBLE_DESCRIPTOR(Construct_BaselineDescriptor,
CallInterfaceDescriptor, 1)
};
// TODO(jgruber): Pass the slot as UintPtr.
class Construct_WithFeedbackDescriptor : public CallInterfaceDescriptor {
public:
// kSlot is passed in a register, kFeedbackVector on the stack.
DEFINE_JS_PARAMETERS(kSlot, kFeedbackVector)
DEFINE_JS_PARAMETER_TYPES(MachineType::Int32(), // kSlot
DEFINE_JS_PARAMETER_TYPES(MachineType::UintPtr(), // kSlot
MachineType::AnyTagged()) // kFeedbackVector
DECLARE_JS_COMPATIBLE_DESCRIPTOR(Construct_WithFeedbackDescriptor,
CallInterfaceDescriptor, 1)

View File

@ -873,7 +873,7 @@ void JSGenericLowering::LowerJSConstruct(Node* node) {
zone(), callable.descriptor(), stack_argument_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* slot = jsgraph()->Int32Constant(p.feedback().index());
Node* slot = jsgraph()->UintPtrConstant(p.feedback().index());
Node* receiver = jsgraph()->UndefinedConstant();
Node* feedback_vector = node->RemoveInput(n.FeedbackVectorIndex());
// Register argument inputs are followed by stack argument inputs (such as
@ -935,7 +935,7 @@ void JSGenericLowering::LowerJSConstructWithArrayLike(Node* node) {
zone(), callable.descriptor(), stack_argument_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* receiver = jsgraph()->UndefinedConstant();
Node* slot = jsgraph()->Int32Constant(p.feedback().index());
Node* slot = jsgraph()->UintPtrConstant(p.feedback().index());
Node* feedback_vector = node->RemoveInput(n.FeedbackVectorIndex());
// Register argument inputs are followed by stack argument inputs (such as
// feedback_vector). Both are listed in ascending order. Note that
@ -997,7 +997,7 @@ void JSGenericLowering::LowerJSConstructWithSpread(Node* node) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
zone(), callable.descriptor(), stack_argument_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* slot = jsgraph()->Int32Constant(p.feedback().index());
Node* slot = jsgraph()->UintPtrConstant(p.feedback().index());
// The single available register is needed for `slot`, thus `spread` remains
// on the stack here.
@ -1088,7 +1088,7 @@ void JSGenericLowering::LowerJSCall(Node* node) {
zone(), callable.descriptor(), arg_count + 1, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* stub_arity = jsgraph()->Int32Constant(arg_count);
Node* slot = jsgraph()->Int32Constant(p.feedback().index());
Node* slot = jsgraph()->UintPtrConstant(p.feedback().index());
node->InsertInput(zone(), 0, stub_code);
node->InsertInput(zone(), 2, stub_arity);
node->InsertInput(zone(), 3, slot);
@ -1128,7 +1128,7 @@ void JSGenericLowering::LowerJSCallWithArrayLike(Node* node) {
Node* receiver = n.receiver();
Node* arguments_list = n.Argument(0);
Node* feedback_vector = n.feedback_vector();
Node* slot = jsgraph()->Int32Constant(p.feedback().index());
Node* slot = jsgraph()->UintPtrConstant(p.feedback().index());
// Shuffling inputs.
// Before: {target, receiver, arguments_list, vector}.
@ -1193,7 +1193,7 @@ void JSGenericLowering::LowerJSCallWithSpread(Node* node) {
auto call_descriptor = Linkage::GetStubCallDescriptor(
zone(), callable.descriptor(), stack_argument_count, flags);
Node* stub_code = jsgraph()->HeapConstant(callable.code());
Node* slot = jsgraph()->Int32Constant(p.feedback().index());
Node* slot = jsgraph()->UintPtrConstant(p.feedback().index());
// We pass the spread in a register, not on the stack.
Node* stub_arity = jsgraph()->Int32Constant(arg_count - kTheSpread);