v8/test/mjsunit/compiler/regress-9087.js
Georg Neis d97bc8db79 [turbofan] Add a regression test
Bug: v8:9087
Change-Id: Ibc21d7e5619e4e6a0edc98cb0bd12e67ab2f6643
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1554690
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60657}
2019-04-05 13:57:56 +00:00

22 lines
502 B
JavaScript

// 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
function constructor() {}
const obj = Object.create(constructor.prototype);
for (let i = 0; i < 1020; ++i) {
constructor.prototype["x" + i] = 42;
}
function foo() {
return obj instanceof constructor;
}
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo());