Revision f230a1cf deps/v8/src/types.cc

View differences:

deps/v8/src/types.cc
128 128
      Handle<v8::internal::Object> value = this->as_constant();
129 129
      if (value->IsSmi()) return kSmi;
130 130
      map = HeapObject::cast(*value)->map();
131
      if (map->instance_type() == HEAP_NUMBER_TYPE) {
132
        int32_t i;
133
        uint32_t u;
134
        if (value->ToInt32(&i)) return Smi::IsValid(i) ? kSmi : kOtherSigned32;
135
        if (value->ToUint32(&u)) return kUnsigned32;
136
        return kDouble;
137
      }
131 138
      if (map->instance_type() == ODDBALL_TYPE) {
132 139
        if (value->IsUndefined()) return kUndefined;
133 140
        if (value->IsNull()) return kNull;
134 141
        if (value->IsTrue() || value->IsFalse()) return kBoolean;
135
        if (value->IsTheHole()) return kAny;
142
        if (value->IsTheHole()) return kAny;  // TODO(rossberg): kNone?
143
        UNREACHABLE();
136 144
      }
137 145
    }
138 146
    switch (map->instance_type()) {
......
230 238

  
231 239

  
232 240
// Check this <= that.
233
bool Type::IsSlowCase(Type* that) {
241
bool Type::SlowIs(Type* that) {
234 242
  // Fast path for bitsets.
243
  if (this->is_none()) return true;
235 244
  if (that->is_bitset()) {
236 245
    return (this->LubBitset() | that->as_bitset()) == that->as_bitset();
237 246
  }
......
518 527
    }
519 528
    PrintF(out, "}");
520 529
  } else if (is_constant()) {
521
    PrintF(out, "Constant(%p)", static_cast<void*>(*as_constant()));
530
    PrintF(out, "Constant(%p : ", static_cast<void*>(*as_constant()));
531
    from_bitset(LubBitset())->TypePrint(out);
532
    PrintF(")");
522 533
  } else if (is_class()) {
523
    PrintF(out, "Class(%p)", static_cast<void*>(*as_class()));
534
    PrintF(out, "Class(%p < ", static_cast<void*>(*as_class()));
535
    from_bitset(LubBitset())->TypePrint(out);
536
    PrintF(")");
524 537
  } else if (is_union()) {
525 538
    PrintF(out, "{");
526 539
    Handle<Unioned> unioned = as_union();

Also available in: Unified diff