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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 66193004: Reland 17588: Add signed/unsigned 8-bit and 16-bit Representations to Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Latest version 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-load-elimination.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2849 : new(zone) Range(); 2849 : new(zone) Range();
2850 result->Shl(c->Integer32Value()); 2850 result->Shl(c->Integer32Value());
2851 return result; 2851 return result;
2852 } 2852 }
2853 } 2853 }
2854 return HValue::InferRange(zone); 2854 return HValue::InferRange(zone);
2855 } 2855 }
2856 2856
2857 2857
2858 Range* HLoadNamedField::InferRange(Zone* zone) { 2858 Range* HLoadNamedField::InferRange(Zone* zone) {
2859 if (access().representation().IsByte()) { 2859 if (access().representation().IsInteger8()) {
2860 return new(zone) Range(0, 255); 2860 return new(zone) Range(kMinInt8, kMaxInt8);
2861 }
2862 if (access().representation().IsUInteger8()) {
2863 return new(zone) Range(kMinUInt8, kMaxUInt8);
2864 }
2865 if (access().representation().IsInteger16()) {
2866 return new(zone) Range(kMinInt16, kMaxInt16);
2867 }
2868 if (access().representation().IsUInteger16()) {
2869 return new(zone) Range(kMinUInt16, kMaxUInt16);
2861 } 2870 }
2862 if (access().IsStringLength()) { 2871 if (access().IsStringLength()) {
2863 return new(zone) Range(0, String::kMaxLength); 2872 return new(zone) Range(0, String::kMaxLength);
2864 } 2873 }
2865 return HValue::InferRange(zone); 2874 return HValue::InferRange(zone);
2866 } 2875 }
2867 2876
2868 2877
2869 Range* HLoadKeyed::InferRange(Zone* zone) { 2878 Range* HLoadKeyed::InferRange(Zone* zone) {
2870 switch (elements_kind()) { 2879 switch (elements_kind()) {
2880 case EXTERNAL_BYTE_ELEMENTS:
2881 return new(zone) Range(kMinInt8, kMaxInt8);
2882 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
2871 case EXTERNAL_PIXEL_ELEMENTS: 2883 case EXTERNAL_PIXEL_ELEMENTS:
2872 return new(zone) Range(0, 255); 2884 return new(zone) Range(kMinUInt8, kMaxUInt8);
2873 case EXTERNAL_BYTE_ELEMENTS:
2874 return new(zone) Range(-128, 127);
2875 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
2876 return new(zone) Range(0, 255);
2877 case EXTERNAL_SHORT_ELEMENTS: 2885 case EXTERNAL_SHORT_ELEMENTS:
2878 return new(zone) Range(-32768, 32767); 2886 return new(zone) Range(kMinInt16, kMaxInt16);
2879 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 2887 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
2880 return new(zone) Range(0, 65535); 2888 return new(zone) Range(kMinUInt16, kMaxUInt16);
2881 default: 2889 default:
2882 return HValue::InferRange(zone); 2890 return HValue::InferRange(zone);
2883 } 2891 }
2884 } 2892 }
2885 2893
2886 2894
2887 void HCompareGeneric::PrintDataTo(StringStream* stream) { 2895 void HCompareGeneric::PrintDataTo(StringStream* stream) {
2888 stream->Add(Token::Name(token())); 2896 stream->Add(Token::Name(token()));
2889 stream->Add(" "); 2897 stream->Add(" ");
2890 HBinaryOperation::PrintDataTo(stream); 2898 HBinaryOperation::PrintDataTo(stream);
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
4318 break; 4326 break;
4319 case kExternalMemory: 4327 case kExternalMemory:
4320 stream->Add("[external-memory]"); 4328 stream->Add("[external-memory]");
4321 break; 4329 break;
4322 } 4330 }
4323 4331
4324 stream->Add("@%d", offset()); 4332 stream->Add("@%d", offset());
4325 } 4333 }
4326 4334
4327 } } // namespace v8::internal 4335 } } // namespace v8::internal
OLDNEW
« 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