node/deps/v8/test/mjsunit/maglev/math-max-float64-same-inlining.js
Michaël Zasso 53379f3706
deps: update V8 to 14.3.127.12
PR-URL: https://github.com/nodejs/node/pull/60488
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2025-11-13 15:08:26 +01:00

29 lines
711 B
JavaScript

// Copyright 2025 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 --maglev
function testDouble() {
let v = 5.5;
return Math.max(v, v);
}
%PrepareFunctionForOptimization(testDouble);
testDouble();
%OptimizeMaglevOnNextCall(testDouble);
assertEquals(5.5, testDouble());
assertTrue(isMaglevved(testDouble));
function testObject() {
let v = {valueOf: () => {return 1.1;}}
return Math.max(v, v);
}
%PrepareFunctionForOptimization(testObject);
testObject();
%OptimizeMaglevOnNextCall(testObject);
assertEquals(1.1, testObject());
assertFalse(isMaglevved(testObject));