2016-10-24 06:36:41 +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.
|
|
|
|
|
|
|
|
// Flags: --allow-natives-syntax
|
|
|
|
|
2021-06-11 14:43:33 +00:00
|
|
|
function foo(o) { return %ToLength(o.length); }
|
2016-10-24 06:36:41 +00:00
|
|
|
|
2019-06-17 16:13:52 +00:00
|
|
|
%PrepareFunctionForOptimization(foo);
|
2016-10-24 06:36:41 +00:00
|
|
|
foo(new Array(4));
|
|
|
|
foo(new Array(Math.pow(2, 32) - 1));
|
|
|
|
foo({length: 10});
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
foo({length: 10});
|