2017-01-02 06:52:04 +00:00
|
|
|
// Copyright 2017 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:33:43 +00:00
|
|
|
// Flags: --allow-natives-syntax --opt
|
2017-01-02 06:52:04 +00:00
|
|
|
|
|
|
|
function foo(a) {
|
|
|
|
"use strict";
|
|
|
|
if (a) return arguments[1];
|
|
|
|
}
|
|
|
|
|
2019-06-17 11:48:08 +00:00
|
|
|
%PrepareFunctionForOptimization(foo);
|
2017-01-02 06:52:04 +00:00
|
|
|
foo(false);
|
|
|
|
foo(false);
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo(true, 1);
|
2019-06-17 11:48:08 +00:00
|
|
|
%PrepareFunctionForOptimization(foo);
|
2017-01-02 06:52:04 +00:00
|
|
|
foo(true, 1);
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo(false);
|
|
|
|
foo(true, 1);
|
|
|
|
assertOptimized(foo);
|