v8/test/mjsunit/large-external-string.js
Dominik Inführ c6527293a5 [heap] Fix external bytes accounting when promoting large objects
Unlike other spaces we didn't update external bytes counters when
adding or removing pages from large spaces.

Bug: chromium:1329766
Change-Id: I5fbc8703964f9e4e846d986c32c5d57ed4f0c0c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3681118
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80877}
2022-06-01 07:24:08 +00:00

17 lines
412 B
JavaScript

// Copyright 2022 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.
// Flags: --expose-gc --expose-externalize-string --verify-heap
const LENGTH = 100 * 1000;
const data = new Array();
for (var i = 0; i < LENGTH; ++i) {
data.push('do ');
}
const largeText = data.join();
externalizeString(largeText);
gc();