2017-12-27 21:40:47 +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: --expose-gc --allow-natives-syntax
|
|
|
|
var notCallable;
|
|
|
|
function inferReceiverMapsInDeadCode() {
|
|
|
|
var obj = { func() {} };
|
|
|
|
gc();
|
|
|
|
function wrappedCode() { try { code(); } catch (e) {} }
|
2019-03-01 10:19:54 +00:00
|
|
|
%PrepareFunctionForOptimization(wrappedCode);
|
2017-12-27 21:40:47 +00:00
|
|
|
function code() {
|
|
|
|
obj.a;
|
|
|
|
try {
|
|
|
|
Object.defineProperty(obj, "func", { get() {} });
|
|
|
|
} catch (neverCaught) {}
|
|
|
|
for (var i = 0; i < 1; i++) {
|
|
|
|
try {
|
|
|
|
notCallable(arguments[i]);
|
|
|
|
} catch (alwaysCaught) {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wrappedCode();
|
|
|
|
try {
|
|
|
|
%OptimizeFunctionOnNextCall(wrappedCode);
|
|
|
|
wrappedCode();
|
|
|
|
} catch (e) {}
|
|
|
|
}
|
|
|
|
inferReceiverMapsInDeadCode();
|
|
|
|
inferReceiverMapsInDeadCode();
|
|
|
|
inferReceiverMapsInDeadCode();
|