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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 inline bool IsInteger32() { | 149 inline bool IsInteger32() { |
150 ASSERT(type_ != kUninitializedType); | 150 ASSERT(type_ != kUninitializedType); |
151 return ((type_ & kInteger32Type) == kInteger32Type); | 151 return ((type_ & kInteger32Type) == kInteger32Type); |
152 } | 152 } |
153 | 153 |
154 inline bool IsDouble() { | 154 inline bool IsDouble() { |
155 ASSERT(type_ != kUninitializedType); | 155 ASSERT(type_ != kUninitializedType); |
156 return ((type_ & kDoubleType) == kDoubleType); | 156 return ((type_ & kDoubleType) == kDoubleType); |
157 } | 157 } |
158 | 158 |
| 159 inline bool IsString() { |
| 160 ASSERT(type_ != kUninitializedType); |
| 161 return ((type_ & kStringType) == kStringType); |
| 162 } |
| 163 |
159 inline bool IsUninitialized() { | 164 inline bool IsUninitialized() { |
160 return type_ == kUninitializedType; | 165 return type_ == kUninitializedType; |
161 } | 166 } |
162 | 167 |
163 const char* ToString() { | 168 const char* ToString() { |
164 switch (type_) { | 169 switch (type_) { |
165 case kUnknownType: return "UnknownType"; | 170 case kUnknownType: return "UnknownType"; |
166 case kPrimitiveType: return "PrimitiveType"; | 171 case kPrimitiveType: return "PrimitiveType"; |
167 case kNumberType: return "NumberType"; | 172 case kNumberType: return "NumberType"; |
168 case kInteger32Type: return "Integer32Type"; | 173 case kInteger32Type: return "Integer32Type"; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 235 } |
231 | 236 |
232 | 237 |
233 TypeInfo TypeInfo::Uninitialized() { | 238 TypeInfo TypeInfo::Uninitialized() { |
234 return TypeInfo(kUninitializedType); | 239 return TypeInfo(kUninitializedType); |
235 } | 240 } |
236 | 241 |
237 } } // namespace v8::internal | 242 } } // namespace v8::internal |
238 | 243 |
239 #endif // V8_TYPE_INFO_H_ | 244 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |