regress-939316.js 740 Bytes
Newer Older
1 2 3 4 5 6
// Copyright 2019 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

7 8 9 10 11 12 13 14
(function JSCreate() {
  function f(arg) {
    const o = Reflect.construct(Object, arguments, Proxy);
    o.foo = arg;
  }

  function g(i) {
    f(i);
15 16
  };
  %PrepareFunctionForOptimization(g);
17 18 19 20 21 22 23 24 25 26 27
  g(0);
  g(1);
  %OptimizeFunctionOnNextCall(g);
  g(2);
})();


(function JSCreateArray() {
  function f() {
    try {
      const o = Reflect.construct(Array, arguments, parseInt);
28 29
    } catch (e) {
    }
30 31 32 33
  }

  function g() {
    f();
34 35
  };
  %PrepareFunctionForOptimization(g);
36 37 38 39 40
  g();
  g();
  %OptimizeFunctionOnNextCall(g);
  g();
})();