PR-URL: https://github.com/nodejs/node/pull/49639 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
24 lines
552 B
JavaScript
24 lines
552 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 --maglev
|
|
|
|
function f(value) {
|
|
return value.x === 'abc';
|
|
}
|
|
|
|
let o1 = { x : 'abc' };
|
|
let o2 = { y : 'no' };
|
|
|
|
%PrepareFunctionForOptimization(f);
|
|
f(o1);
|
|
f(o2);
|
|
f(4);
|
|
// The feedback of `f` now contains 2 kNotFound maps (one for `o2`'s map, and
|
|
// one for HeapNumber map).
|
|
|
|
%OptimizeMaglevOnNextCall(f);
|
|
assertEquals(f(4), false);
|
|
assertOptimized(f);
|