Chromium Code Reviews| Index: src/hydrogen-instructions.cc |
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
| index 206ab7e2accf5e496b6cd814eb1071c511cb21e7..fcbde391e47c65b7d74a997445a08c0c3ce88e22 100644 |
| --- a/src/hydrogen-instructions.cc |
| +++ b/src/hydrogen-instructions.cc |
| @@ -2856,9 +2856,18 @@ Range* HShl::InferRange(Zone* zone) { |
| Range* HLoadNamedField::InferRange(Zone* zone) { |
| - if (access().representation().IsByte()) { |
| + if (access().representation().IsInteger8()) { |
| + return new(zone) Range(-128, 127); |
| + } |
| + if (access().representation().IsUInteger8()) { |
| return new(zone) Range(0, 255); |
| } |
| + if (access().representation().IsInteger16()) { |
| + return new(zone) Range(-16384, 16383); |
|
Yang
2013/11/07 09:32:43
Afaik signed integer goes from -2^15 to 2^15-1, wh
danno
2013/11/07 13:19:57
Done.
|
| + } |
| + if (access().representation().IsUInteger16()) { |
| + return new(zone) Range(0, 65535); |
|
Yang
2013/11/07 09:32:43
Same here. Using a constant would be better.
danno
2013/11/07 13:19:57
Done.
|
| + } |
| if (access().IsStringLength()) { |
| return new(zone) Range(0, String::kMaxLength); |
| } |