Commit 678f782f authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[csa][cleanup] Remove Sloppy-ness for some classes

Remove for:
 * DescriptorArray
 * TransitionArray
 * Name
 * Uint32T
 * JSReceiver
 * JSFunction
 * JSObject
 * JSArray
 * FixedArrayBase
 * NativeContext
 * WeakFixedArray

Bug: v8:6949, v8:11074
Change-Id: I5ef9e2d023758baa869018966a2a800f7a40104b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2523194
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71014}
parent 9db71baa
......@@ -1578,7 +1578,7 @@ void CodeStubAssembler::GotoIfMapHasSlowProperties(TNode<Map> map,
}
TNode<HeapObject> CodeStubAssembler::LoadFastProperties(
SloppyTNode<JSReceiver> object) {
TNode<JSReceiver> object) {
CSA_SLOW_ASSERT(this, Word32BinaryNot(IsDictionaryMap(LoadMap(object))));
TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object);
return Select<HeapObject>(
......@@ -1587,7 +1587,7 @@ TNode<HeapObject> CodeStubAssembler::LoadFastProperties(
}
TNode<HeapObject> CodeStubAssembler::LoadSlowProperties(
SloppyTNode<JSReceiver> object) {
TNode<JSReceiver> object) {
CSA_SLOW_ASSERT(this, IsDictionaryMap(LoadMap(object)));
TNode<Object> properties = LoadJSReceiverPropertiesOrHash(object);
return Select<HeapObject>(
......@@ -1604,8 +1604,7 @@ TNode<Object> CodeStubAssembler::LoadJSArgumentsObjectLength(
return LoadObjectField(array, offset);
}
TNode<Smi> CodeStubAssembler::LoadFastJSArrayLength(
SloppyTNode<JSArray> array) {
TNode<Smi> CodeStubAssembler::LoadFastJSArrayLength(TNode<JSArray> array) {
TNode<Number> length = LoadJSArrayLength(array);
CSA_ASSERT(this, Word32Or(IsFastElementsKind(LoadElementsKind(array)),
IsElementsKindInRange(
......@@ -1618,13 +1617,13 @@ TNode<Smi> CodeStubAssembler::LoadFastJSArrayLength(
}
TNode<Smi> CodeStubAssembler::LoadFixedArrayBaseLength(
SloppyTNode<FixedArrayBase> array) {
TNode<FixedArrayBase> array) {
CSA_SLOW_ASSERT(this, IsNotWeakFixedArraySubclass(array));
return LoadObjectField<Smi>(array, FixedArrayBase::kLengthOffset);
}
TNode<IntPtrT> CodeStubAssembler::LoadAndUntagFixedArrayBaseLength(
SloppyTNode<FixedArrayBase> array) {
TNode<FixedArrayBase> array) {
return LoadAndUntagObjectField(array, FixedArrayBase::kLengthOffset);
}
......@@ -1640,7 +1639,7 @@ TNode<Smi> CodeStubAssembler::LoadWeakFixedArrayLength(
}
TNode<IntPtrT> CodeStubAssembler::LoadAndUntagWeakFixedArrayLength(
SloppyTNode<WeakFixedArray> array) {
TNode<WeakFixedArray> array) {
return LoadAndUntagObjectField(array, WeakFixedArray::kLengthOffset);
}
......@@ -2618,7 +2617,7 @@ TNode<Map> CodeStubAssembler::LoadSlowObjectWithNullPrototypeMap(
}
TNode<Map> CodeStubAssembler::LoadJSArrayElementsMap(
SloppyTNode<Int32T> kind, SloppyTNode<NativeContext> native_context) {
SloppyTNode<Int32T> kind, TNode<NativeContext> native_context) {
CSA_ASSERT(this, IsFastElementsKind(kind));
TNode<IntPtrT> offset =
IntPtrAdd(IntPtrConstant(Context::FIRST_JS_ARRAY_MAP_SLOT),
......@@ -2627,7 +2626,7 @@ TNode<Map> CodeStubAssembler::LoadJSArrayElementsMap(
}
TNode<Map> CodeStubAssembler::LoadJSArrayElementsMap(
ElementsKind kind, SloppyTNode<NativeContext> native_context) {
ElementsKind kind, TNode<NativeContext> native_context) {
return UncheckedCast<Map>(
LoadContextElement(native_context, Context::ArrayMapIndex(kind)));
}
......@@ -3916,11 +3915,10 @@ template V8_EXPORT_PRIVATE TNode<FixedArrayBase>
template <typename TIndex>
TNode<FixedArray> CodeStubAssembler::ExtractToFixedArray(
SloppyTNode<FixedArrayBase> source, TNode<TIndex> first,
TNode<TIndex> count, TNode<TIndex> capacity, TNode<Map> source_map,
ElementsKind from_kind, AllocationFlags allocation_flags,
ExtractFixedArrayFlags extract_flags, HoleConversionMode convert_holes,
TVariable<BoolT>* var_holes_converted,
TNode<FixedArrayBase> source, TNode<TIndex> first, TNode<TIndex> count,
TNode<TIndex> capacity, TNode<Map> source_map, ElementsKind from_kind,
AllocationFlags allocation_flags, ExtractFixedArrayFlags extract_flags,
HoleConversionMode convert_holes, TVariable<BoolT>* var_holes_converted,
base::Optional<TNode<Int32T>> source_elements_kind) {
static_assert(
std::is_same<TIndex, Smi>::value || std::is_same<TIndex, IntPtrT>::value,
......@@ -6090,7 +6088,7 @@ TNode<BoolT> CodeStubAssembler::IsPromiseReactionJobTask(
// TODO(jgruber): It might we worth creating an empty_double_array constant to
// simplify this case.
TNode<BoolT> CodeStubAssembler::IsFixedArrayWithKindOrEmpty(
SloppyTNode<FixedArrayBase> object, ElementsKind kind) {
TNode<FixedArrayBase> object, ElementsKind kind) {
Label out(this);
TVARIABLE(BoolT, var_result, Int32TrueConstant());
......@@ -8392,10 +8390,12 @@ TNode<NativeContext> CodeStubAssembler::GetCreationContext(
return native_context;
}
void CodeStubAssembler::DescriptorLookup(
SloppyTNode<Name> unique_name, SloppyTNode<DescriptorArray> descriptors,
SloppyTNode<Uint32T> bitfield3, Label* if_found,
TVariable<IntPtrT>* var_name_index, Label* if_not_found) {
void CodeStubAssembler::DescriptorLookup(TNode<Name> unique_name,
TNode<DescriptorArray> descriptors,
TNode<Uint32T> bitfield3,
Label* if_found,
TVariable<IntPtrT>* var_name_index,
Label* if_not_found) {
Comment("DescriptorArrayLookup");
TNode<Uint32T> nof =
DecodeWord32<Map::Bits3::NumberOfOwnDescriptorsBits>(bitfield3);
......@@ -8403,9 +8403,11 @@ void CodeStubAssembler::DescriptorLookup(
var_name_index, if_not_found);
}
void CodeStubAssembler::TransitionLookup(
SloppyTNode<Name> unique_name, SloppyTNode<TransitionArray> transitions,
Label* if_found, TVariable<IntPtrT>* var_name_index, Label* if_not_found) {
void CodeStubAssembler::TransitionLookup(TNode<Name> unique_name,
TNode<TransitionArray> transitions,
Label* if_found,
TVariable<IntPtrT>* var_name_index,
Label* if_not_found) {
Comment("TransitionArrayLookup");
TNode<Uint32T> number_of_valid_transitions =
NumberOfEntries<TransitionArray>(transitions);
......@@ -8473,7 +8475,7 @@ void CodeStubAssembler::TryLookupPropertyInSimpleObject(
void CodeStubAssembler::TryLookupProperty(
SloppyTNode<HeapObject> object, TNode<Map> map,
SloppyTNode<Int32T> instance_type, SloppyTNode<Name> unique_name,
SloppyTNode<Int32T> instance_type, TNode<Name> unique_name,
Label* if_found_fast, Label* if_found_dict, Label* if_found_global,
TVariable<HeapObject>* var_meta_storage, TVariable<IntPtrT>* var_name_index,
Label* if_not_found, Label* if_bailout) {
......@@ -9368,14 +9370,14 @@ TNode<BoolT> CodeStubAssembler::IsOffsetInBounds(SloppyTNode<IntPtrT> offset,
}
TNode<HeapObject> CodeStubAssembler::LoadFeedbackCellValue(
SloppyTNode<JSFunction> closure) {
TNode<JSFunction> closure) {
TNode<FeedbackCell> feedback_cell =
LoadObjectField<FeedbackCell>(closure, JSFunction::kFeedbackCellOffset);
return LoadObjectField<HeapObject>(feedback_cell, FeedbackCell::kValueOffset);
}
TNode<HeapObject> CodeStubAssembler::LoadFeedbackVector(
SloppyTNode<JSFunction> closure) {
TNode<JSFunction> closure) {
TVARIABLE(HeapObject, maybe_vector, LoadFeedbackCellValue(closure));
Label done(this);
......@@ -9393,7 +9395,7 @@ TNode<HeapObject> CodeStubAssembler::LoadFeedbackVector(
}
TNode<ClosureFeedbackCellArray> CodeStubAssembler::LoadClosureFeedbackArray(
SloppyTNode<JSFunction> closure) {
TNode<JSFunction> closure) {
TVARIABLE(HeapObject, feedback_cell_array, LoadFeedbackCellValue(closure));
Label end(this);
......@@ -9479,7 +9481,7 @@ void CodeStubAssembler::CombineFeedback(TVariable<Smi>* existing_feedback,
*existing_feedback = SmiOr(existing_feedback->value(), feedback);
}
void CodeStubAssembler::CheckForAssociatedProtector(SloppyTNode<Name> name,
void CodeStubAssembler::CheckForAssociatedProtector(TNode<Name> name,
Label* if_protector) {
// This list must be kept in sync with LookupIterator::UpdateProtector!
// TODO(jkummerow): Would it be faster to have a bit in Symbol::flags()?
......@@ -12360,7 +12362,7 @@ TNode<HeapObject> CodeStubAssembler::GetSuperConstructor(
TNode<JSReceiver> CodeStubAssembler::SpeciesConstructor(
SloppyTNode<Context> context, SloppyTNode<Object> object,
SloppyTNode<JSReceiver> default_constructor) {
TNode<JSReceiver> default_constructor) {
Isolate* isolate = this->isolate();
TVARIABLE(JSReceiver, var_result, default_constructor);
......
......@@ -1201,26 +1201,24 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
void GotoIfMapHasSlowProperties(TNode<Map> map, Label* if_slow);
// Load the properties backing store of a JSReceiver.
TNode<HeapObject> LoadSlowProperties(SloppyTNode<JSReceiver> object);
TNode<HeapObject> LoadFastProperties(SloppyTNode<JSReceiver> object);
TNode<HeapObject> LoadSlowProperties(TNode<JSReceiver> object);
TNode<HeapObject> LoadFastProperties(TNode<JSReceiver> object);
// Load the elements backing store of a JSObject.
TNode<FixedArrayBase> LoadElements(SloppyTNode<JSObject> object) {
TNode<FixedArrayBase> LoadElements(TNode<JSObject> object) {
return LoadJSObjectElements(object);
}
// Load the length of a JSArray instance.
TNode<Object> LoadJSArgumentsObjectLength(TNode<Context> context,
TNode<JSArgumentsObject> array);
// Load the length of a fast JSArray instance. Returns a positive Smi.
TNode<Smi> LoadFastJSArrayLength(SloppyTNode<JSArray> array);
TNode<Smi> LoadFastJSArrayLength(TNode<JSArray> array);
// Load the length of a fixed array base instance.
TNode<Smi> LoadFixedArrayBaseLength(SloppyTNode<FixedArrayBase> array);
TNode<Smi> LoadFixedArrayBaseLength(TNode<FixedArrayBase> array);
// Load the length of a fixed array base instance.
TNode<IntPtrT> LoadAndUntagFixedArrayBaseLength(
SloppyTNode<FixedArrayBase> array);
TNode<IntPtrT> LoadAndUntagFixedArrayBaseLength(TNode<FixedArrayBase> array);
// Load the length of a WeakFixedArray.
TNode<Smi> LoadWeakFixedArrayLength(TNode<WeakFixedArray> array);
TNode<IntPtrT> LoadAndUntagWeakFixedArrayLength(
SloppyTNode<WeakFixedArray> array);
TNode<IntPtrT> LoadAndUntagWeakFixedArrayLength(TNode<WeakFixedArray> array);
// Load the number of descriptors in DescriptorArray.
TNode<Int32T> LoadNumberOfDescriptors(TNode<DescriptorArray> array);
// Load the number of own descriptors of a map.
......@@ -1479,9 +1477,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<NativeContext> native_context);
TNode<Map> LoadJSArrayElementsMap(ElementsKind kind,
SloppyTNode<NativeContext> native_context);
TNode<NativeContext> native_context);
TNode<Map> LoadJSArrayElementsMap(SloppyTNode<Int32T> kind,
SloppyTNode<NativeContext> native_context);
TNode<NativeContext> native_context);
TNode<BoolT> IsJSFunctionWithPrototypeSlot(TNode<HeapObject> object);
TNode<BoolT> IsGeneratorFunction(TNode<JSFunction> function);
......@@ -2100,10 +2098,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// compatible only with HOLEY_ELEMENTS and PACKED_ELEMENTS.
template <typename TIndex>
TNode<FixedArray> ExtractToFixedArray(
SloppyTNode<FixedArrayBase> source, TNode<TIndex> first,
TNode<TIndex> count, TNode<TIndex> capacity, TNode<Map> source_map,
ElementsKind from_kind, AllocationFlags allocation_flags,
ExtractFixedArrayFlags extract_flags, HoleConversionMode convert_holes,
TNode<FixedArrayBase> source, TNode<TIndex> first, TNode<TIndex> count,
TNode<TIndex> capacity, TNode<Map> source_map, ElementsKind from_kind,
AllocationFlags allocation_flags, ExtractFixedArrayFlags extract_flags,
HoleConversionMode convert_holes,
TVariable<BoolT>* var_holes_converted = nullptr,
base::Optional<TNode<Int32T>> source_runtime_kind = base::nullopt);
......@@ -2332,7 +2330,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<BoolT> IsFixedArraySubclass(SloppyTNode<HeapObject> object);
TNode<BoolT> IsFixedArrayWithKind(SloppyTNode<HeapObject> object,
ElementsKind kind);
TNode<BoolT> IsFixedArrayWithKindOrEmpty(SloppyTNode<FixedArrayBase> object,
TNode<BoolT> IsFixedArrayWithKindOrEmpty(TNode<FixedArrayBase> object,
ElementsKind kind);
TNode<BoolT> IsFunctionWithPrototypeSlotMap(TNode<Map> map);
TNode<BoolT> IsHashTable(SloppyTNode<HeapObject> object);
......@@ -3032,7 +3030,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// entry! This has to be done by the caller.
void TryLookupProperty(SloppyTNode<HeapObject> object, TNode<Map> map,
SloppyTNode<Int32T> instance_type,
SloppyTNode<Name> unique_name, Label* if_found_fast,
TNode<Name> unique_name, Label* if_found_fast,
Label* if_found_dict, Label* if_found_global,
TVariable<HeapObject>* var_meta_storage,
TVariable<IntPtrT>* var_name_index,
......@@ -3109,19 +3107,19 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<FeedbackVector> LoadFeedbackVectorForStub();
// Load the value from closure's feedback cell.
TNode<HeapObject> LoadFeedbackCellValue(SloppyTNode<JSFunction> closure);
TNode<HeapObject> LoadFeedbackCellValue(TNode<JSFunction> closure);
// Load the object from feedback vector cell for the given closure.
// The returned object could be undefined if the closure does not have
// a feedback vector associated with it.
TNode<HeapObject> LoadFeedbackVector(SloppyTNode<JSFunction> closure);
TNode<HeapObject> LoadFeedbackVector(TNode<JSFunction> closure);
// Load the ClosureFeedbackCellArray that contains the feedback cells
// used when creating closures from this function. This array could be
// directly hanging off the FeedbackCell when there is no feedback vector
// or available from the feedback vector's header.
TNode<ClosureFeedbackCellArray> LoadClosureFeedbackArray(
SloppyTNode<JSFunction> closure);
TNode<JSFunction> closure);
// Update the type feedback vector.
void UpdateFeedback(TNode<Smi> feedback,
......@@ -3144,7 +3142,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
// Check if a property name might require protector invalidation when it is
// used for a property store or deletion.
void CheckForAssociatedProtector(SloppyTNode<Name> name, Label* if_protector);
void CheckForAssociatedProtector(TNode<Name> name, Label* if_protector);
TNode<Map> LoadReceiverMap(SloppyTNode<Object> receiver);
......@@ -3380,9 +3378,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<HeapObject> GetSuperConstructor(TNode<JSFunction> active_function);
TNode<JSReceiver> SpeciesConstructor(
SloppyTNode<Context> context, SloppyTNode<Object> object,
SloppyTNode<JSReceiver> default_constructor);
TNode<JSReceiver> SpeciesConstructor(SloppyTNode<Context> context,
SloppyTNode<Object> object,
TNode<JSReceiver> default_constructor);
TNode<Oddball> InstanceOf(TNode<Object> object, TNode<Object> callable,
TNode<Context> context);
......@@ -3522,18 +3520,18 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<Number> length);
// Implements DescriptorArray::Search().
void DescriptorLookup(SloppyTNode<Name> unique_name,
SloppyTNode<DescriptorArray> descriptors,
SloppyTNode<Uint32T> bitfield3, Label* if_found,
void DescriptorLookup(TNode<Name> unique_name,
TNode<DescriptorArray> descriptors,
TNode<Uint32T> bitfield3, Label* if_found,
TVariable<IntPtrT>* var_name_index,
Label* if_not_found);
// Implements TransitionArray::SearchName() - searches for first transition
// entry with given name (note that there could be multiple entries with
// the same name).
void TransitionLookup(SloppyTNode<Name> unique_name,
SloppyTNode<TransitionArray> transitions,
Label* if_found, TVariable<IntPtrT>* var_name_index,
void TransitionLookup(TNode<Name> unique_name,
TNode<TransitionArray> transitions, Label* if_found,
TVariable<IntPtrT>* var_name_index,
Label* if_not_found);
// Implements generic search procedure like i::Search<Array>().
......
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