Commit 2a4fec61 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Ensure that allocation happens on the right thread

LocalHeap should only be used on the heap it was created on.

Bug: v8:10315
Change-Id: Ia06f0169d39b4148b356568795f4e316361a1e9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2323358Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69114}
parent 12c60417
...@@ -22,6 +22,10 @@ AllocationResult ConcurrentAllocator::Allocate(int object_size, ...@@ -22,6 +22,10 @@ AllocationResult ConcurrentAllocator::Allocate(int object_size,
AllocationOrigin origin) { AllocationOrigin origin) {
// TODO(dinfuehr): Add support for allocation observers // TODO(dinfuehr): Add support for allocation observers
CHECK(FLAG_concurrent_allocation); CHECK(FLAG_concurrent_allocation);
// Ensure that we are on the right thread
DCHECK_EQ(LocalHeap::Current(), local_heap_);
if (object_size > kMaxLabObjectSize) { if (object_size > kMaxLabObjectSize) {
return AllocateOutsideLab(object_size, alignment, origin); return AllocateOutsideLab(object_size, alignment, origin);
} }
......
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