v8/test/mjsunit/regress/regress-crbug-344186.js
jkummerow@chromium.org 6e3b81a7b2 Fix Hydrogen bounds check elimination
When combining bounds checks, they must all be moved before the first load/store
that they are guarding.

BUG=chromium:344186
LOG=y
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/172093002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-02-19 10:30:39 +00:00

21 lines
487 B
JavaScript

// Copyright 2014 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
var dummy = new Int32Array(100);
var array = new Int32Array(128);
function fun(base) {
array[base - 95] = 1;
array[base - 99] = 2;
array[base + 4] = 3;
}
fun(100);
%OptimizeFunctionOnNextCall(fun);
fun(0);
for (var i = 0; i < dummy.length; i++) {
assertEquals(0, dummy[i]);
}