Index: src/type-info.h |
diff --git a/src/type-info.h b/src/type-info.h |
index 2c3543eafbe87bb87c6c46089a360f50092204d2..7c9c05ef087c9e3bdab1584071c56e5f80ea532a 100644 |
--- a/src/type-info.h |
+++ b/src/type-info.h |
@@ -64,6 +64,8 @@ class TypeInfo { |
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 @@ class TypeInfo { |
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 @@ class TypeInfo { |
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 @@ class TypeInfo { |
kSmi = 0x17, // 0010111 |
kDouble = 0x19, // 0011001 |
kString = 0x30, // 0110000 |
+ kSymbol = 0x32, // 0110010 |
kNonPrimitive = 0x40, // 1000000 |
kUninitialized = 0x7f // 1111111 |
}; |