// Most precise _current_ type of a value (usually its class).
template<class Config>
typename TypeImpl<Config>::TypeHandle TypeImpl<Config>::NowOf(
- i::Handle<i::Object> value, Region* region) {
+ i::Object* value, Region* region) {
if (value->IsSmi() ||
- i::HeapObject::cast(*value)->map()->instance_type() == HEAP_NUMBER_TYPE ||
- i::HeapObject::cast(*value)->map()->instance_type() == ODDBALL_TYPE) {
+ i::HeapObject::cast(value)->map()->instance_type() == HEAP_NUMBER_TYPE ||
+ i::HeapObject::cast(value)->map()->instance_type() == ODDBALL_TYPE) {
return Of(value, region);
}
- return Class(i::handle(i::HeapObject::cast(*value)->map()), region);
+ return Class(i::handle(i::HeapObject::cast(value)->map()), region);
}
static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region* reg);
static TypeHandle Intersect(TypeHandle type1, TypeHandle type2, Region* reg);
+ static TypeHandle Of(i::Object* value, Region* region) {
+ return Config::from_bitset(LubBitset(value), region);
+ }
static TypeHandle Of(i::Handle<i::Object> value, Region* region) {
- return Config::from_bitset(LubBitset(*value), region);
+ return Of(*value, region);
}
bool Is(TypeImpl* that) { return this == that || this->SlowIs(that); }
// State-dependent versions of Of and Is that consider subtyping between
// a constant and its map class.
- static TypeHandle NowOf(i::Handle<i::Object> value, Region* region);
+ static TypeHandle NowOf(i::Object* value, Region* region);
+ static TypeHandle NowOf(i::Handle<i::Object> value, Region* region) {
+ return NowOf(*value, region);
+ }
bool NowIs(TypeImpl* that);
template<class TypeHandle>
bool NowIs(TypeHandle that) { return this->NowIs(*that); }
Effect AstTyper::ObservedOnStack(Object* value) {
- Type* lower = Type::NowOf(handle(value, isolate()), zone());
+ Type* lower = Type::NowOf(value, zone());
return Effect(Bounds(lower, Type::Any(zone())));
}