node/deps/v8/test/mjsunit/shared-memory/shared-struct-property-storage.js
Yagiz Nizipli 16e03e7968 deps: update V8 to 10.9.194.4
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-27 17:27:13 +00:00

24 lines
605 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: --shared-string-table --harmony-struct
'use strict';
let fieldNames = [];
for (let i = 0; i < 999; i++) {
fieldNames.push('field' + i);
}
let s = new (new SharedStructType(fieldNames));
// Write to an out-of-object field.
(function storeOutOfObject() {
for (let i = 0; i < 100; i++) s.field998 = i;
})();
// Write to an in-object field.
(function storeInObject() {
for (let i = 0; i < 100; i++) s.field0 = i;
})();