2017-11-03 09:37:26 +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.
|
|
|
|
|
|
|
|
// Flags: --allow-natives-syntax
|
|
|
|
|
|
|
|
function baz(obj, store) {
|
|
|
|
if (store === true) obj[0] = 1;
|
|
|
|
}
|
|
|
|
function bar(store) {
|
|
|
|
baz(Object.prototype, store);
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(bar);
|
2017-11-03 09:37:26 +00:00
|
|
|
bar(false);
|
|
|
|
bar(false);
|
|
|
|
%OptimizeFunctionOnNextCall(bar);
|
|
|
|
bar(true);
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
function foo() {
|
|
|
|
[].push();
|
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
2017-11-03 09:37:26 +00:00
|
|
|
foo();
|
|
|
|
foo();
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo();
|