Michaël Zasso 918fe04351
deps: update V8 to 13.6.233.8
PR-URL: https://github.com/nodejs/node/pull/58070
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-05-02 15:06:53 +02:00

40 lines
1.0 KiB
JavaScript

// Copyright 2024 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 --turbolev --turbofan
// Flags: --concurrent-recompilation
function g(x) {
assertEquals(42.42, x);
}
%NeverOptimizeFunction(g);
function test_osr(x, y) {
let s = 0;
let loop_is_turbofan = false;
for (let i = 0; i < 20; i++) {
%OptimizeOsr();
s += i;
loop_is_turbofan = %CurrentFrameIsTurbofan();
}
// This multiplication will trigger a deopt (because it has no feedback).
s *= x;
// The loop should have been in Turbofan in its last few iterations.
assertTrue(loop_is_turbofan);
// We shouldn't be in Turbofan anymore
assertFalse(%CurrentFrameIsTurbofan());
assertFalse(%ActiveTierIsTurbofan(test_osr));
// Keeping the parameters alive, just to make sure that everything works.
g(y);
return s;
}
%PrepareFunctionForOptimization(test_osr);
assertEquals(570, test_osr(3, 42.42));