Commit e60ce8d1 authored by jochen's avatar jochen Committed by Commit bot

Register array buffer right after writing it into the object

BUG=chromium:504875
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1215103003

Cr-Commit-Position: refs/heads/master@{#29377}
parent 44ea5fbf
......@@ -28,15 +28,15 @@ void Runtime::SetupArrayBuffer(Isolate* isolate,
array_buffer->set_is_neuterable(shared == SharedFlag::kNotShared);
array_buffer->set_is_shared(shared == SharedFlag::kShared);
Handle<Object> byte_length =
isolate->factory()->NewNumberFromSize(allocated_length);
CHECK(byte_length->IsSmi() || byte_length->IsHeapNumber());
array_buffer->set_byte_length(*byte_length);
if (data && !is_external) {
isolate->heap()->RegisterNewArrayBuffer(
isolate->heap()->InNewSpace(*array_buffer), data, allocated_length);
}
Handle<Object> byte_length =
isolate->factory()->NewNumberFromSize(allocated_length);
CHECK(byte_length->IsSmi() || byte_length->IsHeapNumber());
array_buffer->set_byte_length(*byte_length);
}
......
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