Files
Kmake/deps/v8/test/mjsunit/turboshaft/maglev-frontend/symbol-eq.js
2026-05-26 23:36:42 -07:00

23 lines
641 B
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: --no-always-turbofan
function symbol_eq(x, y) { return x === y; }
const a = Symbol("a");
const b = Symbol("b");
%PrepareFunctionForOptimization(symbol_eq);
assertFalse(symbol_eq(a, b));
assertTrue(symbol_eq(a, a));
%OptimizeFunctionOnNextCall(symbol_eq);
assertFalse(symbol_eq(a, b));
assertTrue(symbol_eq(a, a));
assertOptimized(symbol_eq);
assertFalse(symbol_eq(a, "a"));
assertUnoptimized(symbol_eq);