2015-09-09 14:14:01 +00:00
|
|
|
// Copyright 2015 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.
|
|
|
|
|
2015-09-25 11:33:28 +00:00
|
|
|
// Flags: --allow-natives-syntax --function-context-specialization
|
2015-09-09 14:14:01 +00:00
|
|
|
// Flags: --turbo-filter=f --turbo-inlining
|
|
|
|
|
|
|
|
var f = (function() {
|
|
|
|
var max = Math.max;
|
|
|
|
return function f() { return max(0, -1); };
|
|
|
|
})();
|
2019-06-14 09:18:58 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2015-09-09 14:14:01 +00:00
|
|
|
|
|
|
|
assertEquals(0, f());
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
assertEquals(0, f());
|