| Index: src/types.cc
|
| diff --git a/src/types.cc b/src/types.cc
|
| index b8febc2a149ad4e7e488a8cfc4e6a59f6c896da6..ed98480b8a06e10b4dfcb5630216e56a32cbb05c 100644
|
| --- a/src/types.cc
|
| +++ b/src/types.cc
|
| @@ -131,6 +131,7 @@ int Type::LubBitset() {
|
| if (value->IsUndefined()) return kUndefined;
|
| if (value->IsNull()) return kNull;
|
| if (value->IsTrue() || value->IsFalse()) return kBoolean;
|
| + if (value->IsTheHole()) return kAny;
|
| }
|
| }
|
| switch (map->instance_type()) {
|
| @@ -200,6 +201,10 @@ int Type::LubBitset() {
|
| // We ought to find a cleaner solution for compiling stubs parameterised
|
| // over type or class variables, esp ones with bounds...
|
| return kDetectable;
|
| + case DECLARED_ACCESSOR_INFO_TYPE:
|
| + case EXECUTABLE_ACCESSOR_INFO_TYPE:
|
| + case ACCESSOR_PAIR_TYPE:
|
| + return kInternal;
|
| default:
|
| UNREACHABLE();
|
| return kNone;
|
| @@ -222,7 +227,7 @@ int Type::GlbBitset() {
|
|
|
|
|
| // Check this <= that.
|
| -bool Type::Is(Type* that) {
|
| +bool Type::IsSlowCase(Type* that) {
|
| // Fast path for bitsets.
|
| if (that->is_bitset()) {
|
| return (this->LubBitset() | that->as_bitset()) == that->as_bitset();
|
| @@ -313,6 +318,7 @@ bool Type::InUnion(Handle<Unioned> unioned, int current_size) {
|
| return false;
|
| }
|
|
|
| +
|
| // Get non-bitsets from this which are not subsumed by union, store at unioned,
|
| // starting at index. Returns updated index.
|
| int Type::ExtendUnion(Handle<Unioned> result, int current_size) {
|
| @@ -471,4 +477,13 @@ Type* Type::Optional(Handle<Type> type) {
|
| : Union(type, Undefined()->handle_via_isolate_of(*type));
|
| }
|
|
|
| +
|
| +Representation Representation::FromType(Handle<Type> type) {
|
| + if (type->Is(Type::None())) return Representation::None();
|
| + if (type->Is(Type::Signed32())) return Representation::Integer32();
|
| + if (type->Is(Type::Number())) return Representation::Double();
|
| + return Representation::Tagged();
|
| +}
|
| +
|
| +
|
| } } // namespace v8::internal
|
|
|