nodejs/deps/v8/test/mjsunit/regress/regress-1194869.js
Michaël Zasso 5b358d57e1
deps: patch V8 to 9.0.257.16
Refs: https://github.com/v8/v8/compare/9.0.257.13...9.0.257.16

PR-URL: https://github.com/nodejs/node/pull/38218
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-04-14 17:09:27 +02:00

26 lines
640 B
JavaScript

// Copyright 2021 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 --no-lazy-feedback-allocation
// Flags: --interrupt-budget=100
function f() {
return "".indexOf("", 2);
}
%PrepareFunctionForOptimization(f)
assertEquals(f(), 0);
assertEquals(f(), 0);
%OptimizeFunctionOnNextCall(f)
assertEquals(f(), 0);
assertEquals(f(), 0);
function g() {
return "".indexOf("", 2);
}
for (let i = 0; i < 191; i++) {
// Expect a natural optimization here due to low interrupt budget.
assertEquals(g(), 0);
}