node/deps/v8/test/mjsunit/regress/regress-1312022.js
Michaël Zasso 6bbc5596b1
deps: update V8 to 10.2.154.2
PR-URL: https://github.com/nodejs/node/pull/42740
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-21 11:54:15 +02:00

43 lines
1.0 KiB
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: --allow-natives-syntax
function __getProperties(obj) {
let properties = [];
for (let name of Object.getOwnPropertyNames(obj)) {
properties.push(name);
}
return properties;
}
function* __getObjects(root = this, level = 0) {
if (level > 4) return;
let obj_names = __getProperties(root);
for (let obj_name of obj_names) {
let obj = root[obj_name];
yield* __getObjects(obj, level + 1);
}
}
function __getRandomObject() {
for (let obj of __getObjects()) {}
}
%PrepareFunctionForOptimization(__f_23);
%OptimizeFunctionOnNextCall(__f_23);
try {
__getRandomObject(), {};
} catch (e) {}
function __f_23(__v_93) {
var __v_95 = "x";
return __v_93[__v_95] + __v_94[__v_95];
}
%PrepareFunctionForOptimization(__f_23);
try {
__f_23();
} catch (e) {}
try {
%OptimizeFunctionOnNextCall(__f_23);
__f_23();
} catch (e) {}
%DisableOptimizationFinalization();