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

Unified Diff: src/types.h

Issue 18078002: Type handling for special cases and optimization (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 6 months 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 | « no previous file | src/types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.h
diff --git a/src/types.h b/src/types.h
index 25ed6e8f5612ca8667cf261d691f526ad377321c..a2bcda65791646c57464a5d85a908564efc5587a 100644
--- a/src/types.h
+++ b/src/types.h
@@ -126,6 +126,7 @@ class Type : public Object {
static Type* Function() { return from_bitset(kFunction); }
static Type* RegExp() { return from_bitset(kRegExp); }
static Type* Proxy() { return from_bitset(kProxy); }
+ static Type* Internal() { return from_bitset(kInternal); }
static Type* Class(Handle<Map> map) { return from_handle(map); }
static Type* Constant(Handle<HeapObject> value) {
@@ -139,7 +140,7 @@ class Type : public Object {
static Type* Intersect(Handle<Type> type1, Handle<Type> type2);
static Type* Optional(Handle<Type> type); // type \/ Undefined
- bool Is(Type* that);
+ bool Is(Type* that) { return (this == that) ? true : IsSlowCase(that); }
bool Is(Handle<Type> that) { return this->Is(*that); }
bool Maybe(Type* that);
bool Maybe(Handle<Type> that) { return this->Maybe(*that); }
@@ -207,6 +208,7 @@ class Type : public Object {
kRegExp = 1 << 13,
kOtherObject = 1 << 14,
kProxy = 1 << 15,
+ kInternal = 1 << 16,
kOddball = kBoolean | kNull | kUndefined,
kSigned32 = kSmi | kOtherSigned32,
@@ -218,7 +220,7 @@ class Type : public Object {
kObject = kUndetectable | kArray | kFunction | kRegExp | kOtherObject,
kReceiver = kObject | kProxy,
kAllocated = kDouble | kName | kReceiver,
- kAny = kOddball | kNumber | kAllocated,
+ kAny = kOddball | kNumber | kAllocated | kInternal,
kDetectable = kAllocated - kUndetectable,
kNone = 0
};
@@ -228,6 +230,8 @@ class Type : public Object {
bool is_constant() { return this->IsBox(); }
bool is_union() { return this->IsFixedArray(); }
+ bool IsSlowCase(Type* that);
+
int as_bitset() { return Smi::cast(this)->value(); }
Handle<Map> as_class() { return Handle<Map>::cast(handle()); }
Handle<v8::internal::Object> as_constant() {
« no previous file with comments | « no previous file | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698