Commit 040ff0da authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[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: 's avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53332}
parent 055db605
...@@ -501,8 +501,9 @@ TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement( ...@@ -501,8 +501,9 @@ TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement(
TNode<HeapObject> elements, TNode<IntPtrT> index) { TNode<HeapObject> elements, TNode<IntPtrT> index) {
TVARIABLE(Object, entry); TVARIABLE(Object, entry);
Label if_hole(this, Label::kDeferred), next(this); Label if_hole(this, Label::kDeferred), next(this);
TNode<Float64T> element = UncheckedCast<Float64T>(LoadFixedDoubleArrayElement( TNode<Float64T> element =
elements, index, MachineType::Float64(), 0, INTPTR_PARAMETERS, &if_hole)); LoadFixedDoubleArrayElement(CAST(elements), index, MachineType::Float64(),
0, INTPTR_PARAMETERS, &if_hole);
{ // not hole { // not hole
entry = AllocateHeapNumberWithValue(element); entry = AllocateHeapNumberWithValue(element);
Goto(&next); Goto(&next);
......
...@@ -879,8 +879,8 @@ void CodeStubAssembler::Bind(Label* label) { CodeAssembler::Bind(label); } ...@@ -879,8 +879,8 @@ void CodeStubAssembler::Bind(Label* label) { CodeAssembler::Bind(label); }
TNode<Float64T> CodeStubAssembler::LoadDoubleWithHoleCheck( TNode<Float64T> CodeStubAssembler::LoadDoubleWithHoleCheck(
TNode<FixedDoubleArray> array, TNode<Smi> index, Label* if_hole) { TNode<FixedDoubleArray> array, TNode<Smi> index, Label* if_hole) {
return TNode<Float64T>::UncheckedCast(LoadFixedDoubleArrayElement( return LoadFixedDoubleArrayElement(array, index, MachineType::Float64(), 0,
array, index, MachineType::Float64(), 0, SMI_PARAMETERS, if_hole)); SMI_PARAMETERS, if_hole);
} }
void CodeStubAssembler::BranchIfPrototypesHaveNoElements( void CodeStubAssembler::BranchIfPrototypesHaveNoElements(
...@@ -2164,16 +2164,17 @@ TNode<MaybeObject> CodeStubAssembler::LoadWeakFixedArrayElement( ...@@ -2164,16 +2164,17 @@ TNode<MaybeObject> CodeStubAssembler::LoadWeakFixedArrayElement(
additional_offset, parameter_mode, needs_poisoning); additional_offset, parameter_mode, needs_poisoning);
} }
Node* CodeStubAssembler::LoadFixedDoubleArrayElement( TNode<Float64T> CodeStubAssembler::LoadFixedDoubleArrayElement(
Node* object, Node* index_node, MachineType machine_type, SloppyTNode<FixedDoubleArray> object, Node* index_node,
int additional_offset, ParameterMode parameter_mode, Label* if_hole) { MachineType machine_type, int additional_offset,
ParameterMode parameter_mode, Label* if_hole) {
CSA_ASSERT(this, IsFixedDoubleArray(object)); CSA_ASSERT(this, IsFixedDoubleArray(object));
DCHECK_EQ(additional_offset % kPointerSize, 0); DCHECK_EQ(additional_offset % kPointerSize, 0);
CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode));
int32_t header_size = int32_t header_size =
FixedDoubleArray::kHeaderSize + additional_offset - kHeapObjectTag; FixedDoubleArray::kHeaderSize + additional_offset - kHeapObjectTag;
Node* offset = ElementOffsetFromIndex(index_node, HOLEY_DOUBLE_ELEMENTS, TNode<IntPtrT> offset = ElementOffsetFromIndex(
parameter_mode, header_size); index_node, HOLEY_DOUBLE_ELEMENTS, parameter_mode, header_size);
CSA_SLOW_ASSERT( CSA_SLOW_ASSERT(
this, this,
IsOffsetInBounds(offset, LoadAndUntagFixedArrayBaseLength(object), IsOffsetInBounds(offset, LoadAndUntagFixedArrayBaseLength(object),
...@@ -2181,9 +2182,9 @@ Node* CodeStubAssembler::LoadFixedDoubleArrayElement( ...@@ -2181,9 +2182,9 @@ Node* CodeStubAssembler::LoadFixedDoubleArrayElement(
return LoadDoubleWithHoleCheck(object, offset, if_hole, machine_type); return LoadDoubleWithHoleCheck(object, offset, if_hole, machine_type);
} }
Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset, TNode<Float64T> CodeStubAssembler::LoadDoubleWithHoleCheck(
Label* if_hole, SloppyTNode<Object> base, SloppyTNode<IntPtrT> offset, Label* if_hole,
MachineType machine_type) { MachineType machine_type) {
if (if_hole) { if (if_hole) {
// TODO(ishell): Compare only the upper part for the hole once the // TODO(ishell): Compare only the upper part for the hole once the
// compiler is able to fold addition of already complex |offset| with // compiler is able to fold addition of already complex |offset| with
...@@ -2201,9 +2202,9 @@ Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset, ...@@ -2201,9 +2202,9 @@ Node* CodeStubAssembler::LoadDoubleWithHoleCheck(Node* base, Node* offset,
} }
if (machine_type.IsNone()) { if (machine_type.IsNone()) {
// This means the actual value is not needed. // 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( TNode<Object> CodeStubAssembler::LoadContextElement(
......
...@@ -774,9 +774,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -774,9 +774,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
} }
// Load an array element from a FixedDoubleArray. // Load an array element from a FixedDoubleArray.
Node* LoadFixedDoubleArrayElement( TNode<Float64T> LoadFixedDoubleArrayElement(
Node* object, Node* index, MachineType machine_type, SloppyTNode<FixedDoubleArray> object, Node* index,
int additional_offset = 0, MachineType machine_type, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS, ParameterMode parameter_mode = INTPTR_PARAMETERS,
Label* if_hole = nullptr); Label* if_hole = nullptr);
...@@ -793,8 +793,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -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 // 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 // hole then jump to |if_hole|. If |machine_type| is None then only the hole
// check is generated. // check is generated.
Node* LoadDoubleWithHoleCheck( TNode<Float64T> LoadDoubleWithHoleCheck(
Node* base, Node* offset, Label* if_hole, SloppyTNode<Object> base, SloppyTNode<IntPtrT> offset, Label* if_hole,
MachineType machine_type = MachineType::Float64()); MachineType machine_type = MachineType::Float64());
TNode<RawPtrT> LoadFixedTypedArrayBackingStore( TNode<RawPtrT> LoadFixedTypedArrayBackingStore(
TNode<FixedTypedArrayBase> typed_array); TNode<FixedTypedArrayBase> typed_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