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

[heap] Ensure that ArrayBufferSweeper is not active

Add CHECKs to make sure that ArrayBufferSweeper is only active when
v8_enable_array_buffer_extension is set to true.

Bug: v8:10064
Change-Id: I609d5e1230dca52fd8555d4401c3f60faf4c266c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2047047Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66209}
parent 55a01ec7
......@@ -67,6 +67,7 @@ size_t ArrayBufferList::BytesSlow() {
void ArrayBufferSweeper::EnsureFinished() {
if (!sweeping_in_progress_) return;
CHECK(V8_ARRAY_BUFFER_EXTENSION_BOOL);
TryAbortResult abort_result =
heap_->isolate()->cancelable_task_manager()->TryAbort(job_.id);
......@@ -128,6 +129,8 @@ void ArrayBufferSweeper::RequestSweep(SweepingScope scope) {
if (young_.IsEmpty() && (old_.IsEmpty() || scope == SweepingScope::Young))
return;
CHECK(V8_ARRAY_BUFFER_EXTENSION_BOOL);
if (!heap_->IsTearingDown() && !heap_->ShouldReduceMemory() &&
!heap_->is_current_gc_forced() && FLAG_concurrent_array_buffer_sweeping) {
Prepare(scope);
......@@ -196,6 +199,7 @@ void ArrayBufferSweeper::ReleaseAll(ArrayBufferList* list) {
void ArrayBufferSweeper::Append(JSArrayBuffer object,
ArrayBufferExtension* extension) {
CHECK(V8_ARRAY_BUFFER_EXTENSION_BOOL);
size_t bytes = extension->accounting_length();
if (Heap::InYoungGeneration(object)) {
......
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