Reviewers: Toon Verwaest,

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

BUG=
TEST=


Please review this at https://chromiumcodereview.appspot.com/10905232/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/flag-definitions.h
  M src/hydrogen.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index f2fc0eb86477e377aae547d847bd84c4cf10d1e6..a1ef202ebf200dbd1c0611ed2ef2e9f0656dbb9b 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -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")
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 57fd079d13eada739da5bf06d2005b636563b46e..0f18e79486f5987591a37808e86f41fe94f54f9a 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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) {


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to