[cleanup] TNodeify LoadFixedDoubleArrayElement

R=petermarshall@chromium.org

Change-Id: Id27cae79dcd82b6dd7790736169c76e89ae8881d
Reviewed-on: https://chromium-review.googlesource.com/1071428
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53332}
This commit is contained in:
Simon Zünd 2018-05-24 13:25:36 +02:00 committed by Commit Bot
parent 055db6050e
commit 040ff0da47
3 changed files with 21 additions and 19 deletions

View File

@ -501,8 +501,9 @@ TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement(
TNode<HeapObject> elements, TNode<IntPtrT> index) {
TVARIABLE(Object, entry);
Label if_hole(this, Label::kDeferred), next(this);
TNode<Float64T> element = UncheckedCast<Float64T>(LoadFixedDoubleArrayElement(
elements, index, MachineType::Float64(), 0, INTPTR_PARAMETERS, &if_hole));
TNode<Float64T> element =
LoadFixedDoubleArrayElement(CAST(elements), index, MachineType::Float64(),
0, INTPTR_PARAMETERS, &if_hole);
{ // not hole
entry = AllocateHeapNumberWithValue(element);
Goto(&next);

View File

@ -879,8 +879,8 @@ void CodeStubAssembler::Bind(Label* label) { CodeAssembler::Bind(label); }
TNode<Float64T> CodeStubAssembler::LoadDoubleWithHoleCheck(
TNode<FixedDoubleArray> array, TNode<Smi> index, Label* if_hole) {
return TNode<Float64T>::UncheckedCast(LoadFixedDoubleArrayElement(
array, index, MachineType::Float64(), 0, SMI_PARAMETERS, if_hole));
return LoadFixedDoubleArrayElement(array, index, MachineType::Float64(), 0,
SMI_PARAMETERS, if_hole);
}
void CodeStubAssembler::BranchIfPrototypesHaveNoElements(
@ -2164,16 +2164,17 @@ TNode<MaybeObject> CodeStubAssembler::LoadWeakFixedArrayElement(
additional_offset, parameter_mode, needs_poisoning);
}
Node* CodeStubAssembler::LoadFixedDoubleArrayElement(
Node* object, Node* index_node, MachineType machine_type,
int additional_offset, ParameterMode parameter_mode, Label* if_hole) {
TNode<Float64T> CodeStubAssembler::LoadFixedDoubleArrayElement(
SloppyTNode<FixedDoubleArray> object, Node* index_node,
MachineType machine_type, int additional_offset,
ParameterMode parameter_mode, Label* if_hole) {
CSA_ASSERT(this, IsFixedDoubleArray(object));
DCHECK_EQ(additional_offset % kPointerSize, 0);
CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode));
int32_t header_size =
FixedDoubleArray::kHeaderSize + additional_offset - kHeapObjectTag;
Node* offset = ElementOffsetFromIndex(index_node, HOLEY_DOUBLE_ELEMENTS,
parameter_mode, header_size);
TNode<IntPtrT> offset = ElementOffsetFromIndex(
index_node, HOLEY_DOUBLE_ELEMENTS, parameter_mode, header_size);
CSA_SLOW_ASSERT(
this,
IsOffsetInBounds(offset, LoadAndUntagFixedArrayBaseLength(object),
@ -2181,9 +2182,9 @@ Node* CodeStubAssembler::LoadFixedDoubleArrayElement(
return LoadDoubleWithHoleCheck(object, offset, if_hole, machine_type);
}
Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset,
Label* if_hole,
MachineType machine_type) {
TNode<Float64T> CodeStubAssembler::LoadDoubleWithHoleCheck(
SloppyTNode<Object> base, SloppyTNode<IntPtrT> offset, Label* if_hole,
MachineType machine_type) {
if (if_hole) {
// TODO(ishell): Compare only the upper part for the hole once the
// compiler is able to fold addition of already complex |offset| with
@ -2201,9 +2202,9 @@ Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset,
}
if (machine_type.IsNone()) {
// This means the actual value is not needed.
return nullptr;
return TNode<Float64T>();
}
return Load(machine_type, base, offset);
return UncheckedCast<Float64T>(Load(machine_type, base, offset));
}
TNode<Object> CodeStubAssembler::LoadContextElement(

View File

@ -774,9 +774,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
}
// Load an array element from a FixedDoubleArray.
Node* LoadFixedDoubleArrayElement(
Node* object, Node* index, MachineType machine_type,
int additional_offset = 0,
TNode<Float64T> LoadFixedDoubleArrayElement(
SloppyTNode<FixedDoubleArray> object, Node* index,
MachineType machine_type, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS,
Label* if_hole = nullptr);
@ -793,8 +793,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Load Float64 value by |base| + |offset| address. If the value is a double
// hole then jump to |if_hole|. If |machine_type| is None then only the hole
// check is generated.
Node* LoadDoubleWithHoleCheck(
Node* base, Node* offset, Label* if_hole,
TNode<Float64T> LoadDoubleWithHoleCheck(
SloppyTNode<Object> base, SloppyTNode<IntPtrT> offset, Label* if_hole,
MachineType machine_type = MachineType::Float64());
TNode<RawPtrT> LoadFixedTypedArrayBackingStore(
TNode<FixedTypedArrayBase> typed_array);