regress-747075.js 630 Bytes
Newer Older
1 2 3 4
// 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.

5 6
// Flags: --allow-natives-syntax

7 8 9 10 11
r = [
  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
];

12
function f() {
13 14 15
  r2 = r.map(function(y) {
    return y / 64;
  });
16
  assertTrue(r2[0] < 1);
17 18
};
%PrepareFunctionForOptimization(f);
19 20 21 22
for (let i = 0; i < 1000; ++i) f();
for (let i = 0; i < 1000; ++i) f();
%OptimizeFunctionOnNextCall(f);
for (let i = 0; i < 1000; ++i) f();