Commit aeb08efc authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[csa] add release-mode bounds checks for StoreFixedDoubleArrayElement

This is a follow-up to https://crrev.com/c/1166910

Bug: v8:8029
Change-Id: I2605f9b2a7b25c096da5a57c3c23b9b636213fff
Reviewed-on: https://chromium-review.googlesource.com/1169051Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55048}
parent a4355b77
...@@ -1954,7 +1954,7 @@ TNode<MaybeObject> CodeStubAssembler::LoadArrayElement( ...@@ -1954,7 +1954,7 @@ TNode<MaybeObject> CodeStubAssembler::LoadArrayElement(
Load(MachineType::AnyTagged(), array, offset, needs_poisoning)); Load(MachineType::AnyTagged(), array, offset, needs_poisoning));
} }
void CodeStubAssembler::FixedArrayBoundsCheck(TNode<FixedArray> array, void CodeStubAssembler::FixedArrayBoundsCheck(TNode<FixedArrayBase> array,
Node* index, Node* index,
int additional_offset, int additional_offset,
ParameterMode parameter_mode) { ParameterMode parameter_mode) {
...@@ -2668,18 +2668,17 @@ void CodeStubAssembler::StoreFixedArrayOrPropertyArrayElement( ...@@ -2668,18 +2668,17 @@ void CodeStubAssembler::StoreFixedArrayOrPropertyArrayElement(
} }
} }
Node* CodeStubAssembler::StoreFixedDoubleArrayElement( void CodeStubAssembler::StoreFixedDoubleArrayElement(
Node* object, Node* index_node, Node* value, ParameterMode parameter_mode) { TNode<FixedDoubleArray> object, Node* index_node, TNode<Float64T> value,
ParameterMode parameter_mode) {
CSA_ASSERT(this, IsFixedDoubleArray(object)); CSA_ASSERT(this, IsFixedDoubleArray(object));
CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode)); CSA_SLOW_ASSERT(this, MatchesParameterMode(index_node, parameter_mode));
FixedArrayBoundsCheck(object, index_node, 0, parameter_mode);
Node* offset = Node* offset =
ElementOffsetFromIndex(index_node, PACKED_DOUBLE_ELEMENTS, parameter_mode, ElementOffsetFromIndex(index_node, PACKED_DOUBLE_ELEMENTS, parameter_mode,
FixedArray::kHeaderSize - kHeapObjectTag); FixedArray::kHeaderSize - kHeapObjectTag);
CSA_ASSERT(this, IsOffsetInBounds(
offset, LoadAndUntagFixedArrayBaseLength(object),
FixedDoubleArray::kHeaderSize, PACKED_DOUBLE_ELEMENTS));
MachineRepresentation rep = MachineRepresentation::kFloat64; MachineRepresentation rep = MachineRepresentation::kFloat64;
return StoreNoWriteBarrier(rep, object, offset, value); StoreNoWriteBarrier(rep, object, offset, value);
} }
Node* CodeStubAssembler::StoreFeedbackVectorSlot(Node* object, Node* CodeStubAssembler::StoreFeedbackVectorSlot(Node* object,
...@@ -9155,8 +9154,8 @@ void CodeStubAssembler::StoreElement(Node* elements, ElementsKind kind, ...@@ -9155,8 +9154,8 @@ void CodeStubAssembler::StoreElement(Node* elements, ElementsKind kind,
return; return;
} else if (IsDoubleElementsKind(kind)) { } else if (IsDoubleElementsKind(kind)) {
// Make sure we do not store signalling NaNs into double arrays. // Make sure we do not store signalling NaNs into double arrays.
value = Float64SilenceNaN(value); TNode<Float64T> value_silenced = Float64SilenceNaN(value);
StoreFixedDoubleArrayElement(elements, index, value, mode); StoreFixedDoubleArrayElement(CAST(elements), index, value_silenced, mode);
} else { } else {
WriteBarrierMode barrier_mode = WriteBarrierMode barrier_mode =
IsSmiElementsKind(kind) ? SKIP_WRITE_BARRIER : UPDATE_WRITE_BARRIER; IsSmiElementsKind(kind) ? SKIP_WRITE_BARRIER : UPDATE_WRITE_BARRIER;
......
...@@ -965,7 +965,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -965,7 +965,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
TNode<MaybeObject> MakeWeak(TNode<HeapObject> value); TNode<MaybeObject> MakeWeak(TNode<HeapObject> value);
void FixedArrayBoundsCheck(TNode<FixedArray> array, Node* index, void FixedArrayBoundsCheck(TNode<FixedArrayBase> array, Node* index,
int additional_offset = 0, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS); ParameterMode parameter_mode = INTPTR_PARAMETERS);
...@@ -1191,8 +1191,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { ...@@ -1191,8 +1191,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
SMI_PARAMETERS); SMI_PARAMETERS);
} }
Node* StoreFixedDoubleArrayElement( void StoreFixedDoubleArrayElement(
Node* object, Node* index, Node* value, TNode<FixedDoubleArray> object, Node* index, TNode<Float64T> value,
ParameterMode parameter_mode = INTPTR_PARAMETERS); ParameterMode parameter_mode = INTPTR_PARAMETERS);
Node* StoreFeedbackVectorSlot( Node* StoreFeedbackVectorSlot(
......
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