v8/test/mjsunit/regress/regress-crbug-658185.js
bmeurer 7201bad99d [turbofan] Properly deal with out-of-bounds fields in EscapeAnalysis.
Conflicting type feedback on Load/StoreICs can lead to out-of-bounds
field access, which is essentially dead code, but EscapeAnalysis was
confused about those. For now, mark the objects as escaping in these
cases, middle-term we want to deal better with this kind of compile-
time known dead code.

BUG=chromium:658185,v8:4586
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2459273002
Cr-Commit-Position: refs/heads/master@{#40662}
2016-10-31 06:43:25 +00:00

21 lines
413 B
JavaScript

// Copyright 2016 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 --turbo-escape
var t = 0;
function foo() {
var o = {x:1};
var p = {y:2.5, x:0};
o = [];
for (var i = 0; i < 2; ++i) {
t = o.x;
o = p;
}
}
foo();
foo();
%OptimizeFunctionOnNextCall(foo);
foo();