Commit 185ad97c authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[csa] disable bounds checks for Set/Map accessors

This should recover the microbenchmark performance-regressions.

Bug: chromium:932919
Change-Id: I00e2345428c8730035dc1164278006d687364de7
Reviewed-on: https://chromium-review.googlesource.com/c/1477063Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59663}
parent 136d384b
...@@ -3617,7 +3617,7 @@ void CodeStubAssembler::FindOrderedHashTableEntry( ...@@ -3617,7 +3617,7 @@ void CodeStubAssembler::FindOrderedHashTableEntry(
const std::function<void(Node*, Label*, Label*)>& key_compare, const std::function<void(Node*, Label*, Label*)>& key_compare,
Variable* entry_start_position, Label* entry_found, Label* not_found) { Variable* entry_start_position, Label* entry_found, Label* not_found) {
// Get the index of the bucket. // Get the index of the bucket.
Node* const number_of_buckets = SmiUntag(CAST(LoadFixedArrayElement( Node* const number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement(
CAST(table), CollectionType::NumberOfBucketsIndex()))); CAST(table), CollectionType::NumberOfBucketsIndex())));
Node* const bucket = Node* const bucket =
WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1))); WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1)));
...@@ -3659,7 +3659,7 @@ void CodeStubAssembler::FindOrderedHashTableEntry( ...@@ -3659,7 +3659,7 @@ void CodeStubAssembler::FindOrderedHashTableEntry(
number_of_buckets); number_of_buckets);
// Load the key from the entry. // Load the key from the entry.
Node* const candidate_key = LoadFixedArrayElement( Node* const candidate_key = UnsafeLoadFixedArrayElement(
CAST(table), entry_start, CAST(table), entry_start,
CollectionType::HashTableStartIndex() * kTaggedSize); CollectionType::HashTableStartIndex() * kTaggedSize);
......
...@@ -1016,6 +1016,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1016,6 +1016,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe, LoadSensitivity needs_poisoning = LoadSensitivity::kSafe,
CheckBounds check_bounds = CheckBounds::kAlways); CheckBounds check_bounds = CheckBounds::kAlways);
// 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<Object> UnsafeLoadFixedArrayElement(
TNode<FixedArray> object, Node* index, int additional_offset = 0, TNode<FixedArray> object, Node* index, int additional_offset = 0,
ParameterMode parameter_mode = INTPTR_PARAMETERS, ParameterMode parameter_mode = INTPTR_PARAMETERS,
...@@ -1046,6 +1048,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1046,6 +1048,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
additional_offset, INTPTR_PARAMETERS, additional_offset, INTPTR_PARAMETERS,
needs_poisoning); needs_poisoning);
} }
// 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<Object> UnsafeLoadFixedArrayElement(
TNode<FixedArray> object, int index, int additional_offset = 0, TNode<FixedArray> object, int index, int additional_offset = 0,
LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) { LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
...@@ -1256,6 +1260,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1256,6 +1260,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
barrier_mode, 0, INTPTR_PARAMETERS, barrier_mode, 0, INTPTR_PARAMETERS,
check_bounds); check_bounds);
} }
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedArrayElement( void UnsafeStoreFixedArrayElement(
TNode<FixedArray> object, int index, SloppyTNode<Object> value, TNode<FixedArray> object, int index, SloppyTNode<Object> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER) { WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER) {
...@@ -1269,6 +1275,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1269,6 +1275,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
SKIP_WRITE_BARRIER, 0, INTPTR_PARAMETERS, SKIP_WRITE_BARRIER, 0, INTPTR_PARAMETERS,
check_bounds); check_bounds);
} }
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedArrayElement(TNode<FixedArray> object, int index, void UnsafeStoreFixedArrayElement(TNode<FixedArray> object, int index,
TNode<Smi> value) { TNode<Smi> value) {
return StoreFixedArrayElement(object, index, value, return StoreFixedArrayElement(object, index, value,
...@@ -1297,6 +1305,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1297,6 +1305,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
additional_offset, parameter_mode); additional_offset, parameter_mode);
} }
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedArrayElement( void UnsafeStoreFixedArrayElement(
TNode<FixedArray> array, Node* index, SloppyTNode<Object> value, TNode<FixedArray> array, Node* index, SloppyTNode<Object> value,
WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER,
...@@ -1336,6 +1346,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler ...@@ -1336,6 +1346,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
TNode<FixedDoubleArray> object, Node* index, TNode<Float64T> value, TNode<FixedDoubleArray> object, Node* index, TNode<Float64T> value,
ParameterMode parameter_mode = INTPTR_PARAMETERS, ParameterMode parameter_mode = INTPTR_PARAMETERS,
CheckBounds check_bounds = CheckBounds::kAlways); CheckBounds check_bounds = CheckBounds::kAlways);
// This doesn't emit a bounds-check. As part of the security-performance
// tradeoff, only use it if it is performance critical.
void UnsafeStoreFixedDoubleArrayElement( void UnsafeStoreFixedDoubleArrayElement(
TNode<FixedDoubleArray> object, Node* index, TNode<Float64T> value, TNode<FixedDoubleArray> object, Node* index, TNode<Float64T> value,
ParameterMode parameter_mode = INTPTR_PARAMETERS) { ParameterMode parameter_mode = INTPTR_PARAMETERS) {
......
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