Reviewers: Benedikt Meurer,
Description:
Use HBoundsCheck to check string length.
[email protected]
Please review this at https://codereview.chromium.org/206183003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+2, -5 lines):
M src/hydrogen.cc
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
f6e22d873f2e894593a0fbf25d7ed9fbb7176469..282fae7800bab93132c198f0c338762c2cce7b74
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1793,11 +1793,8 @@ HValue* HGraphBuilder::BuildAddStringLengths(HValue*
left_length,
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.