Commit 948c1718 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

Revert "[csa] disable selected bounds checks for remaining regressions"

This reverts commit c3148664.

Reason for revert: speculative revert for MSAN failure https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/25398

Original change's description:
> [csa] disable selected bounds checks for remaining regressions
> 
> Bug: chromium:932919
> TBR: jarin@chromium.org
> Change-Id: Id1125dcd2978f790af4cf00125bcbb94741d0bf8
> Reviewed-on: https://chromium-review.googlesource.com/c/1480387
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59773}

TBR=jarin@chromium.org,jgruber@chromium.org,leszeks@chromium.org,tebbi@chromium.org

Change-Id: Ib6cb825375725773db73f40ad3b65e084645b568
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:932919
Reviewed-on: https://chromium-review.googlesource.com/c/1480914Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59777}
parent d439296e
This diff is collapsed.
......@@ -1925,9 +1925,9 @@ void RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(Node* const context,
RegExpPrototypeExecBodyWithoutResult(CAST(context), CAST(regexp),
string, &if_didnotmatch, true);
Node* const match_from = UnsafeLoadFixedArrayElement(
Node* const match_from = LoadFixedArrayElement(
match_indices, RegExpMatchInfo::kFirstCaptureIndex);
Node* const match_to = UnsafeLoadFixedArrayElement(
Node* const match_to = LoadFixedArrayElement(
match_indices, RegExpMatchInfo::kFirstCaptureIndex + 1);
var_match.Bind(CallBuiltin(Builtins::kSubString, context, string,
......@@ -2403,7 +2403,7 @@ void RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(Node* const context,
length, allocation_site, mode);
TNode<FixedArray> fixed_array = CAST(LoadElements(result));
UnsafeStoreFixedArrayElement(fixed_array, 0, string);
StoreFixedArrayElement(fixed_array, 0, string);
Return(result);
}
......@@ -2456,7 +2456,7 @@ void RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(Node* const context,
}
TNode<FixedArray> match_indices = CAST(match_indices_ho);
TNode<Smi> const match_from = CAST(UnsafeLoadFixedArrayElement(
TNode<Smi> const match_from = CAST(LoadFixedArrayElement(
match_indices, RegExpMatchInfo::kFirstCaptureIndex));
// We're done if the match starts beyond the string.
......@@ -2466,7 +2466,7 @@ void RegExpBuiltinsAssembler::RegExpPrototypeSplitBody(Node* const context,
BIND(&next);
}
TNode<Smi> const match_to = CAST(UnsafeLoadFixedArrayElement(
TNode<Smi> const match_to = CAST(LoadFixedArrayElement(
match_indices, RegExpMatchInfo::kFirstCaptureIndex + 1));
// Advance index and continue if the match is empty.
......
......@@ -27,7 +27,7 @@ void GrowableFixedArray::Push(TNode<Object> const value) {
BIND(&store);
{
TNode<FixedArray> const array = var_array_.value();
UnsafeStoreFixedArrayElement(array, length, value);
StoreFixedArrayElement(array, length, value);
var_length_ = IntPtrAdd(length, IntPtrConstant(1));
}
......
......@@ -6742,7 +6742,7 @@ TNode<String> CodeStubAssembler::StringFromSingleCharCode(TNode<Int32T> code) {
// cache already.
Label if_entryisundefined(this, Label::kDeferred),
if_entryisnotundefined(this);
Node* entry = UnsafeLoadFixedArrayElement(cache, code_index);
Node* entry = LoadFixedArrayElement(cache, code_index);
Branch(IsUndefined(entry), &if_entryisundefined, &if_entryisnotundefined);
BIND(&if_entryisundefined);
......@@ -8414,8 +8414,7 @@ void CodeStubAssembler::NameDictionaryLookup(
TNode<IntPtrT> index = EntryToIndex<Dictionary>(entry);
*var_name_index = index;
TNode<HeapObject> current =
CAST(UnsafeLoadFixedArrayElement(dictionary, index));
TNode<HeapObject> current = CAST(LoadFixedArrayElement(dictionary, index));
GotoIf(WordEqual(current, undefined), if_not_found);
current = LoadName<Dictionary>(current);
GotoIf(WordEqual(current, unique_name), if_found);
......@@ -8526,7 +8525,7 @@ void CodeStubAssembler::NumberDictionaryLookup(
TNode<IntPtrT> entry = var_entry->value();
TNode<IntPtrT> index = EntryToIndex<NumberDictionary>(entry);
Node* current = UnsafeLoadFixedArrayElement(dictionary, index);
Node* current = LoadFixedArrayElement(dictionary, index);
GotoIf(WordEqual(current, undefined), if_not_found);
Label next_probe(this);
{
......@@ -9614,7 +9613,7 @@ void CodeStubAssembler::TryLookupElement(Node* object, Node* map,
GotoIfNot(UintPtrLessThan(intptr_index, length), &if_oob);
TNode<Object> element = UnsafeLoadFixedArrayElement(elements, intptr_index);
TNode<Object> element = LoadFixedArrayElement(elements, intptr_index);
TNode<Oddball> the_hole = TheHoleConstant();
Branch(WordEqual(element, the_hole), if_not_found, if_found);
}
......
......@@ -1027,20 +1027,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
CheckBounds::kDebugOnly);
}
TNode<Object> LoadFixedArrayElement(
TNode<FixedArray> object, TNode<IntPtrT> index,
LoadSensitivity needs_poisoning,
CheckBounds check_bounds = CheckBounds::kAlways) {
TNode<Object> LoadFixedArrayElement(TNode<FixedArray> object,
TNode<IntPtrT> index,
LoadSensitivity needs_poisoning) {
return LoadFixedArrayElement(object, index, 0, INTPTR_PARAMETERS,
needs_poisoning, check_bounds);
}
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
TNode<Object> UnsafeLoadFixedArrayElement(TNode<FixedArray> object,
TNode<IntPtrT> index,
LoadSensitivity needs_poisoning) {
return LoadFixedArrayElement(object, index, needs_poisoning,
CheckBounds::kDebugOnly);
needs_poisoning);
}
TNode<Object> LoadFixedArrayElement(
......@@ -2622,8 +2613,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
template <class Dictionary>
TNode<Smi> GetCapacity(TNode<Dictionary> dictionary) {
return CAST(
UnsafeLoadFixedArrayElement(dictionary, Dictionary::kCapacityIndex));
return CAST(LoadFixedArrayElement(dictionary, Dictionary::kCapacityIndex));
}
template <class Dictionary>
......
......@@ -1796,14 +1796,13 @@ void AccessorAssembler::EmitElementLoad(
BIND(&if_fast_packed);
{
Comment("fast packed elements");
exit_point->Return(
UnsafeLoadFixedArrayElement(CAST(elements), intptr_index));
exit_point->Return(LoadFixedArrayElement(CAST(elements), intptr_index));
}
BIND(&if_fast_holey);
{
Comment("fast holey elements");
Node* element = UnsafeLoadFixedArrayElement(CAST(elements), intptr_index);
Node* element = LoadFixedArrayElement(CAST(elements), intptr_index);
GotoIf(WordEqual(element, TheHoleConstant()), if_hole);
exit_point->Return(element);
}
......
......@@ -648,8 +648,8 @@ Node* InterpreterAssembler::BytecodeOperandIntrinsicId(int operand_index) {
Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) {
TNode<FixedArray> constant_pool = CAST(LoadObjectField(
BytecodeArrayTaggedPointer(), BytecodeArray::kConstantPoolOffset));
return UnsafeLoadFixedArrayElement(
constant_pool, UncheckedCast<IntPtrT>(index), LoadSensitivity::kCritical);
return LoadFixedArrayElement(constant_pool, UncheckedCast<IntPtrT>(index),
LoadSensitivity::kCritical);
}
Node* InterpreterAssembler::LoadAndUntagConstantPoolEntry(Node* index) {
......
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