2019-03-18 07:52:23 +00:00
|
|
|
// 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
|
|
|
|
|
2019-03-18 14:34:05 +00:00
|
|
|
(function JSCreate() {
|
|
|
|
function f(arg) {
|
|
|
|
const o = Reflect.construct(Object, arguments, Proxy);
|
|
|
|
o.foo = arg;
|
|
|
|
}
|
|
|
|
|
|
|
|
function g(i) {
|
|
|
|
f(i);
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(g);
|
2019-03-18 14:34:05 +00:00
|
|
|
g(0);
|
|
|
|
g(1);
|
|
|
|
%OptimizeFunctionOnNextCall(g);
|
|
|
|
g(2);
|
|
|
|
})();
|
|
|
|
|
|
|
|
|
|
|
|
(function JSCreateArray() {
|
|
|
|
function f() {
|
|
|
|
try {
|
|
|
|
const o = Reflect.construct(Array, arguments, parseInt);
|
2019-06-12 14:00:50 +00:00
|
|
|
} catch (e) {
|
|
|
|
}
|
2019-03-18 14:34:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function g() {
|
|
|
|
f();
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(g);
|
2019-03-18 14:34:05 +00:00
|
|
|
g();
|
|
|
|
g();
|
|
|
|
%OptimizeFunctionOnNextCall(g);
|
|
|
|
g();
|
|
|
|
})();
|