Commit e71cdfd8 authored by Patrick Thier's avatar Patrick Thier Committed by V8 LUCI CQ

[string] Remove temporarily added CHECKs

CHECKs were added / DCHECKs turned into CHECKs in
https://crrev.com/c/3707103 to help investigate crash reports.
Revert this changes (besides 1 CEHCK that prevents potential OOB reads
when the hash value is corrupted).

Bug: chromium:1336516
Change-Id: I84dd699b53c2006a1be4059940017c1277efa7ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3711757Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81247}
parent 39a2c91f
......@@ -823,18 +823,18 @@ class StringForwardingTable::Block {
void operator delete(void* data);
void Set(int index, String string, String forward_to) {
CHECK_LT(index, capacity());
DCHECK_LT(index, capacity());
Set(IndexOfOriginalString(index), string);
Set(IndexOfForwardString(index), forward_to);
}
String GetOriginalString(Isolate* isolate, int index) const {
CHECK_LT(index, capacity());
DCHECK_LT(index, capacity());
return String::cast(Get(isolate, IndexOfOriginalString(index)));
}
String GetForwardString(Isolate* isolate, int index) const {
CHECK_LT(index, capacity());
DCHECK_LT(index, capacity());
return String::cast(Get(isolate, IndexOfForwardString(index)));
}
......@@ -944,17 +944,17 @@ class StringForwardingTable::BlockVector {
size_t capacity() const { return capacity_; }
Block* LoadBlock(size_t index, AcquireLoadTag) {
CHECK_LT(index, size());
DCHECK_LT(index, size());
return base::AsAtomicPointer::Acquire_Load(&begin_[index]);
}
Block* LoadBlock(size_t index) {
CHECK_LT(index, size());
DCHECK_LT(index, size());
return begin_[index];
}
void AddBlock(std::unique_ptr<Block> block) {
CHECK_LT(size(), capacity());
DCHECK_LT(size(), capacity());
base::AsAtomicPointer::Release_Store(&begin_[size_], block.release());
size_++;
}
......@@ -1061,7 +1061,6 @@ int StringForwardingTable::Add(Isolate* isolate, String string,
String StringForwardingTable::GetForwardString(Isolate* isolate,
int index) const {
// TODO(chromium:1336516): Change to DCHECK.
CHECK_LT(index, Size());
uint32_t index_in_block;
const uint32_t block = BlockForIndex(index, &index_in_block);
......
......@@ -1508,14 +1508,10 @@ uint32_t String::ComputeAndSetHash(
// ComputeAndSetHash in parallel. Since only flat strings are in-place
// internalizable and their contents do not change, the result hash is the
// same. The raw hash field is stored with relaxed ordering.
// TODO(chromium:1336516): Change to DCHECK.
CHECK_IMPLIES(!FLAG_shared_string_table, !HasHashCode());
DCHECK_IMPLIES(!FLAG_shared_string_table, !HasHashCode());
uint32_t field = raw_hash_field(kAcquireLoad);
if (Name::IsForwardingIndex(field)) {
// TODO(chromium:1336516): Temporary CHECK to catch potential crashes
// earlier.
CHECK(FLAG_shared_string_table || FLAG_always_use_string_forwarding_table);
// Get the real hash from the forwarded string.
Isolate* isolate = GetIsolateFromWritableObject(*this);
const int forward_index = Name::HashBits::decode(field);
......
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