Revision: 20120
Author:   [email protected]
Date:     Thu Mar 20 12:34:44 2014 UTC
Log:      Use HBoundsCheck to check string length.

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Thu Mar 20 08:33:06 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Mar 20 12:34:44 2014 UTC
@@ -1793,11 +1793,8 @@
                                              HValue* right_length) {
// Compute the combined string length and check against max string length.
   HValue* length = AddUncasted<HAdd>(left_length, right_length);
-  IfBuilder if_nooverflow(this);
-  if_nooverflow.If<HCompareNumericAndBranch>(
-      length, Add<HConstant>(String::kMaxLength), Token::LTE);
-  if_nooverflow.Then();
-  if_nooverflow.ElseDeopt("String length exceeds limit");
+  HValue* max_length = Add<HConstant>(String::kMaxLength);
+  Add<HBoundsCheck>(length, max_length);
   return length;
 }

--
--
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/d/optout.

Reply via email to