2016-06-15 11:37:31 +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.
|
|
|
|
|
2017-04-28 13:09:31 +00:00
|
|
|
// Flags: --allow-natives-syntax
|
2016-06-15 11:37:31 +00:00
|
|
|
|
|
|
|
function f(x) {
|
|
|
|
var s = x ? "0" : "1";
|
|
|
|
return 1 + Number(s);
|
|
|
|
}
|
|
|
|
|
2019-03-01 10:19:54 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2016-06-15 11:37:31 +00:00
|
|
|
f(0);
|
|
|
|
f(0);
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
assertEquals(2, f(0));
|