Commit 1f5cc247 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[clenaup][csa] Remove Sloppy-ness from LoadObjectField

We want to use LoadObjectField's version that it is templated (as the
non-templated one uses Node*). If we remove slopiness, we are forcing to
TNodify when porting the non-templated calls to the templated ones.

Bug: v8:9708, v8:6949
Change-Id: Ic564e3f03f1900718a0ec5503da911650bbac1fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2310353Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68982}
parent 2e96276c
......@@ -1883,8 +1883,8 @@ void ArrayBuiltinsAssembler::GenerateConstructor(
void ArrayBuiltinsAssembler::GenerateArrayNoArgumentConstructor(
ElementsKind kind, AllocationSiteOverrideMode mode) {
using Descriptor = ArrayNoArgumentConstructorDescriptor;
TNode<NativeContext> native_context = CAST(LoadObjectField(
Parameter(Descriptor::kFunction), JSFunction::kContextOffset));
TNode<NativeContext> native_context = LoadObjectField<NativeContext>(
CAST(Parameter(Descriptor::kFunction)), JSFunction::kContextOffset);
bool track_allocation_site =
AllocationSite::ShouldTrack(kind) && mode != DISABLE_ALLOCATION_SITES;
base::Optional<TNode<AllocationSite>> allocation_site =
......
......@@ -1383,14 +1383,14 @@ TNode<Object> CodeStubAssembler::LoadFromParentFrame(int offset) {
return LoadFullTagged(frame_pointer, IntPtrConstant(offset));
}
Node* CodeStubAssembler::LoadObjectField(SloppyTNode<HeapObject> object,
int offset, MachineType type) {
Node* CodeStubAssembler::LoadObjectField(TNode<HeapObject> object, int offset,
MachineType type) {
CSA_ASSERT(this, IsStrong(object));
return LoadFromObject(type, object, IntPtrConstant(offset - kHeapObjectTag));
}
Node* CodeStubAssembler::LoadObjectField(SloppyTNode<HeapObject> object,
SloppyTNode<IntPtrT> offset,
Node* CodeStubAssembler::LoadObjectField(TNode<HeapObject> object,
TNode<IntPtrT> offset,
MachineType type) {
CSA_ASSERT(this, IsStrong(object));
return LoadFromObject(type, object,
......
......@@ -1074,12 +1074,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
return UncheckedCast<T>(
LoadObjectField(object, offset, MachineTypeOf<T>::value));
}
TNode<Object> LoadObjectField(SloppyTNode<HeapObject> object, int offset) {
TNode<Object> LoadObjectField(TNode<HeapObject> object, int offset) {
return UncheckedCast<Object>(
LoadObjectField(object, offset, MachineType::AnyTagged()));
}
TNode<Object> LoadObjectField(SloppyTNode<HeapObject> object,
SloppyTNode<IntPtrT> offset) {
TNode<Object> LoadObjectField(TNode<HeapObject> object,
TNode<IntPtrT> offset) {
return UncheckedCast<Object>(
LoadObjectField(object, offset, MachineType::AnyTagged()));
}
......@@ -3827,10 +3827,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TVariable<BigInt>* var_maybe_bigint = nullptr,
TVariable<Smi>* var_feedback = nullptr);
Node* LoadObjectField(SloppyTNode<HeapObject> object, int offset,
Node* LoadObjectField(TNode<HeapObject> object, int offset, MachineType type);
Node* LoadObjectField(TNode<HeapObject> object, TNode<IntPtrT> offset,
MachineType type);
Node* LoadObjectField(SloppyTNode<HeapObject> object,
SloppyTNode<IntPtrT> offset, MachineType type);
// Low-level accessors for Descriptor arrays.
template <typename T>
......
......@@ -390,7 +390,6 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// Shortened aliases for use in CodeAssembler subclasses.
using Label = CodeAssemblerLabel;
using Variable = CodeAssemblerVariable;
template <class T>
using TVariable = TypedCodeAssemblerVariable<T>;
using VariableList = CodeAssemblerVariableList;
......
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