Revision: 15001
Author:   [email protected]
Date:     Fri Jun  7 04:00:39 2013
Log:      Allow boundscheck elimination to work on Smi keys.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/16035016
http://code.google.com/p/v8/source/detail?r=15001

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Jun 7 02:11:33 2013 +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Jun 7 04:00:39 2013
@@ -1058,6 +1058,7 @@
         block()->graph()->GetInvalidContext(), current_index, add_offset);
     add->InsertBefore(this);
     add->AssumeRepresentation(index()->representation());
+    add->ClearFlag(kCanOverflow);
     current_index = add;
   }

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Fri Jun 7 02:11:33 2013 +++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Jun 7 04:00:39 2013
@@ -3660,9 +3660,6 @@
   virtual Representation RequiredInputRepresentation(int arg_index) {
     return representation();
   }
-  virtual Representation observed_input_representation(int index) {
-    return Representation::Integer32();
-  }

   virtual bool IsRelationTrueInternal(NumericRelation relation,
                                       HValue* related_value,
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Thu Jun  6 08:30:46 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Fri Jun  7 04:00:39 2013
@@ -4115,7 +4115,7 @@
   static BoundsCheckKey* Create(Zone* zone,
                                 HBoundsCheck* check,
                                 int32_t* offset) {
-    if (!check->index()->representation().IsInteger32()) return NULL;
+    if (!check->index()->representation().IsSmiOrInteger32()) return NULL;

     HValue* index_base = NULL;
     HConstant* constant = NULL;
@@ -4211,7 +4211,7 @@
   // returns false, otherwise it returns true.
   bool CoverCheck(HBoundsCheck* new_check,
                   int32_t new_offset) {
-    ASSERT(new_check->index()->representation().IsInteger32());
+    ASSERT(new_check->index()->representation().IsSmiOrInteger32());
     bool keep_new_check = false;

     if (new_offset > upper_offset_) {
@@ -4320,8 +4320,8 @@
     HValue* index_context = IndexContext(*add, check);
     if (index_context == NULL) return false;

-    HConstant* new_constant = new(BasicBlock()->zone())
-       HConstant(new_offset, Representation::Integer32());
+    HConstant* new_constant = new(BasicBlock()->zone()) HConstant(
+        new_offset, representation);
     if (*add == NULL) {
       new_constant->InsertBefore(check);
       (*add) = HAdd::New(
@@ -4453,7 +4453,7 @@

 static void DehoistArrayIndex(ArrayInstructionInterface* array_operation) {
   HValue* index = array_operation->GetKey()->ActualValue();
-  if (!index->representation().IsInteger32()) return;
+  if (!index->representation().IsSmiOrInteger32()) return;

   HConstant* constant;
   HValue* subexpression;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to