Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: src/hydrogen-instructions.cc

Issue 61623004: Add signed/unsigned 8-bit and 16-bit Representations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tweaks Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698