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(
GotoIf(IsUndefined(maybe_feedback_vector), &call_runtime);
TVARIABLE(JSRegExp, result);
TNode<Object> literal_site = CAST(LoadFeedbackVectorSlot(
maybe_feedback_vector, slot, 0, INTPTR_PARAMETERS));
TNode<FeedbackVector> feedback_vector = CAST(maybe_feedback_vector);
TNode<Object> literal_site =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot));
GotoIf(NotHasBoilerplate(literal_site), &call_runtime);
{
TNode<JSRegExp> boilerplate = CAST(literal_site);
......@@ -342,7 +343,7 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateShallowArrayLiteral(
return_result(this);
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);
TNode<AllocationSite> allocation_site = CAST(maybe_allocation_site);
......@@ -385,7 +386,7 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateEmptyArrayLiteral(
// Array literals always have a valid AllocationSite to properly track
// elements transitions.
TNode<Object> maybe_allocation_site =
CAST(LoadFeedbackVectorSlot(feedback_vector, slot, 0, INTPTR_PARAMETERS));
CAST(LoadFeedbackVectorSlot(feedback_vector, slot));
TVARIABLE(AllocationSite, allocation_site);
Label create_empty_array(this),
......@@ -398,8 +399,8 @@ TNode<JSArray> ConstructorBuiltinsAssembler::EmitCreateEmptyArrayLiteral(
// TODO(cbruni): create the AllocationSite in CSA.
BIND(&initialize_allocation_site);
{
allocation_site = CreateAllocationSiteInFeedbackVector(
feedback_vector, SmiTag(Signed(slot)));
allocation_site =
CreateAllocationSiteInFeedbackVector(feedback_vector, slot);
Goto(&create_empty_array);
}
......@@ -434,7 +435,7 @@ TNode<HeapObject> ConstructorBuiltinsAssembler::EmitCreateShallowObjectLiteral(
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
Label* call_runtime) {
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);
TNode<AllocationSite> allocation_site = CAST(maybe_allocation_site);
......
......@@ -583,8 +583,7 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// Assume that the resulting string contains only one-byte characters.
TNode<String> one_byte_result = AllocateSeqOneByteString(Unsigned(argc));
TVARIABLE(IntPtrT, var_max_index);
var_max_index = IntPtrConstant(0);
TVARIABLE(IntPtrT, var_max_index, IntPtrConstant(0));
// 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
......@@ -601,7 +600,6 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// The {code16} fits into the SeqOneByteString {one_byte_result}.
TNode<IntPtrT> offset = ElementOffsetFromIndex(
var_max_index.value(), UINT8_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqOneByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord8, one_byte_result,
offset, code16);
......@@ -626,7 +624,6 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// Write the character that caused the 8-bit to 16-bit fault.
TNode<IntPtrT> max_index_offset =
ElementOffsetFromIndex(var_max_index.value(), UINT16_ELEMENTS,
CodeStubAssembler::INTPTR_PARAMETERS,
SeqTwoByteString::kHeaderSize - kHeapObjectTag);
StoreNoWriteBarrier(MachineRepresentation::kWord16, two_byte_result,
max_index_offset, code16);
......
......@@ -2570,22 +2570,30 @@ void CodeStubAssembler::StoreJSTypedArrayElementFromTagged(
}
}
template <typename TIndex>
TNode<MaybeObject> CodeStubAssembler::LoadFeedbackVectorSlot(
Node* object, Node* slot_index_node, int additional_offset,
ParameterMode parameter_mode) {
CSA_SLOW_ASSERT(this, IsFeedbackVector(object));
CSA_SLOW_ASSERT(this, MatchesParameterMode(slot_index_node, parameter_mode));
TNode<FeedbackVector> feedback_vector, TNode<TIndex> slot,
int additional_offset) {
int32_t header_size =
FeedbackVector::kFeedbackSlotsOffset + additional_offset - kHeapObjectTag;
TNode<IntPtrT> offset = ElementOffsetFromIndex(
slot_index_node, HOLEY_ELEMENTS, parameter_mode, header_size);
TNode<IntPtrT> offset =
ElementOffsetFromIndex(slot, HOLEY_ELEMENTS, header_size);
CSA_SLOW_ASSERT(
this, IsOffsetInBounds(offset, LoadFeedbackVectorLength(CAST(object)),
this, IsOffsetInBounds(offset, LoadFeedbackVectorLength(feedback_vector),
FeedbackVector::kHeaderSize));
return UncheckedCast<MaybeObject>(
Load(MachineType::AnyTagged(), object, offset));
return Load<MaybeObject>(feedback_vector, offset);
}
template TNode<MaybeObject> CodeStubAssembler::LoadFeedbackVectorSlot(
TNode<FeedbackVector> feedback_vector, TNode<Smi> slot,
int additional_offset);
template TNode<MaybeObject> CodeStubAssembler::LoadFeedbackVectorSlot(
TNode<FeedbackVector> feedback_vector, TNode<IntPtrT> slot,
int additional_offset);
template TNode<MaybeObject> CodeStubAssembler::LoadFeedbackVectorSlot(
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
int additional_offset);
template <typename Array>
TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32ArrayElement(
TNode<Array> object, int array_header_size, Node* index_node,
......@@ -2743,15 +2751,15 @@ TNode<Object> CodeStubAssembler::LoadContextElement(
TNode<Object> CodeStubAssembler::LoadContextElement(
SloppyTNode<Context> context, SloppyTNode<IntPtrT> slot_index) {
TNode<IntPtrT> offset = ElementOffsetFromIndex(
slot_index, PACKED_ELEMENTS, INTPTR_PARAMETERS, Context::SlotOffset(0));
TNode<IntPtrT> offset = ElementOffsetFromIndex(slot_index, PACKED_ELEMENTS,
Context::SlotOffset(0));
return UncheckedCast<Object>(Load(MachineType::AnyTagged(), context, offset));
}
TNode<Object> CodeStubAssembler::LoadContextElement(TNode<Context> context,
TNode<Smi> slot_index) {
TNode<IntPtrT> offset = ElementOffsetFromIndex(
slot_index, PACKED_ELEMENTS, SMI_PARAMETERS, Context::SlotOffset(0));
TNode<IntPtrT> offset = ElementOffsetFromIndex(slot_index, PACKED_ELEMENTS,
Context::SlotOffset(0));
return UncheckedCast<Object>(Load(MachineType::AnyTagged(), context, offset));
}
......@@ -3066,33 +3074,30 @@ void CodeStubAssembler::StoreFixedDoubleArrayElement(
StoreNoWriteBarrier(rep, object, offset, value_silenced);
}
void CodeStubAssembler::StoreFeedbackVectorSlot(Node* object,
Node* slot_index_node,
Node* value,
WriteBarrierMode barrier_mode,
int additional_offset,
ParameterMode parameter_mode) {
CSA_SLOW_ASSERT(this, IsFeedbackVector(object));
CSA_SLOW_ASSERT(this, MatchesParameterMode(slot_index_node, parameter_mode));
void CodeStubAssembler::StoreFeedbackVectorSlot(
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
TNode<AnyTaggedT> value, WriteBarrierMode barrier_mode,
int additional_offset) {
DCHECK(IsAligned(additional_offset, kTaggedSize));
DCHECK(barrier_mode == SKIP_WRITE_BARRIER ||
barrier_mode == UNSAFE_SKIP_WRITE_BARRIER ||
barrier_mode == UPDATE_WRITE_BARRIER);
int header_size =
FeedbackVector::kFeedbackSlotsOffset + additional_offset - kHeapObjectTag;
TNode<IntPtrT> offset = ElementOffsetFromIndex(
slot_index_node, HOLEY_ELEMENTS, parameter_mode, header_size);
// Check that slot_index_node <= object.length.
TNode<IntPtrT> offset =
ElementOffsetFromIndex(Signed(slot), HOLEY_ELEMENTS, header_size);
// Check that slot <= feedback_vector.length.
CSA_ASSERT(this,
IsOffsetInBounds(offset, LoadFeedbackVectorLength(CAST(object)),
IsOffsetInBounds(offset, LoadFeedbackVectorLength(feedback_vector),
FeedbackVector::kHeaderSize));
if (barrier_mode == SKIP_WRITE_BARRIER) {
StoreNoWriteBarrier(MachineRepresentation::kTagged, object, offset, value);
StoreNoWriteBarrier(MachineRepresentation::kTagged, feedback_vector, offset,
value);
} else if (barrier_mode == UNSAFE_SKIP_WRITE_BARRIER) {
UnsafeStoreNoWriteBarrier(MachineRepresentation::kTagged, object, offset,
value);
UnsafeStoreNoWriteBarrier(MachineRepresentation::kTagged, feedback_vector,
offset, value);
} else {
Store(object, offset, value);
Store(feedback_vector, offset, value);
}
}
......@@ -5021,12 +5026,10 @@ void CodeStubAssembler::MoveElements(ElementsKind kind,
TNode<IntPtrT> elements_intptr = BitcastTaggedToWord(elements);
TNode<IntPtrT> target_data_ptr =
IntPtrAdd(elements_intptr,
ElementOffsetFromIndex(dst_index, kind, INTPTR_PARAMETERS,
fa_base_data_offset));
ElementOffsetFromIndex(dst_index, kind, fa_base_data_offset));
TNode<IntPtrT> source_data_ptr =
IntPtrAdd(elements_intptr,
ElementOffsetFromIndex(src_index, kind, INTPTR_PARAMETERS,
fa_base_data_offset));
ElementOffsetFromIndex(src_index, kind, fa_base_data_offset));
TNode<ExternalReference> memmove =
ExternalConstant(ExternalReference::libc_memmove_function());
CallCFunction(memmove, MachineType::Pointer(),
......@@ -5416,8 +5419,8 @@ void CodeStubAssembler::CopyStringCharacters(Node* from_string, Node* to_string,
ElementsKind to_kind = to_one_byte ? UINT8_ELEMENTS : UINT16_ELEMENTS;
STATIC_ASSERT(SeqOneByteString::kHeaderSize == SeqTwoByteString::kHeaderSize);
int header_size = SeqOneByteString::kHeaderSize - kHeapObjectTag;
TNode<IntPtrT> from_offset = ElementOffsetFromIndex(
from_index, from_kind, INTPTR_PARAMETERS, header_size);
TNode<IntPtrT> from_offset =
ElementOffsetFromIndex(from_index, from_kind, header_size);
TNode<IntPtrT> to_offset =
ElementOffsetFromIndex(to_index, to_kind, header_size);
TNode<IntPtrT> byte_count =
......@@ -10225,9 +10228,11 @@ TNode<IntPtrT> CodeStubAssembler::ElementOffsetFromIndex(Node* index_node,
template <typename TIndex>
TNode<IntPtrT> CodeStubAssembler::ElementOffsetFromIndex(
TNode<TIndex> index_node, ElementsKind kind, int base_size) {
static_assert(
std::is_same<TIndex, Smi>::value || std::is_same<TIndex, IntPtrT>::value,
"Only Smi or IntPtrT index nodes are allowed");
// TODO(v8:9708): Remove IntPtrT variant in favor of UintPtrT.
static_assert(std::is_same<TIndex, Smi>::value ||
std::is_same<TIndex, IntPtrT>::value ||
std::is_same<TIndex, UintPtrT>::value,
"Only Smi, UintPtrT or IntPtrT index nodes are allowed");
int element_size_shift = ElementsKindToShiftSize(kind);
int element_size = 1 << element_size_shift;
int const kSmiShiftBits = kSmiShiftSize + kSmiTagSize;
......@@ -10333,8 +10338,9 @@ TNode<FeedbackVector> CodeStubAssembler::LoadFeedbackVectorForStub() {
return CAST(LoadFeedbackVector(function));
}
void CodeStubAssembler::UpdateFeedback(Node* feedback, Node* maybe_vector,
Node* slot_id) {
void CodeStubAssembler::UpdateFeedback(TNode<Smi> feedback,
TNode<HeapObject> maybe_vector,
TNode<UintPtrT> slot_id) {
Label end(this);
// If feedback_vector is not valid, then nothing to do.
GotoIf(IsUndefined(maybe_vector), &end);
......@@ -10346,7 +10352,7 @@ void CodeStubAssembler::UpdateFeedback(Node* feedback, Node* maybe_vector,
TNode<MaybeObject> feedback_element =
LoadFeedbackVectorSlot(feedback_vector, slot_id);
TNode<Smi> previous_feedback = CAST(feedback_element);
TNode<Smi> combined_feedback = SmiOr(previous_feedback, CAST(feedback));
TNode<Smi> combined_feedback = SmiOr(previous_feedback, feedback);
GotoIf(SmiEqual(previous_feedback, combined_feedback), &end);
{
......@@ -11177,7 +11183,7 @@ TNode<IntPtrT> CodeStubAssembler::PageFromAddress(TNode<IntPtrT> address) {
}
TNode<AllocationSite> CodeStubAssembler::CreateAllocationSiteInFeedbackVector(
SloppyTNode<FeedbackVector> feedback_vector, TNode<Smi> slot) {
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot) {
TNode<IntPtrT> size = IntPtrConstant(AllocationSite::kSizeWithWeakNext);
TNode<HeapObject> site = Allocate(size, CodeStubAssembler::kPretenured);
StoreMapNoWriteBarrier(site, RootIndex::kAllocationSiteWithWeakNextMap);
......@@ -11220,19 +11226,16 @@ TNode<AllocationSite> CodeStubAssembler::CreateAllocationSiteInFeedbackVector(
StoreObjectField(site, AllocationSite::kWeakNextOffset, next_site);
StoreFullTaggedNoWriteBarrier(site_list, site);
StoreFeedbackVectorSlot(feedback_vector, slot, site, UPDATE_WRITE_BARRIER, 0,
SMI_PARAMETERS);
StoreFeedbackVectorSlot(feedback_vector, slot, site);
return CAST(site);
}
TNode<MaybeObject> CodeStubAssembler::StoreWeakReferenceInFeedbackVector(
SloppyTNode<FeedbackVector> feedback_vector, Node* slot,
SloppyTNode<HeapObject> value, int additional_offset,
ParameterMode parameter_mode) {
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
TNode<HeapObject> value, int additional_offset) {
TNode<MaybeObject> weak_value = MakeWeak(value);
StoreFeedbackVectorSlot(feedback_vector, slot, weak_value,
UPDATE_WRITE_BARRIER, additional_offset,
parameter_mode);
UPDATE_WRITE_BARRIER, additional_offset);
return weak_value;
}
......
......@@ -1384,9 +1384,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Int32T> elements_kind, Label* if_accessor, Label* if_hole);
// Load a feedback slot from a FeedbackVector.
template <typename TIndex>
TNode<MaybeObject> LoadFeedbackVectorSlot(
Node* object, Node* index, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS);
TNode<FeedbackVector> feedback_vector, TNode<TIndex> slot,
int additional_offset = 0);
TNode<IntPtrT> LoadFeedbackVectorLength(TNode<FeedbackVector>);
TNode<Float64T> LoadDoubleWithHoleCheck(TNode<FixedDoubleArray> array,
......@@ -1651,10 +1652,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
}
void StoreFeedbackVectorSlot(
Node* object, Node* index, Node* value,
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
TNode<AnyTaggedT> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER,
int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS);
int additional_offset = 0);
void EnsureArrayLengthWritable(TNode<Map> map, Label* bailout);
......@@ -3219,7 +3220,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
SloppyTNode<JSFunction> closure);
// 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
// be done after a feedback update.
......@@ -3311,13 +3314,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Store a weak in-place reference into the FeedbackVector.
TNode<MaybeObject> StoreWeakReferenceInFeedbackVector(
SloppyTNode<FeedbackVector> feedback_vector, Node* slot,
SloppyTNode<HeapObject> value, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS);
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot,
TNode<HeapObject> value, int additional_offset = 0);
// Create a new AllocationSite and install it into a feedback vector.
TNode<AllocationSite> CreateAllocationSiteInFeedbackVector(
SloppyTNode<FeedbackVector> feedback_vector, TNode<Smi> slot);
TNode<FeedbackVector> feedback_vector, TNode<UintPtrT> slot);
// TODO(ishell, cbruni): Change to HasBoilerplate.
TNode<BoolT> NotHasBoilerplate(TNode<Object> maybe_literal_site);
......@@ -3907,22 +3909,20 @@ class V8_EXPORT_PRIVATE CodeStubArguments {
// Iteration doesn't include the receiver. |first| and |last| are zero-based.
template <typename TIndex>
void ForEach(const ForEachBodyFunction& body,
TNode<TIndex> first = TNode<TIndex>(),
TNode<TIndex> last = TNode<TIndex>()) {
void ForEach(const ForEachBodyFunction& body, TNode<TIndex> first = {},
TNode<TIndex> last = {}) {
CodeStubAssembler::VariableList list(0, assembler_->zone());
ForEach(list, body, first, last);
}
// Iteration doesn't include the receiver. |first| and |last| are zero-based.
void ForEach(const CodeStubAssembler::VariableList& vars,
const ForEachBodyFunction& body,
TNode<IntPtrT> first = TNode<IntPtrT>(),
TNode<IntPtrT> last = TNode<IntPtrT>());
const ForEachBodyFunction& body, TNode<IntPtrT> first = {},
TNode<IntPtrT> last = {});
void ForEach(const CodeStubAssembler::VariableList& vars,
const ForEachBodyFunction& body, TNode<Smi> first,
TNode<Smi> last = TNode<Smi>()) {
TNode<Smi> last = {}) {
TNode<IntPtrT> first_intptr = assembler_->ParameterToIntPtr(first);
TNode<IntPtrT> last_intptr;
if (last != nullptr) {
......
......@@ -29,6 +29,7 @@ namespace internal {
constexpr MachineType MachineTypeOf<Smi>::value;
constexpr MachineType MachineTypeOf<Object>::value;
constexpr MachineType MachineTypeOf<MaybeObject>::value;
namespace compiler {
......
......@@ -64,7 +64,7 @@ TNode<MaybeObject> AccessorAssembler::LoadHandlerDataField(
}
TNode<MaybeObject> AccessorAssembler::TryMonomorphicCase(
Node* slot, Node* vector, Node* receiver_map, Label* if_handler,
TNode<Smi> slot, Node* vector, TNode<Map> receiver_map, Label* if_handler,
TVariable<MaybeObject>* var_handler, Label* if_miss) {
Comment("TryMonomorphicCase");
DCHECK_EQ(MachineRepresentation::kTagged, var_handler->rep());
......@@ -76,15 +76,14 @@ TNode<MaybeObject> AccessorAssembler::TryMonomorphicCase(
// Adding |header_size| with a separate IntPtrAdd rather than passing it
// into ElementOffsetFromIndex() allows it to be folded into a single
// [base, index, offset] indirect memory access on x64.
TNode<IntPtrT> offset =
ElementOffsetFromIndex(slot, HOLEY_ELEMENTS, SMI_PARAMETERS);
TNode<IntPtrT> offset = ElementOffsetFromIndex(slot, HOLEY_ELEMENTS);
TNode<MaybeObject> feedback = ReinterpretCast<MaybeObject>(
Load(MachineType::AnyTagged(), vector,
IntPtrAdd(offset, IntPtrConstant(header_size))));
// Try to quickly handle the monomorphic case without knowing for sure
// if we have a weak reference in feedback.
GotoIf(IsNotWeakReferenceTo(feedback, CAST(receiver_map)), if_miss);
GotoIf(IsNotWeakReferenceTo(feedback, receiver_map), if_miss);
TNode<MaybeObject> handler = UncheckedCast<MaybeObject>(
Load(MachineType::AnyTagged(), vector,
......@@ -2754,21 +2753,25 @@ void AccessorAssembler::LoadIC_NoFeedback(const LoadICParameters* p) {
}
}
void AccessorAssembler::LoadGlobalIC(Node* vector, Node* slot,
void AccessorAssembler::LoadGlobalIC(TNode<HeapObject> maybe_feedback_vector,
const LazyNode<Smi>& lazy_smi_slot,
const LazyNode<UintPtrT>& lazy_slot,
const LazyNode<Context>& lazy_context,
const LazyNode<Name>& lazy_name,
TypeofMode typeof_mode,
ExitPoint* exit_point,
ParameterMode slot_mode) {
ExitPoint* exit_point) {
Label try_handler(this, Label::kDeferred), miss(this, Label::kDeferred);
GotoIf(IsUndefined(vector), &miss);
LoadGlobalIC_TryPropertyCellCase(CAST(vector), slot, lazy_context, exit_point,
&try_handler, &miss, slot_mode);
GotoIf(IsUndefined(maybe_feedback_vector), &miss);
{
TNode<FeedbackVector> vector = CAST(maybe_feedback_vector);
TNode<UintPtrT> slot = lazy_slot();
LoadGlobalIC_TryPropertyCellCase(vector, slot, lazy_context, exit_point,
&try_handler, &miss);
BIND(&try_handler);
LoadGlobalIC_TryHandlerCase(CAST(vector), slot, lazy_context, lazy_name,
typeof_mode, exit_point, &miss, slot_mode);
BIND(&try_handler);
LoadGlobalIC_TryHandlerCase(vector, slot, lazy_smi_slot, lazy_context,
lazy_name, typeof_mode, exit_point, &miss);
}
BIND(&miss);
{
......@@ -2776,20 +2779,19 @@ void AccessorAssembler::LoadGlobalIC(Node* vector, Node* slot,
TNode<Context> context = lazy_context();
TNode<Name> name = lazy_name();
exit_point->ReturnCallRuntime(Runtime::kLoadGlobalIC_Miss, context, name,
ParameterToTagged(slot, slot_mode), vector,
lazy_smi_slot(), maybe_feedback_vector,
SmiConstant(typeof_mode));
}
}
void AccessorAssembler::LoadGlobalIC_TryPropertyCellCase(
TNode<FeedbackVector> vector, Node* slot,
TNode<FeedbackVector> vector, TNode<UintPtrT> slot,
const LazyNode<Context>& lazy_context, ExitPoint* exit_point,
Label* try_handler, Label* miss, ParameterMode slot_mode) {
Label* try_handler, Label* miss) {
Comment("LoadGlobalIC_TryPropertyCellCase");
Label if_lexical_var(this), if_property_cell(this);
TNode<MaybeObject> maybe_weak_ref =
LoadFeedbackVectorSlot(vector, slot, 0, slot_mode);
TNode<MaybeObject> maybe_weak_ref = LoadFeedbackVectorSlot(vector, slot);
Branch(TaggedIsSmi(maybe_weak_ref), &if_lexical_var, &if_property_cell);
BIND(&if_property_cell);
......@@ -2820,16 +2822,16 @@ void AccessorAssembler::LoadGlobalIC_TryPropertyCellCase(
}
void AccessorAssembler::LoadGlobalIC_TryHandlerCase(
TNode<FeedbackVector> vector, Node* slot,
const LazyNode<Context>& lazy_context, const LazyNode<Name>& lazy_name,
TypeofMode typeof_mode, ExitPoint* exit_point, Label* miss,
ParameterMode slot_mode) {
TNode<FeedbackVector> vector, TNode<UintPtrT> slot,
const LazyNode<Smi>& lazy_smi_slot, const LazyNode<Context>& lazy_context,
const LazyNode<Name>& lazy_name, TypeofMode typeof_mode,
ExitPoint* exit_point, Label* miss) {
Comment("LoadGlobalIC_TryHandlerCase");
Label call_handler(this), non_smi(this);
TNode<MaybeObject> feedback_element =
LoadFeedbackVectorSlot(vector, slot, kTaggedSize, slot_mode);
LoadFeedbackVectorSlot(vector, slot, kTaggedSize);
TNode<Object> handler = CAST(feedback_element);
GotoIf(TaggedEqual(handler, UninitializedSymbolConstant()), miss);
......@@ -2845,7 +2847,7 @@ void AccessorAssembler::LoadGlobalIC_TryHandlerCase(
LoadContextElement(native_context, Context::EXTENSION_INDEX);
LazyLoadICParameters p([=] { return context; }, receiver, lazy_name,
ParameterToTagged(slot, slot_mode), vector, holder);
lazy_smi_slot, vector, holder);
HandleLoadICHandlerCase(&p, handler, miss, exit_point, ICMode::kGlobalIC,
on_nonexistent);
......@@ -3063,22 +3065,20 @@ void AccessorAssembler::KeyedLoadICPolymorphicName(const LoadICParameters* p,
Node* receiver = p->receiver();
TNode<Map> receiver_map = LoadReceiverMap(receiver);
TNode<Name> name = CAST(p->name());
Node* vector = p->vector();
Node* slot = p->slot();
TNode<FeedbackVector> vector = CAST(p->vector());
TNode<Smi> slot = p->slot();
TNode<Context> context = p->context();
// When we get here, we know that the {name} matches the recorded
// feedback name in the {vector} and can safely be used for the
// LoadIC handler logic below.
CSA_ASSERT(this, Word32BinaryNot(IsDeprecatedMap(receiver_map)));
CSA_ASSERT(this,
TaggedEqual(
name, LoadFeedbackVectorSlot(vector, slot, 0, SMI_PARAMETERS)),
CSA_ASSERT(this, TaggedEqual(name, LoadFeedbackVectorSlot(vector, slot)),
name, vector);
// Check if we have a matching handler for the {receiver_map}.
TNode<MaybeObject> feedback_element =
LoadFeedbackVectorSlot(vector, slot, kTaggedSize, SMI_PARAMETERS);
LoadFeedbackVectorSlot(vector, slot, kTaggedSize);
TNode<WeakFixedArray> array = CAST(feedback_element);
HandlePolymorphicCase(receiver_map, array, &if_handler, &var_handler, &miss);
......@@ -3163,7 +3163,7 @@ void AccessorAssembler::StoreIC(const StoreICParameters* p) {
void AccessorAssembler::StoreGlobalIC(const StoreICParameters* pp) {
Label if_lexical_var(this), if_heapobject(this);
TNode<MaybeObject> maybe_weak_ref =
LoadFeedbackVectorSlot(pp->vector(), pp->slot(), 0, SMI_PARAMETERS);
LoadFeedbackVectorSlot(CAST(pp->vector()), pp->slot());
Branch(TaggedIsSmi(maybe_weak_ref), &if_lexical_var, &if_heapobject);
BIND(&if_heapobject);
......@@ -3186,8 +3186,8 @@ void AccessorAssembler::StoreGlobalIC(const StoreICParameters* pp) {
BIND(&try_handler);
{
Comment("StoreGlobalIC_try_handler");
TNode<MaybeObject> handler = LoadFeedbackVectorSlot(
pp->vector(), pp->slot(), kTaggedSize, SMI_PARAMETERS);
TNode<MaybeObject> handler =
LoadFeedbackVectorSlot(CAST(pp->vector()), pp->slot(), kTaggedSize);
GotoIf(TaggedEqual(handler, UninitializedSymbolConstant()), &miss);
......@@ -3347,8 +3347,8 @@ void AccessorAssembler::KeyedStoreIC(const StoreICParameters* p) {
GotoIfNot(TaggedEqual(strong_feedback, p->name()), &miss);
// If the name comparison succeeded, we know we have a feedback vector
// with at least one map/handler pair.
TNode<MaybeObject> feedback_element = LoadFeedbackVectorSlot(
p->vector(), p->slot(), kTaggedSize, SMI_PARAMETERS);
TNode<MaybeObject> feedback_element =
LoadFeedbackVectorSlot(CAST(p->vector()), p->slot(), kTaggedSize);
TNode<WeakFixedArray> array = CAST(feedback_element);
HandlePolymorphicCase(receiver_map, array, &if_handler, &var_handler,
&miss);
......@@ -3447,7 +3447,7 @@ void AccessorAssembler::GenerateLoadIC() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3460,7 +3460,7 @@ void AccessorAssembler::GenerateLoadIC_Megamorphic() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3473,7 +3473,7 @@ void AccessorAssembler::GenerateLoadIC_Megamorphic() {
BIND(&if_handler);
LazyLoadICParameters p([=] { return context; }, receiver,
[=] { return name; }, slot, vector);
[=] { return name; }, [=] { return slot; }, vector);
HandleLoadICHandlerCase(&p, CAST(var_handler.value()), &miss, &direct_exit);
BIND(&miss);
......@@ -3486,8 +3486,8 @@ void AccessorAssembler::GenerateLoadIC_Noninlined() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
Node* vector = Parameter(Descriptor::kVector);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<FeedbackVector> vector = CAST(Parameter(Descriptor::kVector));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
ExitPoint direct_exit(this);
......@@ -3495,8 +3495,7 @@ void AccessorAssembler::GenerateLoadIC_Noninlined() {
Label if_handler(this, &var_handler), miss(this, Label::kDeferred);
TNode<Map> receiver_map = LoadReceiverMap(receiver);
TNode<MaybeObject> feedback_element =
LoadFeedbackVectorSlot(vector, slot, 0, SMI_PARAMETERS);
TNode<MaybeObject> feedback_element = LoadFeedbackVectorSlot(vector, slot);
TNode<HeapObject> feedback = CAST(feedback_element);
LoadICParameters p(context, receiver, name, slot, vector);
......@@ -3520,7 +3519,7 @@ void AccessorAssembler::GenerateLoadIC_NoFeedback() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
LoadICParameters p(context, receiver, name, slot, UndefinedConstant());
......@@ -3556,13 +3555,17 @@ void AccessorAssembler::GenerateLoadGlobalIC(TypeofMode typeof_mode) {
using Descriptor = LoadGlobalWithVectorDescriptor;
TNode<Name> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
Node* vector = Parameter(Descriptor::kVector);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<HeapObject> vector = CAST(Parameter(Descriptor::kVector));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
ExitPoint direct_exit(this);
LoadGlobalIC(
vector, slot,
vector,
// lazy_smi_slot
[=] { return slot; },
// lazy_slot
[=] { return Unsigned(SmiUntag(slot)); },
// lazy_context
[=] { return context; },
// lazy_name
......@@ -3587,7 +3590,7 @@ void AccessorAssembler::GenerateKeyedLoadIC() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3600,7 +3603,7 @@ void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3613,7 +3616,7 @@ void AccessorAssembler::GenerateKeyedLoadICTrampoline() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<FeedbackVector> vector = LoadFeedbackVectorForStub();
......@@ -3626,7 +3629,7 @@ void AccessorAssembler::GenerateKeyedLoadICTrampoline_Megamorphic() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<FeedbackVector> vector = LoadFeedbackVectorForStub();
......@@ -3639,7 +3642,7 @@ void AccessorAssembler::GenerateKeyedLoadIC_PolymorphicName() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3652,7 +3655,7 @@ void AccessorAssembler::GenerateStoreGlobalIC() {
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3665,7 +3668,7 @@ void AccessorAssembler::GenerateStoreGlobalICTrampoline() {
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<FeedbackVector> vector = LoadFeedbackVectorForStub();
......@@ -3678,7 +3681,7 @@ void AccessorAssembler::GenerateStoreIC() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3692,7 +3695,7 @@ void AccessorAssembler::GenerateStoreICTrampoline() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<FeedbackVector> vector = LoadFeedbackVectorForStub();
......@@ -3706,7 +3709,7 @@ void AccessorAssembler::GenerateKeyedStoreIC() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3720,7 +3723,7 @@ void AccessorAssembler::GenerateKeyedStoreICTrampoline() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
TNode<FeedbackVector> vector = LoadFeedbackVectorForStub();
......@@ -3734,7 +3737,7 @@ void AccessorAssembler::GenerateStoreInArrayLiteralIC() {
Node* array = Parameter(Descriptor::kReceiver);
TNode<Object> index = CAST(Parameter(Descriptor::kName));
Node* value = Parameter(Descriptor::kValue);
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3966,7 +3969,7 @@ void AccessorAssembler::GenerateKeyedHasIC() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......@@ -3990,7 +3993,7 @@ void AccessorAssembler::GenerateKeyedHasIC_PolymorphicName() {
Node* receiver = Parameter(Descriptor::kReceiver);
TNode<Object> name = CAST(Parameter(Descriptor::kName));
Node* slot = Parameter(Descriptor::kSlot);
TNode<Smi> slot = CAST(Parameter(Descriptor::kSlot));
Node* vector = Parameter(Descriptor::kVector);
TNode<Context> context = CAST(Parameter(Descriptor::kContext));
......
......@@ -66,7 +66,7 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
struct LoadICParameters {
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),
receiver_(receiver),
name_(name),
......@@ -85,7 +85,7 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
TNode<Context> context() const { return context_; }
Node* receiver() const { return receiver_; }
TNode<Object> name() const { return name_; }
Node* slot() const { return slot_; }
TNode<Smi> slot() const { return slot_; }
Node* vector() const { return vector_; }
Node* holder() const { return holder_; }
......@@ -93,15 +93,15 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
TNode<Context> context_;
Node* receiver_;
TNode<Object> name_;
Node* slot_;
TNode<Smi> slot_;
Node* vector_;
Node* holder_;
};
struct LazyLoadICParameters {
LazyLoadICParameters(LazyNode<Context> context, Node* receiver,
LazyNode<Object> name, Node* slot, Node* vector,
Node* holder = nullptr)
LazyNode<Object> name, LazyNode<Smi> slot,
Node* vector, Node* holder = nullptr)
: context_(context),
receiver_(receiver),
name_(name),
......@@ -111,19 +111,17 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
explicit LazyLoadICParameters(const LoadICParameters* p)
: receiver_(p->receiver()),
slot_(p->slot()),
vector_(p->vector()),
holder_(p->holder()) {
TNode<Context> p_context = p->context();
context_ = [=] { return p_context; };
TNode<Object> p_name = p->name();
name_ = [=] { return p_name; };
slot_ = [=] { return p->slot(); };
context_ = [=] { return p->context(); };
name_ = [=] { return p->name(); };
}
TNode<Context> context() const { return context_(); }
Node* receiver() const { return receiver_; }
TNode<Object> name() const { return name_(); }
Node* slot() const { return slot_; }
TNode<Smi> slot() const { return slot_(); }
Node* vector() const { return vector_; }
Node* holder() const { return holder_; }
......@@ -131,16 +129,17 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
LazyNode<Context> context_;
Node* receiver_;
LazyNode<Object> name_;
Node* slot_;
LazyNode<Smi> slot_;
Node* vector_;
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<Name>& lazy_name, TypeofMode typeof_mode,
ExitPoint* exit_point,
ParameterMode slot_mode = SMI_PARAMETERS);
ExitPoint* exit_point);
// Specialized LoadIC for inlined bytecode handler, hand-tuned to omit frame
// construction on common paths.
......@@ -154,8 +153,8 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
protected:
struct StoreICParameters : public LoadICParameters {
StoreICParameters(TNode<Context> context, Node* receiver,
TNode<Object> name, SloppyTNode<Object> value, Node* slot,
Node* vector)
TNode<Object> name, SloppyTNode<Object> value,
TNode<Smi> slot, Node* vector)
: LoadICParameters(context, receiver, name, slot, vector),
value_(value) {}
......@@ -229,8 +228,9 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
// IC dispatcher behavior.
// Checks monomorphic case. Returns {feedback} entry of the vector.
TNode<MaybeObject> TryMonomorphicCase(Node* slot, Node* vector,
Node* receiver_map, Label* if_handler,
TNode<MaybeObject> TryMonomorphicCase(TNode<Smi> slot, Node* vector,
TNode<Map> receiver_map,
Label* if_handler,
TVariable<MaybeObject>* var_handler,
Label* if_miss);
void HandlePolymorphicCase(Node* receiver_map, TNode<WeakFixedArray> feedback,
......@@ -292,18 +292,19 @@ class V8_EXPORT_PRIVATE AccessorAssembler : public CodeStubAssembler {
// LoadGlobalIC implementation.
void LoadGlobalIC_TryPropertyCellCase(
TNode<FeedbackVector> vector, Node* slot,
const LazyNode<Context>& lazy_context, ExitPoint* exit_point,
Label* try_handler, Label* miss,
ParameterMode slot_mode = SMI_PARAMETERS);
void LoadGlobalIC_TryPropertyCellCase(TNode<FeedbackVector> vector,
TNode<UintPtrT> slot,
const LazyNode<Context>& lazy_context,
ExitPoint* exit_point,
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<Name>& lazy_name,
TypeofMode typeof_mode,
ExitPoint* exit_point, Label* miss,
ParameterMode slot_mode);
ExitPoint* exit_point, Label* miss);
// StoreIC implementation.
......
......@@ -1015,7 +1015,7 @@ void KeyedStoreGenericAssembler::KeyedStoreGeneric(
BIND(&if_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);
ExitPoint direct_exit(this);
EmitGenericPropertyStore(CAST(receiver), receiver_map, &p, &direct_exit,
......@@ -1105,7 +1105,7 @@ void KeyedStoreGenericAssembler::SetProperty(TNode<Context> context,
TNode<Name> unique_name,
TNode<Object> value,
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);
ExitPoint exit_point(this, [&](Node* result) { Goto(&done); });
......
......@@ -930,12 +930,10 @@ TNode<Object> InterpreterAssembler::Construct(
Branch(TaggedEqual(target, array_function), &create_allocation_site,
&store_weak_reference);
TNode<IntPtrT> slot_id_int_ptr = Signed(slot_id);
BIND(&create_allocation_site);
{
var_site = CreateAllocationSiteInFeedbackVector(
feedback_vector, SmiTag(slot_id_int_ptr));
var_site =
CreateAllocationSiteInFeedbackVector(feedback_vector, slot_id);
ReportFeedbackUpdate(feedback_vector, slot_id,
"Construct:CreateAllocationSite");
Goto(&construct_array);
......@@ -943,7 +941,7 @@ TNode<Object> InterpreterAssembler::Construct(
BIND(&store_weak_reference);
{
StoreWeakReferenceInFeedbackVector(feedback_vector, slot_id_int_ptr,
StoreWeakReferenceInFeedbackVector(feedback_vector, slot_id,
CAST(new_target));
ReportFeedbackUpdate(feedback_vector, slot_id,
"Construct:StoreWeakReference");
......
......@@ -160,7 +160,6 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
void LdaGlobal(int slot_operand_index, int name_operand_index,
TypeofMode typeof_mode) {
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<UintPtrT> feedback_slot = BytecodeOperandIdx(slot_operand_index);
AccessorAssembler accessor_asm(state());
ExitPoint exit_point(this, [=](Node* result) {
......@@ -168,6 +167,14 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
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<Name> lazy_name = [=] {
......@@ -176,10 +183,9 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler {
return name;
};
ParameterMode slot_mode = CodeStubAssembler::INTPTR_PARAMETERS;
accessor_asm.LoadGlobalIC(maybe_feedback_vector, feedback_slot,
lazy_context, lazy_name, typeof_mode, &exit_point,
slot_mode);
accessor_asm.LoadGlobalIC(maybe_feedback_vector, lazy_smi_slot, lazy_slot,
lazy_context, lazy_name, typeof_mode,
&exit_point);
}
};
......@@ -507,24 +513,24 @@ IGNITION_HANDLER(StaLookupSlot, InterpreterAssembler) {
// constant pool entry <name_index>.
IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) {
TNode<HeapObject> feedback_vector = LoadFeedbackVector();
TNode<IntPtrT> feedback_slot = Signed(BytecodeOperandIdx(2));
TNode<Smi> smi_slot = SmiTag(feedback_slot);
TNode<UintPtrT> feedback_slot = BytecodeOperandIdx(2);
// Load receiver.
TNode<Object> recv = LoadRegisterAtOperandIndex(0);
// 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));
};
LazyNode<Context> context = [=] { return GetContext(); };
LazyNode<Context> lazy_context = [=] { return GetContext(); };
Label done(this);
TVARIABLE(Object, var_result);
ExitPoint exit_point(this, &done, &var_result);
AccessorAssembler::LazyLoadICParameters params(context, recv, name, smi_slot,
feedback_vector);
AccessorAssembler::LazyLoadICParameters params(
lazy_context, recv, lazy_name, lazy_smi_slot, feedback_vector);
AccessorAssembler accessor_asm(state());
accessor_asm.LoadIC_BytecodeHandler(&params, &exit_point);
......@@ -961,7 +967,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler {
TNode<Object> left = LoadRegisterAtOperandIndex(0);
TNode<Object> right = GetAccumulator();
TNode<Context> context = GetContext();
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(1));
TNode<UintPtrT> slot_index = BytecodeOperandIdx(1);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TVARIABLE(Smi, var_left_feedback);
......@@ -1010,7 +1016,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler {
void BitwiseBinaryOpWithSmi(Operation bitwise_op) {
TNode<Object> left = GetAccumulator();
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<Context> context = GetContext();
......@@ -1119,7 +1125,7 @@ IGNITION_HANDLER(BitwiseAndSmi, InterpreterBitwiseBinaryOpAssembler) {
// Perform bitwise-not on the accumulator.
IGNITION_HANDLER(BitwiseNot, InterpreterAssembler) {
TNode<Object> operand = GetAccumulator();
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(0));
TNode<UintPtrT> slot_index = BytecodeOperandIdx(0);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<Context> context = GetContext();
......@@ -1281,7 +1287,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler {
}
BIND(&end);
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(0));
TNode<UintPtrT> slot_index = BytecodeOperandIdx(0);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
UpdateFeedback(var_feedback.value(), maybe_feedback_vector, slot_index);
SetAccumulator(var_result.value());
......@@ -1831,7 +1837,7 @@ class InterpreterCompareOpAssembler : public InterpreterAssembler {
UNREACHABLE();
}
TNode<IntPtrT> slot_index = Signed(BytecodeOperandIdx(1));
TNode<UintPtrT> slot_index = BytecodeOperandIdx(1);
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
UpdateFeedback(var_type_feedback.value(), maybe_feedback_vector,
slot_index);
......@@ -2646,14 +2652,14 @@ IGNITION_HANDLER(CloneObject, InterpreterAssembler) {
// accumulator, creating and caching the site object on-demand as per the
// specification.
IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) {
TNode<HeapObject> feedback_vector = LoadFeedbackVector();
TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector();
TNode<UintPtrT> slot = BytecodeOperandIdx(1);
Label call_runtime(this, Label::kDeferred);
GotoIf(IsUndefined(feedback_vector), &call_runtime);
GotoIf(IsUndefined(maybe_feedback_vector), &call_runtime);
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);
......@@ -2673,8 +2679,8 @@ IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) {
description, shared_info, slot_smi);
Label end(this);
GotoIf(IsUndefined(feedback_vector), &end);
StoreFeedbackVectorSlot(feedback_vector, slot, result);
GotoIf(IsUndefined(maybe_feedback_vector), &end);
StoreFeedbackVectorSlot(CAST(maybe_feedback_vector), slot, result);
Goto(&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