Commit 6dfbb095 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

Reland x2 "[compiler] Perform MapRef's SupportsFastArray methods concurrently"

This is a reland of fd16e67e.
https://chromium-review.googlesource.com/c/v8/v8/+/2843813

Reason for reland: The reland was reverted due to TSAN no-cm flakily
failing due to races with the ProtectorCells[1]. The protector cells
part of the method was removed in a refactor[2]. Therefore, we can
re-reland with minor rebase changes in heap-refs.cc (heap.cc remains the
same).

[1]: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20no-concurrent-marking/3413
[2]: https://chromium-review.googlesource.com/c/v8/v8/+/2839553/7/src/compiler/heap-refs.cc

Bug: v8:7790
Change-Id: I976ab10c6398cffe5c5b87b28d9be0de2dd6261c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2850638Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74182}
parent be33ad31
......@@ -2982,14 +2982,14 @@ bool MapRef::HasOnlyStablePrototypesWithFastElements(
}
bool MapRef::supports_fast_array_iteration() const {
if (data_->should_access_heap()) {
if (data_->should_access_heap() || broker()->is_concurrent_inlining()) {
return SupportsFastArrayIteration(broker(), object());
}
return data()->AsMap()->supports_fast_array_iteration();
}
bool MapRef::supports_fast_array_resize() const {
if (data_->should_access_heap()) {
if (data_->should_access_heap() || broker()->is_concurrent_inlining()) {
return SupportsFastArrayResize(broker(), object());
}
return data()->AsMap()->supports_fast_array_resize();
......
......@@ -569,9 +569,12 @@ class Heap {
V8_EXPORT_PRIVATE int NotifyContextDisposed(bool dependant_context);
void set_native_contexts_list(Object object) {
native_contexts_list_ = object;
native_contexts_list_.store(object.ptr(), std::memory_order_release);
}
Object native_contexts_list() const {
return Object(native_contexts_list_.load(std::memory_order_acquire));
}
Object native_contexts_list() const { return native_contexts_list_; }
void set_allocation_sites_list(Object object) {
allocation_sites_list_ = object;
......@@ -2221,7 +2224,9 @@ class Heap {
// Weak list heads, threaded through the objects.
// List heads are initialized lazily and contain the undefined_value at start.
Object native_contexts_list_;
// {native_contexts_list_} is an Address instead of an Object to allow the use
// of atomic accessors.
std::atomic<Address> native_contexts_list_;
Object allocation_sites_list_;
Object dirty_js_finalization_registries_list_;
// Weak list tails.
......
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