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

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: Address review feedback and prepare to land 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
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-load-elimination.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 206ab7e2accf5e496b6cd814eb1071c511cb21e7..0d47b23f28264803a39b251a30a2c183a607fc04 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2856,8 +2856,17 @@ Range* HShl::InferRange(Zone* zone) {
Range* HLoadNamedField::InferRange(Zone* zone) {
- if (access().representation().IsByte()) {
- return new(zone) Range(0, 255);
+ if (access().representation().IsInteger8()) {
+ return new(zone) Range(kMinInt8, kMaxInt8);
+ }
+ if (access().representation().IsUInteger8()) {
+ return new(zone) Range(kMinUInt8, kMaxUInt8);
+ }
+ if (access().representation().IsInteger16()) {
+ return new(zone) Range(kMinInt16, kMaxInt16);
+ }
+ if (access().representation().IsUInteger16()) {
+ return new(zone) Range(kMinUInt16, kMaxUInt16);
}
if (access().IsStringLength()) {
return new(zone) Range(0, String::kMaxLength);
@@ -2868,16 +2877,15 @@ Range* HLoadNamedField::InferRange(Zone* zone) {
Range* HLoadKeyed::InferRange(Zone* zone) {
switch (elements_kind()) {
- case EXTERNAL_PIXEL_ELEMENTS:
- return new(zone) Range(0, 255);
case EXTERNAL_BYTE_ELEMENTS:
- return new(zone) Range(-128, 127);
+ return new(zone) Range(kMinInt8, kMaxInt8);
case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
- return new(zone) Range(0, 255);
+ case EXTERNAL_PIXEL_ELEMENTS:
+ return new(zone) Range(kMinUInt8, kMaxUInt8);
case EXTERNAL_SHORT_ELEMENTS:
- return new(zone) Range(-32768, 32767);
+ return new(zone) Range(kMinInt16, kMaxInt16);
case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
- return new(zone) Range(0, 65535);
+ return new(zone) Range(kMinUInt16, kMaxUInt16);
default:
return HValue::InferRange(zone);
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-load-elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698