Index: src/type-info.h |
=================================================================== |
--- src/type-info.h (revision 10035) |
+++ src/type-info.h (working copy) |
@@ -64,6 +64,8 @@ |
static TypeInfo Integer32() { return TypeInfo(kInteger32); } |
// We know it's a Smi. |
static TypeInfo Smi() { return TypeInfo(kSmi); } |
+ // We know it's a Symbol. |
+ static TypeInfo Symbol() { return TypeInfo(kSymbol); } |
// We know it's a heap number. |
static TypeInfo Double() { return TypeInfo(kDouble); } |
// We know it's a string. |
@@ -137,6 +139,16 @@ |
return ((type_ & kSmi) == kSmi); |
} |
+ inline bool IsSymbol() { |
+ ASSERT(type_ != kUninitialized); |
+ return ((type_ & kSymbol) == kSymbol); |
+ } |
+ |
+ inline bool IsNonSymbol() { |
+ ASSERT(type_ != kUninitialized); |
+ return ((type_ & kSymbol) == kString); |
+ } |
+ |
inline bool IsInteger32() { |
ASSERT(type_ != kUninitialized); |
return ((type_ & kInteger32) == kInteger32); |
@@ -168,6 +180,7 @@ |
case kNumber: return "Number"; |
case kInteger32: return "Integer32"; |
case kSmi: return "Smi"; |
+ case kSymbol: return "Symbol"; |
case kDouble: return "Double"; |
case kString: return "String"; |
case kNonPrimitive: return "Object"; |
@@ -186,6 +199,7 @@ |
kSmi = 0x17, // 0010111 |
kDouble = 0x19, // 0011001 |
kString = 0x30, // 0110000 |
+ kSymbol = 0x32, // 0110010 |
kNonPrimitive = 0x40, // 1000000 |
kUninitialized = 0x7f // 1111111 |
}; |