OLD | NEW |
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 Loading... |
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(kMinInteger8, kMaxInteger8); |
| 2861 } |
| 2862 if (access().representation().IsUInteger8()) { |
| 2863 return new(zone) Range(kMinUInteger8, kMaxUInteger8); |
| 2864 } |
| 2865 if (access().representation().IsInteger16()) { |
| 2866 return new(zone) Range(kMinInteger16, kMaxInteger16); |
| 2867 } |
| 2868 if (access().representation().IsUInteger16()) { |
| 2869 return new(zone) Range(kMinUInteger16, kMaxUInteger16); |
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(kMinInteger8, kMaxInteger8); |
| 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(kMinUInteger8, kMaxUInteger8); |
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(kMinInteger16, kMaxInteger16); |
2879 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 2887 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
2880 return new(zone) Range(0, 65535); | 2888 return new(zone) Range(kMinUInteger16, kMaxUInteger16); |
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 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4298 break; | 4306 break; |
4299 case kExternalMemory: | 4307 case kExternalMemory: |
4300 stream->Add("[external-memory]"); | 4308 stream->Add("[external-memory]"); |
4301 break; | 4309 break; |
4302 } | 4310 } |
4303 | 4311 |
4304 stream->Add("@%d", offset()); | 4312 stream->Add("@%d", offset()); |
4305 } | 4313 } |
4306 | 4314 |
4307 } } // namespace v8::internal | 4315 } } // namespace v8::internal |
OLD | NEW |