Index: src/types.h |
diff --git a/src/types.h b/src/types.h |
index b349b6b970c9282df9bc60894edf3e5d453878c7..808e07f38d3d26ba8ac9f7b5eb950c646724075b 100644 |
--- a/src/types.h |
+++ b/src/types.h |
@@ -219,8 +219,9 @@ namespace internal { |
V(Detectable, kDetectableReceiver | kNumber | kName) \ |
V(Object, kDetectableObject | kUndetectable) \ |
V(Receiver, kObject | kProxy) \ |
- V(NonNumber, kBoolean | kName | kNull | kReceiver | \ |
- kUndefined | kInternal) \ |
+ V(Unique, kBoolean | kUniqueName | kNull | kUndefined | \ |
+ kReceiver) \ |
+ V(NonNumber, kUnique | kString | kInternal) \ |
V(Any, 0xfffffffeu) |
/* |
@@ -262,6 +263,7 @@ namespace internal { |
// typedef Struct; |
// typedef Region; |
// template<class> struct Handle { typedef type; } // No template typedefs... |
+// template<class T> static Handle<T>::type null_handle(); |
// template<class T> static Handle<T>::type handle(T* t); // !is_bitset(t) |
// template<class T> static Handle<T>::type cast(Handle<Type>::type); |
// static bool is_bitset(Type*); |
@@ -372,6 +374,12 @@ class TypeImpl : public Config::Base { |
static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region* reg); |
static TypeHandle Intersect(TypeHandle type1, TypeHandle type2, Region* reg); |
+ static TypeImpl* Union(TypeImpl* type1, TypeImpl* type2) { |
+ return BitsetType::New(type1->AsBitset() | type2->AsBitset()); |
+ } |
+ static TypeImpl* Intersect(TypeImpl* type1, TypeImpl* type2) { |
+ return BitsetType::New(type1->AsBitset() & type2->AsBitset()); |
+ } |
static TypeHandle Of(double value, Region* region) { |
return Config::from_bitset(BitsetType::Lub(value), region); |
@@ -909,6 +917,7 @@ struct ZoneTypeConfig { |
typedef i::Zone Region; |
template<class T> struct Handle { typedef T* type; }; |
+ template<class T> static inline T* null_handle(); |
template<class T> static inline T* handle(T* type); |
template<class T> static inline T* cast(Type* type); |
@@ -951,6 +960,7 @@ struct HeapTypeConfig { |
typedef i::Isolate Region; |
template<class T> struct Handle { typedef i::Handle<T> type; }; |
+ template<class T> static inline i::Handle<T> null_handle(); |
template<class T> static inline i::Handle<T> handle(T* type); |
template<class T> static inline i::Handle<T> cast(i::Handle<Type> type); |
@@ -999,7 +1009,9 @@ struct BoundsImpl { |
TypeHandle lower; |
TypeHandle upper; |
- BoundsImpl() {} |
+ BoundsImpl() : // Make sure accessing uninitialized bounds crashes big-time. |
+ lower(Config::template null_handle<Type>()), |
+ upper(Config::template null_handle<Type>()) {} |
explicit BoundsImpl(TypeHandle t) : lower(t), upper(t) {} |
BoundsImpl(TypeHandle l, TypeHandle u) : lower(l), upper(u) { |
DCHECK(lower->Is(upper)); |