| Index: src/compiler/typer.cc
|
| diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
|
| index 9679513219d666f64a9d2b7ebf5be1371c68acdb..e7638019a398cf7821ce57ef5054e1415c6cdc1d 100644
|
| --- a/src/compiler/typer.cc
|
| +++ b/src/compiler/typer.cc
|
| @@ -57,10 +57,8 @@ Typer::Typer(Isolate* isolate, Graph* graph, Flags flags,
|
| unsigned32ish_ = Type::Union(Type::Unsigned32(), truncating_to_zero, zone);
|
| falsish_ = Type::Union(
|
| Type::Undetectable(),
|
| - Type::Union(
|
| - Type::Union(Type::Union(singleton_false_, cache_.kZeroish, zone),
|
| - Type::NullOrUndefined(), zone),
|
| - singleton_the_hole_, zone),
|
| + Type::Union(Type::Union(singleton_false_, cache_.kZeroish, zone),
|
| + singleton_the_hole_, zone),
|
| zone);
|
| truish_ = Type::Union(
|
| singleton_true_,
|
| @@ -244,6 +242,7 @@ class Typer::Visitor : public Reducer {
|
| static Type* ObjectIsNumber(Type*, Typer*);
|
| static Type* ObjectIsReceiver(Type*, Typer*);
|
| static Type* ObjectIsSmi(Type*, Typer*);
|
| + static Type* ObjectIsUndetectable(Type*, Typer*);
|
|
|
| static Type* JSAddRanger(RangeType*, RangeType*, Typer*);
|
| static Type* JSSubtractRanger(RangeType*, RangeType*, Typer*);
|
| @@ -469,7 +468,9 @@ Type* Typer::Visitor::ToObject(Type* type, Typer* t) {
|
| // ES6 section 7.1.13 ToObject ( argument )
|
| if (type->Is(Type::Receiver())) return type;
|
| if (type->Is(Type::Primitive())) return Type::OtherObject();
|
| - if (!type->Maybe(Type::Undetectable())) return Type::DetectableReceiver();
|
| + if (!type->Maybe(Type::OtherUndetectable())) {
|
| + return Type::DetectableReceiver();
|
| + }
|
| return Type::Receiver();
|
| }
|
|
|
| @@ -533,6 +534,13 @@ Type* Typer::Visitor::ObjectIsSmi(Type* type, Typer* t) {
|
| }
|
|
|
|
|
| +Type* Typer::Visitor::ObjectIsUndetectable(Type* type, Typer* t) {
|
| + if (type->Is(Type::Undetectable())) return t->singleton_true_;
|
| + if (!type->Maybe(Type::Undetectable())) return t->singleton_false_;
|
| + return Type::Boolean();
|
| +}
|
| +
|
| +
|
| // -----------------------------------------------------------------------------
|
|
|
|
|
| @@ -1171,7 +1179,7 @@ Type* Typer::Visitor::JSTypeOfTyper(Type* type, Typer* t) {
|
| return Type::Constant(f->string_string(), t->zone());
|
| } else if (type->Is(Type::Symbol())) {
|
| return Type::Constant(f->symbol_string(), t->zone());
|
| - } else if (type->Is(Type::Union(Type::Undefined(), Type::Undetectable(),
|
| + } else if (type->Is(Type::Union(Type::Undefined(), Type::OtherUndetectable(),
|
| t->zone()))) {
|
| return Type::Constant(f->undefined_string(), t->zone());
|
| } else if (type->Is(Type::Null())) {
|
| @@ -1925,6 +1933,11 @@ Type* Typer::Visitor::TypeObjectIsSmi(Node* node) {
|
| }
|
|
|
|
|
| +Type* Typer::Visitor::TypeObjectIsUndetectable(Node* node) {
|
| + return TypeUnaryOp(node, ObjectIsUndetectable);
|
| +}
|
| +
|
| +
|
| // Machine operators.
|
|
|
| Type* Typer::Visitor::TypeLoad(Node* node) { return Type::Any(); }
|
|
|