Revision: 13701
Author:   [email protected]
Date:     Thu Feb 21 01:09:01 2013
Log:      Also check if the length ia a smi in a HBoundsCheck.

Review URL: https://codereview.chromium.org/12301026
http://code.google.com/p/v8/source/detail?r=13701

Modified:
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Tue Feb 19 08:32:02 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Feb 21 01:09:01 2013
@@ -784,11 +784,16 @@
                                             HValue* length,
                                             BoundsCheckKeyMode key_mode,
                                             Representation r) {
-  HCheckSmiOrInt32* checked_index =
-      new(graph()->zone()) HCheckSmiOrInt32(index);
-  AddInstruction(checked_index);
+  if (!index->type().IsSmi()) {
+    index = new(graph()->zone()) HCheckSmiOrInt32(index);
+    AddInstruction(HCheckSmiOrInt32::cast(index));
+  }
+  if (!length->type().IsSmi()) {
+    length = new(graph()->zone()) HCheckSmiOrInt32(length);
+    AddInstruction(HCheckSmiOrInt32::cast(length));
+  }
   HBoundsCheck* result = new(graph()->zone()) HBoundsCheck(
-      checked_index, length, key_mode, r);
+      index, length, key_mode, r);
   AddInstruction(result);
   return result;
 }

--
--
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