diff options
Diffstat (limited to 'deps/v8/src/objects/js-array-buffer.cc')
-rw-r--r-- | deps/v8/src/objects/js-array-buffer.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/deps/v8/src/objects/js-array-buffer.cc b/deps/v8/src/objects/js-array-buffer.cc index 0c2aca6d710..c67777acc03 100644 --- a/deps/v8/src/objects/js-array-buffer.cc +++ b/deps/v8/src/objects/js-array-buffer.cc @@ -45,7 +45,7 @@ void JSArrayBuffer::Setup(SharedFlag shared, } set_extension(nullptr); if (!backing_store) { - set_backing_store(nullptr); + set_backing_store(GetIsolate(), nullptr); set_byte_length(0); } else { Attach(std::move(backing_store)); @@ -60,19 +60,20 @@ void JSArrayBuffer::Attach(std::shared_ptr<BackingStore> backing_store) { DCHECK_NOT_NULL(backing_store); DCHECK_EQ(is_shared(), backing_store->is_shared()); DCHECK(!was_detached()); - set_backing_store(backing_store->buffer_start()); + Isolate* isolate = GetIsolate(); + set_backing_store(isolate, backing_store->buffer_start()); set_byte_length(backing_store->byte_length()); if (backing_store->is_wasm_memory()) set_is_detachable(false); if (!backing_store->free_on_destruct()) set_is_external(true); if (V8_ARRAY_BUFFER_EXTENSION_BOOL) { - Heap* heap = GetIsolate()->heap(); + Heap* heap = isolate->heap(); ArrayBufferExtension* extension = EnsureExtension(); size_t bytes = backing_store->PerIsolateAccountingLength(); extension->set_accounting_length(bytes); extension->set_backing_store(std::move(backing_store)); heap->AppendArrayBufferExtension(*this, extension); } else { - GetIsolate()->heap()->RegisterBackingStore(*this, std::move(backing_store)); + isolate->heap()->RegisterBackingStore(*this, std::move(backing_store)); } } @@ -103,7 +104,7 @@ void JSArrayBuffer::Detach(bool force_for_wasm_memory) { DCHECK(!is_shared()); DCHECK(!is_asmjs_memory()); - set_backing_store(nullptr); + set_backing_store(isolate, nullptr); set_byte_length(0); set_was_detached(true); } @@ -193,7 +194,7 @@ Handle<JSArrayBuffer> JSTypedArray::GetBuffer() { // Clear the elements of the typed array. self->set_elements(ReadOnlyRoots(isolate).empty_byte_array()); - self->SetOffHeapDataPtr(array_buffer->backing_store(), 0); + self->SetOffHeapDataPtr(isolate, array_buffer->backing_store(), 0); DCHECK(!self->is_on_heap()); return array_buffer; |