Commit 73dee8fc authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[runtime] Use MemsetTagged for initializing SmallOrderedHashTable

the_hole_value is in ReadOnlyRoots and we don't need write barriers
for it.

Change-Id: Iebdac2e6a2c0f594445e80cfd016dda351a66f98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2787486Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73711}
parent f23e66e6
......@@ -680,17 +680,9 @@ void SmallOrderedHashTable<Derived>::Initialize(Isolate* isolate,
memset(reinterpret_cast<byte*>(hashtable_start), kNotFound,
num_buckets + num_chains);
if (Heap::InYoungGeneration(*this)) {
MemsetTagged(RawField(DataTableStartOffset()),
ReadOnlyRoots(isolate).the_hole_value(),
capacity * Derived::kEntrySize);
} else {
for (int i = 0; i < capacity; i++) {
for (int j = 0; j < Derived::kEntrySize; j++) {
SetDataEntry(i, j, ReadOnlyRoots(isolate).the_hole_value());
}
}
}
MemsetTagged(RawField(DataTableStartOffset()),
ReadOnlyRoots(isolate).the_hole_value(),
capacity * Derived::kEntrySize);
#ifdef DEBUG
for (int i = 0; i < num_buckets; ++i) {
......
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