Commit 440a9eb6 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

Revert "[offthread] Add a write lock to the string table"

This reverts commit 6af09b1b.

Reason for revert: Breaks Win debug builder - https://ci.chromium.org/p/v8/builders/ci/V8%20Win32%20-%20debug/26384?

Original change's description:
> [offthread] Add a write lock to the string table
> 
> Adds an initial implementation of a concurrency support for the string
> table, allowing it to be read without holding a lock, and written to
> while holding a lock.
> 
> This is an initial prototype of _roughly_ how the concurrency would
> work; there are still a few holes (e.g. around deserialization). This
> is predominantly to assess the main-thread runtime impact of the more
> complex string table access.
> 
> Bug: v8:10729
> Change-Id: I5c6c35e6fca309efd6ee79804c16972aae1ab3ab
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2306804
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68985}

TBR=ulan@chromium.org,leszeks@chromium.org,ishell@chromium.org,verwaest@chromium.org

Change-Id: I001dc81f1d4031bf0451766452a43176df997354
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10729
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2312776Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68988}
parent 1c304527
......@@ -16,7 +16,6 @@
#include "include/v8-internal.h"
#include "include/v8.h"
#include "src/base/macros.h"
#include "src/base/platform/mutex.h"
#include "src/builtins/builtins.h"
#include "src/common/globals.h"
#include "src/debug/interface-types.h"
......@@ -614,9 +613,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
return &transition_array_access_;
}
// Mutex for accessing the string table.
base::Mutex* string_table_mutex() { return &string_table_mutex_; }
Address get_address_from_id(IsolateAddressId id);
// Access to top context (where the current function object was created).
......@@ -1658,7 +1654,6 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory {
std::shared_ptr<Counters> async_counters_;
base::RecursiveMutex break_access_;
base::SharedMutex transition_array_access_;
base::Mutex string_table_mutex_;
Logger* logger_ = nullptr;
StubCache* load_stub_cache_ = nullptr;
StubCache* store_stub_cache_ = nullptr;
......
......@@ -157,10 +157,11 @@ InternalIndex HashTable<Derived, Shape>::FindEntry(const LocalIsolate* isolate,
Object element = KeyAt(isolate, entry);
// Empty entry. Uses raw unchecked accessors because it is called by the
// string table during bootstrapping.
if (element == undefined) return InternalIndex::NotFound();
if (element == undefined) break;
if (Shape::kMatchNeedsHoleCheck && element == the_hole) continue;
if (Shape::IsMatch(key, element)) return entry;
}
return InternalIndex::NotFound();
}
// static
......
......@@ -223,12 +223,6 @@ class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) HashTable
uint32_t hash);
InternalIndex FindInsertionEntry(Isolate* isolate, uint32_t hash);
// Find either the entry with the given key, or the entry at which to insert
// an element with the given key.
InternalIndex FindEntryOrInsertionEntry(const Isolate* isolate,
ReadOnlyRoots roots, Key key,
uint32_t hash);
// Computes the capacity a table with the given capacity would need to have
// room for the given number of elements, also allowing it to shrink.
static int ComputeCapacityWithShrink(int current_capacity,
......
This diff is collapsed.
......@@ -436,12 +436,6 @@ class RootsTable {
return roots_[index];
}
FullObjectSlot slot(RootIndex root_index) {
size_t index = static_cast<size_t>(root_index);
DCHECK_LT(index, kEntriesCount);
return FullObjectSlot(&roots_[index]);
}
static const char* name(RootIndex root_index) {
size_t index = static_cast<size_t>(root_index);
DCHECK_LT(index, kEntriesCount);
......
......@@ -240,7 +240,6 @@ HeapObject Deserializer::PostProcessNewObject(HeapObject obj,
if (string.IsInternalizedString()) {
// Off-thread internalized strings are canonicalized during off-thread
// isolate publish, so we don't have to canonicalize them here.
// TODO(crbug.com/v8/10729): Add concurrent string table support.
if (local_isolate().is_off_thread()) return string;
// Canonicalize the internalized string. If it already exists in the
......
......@@ -79,7 +79,6 @@ MaybeHandle<HeapObject> ObjectDeserializer::Deserialize(
void ObjectDeserializer::CommitPostProcessedObjects() {
if (is_main_thread()) {
// TODO(crbug.com/v8/10729): Add concurrent string table support.
CHECK_LE(new_internalized_strings().size(), kMaxInt);
StringTable::EnsureCapacityForDeserialization(
isolate(), static_cast<int>(new_internalized_strings().size()));
......
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