f28a753354
GC needs to be able to read a bigint's length while the main thread may change the length and the sign (bigints are intentionally mutable as long as they haven't escaped to user code). Since both values are stored in the same bitfield, we need to make these accesses atomic. Also change right-trimming to not insert a filler when the object is in large object space (it makes no sense there). Bug: v8:8440 Change-Id: I72a1b6f1eda54566d3cfad554dda1a98ddd61975 Reviewed-on: https://chromium-review.googlesource.com/c/1337737 Commit-Queue: Georg Neis <neis@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#57576}
9 lines
315 B
JavaScript
9 lines
315 B
JavaScript
// Copyright 2018 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Create BigInt in large object space for which MakeImmutable reduces the
|
|
// length.
|
|
const x = 2n ** (2n ** 22n);
|
|
assertEquals(1n, x - (x - 1n));
|