Commit 7b8c532d authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[csa][cleanup] Remove non-TNodified int version of LoadObjectField

Bug: v8:9708, v8:6949
Change-Id: Ic219e0eb18648166a712493039f96e067ad47418
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2395555Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70141}
parent 50348472
......@@ -1375,12 +1375,6 @@ TNode<Object> CodeStubAssembler::LoadFromParentFrame(int offset) {
return LoadFullTagged(frame_pointer, IntPtrConstant(offset));
}
Node* CodeStubAssembler::LoadObjectField(TNode<HeapObject> object, int offset,
MachineType type) {
CSA_ASSERT(this, IsStrong(object));
return LoadFromObject(type, object, IntPtrConstant(offset - kHeapObjectTag));
}
TNode<IntPtrT> CodeStubAssembler::LoadAndUntagObjectField(
SloppyTNode<HeapObject> object, int offset) {
if (SmiValuesAre32Bits()) {
......@@ -1389,8 +1383,7 @@ TNode<IntPtrT> CodeStubAssembler::LoadAndUntagObjectField(
#endif
return ChangeInt32ToIntPtr(LoadObjectField<Int32T>(object, offset));
} else {
return SmiToIntPtr(
LoadObjectField(object, offset, MachineType::TaggedSigned()));
return SmiToIntPtr(LoadObjectField<Smi>(object, offset));
}
}
......@@ -1400,11 +1393,9 @@ TNode<Int32T> CodeStubAssembler::LoadAndUntagToWord32ObjectField(
#if V8_TARGET_LITTLE_ENDIAN
offset += 4;
#endif
return UncheckedCast<Int32T>(
LoadObjectField(object, offset, MachineType::Int32()));
return LoadObjectField<Int32T>(object, offset);
} else {
return SmiToInt32(
LoadObjectField(object, offset, MachineType::TaggedSigned()));
return SmiToInt32(LoadObjectField<Smi>(object, offset));
}
}
......@@ -1412,8 +1403,7 @@ TNode<Float64T> CodeStubAssembler::LoadHeapNumberValue(
SloppyTNode<HeapObject> object) {
CSA_ASSERT(this, Word32Or(IsHeapNumber(object), IsOddball(object)));
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
return TNode<Float64T>::UncheckedCast(LoadObjectField(
object, HeapNumber::kValueOffset, MachineType::Float64()));
return LoadObjectField<Float64T>(object, HeapNumber::kValueOffset);
}
TNode<Map> CodeStubAssembler::GetInstanceTypeMap(InstanceType instance_type) {
......@@ -1548,9 +1538,8 @@ TNode<IntPtrT> CodeStubAssembler::LoadAndUntagWeakFixedArrayLength(
TNode<Int32T> CodeStubAssembler::LoadNumberOfDescriptors(
TNode<DescriptorArray> array) {
return UncheckedCast<Int32T>(
LoadObjectField(array, DescriptorArray::kNumberOfDescriptorsOffset,
MachineType::Int16()));
return UncheckedCast<Int32T>(LoadObjectField<Int16T>(
array, DescriptorArray::kNumberOfDescriptorsOffset));
}
TNode<Int32T> CodeStubAssembler::LoadNumberOfOwnDescriptors(TNode<Map> map) {
......@@ -1562,19 +1551,18 @@ TNode<Int32T> CodeStubAssembler::LoadNumberOfOwnDescriptors(TNode<Map> map) {
TNode<Int32T> CodeStubAssembler::LoadMapBitField(SloppyTNode<Map> map) {
CSA_SLOW_ASSERT(this, IsMap(map));
return UncheckedCast<Int32T>(
LoadObjectField(map, Map::kBitFieldOffset, MachineType::Uint8()));
LoadObjectField<Uint8T>(map, Map::kBitFieldOffset));
}
TNode<Int32T> CodeStubAssembler::LoadMapBitField2(SloppyTNode<Map> map) {
CSA_SLOW_ASSERT(this, IsMap(map));
return UncheckedCast<Int32T>(
LoadObjectField(map, Map::kBitField2Offset, MachineType::Uint8()));
LoadObjectField<Uint8T>(map, Map::kBitField2Offset));
}
TNode<Uint32T> CodeStubAssembler::LoadMapBitField3(SloppyTNode<Map> map) {
CSA_SLOW_ASSERT(this, IsMap(map));
return UncheckedCast<Uint32T>(
LoadObjectField(map, Map::kBitField3Offset, MachineType::Uint32()));
return LoadObjectField<Uint32T>(map, Map::kBitField3Offset);
}
TNode<Uint16T> CodeStubAssembler::LoadMapInstanceType(SloppyTNode<Map> map) {
......@@ -2556,9 +2544,9 @@ TNode<BoolT> CodeStubAssembler::IsGeneratorFunction(
function, JSFunction::kSharedFunctionInfoOffset);
const TNode<Uint32T> function_kind =
DecodeWord32<SharedFunctionInfo::FunctionKindBits>(LoadObjectField(
shared_function_info, SharedFunctionInfo::kFlagsOffset,
MachineType::Uint32()));
DecodeWord32<SharedFunctionInfo::FunctionKindBits>(
LoadObjectField<Uint32T>(shared_function_info,
SharedFunctionInfo::kFlagsOffset));
// See IsGeneratorFunction(FunctionKind kind).
return IsInRange(function_kind, FunctionKind::kAsyncConciseGeneratorMethod,
......@@ -3047,18 +3035,16 @@ void CodeStubAssembler::StoreBigIntDigit(TNode<BigInt> bigint,
TNode<Word32T> CodeStubAssembler::LoadBigIntBitfield(TNode<BigInt> bigint) {
return UncheckedCast<Word32T>(
LoadObjectField(bigint, BigInt::kBitfieldOffset, MachineType::Uint32()));
LoadObjectField<Uint32T>(bigint, BigInt::kBitfieldOffset));
}
TNode<UintPtrT> CodeStubAssembler::LoadBigIntDigit(TNode<BigInt> bigint,
intptr_t digit_index) {
CHECK_LE(0, digit_index);
CHECK_LT(digit_index, BigInt::kMaxLength);
return UncheckedCast<UintPtrT>(
LoadObjectField(bigint,
BigInt::kDigitsOffset +
static_cast<int>(digit_index) * kSystemPointerSize,
MachineType::UintPtr()));
return LoadObjectField<UintPtrT>(
bigint, BigInt::kDigitsOffset +
static_cast<int>(digit_index) * kSystemPointerSize);
}
TNode<UintPtrT> CodeStubAssembler::LoadBigIntDigit(TNode<BigInt> bigint,
......
......@@ -1018,18 +1018,21 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
std::is_convertible<TNode<T>, TNode<Object>>::value,
int>::type = 0>
TNode<T> LoadObjectField(TNode<HeapObject> object, int offset) {
return CAST(LoadObjectField(object, offset, MachineTypeOf<T>::value));
return CAST(LoadFromObject(MachineTypeOf<T>::value, object,
IntPtrConstant(offset - kHeapObjectTag)));
}
template <class T, typename std::enable_if<
std::is_convertible<TNode<T>, TNode<UntaggedT>>::value,
int>::type = 0>
TNode<T> LoadObjectField(TNode<HeapObject> object, int offset) {
return UncheckedCast<T>(
LoadObjectField(object, offset, MachineTypeOf<T>::value));
LoadFromObject(MachineTypeOf<T>::value, object,
IntPtrConstant(offset - kHeapObjectTag)));
}
TNode<Object> LoadObjectField(TNode<HeapObject> object, int offset) {
return UncheckedCast<Object>(
LoadObjectField(object, offset, MachineType::AnyTagged()));
LoadFromObject(MachineType::AnyTagged(), object,
IntPtrConstant(offset - kHeapObjectTag)));
}
TNode<Object> LoadObjectField(TNode<HeapObject> object,
TNode<IntPtrT> offset) {
......@@ -1054,8 +1057,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<MaybeObject> LoadMaybeWeakObjectField(SloppyTNode<HeapObject> object,
int offset) {
return UncheckedCast<MaybeObject>(
LoadObjectField(object, offset, MachineType::AnyTagged()));
return UncheckedCast<MaybeObject>(LoadObjectField(object, offset));
}
TNode<Object> LoadConstructorOrBackPointer(TNode<Map> map) {
......@@ -3634,8 +3636,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TVariable<BigInt>* var_maybe_bigint = nullptr,
TVariable<Smi>* var_feedback = nullptr);
Node* LoadObjectField(TNode<HeapObject> object, int offset, MachineType type);
// Low-level accessors for Descriptor arrays.
template <typename T>
TNode<T> LoadDescriptorArrayElement(TNode<DescriptorArray> object,
......
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