2014-06-26 06:32:51 +00:00
|
|
|
// Copyright 2014 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-09-07 06:47:03 +00:00
|
|
|
// Flags: --opt --no-always-opt
|
2014-06-26 06:32:51 +00:00
|
|
|
|
|
|
|
Debug = debug.Debug;
|
|
|
|
|
|
|
|
Debug.setListener(function() {});
|
|
|
|
|
|
|
|
function f() {}
|
2019-04-29 13:14:40 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2014-06-26 06:32:51 +00:00
|
|
|
f();
|
|
|
|
f();
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
f();
|
|
|
|
assertOptimized(f);
|
|
|
|
|
2017-09-07 06:47:03 +00:00
|
|
|
var bp = Debug.setBreakPoint(f);
|
|
|
|
assertUnoptimized(f);
|
2019-04-29 13:14:40 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2017-09-07 06:47:03 +00:00
|
|
|
f();
|
|
|
|
f();
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
f();
|
|
|
|
assertUnoptimized(f);
|
|
|
|
|
|
|
|
Debug.clearBreakPoint(bp);
|
2019-04-29 13:14:40 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2017-09-07 06:47:03 +00:00
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
f();
|
|
|
|
assertOptimized(f);
|
|
|
|
|
2014-06-26 06:32:51 +00:00
|
|
|
Debug.setListener(null);
|