Commit 22aed1cd authored by mmassi@chromium.org's avatar mmassi@chromium.org

Fixed bounds check removal by restricting it to int32 indexes (and reenabled...

Fixed bounds check removal by restricting it to int32 indexes (and reenabled both ABCR and index dehoisting).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10905232

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ebd3241b
......@@ -198,9 +198,9 @@ DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing")
DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining")
DEFINE_bool(use_osr, true, "use on-stack replacement")
DEFINE_bool(array_bounds_checks_elimination, false,
DEFINE_bool(array_bounds_checks_elimination, true,
"perform array bounds checks elimination")
DEFINE_bool(array_index_dehoisting, false,
DEFINE_bool(array_index_dehoisting, true,
"perform array index dehoisting")
DEFINE_bool(trace_osr, false, "trace on-stack replacement")
......
......@@ -3432,6 +3432,8 @@ class BoundsCheckKey : public ZoneObject {
static BoundsCheckKey* Create(Zone* zone,
HBoundsCheck* check,
int32_t* offset) {
if (!check->index()->representation().IsInteger32()) return NULL;
HValue* index_base = NULL;
HConstant* constant = NULL;
bool is_sub = false;
......@@ -3682,6 +3684,7 @@ void HGraph::EliminateRedundantBoundsChecks(HBasicBlock* bb,
int32_t offset;
BoundsCheckKey* key =
BoundsCheckKey::Create(zone(), check, &offset);
if (key == NULL) continue;
BoundsCheckBbData** data_p = table->LookupOrInsert(key, zone());
BoundsCheckBbData* data = *data_p;
if (data == NULL) {
......
......@@ -29,6 +29,29 @@
var a = new Int32Array(1024);
// Test that we do not assert if the accessed index has not an int32 rep.
var v = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
function test_do_not_assert_on_non_int32(vector, base) {
var r = 0;
var a1 = base + 1;
var a2 = base + 2;
var a3 = base + 3;
var a4 = base + 4;
if (a1 == 2) {
r += vector[a1];
r += vector[a4];
r += vector[a2];
r += vector[a3];
}
return r;
}
test_do_not_assert_on_non_int32(v,1);
test_do_not_assert_on_non_int32(v,1);
test_do_not_assert_on_non_int32(v,"a");
test_do_not_assert_on_non_int32(v,"a");
%OptimizeFunctionOnNextCall(test_do_not_assert_on_non_int32);
test_do_not_assert_on_non_int32(v,0);
function test_base(base,cond) {
a[base + 1] = 1;
a[base + 4] = 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment