R=bmeurer@chromium.org
Review URL: https://codereview.chromium.org/
206183003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20120
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
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;
}