Commit b9a393a2 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[csa] Remove ParameterMode from CSA::Load/StoreFeedbackVectorSlot

... and from AccessorAssembler::LoadGlobalIC().

Tbr: tebbi@chromium.org
Bug: v8:9708
Change-Id: Ia7d2ab30cfcfd513257655eb30a466d929ac774a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1801853
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63759}
parent eac9b077
...@@ -295,8 +295,9 @@ TNode<JSRegExp> ConstructorBuiltinsAssembler::EmitCreateRegExpLiteral( ...@@ -295,8 +295,9 @@ TNode<JSRegExp> ConstructorBuiltinsAssembler::EmitCreateRegExpLiteral(
GotoIf(IsUndefined(maybe_feedback_vector), &call_runtime); GotoIf(IsUndefined(maybe_feedback_vector), &call_runtime);
TVARIABLE(JSRegExp, result); TVARIABLE(JSRegExp, result);
TNode<Object> literal_site = CAST(LoadFeedbackVectorSlot( TNode<FeedbackVector> feedback_vector = CAST(maybe_feedback_vector);
maybe_feedback_vector, slot, 0, INTPTR_PARAMETERS)); TNode<Object> literal_site =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot));
GotoIf(NotHasBoilerplate(literal_site), &call_runtime); GotoIf(NotHasBoilerplate(literal_site), &call_runtime);
{ {
TNode<JSRegExp> boilerplate = CAST(literal_site); TNode<JSRegExp> boilerplate = CAST(literal_site);
...@@ -342,7 +343,7 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateShallowArrayLiteral( ...@@ -342,7 +343,7 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateShallowArrayLiteral(
return_result(this); return_result(this);
TNode<Object> maybe_allocation_site = TNode<Object> maybe_allocation_site =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot, 0, INTPTR_PARAMETERS)); CAST(LoadFeedbackVectorSlot(feedback_vector, slot));
GotoIf(NotHasBoilerplate(maybe_allocation_site), call_runtime); GotoIf(NotHasBoilerplate(maybe_allocation_site), call_runtime);
TNode<AllocationSite> allocation_site = CAST(maybe_allocation_site); TNode<AllocationSite> allocation_site = CAST(maybe_allocation_site);
...@@ -385,7 +386,7 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateEmptyArrayLiteral( ...@@ -385,7 +386,7 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateEmptyArrayLiteral(
// Array literals always have a valid AllocationSite to properly track // Array literals always have a valid AllocationSite to properly track
// elements transitions. // elements transitions.
TNode<Object> maybe_allocation_site = TNode<Object> maybe_allocation_site =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot, 0, INTPTR_PARAMETERS)); CAST(LoadFeedbackVectorSlot(feedback_vector, slot));
TVARIABLE(AllocationSite, allocation_site); TVARIABLE(AllocationSite, allocation_site);
Label create_empty_array(this), Label create_empty_array(this),
...@@ -398,8 +399,8 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateEmptyArrayLiteral( ...@@ -398,8 +399,8 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateEmptyArrayLiteral(
// TODO(cbruni): create the AllocationSite in CSA. // TODO(cbruni): create the AllocationSite in CSA.
BIND(&initialize_allocation_site); BIND(&initialize_allocation_site);
{ {
allocation_site = CreateAllocationSiteInFeedbackVector( allocation_site =
feedback_vector, SmiTag(Signed(slot))); CreateAllocationSiteInFeedbackVector(feedback_vector, slot);
Goto(&create_empty_array); Goto(&create_empty_array);
} }
...@@ -434,7 +435,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::EmitCreateShallowObjectLiteral( ...@@ -434,7 +435,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::EmitCreateShallowObjectLiteral(
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot, TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
Label* call_runtime) { Label* call_runtime) {
TNode<Object> maybe_allocation_site = TNode<Object> maybe_allocation_site =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot, 0, INTPTR_PARAMETERS)); CAST(LoadFeedbackVectorSlot(feedback_vector, slot));
GotoIf(NotHasBoilerplate(maybe_allocation_site), call_runtime); GotoIf(NotHasBoilerplate(maybe_allocation_site), call_runtime);
TNode<AllocationSite> allocation_site = CAST(maybe_allocation_site); TNode<AllocationSite> allocation_site = CAST(maybe_allocation_site);
......
...@@ -583,8 +583,7 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) { ...@@ -583,8 +583,7 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// Assume that the resulting string contains only one-byte characters. // Assume that the resulting string contains only one-byte characters.
TNode<String> one_byte_result = AllocateSeqOneByteString(Unsigned(argc)); TNode<String> one_byte_result = AllocateSeqOneByteString(Unsigned(argc));
TVARIABLE(IntPtrT, var_max_index); TVARIABLE(IntPtrT, var_max_index, IntPtrConstant(0));
var_max_index = IntPtrConstant(0);
// Iterate over the incoming arguments, converting them to 8-bit character // Iterate over the incoming arguments, converting them to 8-bit character
// codes. Stop if any of the conversions generates a code that doesn't fit // codes. Stop if any of the conversions generates a code that doesn't fit
...@@ -601,7 +600,6 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) { ...@@ -601,7 +600,6 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// The {code16} fits into the SeqOneByteString {one_byte_result}. // The {code16} fits into the SeqOneByteString {one_byte_result}.
TNode<IntPtrT> offset = ElementOffsetFromIndex( TNode<IntPtrT> offset = ElementOffsetFromIndex(
var_max_index.value(), UINT8_ELEMENTS, var_max_index.value(), UINT8_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqOneByteString::kHeaderSize - kHeapObjectTag); SeqOneByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord8, one_byte_result, StoreNoWriteBarrier(MachineRepresentation::kWord8, one_byte_result,
offset, code16); offset, code16);
...@@ -626,7 +624,6 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) { ...@@ -626,7 +624,6 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// Write the character that caused the 8-bit to 16-bit fault. // Write the character that caused the 8-bit to 16-bit fault.
TNode<IntPtrT> max_index_offset = TNode<IntPtrT> max_index_offset =
ElementOffsetFromIndex(var_max_index.value(), UINT16_ELEMENTS, ElementOffsetFromIndex(var_max_index.value(), UINT16_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqTwoByteString::kHeaderSize - kHeapObjectTag); SeqTwoByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord16, two_byte_result, StoreNoWriteBarrier(MachineRepresentation::kWord16, two_byte_result,
max_index_offset, code16); max_index_offset, code16);
......
This diff is collapsed.
...@@ -1384,9 +1384,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1384,9 +1384,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Int32T> elements_kind, Label* if_accessor, Label* if_hole); TNode<Int32T> elements_kind, Label* if_accessor, Label* if_hole);
// Load a feedback slot from a FeedbackVector. // Load a feedback slot from a FeedbackVector.
template <typename TIndex>
TNode<MaybeObject> LoadFeedbackVectorSlot( TNode<MaybeObject> LoadFeedbackVectorSlot(
Node* object, Node* index, int additional_offset = 0, TNode<FeedbackVector> feedback_vector, TNode<TIndex> slot,
ParameterMode parameter_mode = INTPTR_PARAMETERS); int additional_offset = 0);
TNode<IntPtrT> LoadFeedbackVectorLength(TNode<FeedbackVector>); TNode<IntPtrT> LoadFeedbackVectorLength(TNode<FeedbackVector>);
TNode<Float64T> LoadDoubleWithHoleCheck(TNode<FixedDoubleArray> array, TNode<Float64T> LoadDoubleWithHoleCheck(TNode<FixedDoubleArray> array,
...@@ -1651,10 +1652,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1651,10 +1652,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
} }
void StoreFeedbackVectorSlot( void StoreFeedbackVectorSlot(
Node* object, Node* index, Node* value, TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
TNode<AnyTaggedT> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER,
int additional_offset = 0, int additional_offset = 0);
ParameterMode parameter_mode = INTPTR_PARAMETERS);
void EnsureArrayLengthWritable(TNode<Map> map, Label* bailout); void EnsureArrayLengthWritable(TNode<Map> map, Label* bailout);
...@@ -3219,7 +3220,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -3219,7 +3220,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
SloppyTNode<JSFunction> closure); SloppyTNode<JSFunction> closure);
// Update the type feedback vector. // Update the type feedback vector.
void UpdateFeedback(Node* feedback, Node* feedback_vector, Node* slot_id); void UpdateFeedback(TNode<Smi> feedback,
TNode<HeapObject> maybe_feedback_vector,
TNode<UintPtrT> slot_id);
// Report that there was a feedback update, performing any tasks that should // Report that there was a feedback update, performing any tasks that should
// be done after a feedback update. // be done after a feedback update.
...@@ -3311,13 +3314,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -3311,13 +3314,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Store a weak in-place reference into the FeedbackVector. // Store a weak in-place reference into the FeedbackVector.
TNode<MaybeObject> StoreWeakReferenceInFeedbackVector( TNode<MaybeObject> StoreWeakReferenceInFeedbackVector(
SloppyTNode<FeedbackVector> feedback_vector, Node* slot, TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
SloppyTNode<HeapObject> value, int additional_offset = 0, TNode<HeapObject> value, int additional_offset = 0);
ParameterMode parameter_mode = INTPTR_PARAMETERS);
// Create a new AllocationSite and install it into a feedback vector. // Create a new AllocationSite and install it into a feedback vector.
TNode<AllocationSite> CreateAllocationSiteInFeedbackVector( TNode<AllocationSite> CreateAllocationSiteInFeedbackVector(
SloppyTNode<FeedbackVector> feedback_vector, TNode<Smi> slot); TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot);
// TODO(ishell, cbruni): Change to HasBoilerplate. // TODO(ishell, cbruni): Change to HasBoilerplate.
TNode<BoolT> NotHasBoilerplate(TNode<Object> maybe_literal_site); TNode<BoolT> NotHasBoilerplate(TNode<Object> maybe_literal_site);
...@@ -3907,22 +3909,20 @@ class V8_EXPORT_PRIVATE CodeStubArguments { ...@@ -3907,22 +3909,20 @@ class V8_EXPORT_PRIVATE CodeStubArguments {
// Iteration doesn't include the receiver. |first| and |last| are zero-based. // Iteration doesn't include the receiver. |first| and |last| are zero-based.
template <typename TIndex> template <typename TIndex>
void ForEach(const ForEachBodyFunction& body, void ForEach(const ForEachBodyFunction& body, TNode<TIndex> first = {},
TNode<TIndex> first = TNode<TIndex>(), TNode<TIndex> last = {}) {
TNode<TIndex> last = TNode<TIndex>()) {
CodeStubAssembler::VariableList list(0, assembler_->zone()); CodeStubAssembler::VariableList list(0, assembler_->zone());
ForEach(list, body, first, last); ForEach(list, body, first, last);
} }
// Iteration doesn't include the receiver. |first| and |last| are zero-based. // Iteration doesn't include the receiver. |first| and |last| are zero-based.
void ForEach(const CodeStubAssembler::VariableList& vars, void ForEach(const CodeStubAssembler::VariableList& vars,
const ForEachBodyFunction& body, const ForEachBodyFunction& body, TNode<IntPtrT> first = {},
TNode<IntPtrT> first = TNode<IntPtrT>(), TNode<IntPtrT> last = {});
TNode<IntPtrT> last = TNode<IntPtrT>());
void ForEach(const CodeStubAssembler::VariableList& vars, void ForEach(const CodeStubAssembler::VariableList& vars,
const ForEachBodyFunction& body, TNode<Smi> first, const ForEachBodyFunction& body, TNode<Smi> first,
TNode<Smi> last = TNode<Smi>()) { TNode<Smi> last = {}) {
TNode<IntPtrT> first_intptr = assembler_->ParameterToIntPtr(first); TNode<IntPtrT> first_intptr = assembler_->ParameterToIntPtr(first);
TNode<IntPtrT> last_intptr; TNode<IntPtrT> last_intptr;
if (last != nullptr) { if (last != nullptr) {
......
...@@ -29,6 +29,7 @@ namespace internal { ...@@ -29,6 +29,7 @@ namespace internal {
constexpr MachineType MachineTypeOf<Smi>::value; constexpr MachineType MachineTypeOf<Smi>::value;
constexpr MachineType MachineTypeOf<Object>::value; constexpr MachineType MachineTypeOf<Object>::value;
constexpr MachineType MachineTypeOf<MaybeObject>::value;
namespace compiler { namespace compiler {
......
This diff is collapsed.
...@@ -66,7 +66,7 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -66,7 +66,7 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
struct LoadICParameters { struct LoadICParameters {
LoadICParameters(TNode<Context> context, Node* receiver, TNode<Object> name, LoadICParameters(TNode<Context> context, Node* receiver, TNode<Object> name,
Node* slot, Node* vector, Node* holder = nullptr) TNode<Smi> slot, Node* vector, Node* holder = nullptr)
: context_(context), : context_(context),
receiver_(receiver), receiver_(receiver),
name_(name), name_(name),
...@@ -85,7 +85,7 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -85,7 +85,7 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
TNode<Context> context() const { return context_; } TNode<Context> context() const { return context_; }
Node* receiver() const { return receiver_; } Node* receiver() const { return receiver_; }
TNode<Object> name() const { return name_; } TNode<Object> name() const { return name_; }
Node* slot() const { return slot_; } TNode<Smi> slot() const { return slot_; }
Node* vector() const { return vector_; } Node* vector() const { return vector_; }
Node* holder() const { return holder_; } Node* holder() const { return holder_; }
...@@ -93,15 +93,15 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -93,15 +93,15 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
TNode<Context> context_; TNode<Context> context_;
Node* receiver_; Node* receiver_;
TNode<Object> name_; TNode<Object> name_;
Node* slot_; TNode<Smi> slot_;
Node* vector_; Node* vector_;
Node* holder_; Node* holder_;
}; };
struct LazyLoadICParameters { struct LazyLoadICParameters {
LazyLoadICParameters(LazyNode<Context> context, Node* receiver, LazyLoadICParameters(LazyNode<Context> context, Node* receiver,
LazyNode<Object> name, Node* slot, Node* vector, LazyNode<Object> name, LazyNode<Smi> slot,
Node* holder = nullptr) Node* vector, Node* holder = nullptr)
: context_(context), : context_(context),
receiver_(receiver), receiver_(receiver),
name_(name), name_(name),
...@@ -111,19 +111,17 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -111,19 +111,17 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
explicit LazyLoadICParameters(const LoadICParameters* p) explicit LazyLoadICParameters(const LoadICParameters* p)
: receiver_(p->receiver()), : receiver_(p->receiver()),
slot_(p->slot()),
vector_(p->vector()), vector_(p->vector()),
holder_(p->holder()) { holder_(p->holder()) {
TNode<Context> p_context = p->context(); slot_ = [=] { return p->slot(); };
context_ = [=] { return p_context; }; context_ = [=] { return p->context(); };
TNode<Object> p_name = p->name(); name_ = [=] { return p->name(); };
name_ = [=] { return p_name; };
} }
TNode<Context> context() const { return context_(); } TNode<Context> context() const { return context_(); }
Node* receiver() const { return receiver_; } Node* receiver() const { return receiver_; }
TNode<Object> name() const { return name_(); } TNode<Object> name() const { return name_(); }
Node* slot() const { return slot_; } TNode<Smi> slot() const { return slot_(); }
Node* vector() const { return vector_; } Node* vector() const { return vector_; }
Node* holder() const { return holder_; } Node* holder() const { return holder_; }
...@@ -131,16 +129,17 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -131,16 +129,17 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
LazyNode<Context> context_; LazyNode<Context> context_;
Node* receiver_; Node* receiver_;
LazyNode<Object> name_; LazyNode<Object> name_;
Node* slot_; LazyNode<Smi> slot_;
Node* vector_; Node* vector_;
Node* holder_; Node* holder_;
}; };
void LoadGlobalIC(Node* vector, Node* slot, void LoadGlobalIC(TNode<HeapObject> maybe_feedback_vector,
const LazyNode<Smi>& lazy_smi_slot,
const LazyNode<UintPtrT>& lazy_slot,
const LazyNode<Context>& lazy_context, const LazyNode<Context>& lazy_context,
const LazyNode<Name>& lazy_name, TypeofMode typeof_mode, const LazyNode<Name>& lazy_name, TypeofMode typeof_mode,
ExitPoint* exit_point, ExitPoint* exit_point);
ParameterMode slot_mode = SMI_PARAMETERS);
// Specialized LoadIC for inlined bytecode handler, hand-tuned to omit frame // Specialized LoadIC for inlined bytecode handler, hand-tuned to omit frame
// construction on common paths. // construction on common paths.
...@@ -154,8 +153,8 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -154,8 +153,8 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
protected: protected:
struct StoreICParameters : public LoadICParameters { struct StoreICParameters : public LoadICParameters {
StoreICParameters(TNode<Context> context, Node* receiver, StoreICParameters(TNode<Context> context, Node* receiver,
TNode<Object> name, SloppyTNode<Object> value, Node* slot, TNode<Object> name, SloppyTNode<Object> value,
Node* vector) TNode<Smi> slot, Node* vector)
: LoadICParameters(context, receiver, name, slot, vector), : LoadICParameters(context, receiver, name, slot, vector),
value_(value) {} value_(value) {}
...@@ -229,8 +228,9 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -229,8 +228,9 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
// IC dispatcher behavior. // IC dispatcher behavior.
// Checks monomorphic case. Returns {feedback} entry of the vector. // Checks monomorphic case. Returns {feedback} entry of the vector.
TNode<MaybeObject> TryMonomorphicCase(Node* slot, Node* vector, TNode<MaybeObject> TryMonomorphicCase(TNode<Smi> slot, Node* vector,
Node* receiver_map, Label* if_handler, TNode<Map> receiver_map,
Label* if_handler,
TVariable<MaybeObject>* var_handler, TVariable<MaybeObject>* var_handler,
Label* if_miss); Label* if_miss);
void HandlePolymorphicCase(Node* receiver_map, TNode<WeakFixedArray> feedback, void HandlePolymorphicCase(Node* receiver_map, TNode<WeakFixedArray> feedback,
...@@ -292,18 +292,19 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler { ...@@ -292,18 +292,19 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
// LoadGlobalIC implementation. // LoadGlobalIC implementation.
void LoadGlobalIC_TryPropertyCellCase( void LoadGlobalIC_TryPropertyCellCase(TNode<FeedbackVector> vector,
TNode<FeedbackVector> vector, Node* slot, TNode<UintPtrT> slot,
const LazyNode<Context>& lazy_context, ExitPoint* exit_point, const LazyNode<Context>& lazy_context,
Label* try_handler, Label* miss, ExitPoint* exit_point,
ParameterMode slot_mode = SMI_PARAMETERS); Label* try_handler, Label* miss);
void LoadGlobalIC_TryHandlerCase(TNode<FeedbackVector> vector, Node* slot, void LoadGlobalIC_TryHandlerCase(TNode<FeedbackVector> vector,
TNode<UintPtrT> slot,
const LazyNode<Smi>& lazy_smi_slot,
const LazyNode<Context>& lazy_context, const LazyNode<Context>& lazy_context,
const LazyNode<Name>& lazy_name, const LazyNode<Name>& lazy_name,
TypeofMode typeof_mode, TypeofMode typeof_mode,
ExitPoint* exit_point, Label* miss, ExitPoint* exit_point, Label* miss);
ParameterMode slot_mode);
// StoreIC implementation. // StoreIC implementation.
......
...@@ -1015,7 +1015,7 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric( ...@@ -1015,7 +1015,7 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric(
BIND(&if_unique_name); BIND(&if_unique_name);
{ {
Comment("key is unique name"); Comment("key is unique name");
StoreICParameters p(context, receiver, var_unique.value(), value, nullptr, StoreICParameters p(context, receiver, var_unique.value(), value, {},
nullptr); nullptr);
ExitPoint direct_exit(this); ExitPoint direct_exit(this);
EmitGenericPropertyStore(CAST(receiver), receiver_map, &p, &direct_exit, EmitGenericPropertyStore(CAST(receiver), receiver_map, &p, &direct_exit,
...@@ -1105,7 +1105,7 @@ void KeyedStoreGenericAssembler::SetProperty(TNode<Context> context, ...@@ -1105,7 +1105,7 @@ void KeyedStoreGenericAssembler::SetProperty(TNode<Context> context,
TNode<Name> unique_name, TNode<Name> unique_name,
TNode<Object> value, TNode<Object> value,
LanguageMode language_mode) { LanguageMode language_mode) {
StoreICParameters p(context, receiver, unique_name, value, nullptr, nullptr); StoreICParameters p(context, receiver, unique_name, value, {}, nullptr);
Label done(this), slow(this, Label::kDeferred); Label done(this), slow(this, Label::kDeferred);
ExitPoint exit_point(this, [&](Node* result) { Goto(&done); }); ExitPoint exit_point(this, [&](Node* result) { Goto(&done); });
......
...@@ -930,12 +930,10 @@ TNode<Object> InterpreterAssembler::Construct( ...@@ -930,12 +930,10 @@ TNode<Object> InterpreterAssembler::Construct(
Branch(TaggedEqual(target, array_function), &create_allocation_site, Branch(TaggedEqual(target, array_function), &create_allocation_site,
&store_weak_reference); &store_weak_reference);
TNode<IntPtrT> slot_id_int_ptr = Signed(slot_id);
BIND(&create_allocation_site); BIND(&create_allocation_site);
{ {
var_site = CreateAllocationSiteInFeedbackVector( var_site =
feedback_vector, SmiTag(slot_id_int_ptr)); CreateAllocationSiteInFeedbackVector(feedback_vector, slot_id);
ReportFeedbackUpdate(feedback_vector, slot_id, ReportFeedbackUpdate(feedback_vector, slot_id,
"Construct:CreateAllocationSite"); "Construct:CreateAllocationSite");
Goto(&construct_array); Goto(&construct_array);
...@@ -943,7 +941,7 @@ TNode<Object> InterpreterAssembler::Construct( ...@@ -943,7 +941,7 @@ TNode<Object> InterpreterAssembler::Construct(
BIND(&store_weak_reference); BIND(&store_weak_reference);
{ {
StoreWeakReferenceInFeedbackVector(feedback_vector, slot_id_int_ptr, StoreWeakReferenceInFeedbackVector(feedback_vector, slot_id,
CAST(new_target)); CAST(new_target));
ReportFeedbackUpdate(feedback_vector, slot_id, ReportFeedbackUpdate(feedback_vector, slot_id,
"Construct:StoreWeakReference"); "Construct:StoreWeakReference");
......
...@@ -160,7 +160,6 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -160,7 +160,6 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
void LdaGlobal(int slot_operand_index, int name_operand_index, void LdaGlobal(int slot_operand_index, int name_operand_index,
TypeofMode typeof_mode) { TypeofMode typeof_mode) {
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<UintPtrT> feedback_slot = BytecodeOperandIdx(slot_operand_index);
AccessorAssembler accessor_asm(state()); AccessorAssembler accessor_asm(state());
ExitPoint exit_point(this, [=](Node* result) { ExitPoint exit_point(this, [=](Node* result) {
...@@ -168,6 +167,14 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -168,6 +167,14 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
Dispatch(); Dispatch();
}); });
LazyNode<Smi> lazy_smi_slot = [=] {
return SmiTag(Signed(BytecodeOperandIdx(slot_operand_index)));
};
LazyNode<UintPtrT> lazy_slot = [=] {
return BytecodeOperandIdx(slot_operand_index);
};
LazyNode<Context> lazy_context = [=] { return GetContext(); }; LazyNode<Context> lazy_context = [=] { return GetContext(); };
LazyNode<Name> lazy_name = [=] { LazyNode<Name> lazy_name = [=] {
...@@ -176,10 +183,9 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { ...@@ -176,10 +183,9 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
return name; return name;
}; };
ParameterMode slot_mode = CodeStubAssembler::INTPTR_PARAMETERS; accessor_asm.LoadGlobalIC(maybe_feedback_vector, lazy_smi_slot, lazy_slot,
accessor_asm.LoadGlobalIC(maybe_feedback_vector, feedback_slot, lazy_context, lazy_name, typeof_mode,
lazy_context, lazy_name, typeof_mode, &exit_point, &exit_point);
slot_mode);
} }
}; };
...@@ -507,24 +513,24 @@ IGNITION_HANDLER(StaLookupSlot, InterpreterAssembler) { ...@@ -507,24 +513,24 @@ IGNITION_HANDLER(StaLookupSlot, InterpreterAssembler) {
// constant pool entry <name_index>. // constant pool entry <name_index>.
IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) { IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) {
TNode<HeapObject> feedback_vector = LoadFeedbackVector(); TNode<HeapObject> feedback_vector = LoadFeedbackVector();
TNode<IntPtrT> feedback_slot = Signed(BytecodeOperandIdx(2)); TNode<UintPtrT> feedback_slot = BytecodeOperandIdx(2);
TNode<Smi> smi_slot = SmiTag(feedback_slot);
// Load receiver. // Load receiver.
TNode<Object> recv = LoadRegisterAtOperandIndex(0); TNode<Object> recv = LoadRegisterAtOperandIndex(0);
// Load the name and context lazily. // Load the name and context lazily.
LazyNode<Name> name = [=] { LazyNode<Smi> lazy_smi_slot = [=] { return SmiTag(Signed(feedback_slot)); };
LazyNode<Name> lazy_name = [=] {
return CAST(LoadConstantPoolEntryAtOperandIndex(1)); return CAST(LoadConstantPoolEntryAtOperandIndex(1));
}; };
LazyNode<Context> context = [=] { return GetContext(); }; LazyNode<Context> lazy_context = [=] { return GetContext(); };
Label done(this); Label done(this);
TVARIABLE(Object, var_result); TVARIABLE(Object, var_result);
ExitPoint exit_point(this, &done, &var_result); ExitPoint exit_point(this, &done, &var_result);
AccessorAssembler::LazyLoadICParameters params(context, recv, name, smi_slot, AccessorAssembler::LazyLoadICParameters params(
feedback_vector); lazy_context, recv, lazy_name, lazy_smi_slot, feedback_vector);
AccessorAssembler accessor_asm(state()); AccessorAssembler accessor_asm(state());
accessor_asm.LoadIC_BytecodeHandler(&params, &exit_point); accessor_asm.LoadIC_BytecodeHandler(&params, &exit_point);
...@@ -961,7 +967,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler { ...@@ -961,7 +967,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler {
TNode<Object> left = LoadRegisterAtOperandIndex(0); TNode<Object> left = LoadRegisterAtOperandIndex(0);
TNode<Object> right = GetAccumulator(); TNode<Object> right = GetAccumulator();
TNode<Context> context = GetContext(); TNode<Context> context = GetContext();
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(1)); TNode<UintPtrT> slot_index = BytecodeOperandIdx(1);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TVARIABLE(Smi, var_left_feedback); TVARIABLE(Smi, var_left_feedback);
...@@ -1010,7 +1016,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler { ...@@ -1010,7 +1016,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler {
void BitwiseBinaryOpWithSmi(Operation bitwise_op) { void BitwiseBinaryOpWithSmi(Operation bitwise_op) {
TNode<Object> left = GetAccumulator(); TNode<Object> left = GetAccumulator();
TNode<Smi> right = BytecodeOperandImmSmi(0); TNode<Smi> right = BytecodeOperandImmSmi(0);
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(1)); TNode<UintPtrT> slot_index = BytecodeOperandIdx(1);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<Context> context = GetContext(); TNode<Context> context = GetContext();
...@@ -1119,7 +1125,7 @@ IGNITION_HANDLER(BitwiseAndSmi, InterpreterBitwiseBinaryOpAssembler) { ...@@ -1119,7 +1125,7 @@ IGNITION_HANDLER(BitwiseAndSmi, InterpreterBitwiseBinaryOpAssembler) {
// Perform bitwise-not on the accumulator. // Perform bitwise-not on the accumulator.
IGNITION_HANDLER(BitwiseNot, InterpreterAssembler) { IGNITION_HANDLER(BitwiseNot, InterpreterAssembler) {
TNode<Object> operand = GetAccumulator(); TNode<Object> operand = GetAccumulator();
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(0)); TNode<UintPtrT> slot_index = BytecodeOperandIdx(0);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<Context> context = GetContext(); TNode<Context> context = GetContext();
...@@ -1281,7 +1287,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler { ...@@ -1281,7 +1287,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler {
} }
BIND(&end); BIND(&end);
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(0)); TNode<UintPtrT> slot_index = BytecodeOperandIdx(0);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
UpdateFeedback(var_feedback.value(), maybe_feedback_vector, slot_index); UpdateFeedback(var_feedback.value(), maybe_feedback_vector, slot_index);
SetAccumulator(var_result.value()); SetAccumulator(var_result.value());
...@@ -1831,7 +1837,7 @@ class InterpreterCompareOpAssembler : public InterpreterAssembler { ...@@ -1831,7 +1837,7 @@ class InterpreterCompareOpAssembler : public InterpreterAssembler {
UNREACHABLE(); UNREACHABLE();
} }
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(1)); TNode<UintPtrT> slot_index = BytecodeOperandIdx(1);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
UpdateFeedback(var_type_feedback.value(), maybe_feedback_vector, UpdateFeedback(var_type_feedback.value(), maybe_feedback_vector,
slot_index); slot_index);
...@@ -2646,14 +2652,14 @@ IGNITION_HANDLER(CloneObject, InterpreterAssembler) { ...@@ -2646,14 +2652,14 @@ IGNITION_HANDLER(CloneObject, InterpreterAssembler) {
// accumulator, creating and caching the site object on-demand as per the // accumulator, creating and caching the site object on-demand as per the
// specification. // specification.
IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) { IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) {
TNode<HeapObject> feedback_vector = LoadFeedbackVector(); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<UintPtrT> slot = BytecodeOperandIdx(1); TNode<UintPtrT> slot = BytecodeOperandIdx(1);
Label call_runtime(this, Label::kDeferred); Label call_runtime(this, Label::kDeferred);
GotoIf(IsUndefined(feedback_vector), &call_runtime); GotoIf(IsUndefined(maybe_feedback_vector), &call_runtime);
TNode<Object> cached_value = TNode<Object> cached_value =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot, 0, INTPTR_PARAMETERS)); CAST(LoadFeedbackVectorSlot(CAST(maybe_feedback_vector), slot));
GotoIf(TaggedEqual(cached_value, SmiConstant(0)), &call_runtime); GotoIf(TaggedEqual(cached_value, SmiConstant(0)), &call_runtime);
...@@ -2673,8 +2679,8 @@ IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) { ...@@ -2673,8 +2679,8 @@ IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) {
description, shared_info, slot_smi); description, shared_info, slot_smi);
Label end(this); Label end(this);
GotoIf(IsUndefined(feedback_vector), &end); GotoIf(IsUndefined(maybe_feedback_vector), &end);
StoreFeedbackVectorSlot(feedback_vector, slot, result); StoreFeedbackVectorSlot(CAST(maybe_feedback_vector), slot, result);
Goto(&end); Goto(&end);
Bind(&end); Bind(&end);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment