2016-03-02 19:26:13 +00:00
|
|
|
// Copyright 2016 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
|
|
|
|
|
|
|
|
var o = {}
|
|
|
|
var p = {foo: 1.5}
|
|
|
|
|
|
|
|
function g(x) { return x.foo === +x.foo; }
|
|
|
|
|
2019-06-17 16:13:52 +00:00
|
|
|
%PrepareFunctionForOptimization(g);
|
2016-03-02 19:26:13 +00:00
|
|
|
assertEquals(false, g(o));
|
|
|
|
assertEquals(false, g(o));
|
|
|
|
%OptimizeFunctionOnNextCall(g);
|
|
|
|
assertEquals(false, g(o)); // Still fine here.
|
|
|
|
assertEquals(true, g(p));
|
2019-06-17 16:13:52 +00:00
|
|
|
%PrepareFunctionForOptimization(g);
|
2016-03-02 19:26:13 +00:00
|
|
|
%OptimizeFunctionOnNextCall(g);
|
|
|
|
assertEquals(false, g(o)); // Confused by type feedback.
|