Commit 0df222ac authored by Marja Hölttä's avatar Marja Hölttä Committed by V8 LUCI CQ

Reland "[rab/gsab] Fix ObjectSerializer"

This time without stray changes.

Previous version: https://chromium-review.googlesource.com/c/v8/v8/+/3657431

Bug: v8:11111
Change-Id: I365224040c2d1b490a8d92513b9e73027bf8bb0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3683609Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80892}
parent 1acb5db0
......@@ -513,13 +513,14 @@ void Serializer::ObjectSerializer::SerializeJSTypedArray() {
if (typed_array.is_on_heap()) {
typed_array.RemoveExternalPointerCompensationForSerialization(isolate());
} else {
if (!typed_array.WasDetached()) {
if (!typed_array.IsDetachedOrOutOfBounds()) {
// Explicitly serialize the backing store now.
JSArrayBuffer buffer = JSArrayBuffer::cast(typed_array.buffer());
// We cannot store byte_length or max_byte_length larger than int32
// range in the snapshot.
CHECK_LE(buffer.byte_length(), std::numeric_limits<int32_t>::max());
int32_t byte_length = static_cast<int32_t>(buffer.byte_length());
size_t byte_length_size = buffer.GetByteLength();
CHECK_LE(byte_length_size, size_t{std::numeric_limits<int32_t>::max()});
int32_t byte_length = static_cast<int32_t>(byte_length_size);
Maybe<int32_t> max_byte_length = Nothing<int32_t>();
if (buffer.is_resizable()) {
CHECK_LE(buffer.max_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