Commit 54ef0d87 authored by Nico Hartmann's avatar Nico Hartmann Committed by V8 LUCI CQ

Revert "[heap] Rework Worklist base type"

This reverts commit a19316d9.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20UBSan/22670/overview

Original change's description:
> [heap] Rework Worklist base type
>
> Worklist uses a singly-linked list of segments to hold entries.
> Segment size was based on a compile-time constant but already stored
> in the segment itself.
>
> Rework the segments to query `malloc_usable_size()` on allocation and
> adjust the capacity properly. For PartitionAlloc, it turns out that
> there's ~20% more capacity available for the 64-element segments.
>
> This slows down actual allocation of the segments with the upside of
> improving utilization and requiring 20% less segments.
>
> Change-Id: Ib8595c3fb9fb75b02e4022f6c525bb59a2df7ab7
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3826047
> Commit-Queue: Anton Bikineev <bikineev@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#82432}

Change-Id: I14994e11ff5ffaba70b93d977d40dd2f6e9e5d35
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3829474
Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#82438}
parent 0cd0e4bb
......@@ -52,9 +52,6 @@
#if V8_OS_DARWIN
#include <mach/mach.h>
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#if V8_OS_LINUX
......@@ -1265,14 +1262,5 @@ Stack::StackSlot Stack::GetCurrentStackPosition() {
#undef MAP_ANONYMOUS
#undef MADV_FREE
// static
size_t Malloc::GetUsableSize(void* ptr) {
#if defined(V8_OS_DARWIN)
return malloc_size(ptr);
#else // defined(V8_OS_DARWIN)
return malloc_usable_size(ptr);
#endif // !defined(V8_OS_DARWIN)
}
} // namespace base
} // namespace v8
......@@ -19,8 +19,7 @@
// This has to come after windows.h.
#include <VersionHelpers.h>
#include <dbghelp.h> // For SymLoadModule64 and al.
#include <malloc.h> // For _msize()
#include <dbghelp.h> // For SymLoadModule64 and al.
#include <mmsystem.h> // For timeGetTime().
#include <tlhelp32.h> // For Module32First and al.
......@@ -1766,8 +1765,5 @@ Stack::StackSlot Stack::GetCurrentStackPosition() {
#endif
}
// static
size_t Malloc::GetUsableSize(void* ptr) { return _msize(ptr); }
} // namespace base
} // namespace v8
......@@ -661,12 +661,6 @@ class V8_BASE_EXPORT Stack {
}
};
class V8_BASE_EXPORT Malloc final {
public:
// Returns the usable size in bytes for a `ptr` allocated using `malloc()`.
static size_t GetUsableSize(void* ptr);
};
} // namespace base
} // namespace v8
......
......@@ -4,12 +4,16 @@
#include "src/heap/base/worklist.h"
namespace heap::base::internal {
namespace heap {
namespace base {
namespace internal {
// static
SegmentBase* SegmentBase::GetSentinelSegmentAddress() {
static SegmentBase sentinel_segment(0);
return &sentinel_segment;
static SegmentBase kSentinelSegment(0);
return &kSentinelSegment;
}
} // namespace heap::base::internal
} // namespace internal
} // namespace base
} // namespace heap
This diff is collapsed.
......@@ -704,7 +704,7 @@ void Scavenger::Process(JobDelegate* delegate) {
scavenge_visitor.Visit(object_and_size.first);
done = false;
if (delegate && ((++objects % kInterruptThreshold) == 0)) {
if (!copied_list_local_.IsLocalEmpty()) {
if (!copied_list_local_.IsEmpty()) {
delegate->NotifyConcurrencyIncrease();
}
}
......
......@@ -20,10 +20,10 @@ namespace heap {
void PublishSegment(MarkingWorklist* worklist, HeapObject object) {
MarkingWorklist::Local local(worklist);
for (size_t i = 0; i < MarkingWorklist::kMinSegmentSizeForTesting; i++) {
for (size_t i = 0; i <= MarkingWorklist::kSegmentSize; i++) {
local.Push(object);
}
local.Publish();
CHECK(local.Pop(&object));
}
TEST(ConcurrentMarking) {
......
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