Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1316)

Unified Diff: src/type-info.h

Issue 8373029: [hydrogen] optimize switch with string clauses (Closed) Base URL: gh:v8/v8@master
Patch Set: fix lint errors, improved test Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/type-info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
};
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698