OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (rep.bits == minus_zero.bits) return false; | 123 if (rep.bits == minus_zero.bits) return false; |
124 if (value >= kMinInt && value <= kMaxUInt32) { | 124 if (value >= kMinInt && value <= kMaxUInt32) { |
125 if (value <= kMaxInt && value == static_cast<int32_t>(value)) { | 125 if (value <= kMaxInt && value == static_cast<int32_t>(value)) { |
126 return true; | 126 return true; |
127 } | 127 } |
128 if (value == static_cast<uint32_t>(value)) return true; | 128 if (value == static_cast<uint32_t>(value)) return true; |
129 } | 129 } |
130 return false; | 130 return false; |
131 } | 131 } |
132 | 132 |
133 static inline TypeInfo TypeFromValue(Handle<Object> value); | 133 static TypeInfo TypeFromValue(Handle<Object> value); |
134 | 134 |
135 inline bool IsUnknown() { | 135 inline bool IsUnknown() { |
136 return type_ == kUnknownType; | 136 return type_ == kUnknownType; |
137 } | 137 } |
138 | 138 |
139 inline bool IsNumber() { | 139 inline bool IsNumber() { |
140 ASSERT(type_ != kUninitializedType); | 140 ASSERT(type_ != kUninitializedType); |
141 return ((type_ & kNumberType) == kNumberType); | 141 return ((type_ & kNumberType) == kNumberType); |
142 } | 142 } |
143 | 143 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 | 232 |
233 TypeInfo TypeInfo::Uninitialized() { | 233 TypeInfo TypeInfo::Uninitialized() { |
234 return TypeInfo(kUninitializedType); | 234 return TypeInfo(kUninitializedType); |
235 } | 235 } |
236 | 236 |
237 } } // namespace v8::internal | 237 } } // namespace v8::internal |
238 | 238 |
239 #endif // V8_TYPE_INFO_H_ | 239 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |