PR-URL: https://github.com/nodejs/node/pull/51362 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
31 lines
586 B
JavaScript
31 lines
586 B
JavaScript
// Copyright 2023 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 Module(stdlib) {
|
|
"use asm";
|
|
|
|
var fround = stdlib.Math.fround;
|
|
|
|
// f: double -> float
|
|
function f(a) {
|
|
a = +a;
|
|
return fround(a);
|
|
}
|
|
|
|
return { f: f };
|
|
}
|
|
|
|
var f = Module({ Math }).f;
|
|
let count = 0;
|
|
|
|
let tester = () => {
|
|
return f(140737463189505, 8388607);
|
|
}
|
|
%PrepareFunctionForOptimization(tester);
|
|
tester();
|
|
%OptimizeFunctionOnNextCall(tester);
|
|
tester();
|