Commit d75f7613 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[heap] Use AlwaysAllocateScope for clients with shared allocations

When performing a shared allocation in a client we have checks for the
AlwaysAllocateScope in both client and shared isolate slow allocation
code paths. We need to enable both such that we don't fail with
spurious OOM failures with GC stress bots.

This change was already introduced with the reverted CL
https://crrev.com/c/3422630. Land this as its own CL until that CL
relands.

Bug: v8:11708, v8:12582
Change-Id: I81ca3f0aaec3ac3fbef9d0b7219e09fa056000f5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3443503Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78979}
parent da62220f
...@@ -5566,7 +5566,10 @@ HeapObject Heap::AllocateRawWithRetryOrFailSlowPath( ...@@ -5566,7 +5566,10 @@ HeapObject Heap::AllocateRawWithRetryOrFailSlowPath(
if (IsSharedAllocationType(allocation)) { if (IsSharedAllocationType(allocation)) {
CollectSharedGarbage(GarbageCollectionReason::kLastResort); CollectSharedGarbage(GarbageCollectionReason::kLastResort);
AlwaysAllocateScope scope(isolate()->shared_isolate()->heap()); // We need always_allocate() to be true both on the client- and
// server-isolate. It is used in both code paths.
AlwaysAllocateScope shared_scope(isolate()->shared_isolate()->heap());
AlwaysAllocateScope client_scope(isolate()->heap());
alloc = AllocateRaw(size, allocation, origin, alignment); alloc = AllocateRaw(size, allocation, origin, alignment);
} else { } else {
CollectAllAvailableGarbage(GarbageCollectionReason::kLastResort); CollectAllAvailableGarbage(GarbageCollectionReason::kLastResort);
......
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