V8 Project
v8::internal::TypeImpl< Config > Class Template Reference

#include <types.h>

+ Inheritance diagram for v8::internal::TypeImpl< Config >:
+ Collaboration diagram for v8::internal::TypeImpl< Config >:

Classes

class  ArrayType
 
class  BitsetType
 
class  ClassType
 
class  ConstantType
 
class  ContextType
 
class  FunctionType
 
class  Iterator
 
struct  Limits
 
class  RangeType
 
class  StructuralType
 
class  UnionType
 

Public Types

enum  PrintDimension { BOTH_DIMS , SEMANTIC_DIM , REPRESENTATION_DIM }
 
typedef uint32_t bitset
 
typedef Config::template Handle< TypeImpl >::type TypeHandle
 
typedef Config::template Handle< ClassType >::type ClassHandle
 
typedef Config::template Handle< ConstantType >::type ConstantHandle
 
typedef Config::template Handle< RangeType >::type RangeHandle
 
typedef Config::template Handle< ContextType >::type ContextHandle
 
typedef Config::template Handle< ArrayType >::type ArrayHandle
 
typedef Config::template Handle< FunctionType >::type FunctionHandle
 
typedef Config::template Handle< UnionType >::type UnionHandle
 
typedef Config::Region Region
 

Public Member Functions

bool IsInhabited ()
 
bool Is (TypeImpl *that)
 
template<class TypeHandle >
bool Is (TypeHandle that)
 
bool Maybe (TypeImpl *that)
 
template<class TypeHandle >
bool Maybe (TypeHandle that)
 
bool Equals (TypeImpl *that)
 
template<class TypeHandle >
bool Equals (TypeHandle that)
 
bool Contains (i::Object *val)
 
bool Contains (i::Handle< i::Object > val)
 
bool NowIs (TypeImpl *that)
 
template<class TypeHandle >
bool NowIs (TypeHandle that)
 
bool NowContains (i::Object *val)
 
bool NowContains (i::Handle< i::Object > val)
 
bool NowStable ()
 
bool IsClass ()
 
bool IsConstant ()
 
bool IsRange ()
 
bool IsContext ()
 
bool IsArray ()
 
bool IsFunction ()
 
ClassTypeAsClass ()
 
ConstantTypeAsConstant ()
 
RangeTypeAsRange ()
 
ContextTypeAsContext ()
 
ArrayTypeAsArray ()
 
FunctionTypeAsFunction ()
 
double Min ()
 
double Max ()
 
int NumClasses ()
 
int NumConstants ()
 
Iterator< i::MapClasses ()
 
Iterator< i::ObjectConstants ()
 
void PrintTo (OStream &os, PrintDimension dim=BOTH_DIMS)
 
template<class OtherType >
TypeImpl< Config >::TypeHandle Convert (typename OtherType::TypeHandle type, Region *region)
 

Static Public Member Functions

static TypeHandle Class (i::Handle< i::Map > map, Region *region)
 
static TypeHandle Constant (i::Handle< i::Object > value, Region *region)
 
static TypeHandle Range (i::Handle< i::Object > min, i::Handle< i::Object > max, Region *region)
 
static TypeHandle Context (TypeHandle outer, Region *region)
 
static TypeHandle Array (TypeHandle element, Region *region)
 
static FunctionHandle Function (TypeHandle result, TypeHandle receiver, int arity, Region *region)
 
static TypeHandle Function (TypeHandle result, Region *region)
 
static TypeHandle Function (TypeHandle result, TypeHandle param0, Region *region)
 
static TypeHandle Function (TypeHandle result, TypeHandle param0, TypeHandle param1, Region *region)
 
static TypeHandle Function (TypeHandle result, TypeHandle param0, TypeHandle param1, TypeHandle param2, Region *region)
 
static TypeHandle Union (TypeHandle type1, TypeHandle type2, Region *reg)
 
static TypeHandle Intersect (TypeHandle type1, TypeHandle type2, Region *reg)
 
static TypeHandle Of (double value, Region *region)
 
static TypeHandle Of (i::Object *value, Region *region)
 
static TypeHandle Of (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)
 
static TypeImplcast (typename Config::Base *object)
 
template<class OtherTypeImpl >
static TypeHandle Convert (typename OtherTypeImpl::TypeHandle type, Region *region)
 

Protected Member Functions

TypeImplunhandle ()
 
bool IsNone ()
 
bool IsAny ()
 
bool IsBitset ()
 
bool IsUnion ()
 
bitset AsBitset ()
 
UnionTypeAsUnion ()
 
bitset BitsetGlb ()
 
bitset BitsetLub ()
 
bool SlowIs (TypeImpl *that)
 
RangeTypeGetRange ()
 
bool SimplyEquals (TypeImpl *that)
 
template<class TypeHandle >
bool SimplyEquals (TypeHandle that)
 

Static Protected Member Functions

template<class T >
static Config::template Handle< T >::type handle (T *type)
 
static bool IsInteger (double x)
 
static bool IsInteger (i::Object *x)
 
static Limits Intersect (Limits lhs, Limits rhs)
 
static Limits Union (Limits lhs, Limits rhs)
 
static bool Overlap (RangeType *lhs, RangeType *rhs)
 
static bool Contains (RangeType *lhs, RangeType *rhs)
 
static bool Contains (RangeType *range, i::Object *val)
 
static int UpdateRange (RangeHandle type, UnionHandle result, int size, Region *region)
 
static int AddToUnion (TypeHandle type, UnionHandle result, int size, Region *region)
 
static int IntersectAux (TypeHandle type, TypeHandle other, UnionHandle result, int size, Region *region)
 
static TypeHandle NormalizeUnion (UnionHandle unioned, int size)
 

Friends

template<class >
class Iterator
 
template<class >
class TypeImpl
 

Detailed Description

template<class Config>
class v8::internal::TypeImpl< Config >

Definition at line 289 of file types.h.

Member Typedef Documentation

◆ ArrayHandle

template<class Config >
typedef Config::template Handle<ArrayType>::type v8::internal::TypeImpl< Config >::ArrayHandle

Definition at line 310 of file types.h.

◆ bitset

template<class Config >
typedef uint32_t v8::internal::TypeImpl< Config >::bitset

Definition at line 293 of file types.h.

◆ ClassHandle

template<class Config >
typedef Config::template Handle<ClassType>::type v8::internal::TypeImpl< Config >::ClassHandle

Definition at line 306 of file types.h.

◆ ConstantHandle

template<class Config >
typedef Config::template Handle<ConstantType>::type v8::internal::TypeImpl< Config >::ConstantHandle

Definition at line 307 of file types.h.

◆ ContextHandle

template<class Config >
typedef Config::template Handle<ContextType>::type v8::internal::TypeImpl< Config >::ContextHandle

Definition at line 309 of file types.h.

◆ FunctionHandle

template<class Config >
typedef Config::template Handle<FunctionType>::type v8::internal::TypeImpl< Config >::FunctionHandle

Definition at line 311 of file types.h.

◆ RangeHandle

template<class Config >
typedef Config::template Handle<RangeType>::type v8::internal::TypeImpl< Config >::RangeHandle

Definition at line 308 of file types.h.

◆ Region

template<class Config >
typedef Config::Region v8::internal::TypeImpl< Config >::Region

Definition at line 313 of file types.h.

◆ TypeHandle

template<class Config >
typedef Config::template Handle<TypeImpl>::type v8::internal::TypeImpl< Config >::TypeHandle

Definition at line 305 of file types.h.

◆ UnionHandle

template<class Config >
typedef Config::template Handle<UnionType>::type v8::internal::TypeImpl< Config >::UnionHandle

Definition at line 312 of file types.h.

Member Enumeration Documentation

◆ PrintDimension

template<class Config >
enum v8::internal::TypeImpl::PrintDimension
Enumerator
BOTH_DIMS 
SEMANTIC_DIM 
REPRESENTATION_DIM 

Definition at line 479 of file types.h.

Member Function Documentation

◆ AddToUnion()

template<class Config >
int v8::internal::TypeImpl< Config >::AddToUnion ( TypeHandle  type,
UnionHandle  result,
int  size,
Region region 
)
staticprotected

Definition at line 790 of file types.cc.

791  {
792  if (type->IsBitset() || type->IsRange()) return size;
793  if (type->IsUnion()) {
794  for (int i = 0, n = type->AsUnion()->Length(); i < n; ++i) {
795  size = AddToUnion(type->AsUnion()->Get(i), result, size, region);
796  }
797  return size;
798  }
799  for (int i = 0; i < size; ++i) {
800  if (type->Is(result->Get(i))) return size;
801  }
802  result->Set(size++, type);
803  return size;
804 }
static int AddToUnion(TypeHandle type, UnionHandle result, int size, Region *region)
Definition: types.cc:790
enable harmony numeric enable harmony object literal extensions Optimize object size

References size.

Referenced by v8::internal::TypeImpl< Config >::Union().

+ Here is the caller graph for this function:

◆ Array()

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Array ( TypeHandle  element,
Region region 
)
inlinestatic

Definition at line 340 of file types.h.

340  {
341  return ArrayType::New(element, region);
342  }
static ArrayHandle New(TypeHandle element, Region *region)
Definition: types.h:833

References v8::internal::TypeImpl< Config >::ArrayType::New().

+ Here is the call graph for this function:

◆ AsArray()

template<class Config >
ArrayType* v8::internal::TypeImpl< Config >::AsArray ( )
inline

Definition at line 446 of file types.h.

446 { return ArrayType::cast(this); }
static ArrayType * cast(TypeImpl *type)
Definition: types.h:840

References v8::internal::TypeImpl< Config >::ArrayType::cast().

Referenced by v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsBitset()

template<class Config >
bitset v8::internal::TypeImpl< Config >::AsBitset ( )
inlineprotected

Definition at line 508 of file types.h.

508  {
509  DCHECK(this->IsBitset());
510  return static_cast<BitsetType*>(this)->Bitset();
511  }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, and v8::internal::TypeImpl< Config >::IsBitset().

Referenced by v8::internal::TypeImpl< Config >::BitsetType::Glb(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::TypeImpl< Config >::SlowIs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsClass()

template<class Config >
ClassType* v8::internal::TypeImpl< Config >::AsClass ( )
inline

Definition at line 442 of file types.h.

442 { return ClassType::cast(this); }
static ClassType * cast(TypeImpl *type)
Definition: types.h:736

References v8::internal::TypeImpl< Config >::ClassType::cast().

Referenced by v8::internal::TypeImpl< ZoneTypeConfig >::Iterator::Advance(), v8::internal::HOptimizedGraphBuilder::BuildCompareInstruction(), v8::internal::CanInlinePropertyAccess(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< Config >::PrintTo(), v8::internal::TypeImpl< Config >::SimplyEquals(), and v8::internal::IC::TypeToMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsConstant()

template<class Config >
ConstantType* v8::internal::TypeImpl< Config >::AsConstant ( )
inline

Definition at line 443 of file types.h.

443 { return ConstantType::cast(this); }
static ConstantType * cast(TypeImpl *type)
Definition: types.h:760

References v8::internal::TypeImpl< Config >::ConstantType::cast().

Referenced by v8::internal::TypeImpl< ZoneTypeConfig >::Iterator::get_type(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< Config >::NowIs(), v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::IC::TypeToMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsContext()

template<class Config >
ContextType* v8::internal::TypeImpl< Config >::AsContext ( )
inline

Definition at line 445 of file types.h.

445 { return ContextType::cast(this); }
static ContextType * cast(TypeImpl *type)
Definition: types.h:818

References v8::internal::TypeImpl< Config >::ContextType::cast().

Referenced by v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsFunction()

template<class Config >
FunctionType* v8::internal::TypeImpl< Config >::AsFunction ( )
inline

Definition at line 447 of file types.h.

447 { return FunctionType::cast(this); }
static FunctionType * cast(TypeImpl *type)
Definition: types.h:869

References v8::internal::TypeImpl< Config >::FunctionType::cast().

Referenced by v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsRange()

template<class Config >
RangeType* v8::internal::TypeImpl< Config >::AsRange ( )
inline

Definition at line 444 of file types.h.

444 { return RangeType::cast(this); }
static RangeType * cast(TypeImpl *type)
Definition: types.h:794

References v8::internal::TypeImpl< Config >::RangeType::cast().

Referenced by v8::internal::TypeImpl< Config >::GetRange(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), and v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AsUnion()

template<class Config >
UnionType* v8::internal::TypeImpl< Config >::AsUnion ( )
inlineprotected

Definition at line 512 of file types.h.

512 { return UnionType::cast(this); }
static UnionType * cast(TypeImpl *type)
Definition: types.h:699

References v8::internal::TypeImpl< Config >::UnionType::cast().

Referenced by v8::internal::TypeImpl< ZoneTypeConfig >::AddToUnion(), v8::internal::TypeImpl< Config >::BitsetType::Glb(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< ZoneTypeConfig >::Max(), v8::internal::TypeImpl< Config >::Maybe(), v8::internal::TypeImpl< Config >::NumClasses(), v8::internal::TypeImpl< Config >::NumConstants(), v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::TypeImpl< Config >::SlowIs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BitsetGlb()

template<class Config >
bitset v8::internal::TypeImpl< Config >::BitsetGlb ( )
inlineprotected

Definition at line 516 of file types.h.

516 { return BitsetType::Glb(this); }
static bitset Glb(TypeImpl *type)
Definition: types.cc:120

References v8::internal::TypeImpl< Config >::BitsetType::Glb().

Referenced by v8::internal::TypeImpl< Config >::SlowIs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BitsetLub()

template<class Config >
bitset v8::internal::TypeImpl< Config >::BitsetLub ( )
inlineprotected

Definition at line 517 of file types.h.

517 { return BitsetType::Lub(this); }
static bitset Lub(TypeImpl *type)
Definition: types.cc:137

References v8::internal::TypeImpl< Config >::BitsetType::Lub().

Referenced by v8::internal::TypeImpl< Config >::IsInhabited(), v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::TypeImpl< Config >::SlowIs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast()

template<class Config >
TypeImpl< Config > * v8::internal::TypeImpl< Config >::cast ( typename Config::Base *  object)
inlinestatic

Definition at line 20 of file types-inl.h.

20  {
21  TypeImpl* t = static_cast<TypeImpl*>(object);
22  DCHECK(t->IsBitset() || t->IsClass() || t->IsConstant() || t->IsRange() ||
23  t->IsUnion() || t->IsArray() || t->IsFunction() || t->IsContext());
24  return t;
25 }
friend class TypeImpl
Definition: types.h:491

References DCHECK, v8::internal::TypeImpl< Config >::IsArray(), v8::internal::TypeImpl< Config >::IsBitset(), v8::internal::TypeImpl< Config >::IsClass(), v8::internal::TypeImpl< Config >::IsConstant(), v8::internal::TypeImpl< Config >::IsContext(), v8::internal::TypeImpl< Config >::IsFunction(), v8::internal::TypeImpl< Config >::IsRange(), and v8::internal::TypeImpl< Config >::IsUnion().

Referenced by v8::internal::DescriptorArray::GetFieldType(), and v8::internal::Map::TryUpdateInternal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Class()

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Class ( i::Handle< i::Map map,
Region region 
)
inlinestatic

Definition at line 327 of file types.h.

327  {
328  return ClassType::New(map, region);
329  }
static ClassHandle New(i::Handle< i::Map > map, Region *region)
Definition: types.h:724
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map

References map, and v8::internal::TypeImpl< Config >::ClassType::New().

Referenced by v8::internal::PropertyICCompiler::ComputeKeyedLoadMonomorphic(), v8::internal::PropertyICCompiler::ComputeKeyedLoadPolymorphic(), and v8::internal::Object::OptimalType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Classes()

template<class Config >
Iterator<i::Map> v8::internal::TypeImpl< Config >::Classes ( )
inline

Definition at line 460 of file types.h.

460  {
461  if (this->IsBitset()) return Iterator<i::Map>();
462  return Iterator<i::Map>(Config::handle(this));
463  }
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::handle(), and v8::internal::TypeImpl< Config >::IsBitset().

Referenced by v8::internal::HGraphBuilder::BuildCompareNil(), and v8::internal::TypeImpl< Config >::NowStable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Constant()

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Constant ( i::Handle< i::Object value,
Region region 
)
inlinestatic

Definition at line 330 of file types.h.

330  {
331  return ConstantType::New(value, region);
332  }
static ConstantHandle New(i::Handle< i::Object > value, Region *region)
Definition: types.h:752

References v8::internal::TypeImpl< Config >::ConstantType::New().

Referenced by v8::internal::IC::CurrentTypeOf(), v8::internal::Map::GeneralizeRepresentation(), and v8::internal::PropertyCell::UpdatedType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Constants()

template<class Config >
Iterator<i::Object> v8::internal::TypeImpl< Config >::Constants ( )
inline

Definition at line 464 of file types.h.

464  {
465  if (this->IsBitset()) return Iterator<i::Object>();
466  return Iterator<i::Object>(Config::handle(this));
467  }

References v8::internal::handle(), and v8::internal::TypeImpl< Config >::IsBitset().

Referenced by v8::internal::TypeImpl< Config >::Contains().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Contains() [1/4]

template<class Config >
bool v8::internal::TypeImpl< Config >::Contains ( i::Handle< i::Object val)
inline

Definition at line 404 of file types.h.

404 { return this->Contains(*val); }
bool Contains(i::Object *val)
Definition: types.cc:559

References v8::internal::TypeImpl< Config >::Contains().

Referenced by v8::internal::TypeImpl< Config >::Contains().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Contains() [2/4]

template<class Config >
bool v8::internal::TypeImpl< Config >::Contains ( i::Object val)

Definition at line 559 of file types.cc.

559  {
560  DisallowHeapAllocation no_allocation;
561  for (Iterator<i::Object> it = this->Constants(); !it.Done(); it.Advance()) {
562  if (*it.Current() == value) return true;
563  }
564  if (IsInteger(value)) {
565  RangeType* range = this->GetRange();
566  if (range != NULL && Contains(range, value)) return true;
567  }
568  return BitsetType::New(BitsetType::Lub(value))->Is(this);
569 }
static TypeImpl * New(bitset bits)
Definition: types.h:577
static bool IsInteger(double x)
Definition: types.h:521
bool Is(TypeImpl *that)
Definition: types.h:390
RangeType * GetRange()
Definition: types.cc:548
Iterator< i::Object > Constants()
Definition: types.h:464
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110

References v8::internal::TypeImpl< Config >::Constants(), v8::internal::TypeImpl< Config >::GetRange(), v8::internal::TypeImpl< Config >::Is(), v8::internal::TypeImpl< Config >::IsInteger(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< Config >::BitsetType::New(), and NULL.

+ Here is the call graph for this function:

◆ Contains() [3/4]

template<class Config >
static bool v8::internal::TypeImpl< Config >::Contains ( RangeType lhs,
RangeType rhs 
)
staticprotected

◆ Contains() [4/4]

template<class Config >
static bool v8::internal::TypeImpl< Config >::Contains ( RangeType range,
i::Object val 
)
staticprotected

◆ Context()

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Context ( TypeHandle  outer,
Region region 
)
inlinestatic

Definition at line 337 of file types.h.

337  {
338  return ContextType::New(outer, region);
339  }
static ContextHandle New(TypeHandle outer, Region *region)
Definition: types.h:811

References v8::internal::TypeImpl< Config >::ContextType::New().

+ Here is the call graph for this function:

◆ Convert() [1/2]

template<class Config >
template<class OtherType >
TypeImpl<Config>::TypeHandle v8::internal::TypeImpl< Config >::Convert ( typename OtherType::TypeHandle  type,
Region region 
)

Definition at line 931 of file types.cc.

932  {
933  if (type->IsBitset()) {
934  return BitsetType::New(type->AsBitset(), region);
935  } else if (type->IsClass()) {
936  return ClassType::New(type->AsClass()->Map(), region);
937  } else if (type->IsConstant()) {
938  return ConstantType::New(type->AsConstant()->Value(), region);
939  } else if (type->IsRange()) {
940  return RangeType::New(
941  type->AsRange()->Min(), type->AsRange()->Max(), region);
942  } else if (type->IsContext()) {
943  TypeHandle outer = Convert<OtherType>(type->AsContext()->Outer(), region);
944  return ContextType::New(outer, region);
945  } else if (type->IsUnion()) {
946  int length = type->AsUnion()->Length();
947  UnionHandle unioned = UnionType::New(length, region);
948  for (int i = 0; i < length; ++i) {
949  TypeHandle t = Convert<OtherType>(type->AsUnion()->Get(i), region);
950  unioned->Set(i, t);
951  }
952  return unioned;
953  } else if (type->IsArray()) {
954  TypeHandle element = Convert<OtherType>(type->AsArray()->Element(), region);
955  return ArrayType::New(element, region);
956  } else if (type->IsFunction()) {
957  TypeHandle res = Convert<OtherType>(type->AsFunction()->Result(), region);
958  TypeHandle rcv = Convert<OtherType>(type->AsFunction()->Receiver(), region);
960  res, rcv, type->AsFunction()->Arity(), region);
961  for (int i = 0; i < function->Arity(); ++i) {
962  TypeHandle param = Convert<OtherType>(
963  type->AsFunction()->Parameter(i), region);
964  function->InitParameter(i, param);
965  }
966  return function;
967  } else {
968  UNREACHABLE();
969  return None(region);
970  }
971 }
static FunctionHandle New(TypeHandle result, TypeHandle receiver, int arity, Region *region)
Definition: types.h:860
static RangeHandle New(i::Handle< i::Object > min, i::Handle< i::Object > max, Region *region)
Definition: types.h:779
static UnionHandle New(int length, Region *region)
Definition: types.h:694
Config::template Handle< FunctionType >::type FunctionHandle
Definition: types.h:311
Config::template Handle< TypeImpl >::type TypeHandle
Definition: types.h:303
Config::template Handle< UnionType >::type UnionHandle
Definition: types.h:312
#define UNREACHABLE()
Definition: logging.h:30
@ None
Definition: v8.h:2211

References v8::internal::TypeImpl< Config >::BitsetType::New(), v8::internal::TypeImpl< Config >::ClassType::New(), v8::internal::TypeImpl< Config >::RangeType::New(), v8::internal::TypeImpl< Config >::ConstantType::New(), v8::internal::TypeImpl< Config >::UnionType::New(), v8::internal::TypeImpl< Config >::ArrayType::New(), v8::internal::TypeImpl< Config >::ContextType::New(), v8::internal::TypeImpl< Config >::FunctionType::New(), v8::None, and UNREACHABLE.

+ Here is the call graph for this function:

◆ Convert() [2/2]

template<class Config >
template<class OtherTypeImpl >
static TypeHandle v8::internal::TypeImpl< Config >::Convert ( typename OtherTypeImpl< Config >::TypeHandle  type,
Region region 
)
static

◆ Equals() [1/2]

template<class Config >
template<class TypeHandle >
bool v8::internal::TypeImpl< Config >::Equals ( TypeHandle  that)
inline

Definition at line 400 of file types.h.

400 { return this->Equals(*that); }
bool Equals(TypeImpl *that)
Definition: types.h:398

References v8::internal::TypeImpl< Config >::Equals().

Referenced by v8::internal::TypeImpl< Config >::Equals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Equals() [2/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::Equals ( TypeImpl< Config > *  that)
inline

Definition at line 398 of file types.h.

398 { return this->Is(that) && that->Is(this); }

References v8::internal::TypeImpl< Config >::Is().

+ Here is the call graph for this function:

◆ Function() [1/5]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Function ( TypeHandle  result,
Region region 
)
inlinestatic

Definition at line 347 of file types.h.

347  {
348  return Function(result, Any(region), 0, region);
349  }
static FunctionHandle Function(TypeHandle result, TypeHandle receiver, int arity, Region *region)
Definition: types.h:343

References v8::internal::TypeImpl< Config >::Function().

+ Here is the call graph for this function:

◆ Function() [2/5]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Function ( TypeHandle  result,
TypeHandle  param0,
Region region 
)
inlinestatic

Definition at line 350 of file types.h.

351  {
352  FunctionHandle function = Function(result, Any(region), 1, region);
353  function->InitParameter(0, param0);
354  return function;
355  }

References v8::internal::TypeImpl< Config >::Function().

+ Here is the call graph for this function:

◆ Function() [3/5]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Function ( TypeHandle  result,
TypeHandle  param0,
TypeHandle  param1,
Region region 
)
inlinestatic

Definition at line 356 of file types.h.

357  {
358  FunctionHandle function = Function(result, Any(region), 2, region);
359  function->InitParameter(0, param0);
360  function->InitParameter(1, param1);
361  return function;
362  }

References v8::internal::TypeImpl< Config >::Function().

+ Here is the call graph for this function:

◆ Function() [4/5]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Function ( TypeHandle  result,
TypeHandle  param0,
TypeHandle  param1,
TypeHandle  param2,
Region region 
)
inlinestatic

Definition at line 363 of file types.h.

365  {
366  FunctionHandle function = Function(result, Any(region), 3, region);
367  function->InitParameter(0, param0);
368  function->InitParameter(1, param1);
369  function->InitParameter(2, param2);
370  return function;
371  }

References v8::internal::TypeImpl< Config >::Function().

+ Here is the call graph for this function:

◆ Function() [5/5]

template<class Config >
static FunctionHandle v8::internal::TypeImpl< Config >::Function ( TypeHandle  result,
TypeHandle  receiver,
int  arity,
Region region 
)
inlinestatic

Definition at line 343 of file types.h.

344  {
345  return FunctionType::New(result, receiver, arity, region);
346  }

References v8::internal::TypeImpl< Config >::FunctionType::New().

Referenced by v8::internal::TypeImpl< Config >::Function().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRange()

template<class Config >
TypeImpl< Config >::RangeType * v8::internal::TypeImpl< Config >::GetRange
protected

Definition at line 548 of file types.cc.

548  {
549  DisallowHeapAllocation no_allocation;
550  if (this->IsRange()) return this->AsRange();
551  if (this->IsUnion() && this->AsUnion()->Get(1)->IsRange()) {
552  return this->AsUnion()->Get(1)->AsRange();
553  }
554  return NULL;
555 }
UnionType * AsUnion()
Definition: types.h:512
RangeType * AsRange()
Definition: types.h:444

References v8::internal::TypeImpl< Config >::AsRange(), and v8::internal::TypeImpl< Config >::IsRange().

Referenced by v8::internal::TypeImpl< Config >::Contains(), and v8::internal::TypeImpl< Config >::Union().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle()

template<class Config >
template<class T >
static Config::template Handle<T>::type v8::internal::TypeImpl< Config >::handle ( T type)
inlinestaticprotected

Definition at line 496 of file types.h.

496  {
497  return Config::handle(type);
498  }

References v8::internal::handle().

Referenced by v8::internal::TypeImpl< Config >::Union().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Intersect() [1/2]

template<class Config >
TypeImpl< Config >::Limits v8::internal::TypeImpl< Config >::Intersect ( Limits  lhs,
Limits  rhs 
)
staticprotected

Definition at line 23 of file types.cc.

24  {
25  DisallowHeapAllocation no_allocation;
26  Limits result(lhs);
27  if (lhs.min->Number() < rhs.min->Number()) result.min = rhs.min;
28  if (lhs.max->Number() > rhs.max->Number()) result.max = rhs.max;
29  return result;
30 }

References v8::internal::TypeImpl< Config >::Limits::max, and v8::internal::TypeImpl< Config >::Limits::min.

◆ Intersect() [2/2]

template<class Config >
TypeImpl< Config >::TypeHandle v8::internal::TypeImpl< Config >::Intersect ( TypeHandle  type1,
TypeHandle  type2,
Region reg 
)
static

Definition at line 607 of file types.cc.

608  {
609  bitset bits = type1->BitsetGlb() & type2->BitsetGlb();
610  if (!BitsetType::IsInhabited(bits)) bits = BitsetType::kNone;
611 
612  // Fast case: bit sets.
613  if (type1->IsBitset() && type2->IsBitset()) {
614  return BitsetType::New(bits, region);
615  }
616 
617  // Fast case: top or bottom types.
618  if (type1->IsNone() || type2->IsAny()) return type1; // Shortcut.
619  if (type2->IsNone() || type1->IsAny()) return type2; // Shortcut.
620 
621  // Semi-fast case.
622  if (type1->Is(type2)) return type1;
623  if (type2->Is(type1)) return type2;
624 
625  // Slow case: create union.
626  int size1 = type1->IsUnion() ? type1->AsUnion()->Length() : 1;
627  int size2 = type2->IsUnion() ? type2->AsUnion()->Length() : 1;
628  if (!AddIsSafe(size1, size2)) return Any(region);
629  int size = size1 + size2;
630  if (!AddIsSafe(size, 2)) return Any(region);
631  size += 2;
632  UnionHandle result = UnionType::New(size, region);
633  size = 0;
634 
635  // Deal with bitsets.
636  result->Set(size++, BitsetType::New(bits, region));
637 
638  // Deal with ranges.
639  TypeHandle range = None(region);
640  RangeType* range1 = type1->GetRange();
641  RangeType* range2 = type2->GetRange();
642  if (range1 != NULL && range2 != NULL) {
643  Limits lim = Intersect(Limits(range1), Limits(range2));
644  if (lim.min->Number() <= lim.max->Number()) {
645  range = RangeType::New(lim, region);
646  }
647  }
648  result->Set(size++, range);
649 
650  size = IntersectAux(type1, type2, result, size, region);
651  return NormalizeUnion(result, size);
652 }
static TypeHandle NormalizeUnion(UnionHandle unioned, int size)
Definition: types.cc:808
static TypeHandle Intersect(TypeHandle type1, TypeHandle type2, Region *reg)
Definition: types.cc:607
static int IntersectAux(TypeHandle type, TypeHandle other, UnionHandle result, int size, Region *region)
Definition: types.cc:680
static bool AddIsSafe(int x, int y)
Definition: types.cc:599

◆ IntersectAux()

template<class Config >
int v8::internal::TypeImpl< Config >::IntersectAux ( TypeHandle  type,
TypeHandle  other,
UnionHandle  result,
int  size,
Region region 
)
staticprotected

Definition at line 680 of file types.cc.

682  {
683  if (lhs->IsUnion()) {
684  for (int i = 0, n = lhs->AsUnion()->Length(); i < n; ++i) {
685  size = IntersectAux(lhs->AsUnion()->Get(i), rhs, result, size, region);
686  }
687  return size;
688  }
689  if (rhs->IsUnion()) {
690  for (int i = 0, n = rhs->AsUnion()->Length(); i < n; ++i) {
691  size = IntersectAux(lhs, rhs->AsUnion()->Get(i), result, size, region);
692  }
693  return size;
694  }
695 
696  if (!BitsetType::IsInhabited(lhs->BitsetLub() & rhs->BitsetLub())) {
697  return size;
698  }
699 
700  if (lhs->IsRange()) {
701  if (rhs->IsBitset() || rhs->IsClass()) {
702  return UpdateRange(
703  Config::template cast<RangeType>(lhs), result, size, region);
704  }
705  if (rhs->IsConstant() &&
706  Contains(lhs->AsRange(), *rhs->AsConstant()->Value())) {
707  return AddToUnion(rhs, result, size, region);
708  }
709  return size;
710  }
711  if (rhs->IsRange()) {
712  if (lhs->IsBitset() || lhs->IsClass()) {
713  return UpdateRange(
714  Config::template cast<RangeType>(rhs), result, size, region);
715  }
716  if (lhs->IsConstant() &&
717  Contains(rhs->AsRange(), *lhs->AsConstant()->Value())) {
718  return AddToUnion(lhs, result, size, region);
719  }
720  return size;
721  }
722 
723  if (lhs->IsBitset() || rhs->IsBitset()) {
724  return AddToUnion(lhs->IsBitset() ? rhs : lhs, result, size, region);
725  }
726  if (lhs->IsClass() != rhs->IsClass()) {
727  return AddToUnion(lhs->IsClass() ? rhs : lhs, result, size, region);
728  }
729  if (lhs->SimplyEquals(rhs->unhandle())) {
730  return AddToUnion(lhs, result, size, region);
731  }
732  return size;
733 }
static int UpdateRange(RangeHandle type, UnionHandle result, int size, Region *region)
Definition: types.cc:656

References v8::internal::TypeImpl< Config >::IsInhabited(), size, and v8::internal::TypeImpl< Config >::UpdateRange().

+ Here is the call graph for this function:

◆ Is() [1/2]

template<class Config >
template<class TypeHandle >
bool v8::internal::TypeImpl< Config >::Is ( TypeHandle  that)
inline

Definition at line 392 of file types.h.

392 { return this->Is(*that); }

References v8::internal::TypeImpl< Config >::Is().

Referenced by v8::internal::TypeImpl< Config >::Is().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Is() [2/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::Is ( TypeImpl< Config > *  that)
inline

Definition at line 390 of file types.h.

390 { return this == that || this->SlowIs(that); }
bool SlowIs(TypeImpl *that)
Definition: types.cc:434

References v8::internal::TypeImpl< Config >::SlowIs().

Referenced by v8::internal::compiler::JSBinopReduction::BothInputsAre(), v8::internal::HGraphBuilder::BuildBinaryOperation(), v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeInitializedStub(), v8::internal::HOptimizedGraphBuilder::BuildCompareInstruction(), v8::internal::HOptimizedGraphBuilder::BuildNamedAccess(), v8::internal::HGraphBuilder::BuildNumberToString(), v8::internal::CanInlinePropertyAccess(), v8::internal::TypeImpl< Config >::Contains(), v8::internal::compiler::JSBinopReduction::ConvertToI32(), v8::internal::HGraphBuilder::EnforceNumberType(), v8::internal::compiler::StaticParameterTraits< ElementAccess >::Equals(), v8::internal::compiler::StaticParameterTraits< FieldAccess >::Equals(), v8::internal::TypeImpl< Config >::Equals(), v8::internal::Representation::FromType(), v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::GetJSObjectFieldAccess(), v8::internal::HOptimizedGraphBuilder::HandleLiteralCompareNil(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicCallNamed(), v8::internal::HOptimizedGraphBuilder::HandlePolymorphicNamedFieldAccess(), v8::internal::HOptimizedGraphBuilder::PropertyAccessInfo::IsCompatible(), v8::internal::TypeImpl< ZoneTypeConfig >::Max(), v8::internal::TypeImpl< Config >::BitsetType::Min(), v8::internal::NeedsWrappingFor(), v8::internal::compiler::JSBinopReduction::OneInputIs(), v8::internal::TypeImpl< Config >::SlowIs(), v8::internal::HGraphBuilder::TruncateToNumber(), v8::internal::compiler::RepresentationChanger::TypeFromUpperBound(), v8::internal::IC::TypeToMap(), and v8::internal::TypeImpl< Config >::UnionType::Wellformed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsAny()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsAny ( )
inlineprotected

Definition at line 504 of file types.h.

504 { return this == Any(); }

Referenced by v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the caller graph for this function:

◆ IsArray()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsArray ( )
inline

Definition at line 435 of file types.h.

435  {
436  return Config::is_struct(this, StructuralType::kArrayTag);
437  }

References v8::internal::TypeImpl< Config >::StructuralType::kArrayTag.

Referenced by v8::internal::TypeImpl< Config >::ArrayType::cast(), v8::internal::TypeImpl< Config >::cast(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), and v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the caller graph for this function:

◆ IsBitset()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsBitset ( )
inlineprotected

◆ IsClass()

◆ IsConstant()

◆ IsContext()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsContext ( )
inline

Definition at line 432 of file types.h.

432  {
433  return Config::is_struct(this, StructuralType::kContextTag);
434  }

References v8::internal::TypeImpl< Config >::StructuralType::kContextTag.

Referenced by v8::internal::TypeImpl< Config >::ContextType::cast(), v8::internal::TypeImpl< Config >::cast(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), and v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the caller graph for this function:

◆ IsFunction()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsFunction ( )
inline

Definition at line 438 of file types.h.

438  {
439  return Config::is_struct(this, StructuralType::kFunctionTag);
440  }

References v8::internal::TypeImpl< Config >::StructuralType::kFunctionTag.

Referenced by v8::internal::TypeImpl< Config >::FunctionType::cast(), v8::internal::TypeImpl< Config >::cast(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), and v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the caller graph for this function:

◆ IsInhabited()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsInhabited ( )
inline

Definition at line 388 of file types.h.

388 { return BitsetType::IsInhabited(this->BitsetLub()); }
bitset BitsetLub()
Definition: types.h:517

References v8::internal::TypeImpl< Config >::BitsetLub().

Referenced by v8::internal::HGraphBuilder::BuildBinaryOperation(), v8::internal::HOptimizedGraphBuilder::BuildCompareInstruction(), v8::internal::TypeImpl< Config >::IntersectAux(), and v8::internal::TypeImpl< Config >::BitsetType::New().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsInteger() [1/2]

template<class Config >
static bool v8::internal::TypeImpl< Config >::IsInteger ( double  x)
inlinestaticprotected

Definition at line 521 of file types.h.

521  {
522  return nearbyint(x) == x && !i::IsMinusZero(x); // Allows for infinities.
523  }
static bool IsMinusZero(double value)
Definition: conversions.h:154

References v8::internal::IsMinusZero().

Referenced by v8::internal::TypeImpl< Config >::Contains(), and v8::internal::TypeImpl< Config >::IsInteger().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsInteger() [2/2]

template<class Config >
static bool v8::internal::TypeImpl< Config >::IsInteger ( i::Object x)
inlinestaticprotected

Definition at line 524 of file types.h.

524  {
525  return x->IsNumber() && IsInteger(x->Number());
526  }

References v8::internal::TypeImpl< Config >::IsInteger(), and v8::internal::Object::Number().

+ Here is the call graph for this function:

◆ IsNone()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsNone ( )
inlineprotected

Definition at line 503 of file types.h.

503 { return this == None(); }

References v8::None.

◆ IsRange()

template<class Config >
bool v8::internal::TypeImpl< Config >::IsRange ( )
inline

Definition at line 429 of file types.h.

429  {
430  return Config::is_struct(this, StructuralType::kRangeTag);
431  }

References v8::internal::TypeImpl< Config >::StructuralType::kRangeTag.

Referenced by v8::internal::TypeImpl< Config >::RangeType::cast(), v8::internal::TypeImpl< Config >::cast(), v8::internal::TypeImpl< Config >::GetRange(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::TypeImpl< Config >::UnionType::Wellformed().

+ Here is the caller graph for this function:

◆ IsUnion()

◆ Max()

template<class Config >
double v8::internal::TypeImpl< Config >::Max

Definition at line 96 of file types.cc.

96  {
97  DCHECK(this->Is(Number()));
98  if (this->IsBitset()) return BitsetType::Max(this->AsBitset());
99  if (this->IsUnion()) {
100  double max = -V8_INFINITY;
101  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
102  max = std::max(max, this->AsUnion()->Get(i)->Max());
103  }
104  return max;
105  }
106  if (this->IsRange()) return this->AsRange()->Max()->Number();
107  if (this->IsConstant()) return this->AsConstant()->Value()->Number();
108  UNREACHABLE();
109  return 0;
110 }
i::Handle< i::Object > Value()
Definition: types.h:750
i::Handle< i::Object > Max()
Definition: types.h:777
bitset AsBitset()
Definition: types.h:508
ConstantType * AsConstant()
Definition: types.h:443
#define V8_INFINITY
Definition: globals.h:25

References DCHECK, v8::internal::Is(), v8::internal::compiler::Max(), v8::internal::Max(), UNREACHABLE, and V8_INFINITY.

+ Here is the call graph for this function:

◆ Maybe() [1/2]

template<class Config >
template<class TypeHandle >
bool v8::internal::TypeImpl< Config >::Maybe ( TypeHandle  that)
inline

Definition at line 396 of file types.h.

396 { return this->Maybe(*that); }
bool Maybe(TypeImpl *that)
Definition: types.cc:504

References v8::internal::TypeImpl< Config >::Maybe().

Referenced by v8::internal::TypeImpl< Config >::Maybe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Maybe() [2/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::Maybe ( TypeImpl< Config > *  that)

Definition at line 504 of file types.cc.

504  {
505  DisallowHeapAllocation no_allocation;
506 
507  // (T1 \/ ... \/ Tn) overlaps T if (T1 overlaps T) \/ ... \/ (Tn overlaps T)
508  if (this->IsUnion()) {
509  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
510  if (this->AsUnion()->Get(i)->Maybe(that)) return true;
511  }
512  return false;
513  }
514 
515  // T overlaps (T1 \/ ... \/ Tn) if (T overlaps T1) \/ ... \/ (T overlaps Tn)
516  if (that->IsUnion()) {
517  for (int i = 0, n = that->AsUnion()->Length(); i < n; ++i) {
518  if (this->Maybe(that->AsUnion()->Get(i))) return true;
519  }
520  return false;
521  }
522 
523  if (!BitsetType::IsInhabited(this->BitsetLub() & that->BitsetLub()))
524  return false;
525  if (this->IsBitset() || that->IsBitset()) return true;
526 
527  if (this->IsClass() != that->IsClass()) return true;
528 
529  if (this->IsRange()) {
530  if (that->IsConstant()) {
531  return Contains(this->AsRange(), *that->AsConstant()->Value());
532  }
533  return that->IsRange() && Overlap(this->AsRange(), that->AsRange());
534  }
535  if (that->IsRange()) {
536  if (this->IsConstant()) {
537  return Contains(that->AsRange(), *this->AsConstant()->Value());
538  }
539  return this->IsRange() && Overlap(this->AsRange(), that->AsRange());
540  }
541 
542  return this->SimplyEquals(that);
543 }
bool SimplyEquals(TypeImpl *that)
Definition: types.cc:395
static bool Overlap(RangeType *lhs, RangeType *rhs)
Definition: types.cc:45

References v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::StructuralType::Get(), v8::internal::TypeImpl< Config >::IsUnion(), and v8::internal::TypeImpl< Config >::StructuralType::Length().

Referenced by v8::internal::HGraphBuilder::BuildBinaryOperation(), v8::internal::CodeStubGraphBuilder< Stub >::BuildCodeInitializedStub(), v8::internal::HGraphBuilder::BuildCompareNil(), v8::internal::compiler::JSBinopReduction::NeitherInputCanBe(), and v8::internal::compiler::JSBinopReduction::OneInputCannotBe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Min()

template<class Config >
double v8::internal::TypeImpl< Config >::Min

Definition at line 78 of file types.cc.

78  {
79  DCHECK(this->Is(Number()));
80  if (this->IsBitset()) return BitsetType::Min(this->AsBitset());
81  if (this->IsUnion()) {
82  double min = +V8_INFINITY;
83  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
84  min = std::min(min, this->AsUnion()->Get(i)->Min());
85  }
86  return min;
87  }
88  if (this->IsRange()) return this->AsRange()->Min()->Number();
89  if (this->IsConstant()) return this->AsConstant()->Value()->Number();
90  UNREACHABLE();
91  return 0;
92 }
i::Handle< i::Object > Min()
Definition: types.h:776
static int min(int a, int b)
Definition: liveedit.cc:273

References DCHECK, v8::internal::Is(), v8::internal::min(), v8::internal::compiler::Min(), v8::internal::Min(), UNREACHABLE, and V8_INFINITY.

+ Here is the call graph for this function:

◆ NormalizeUnion()

template<class Config >
TypeImpl< Config >::TypeHandle v8::internal::TypeImpl< Config >::NormalizeUnion ( UnionHandle  unioned,
int  size 
)
staticprotected

Definition at line 808 of file types.cc.

809  {
810  DCHECK(size >= 2);
811  // If range is subsumed by bitset, use its place for a different type.
812  if (unioned->Get(1)->Is(unioned->Get(0))) {
813  unioned->Set(1, unioned->Get(--size));
814  }
815  // If bitset is None, use its place for a different type.
816  if (size >= 2 && unioned->Get(0)->IsNone()) {
817  unioned->Set(0, unioned->Get(--size));
818  }
819  if (size == 1) return unioned->Get(0);
820  unioned->Shrink(size);
821  SLOW_DCHECK(unioned->Wellformed());
822  return unioned;
823 }
#define SLOW_DCHECK(condition)
Definition: checks.h:30

References DCHECK, size, and SLOW_DCHECK.

Referenced by v8::internal::TypeImpl< Config >::Union().

+ Here is the caller graph for this function:

◆ NowContains() [1/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::NowContains ( i::Handle< i::Object val)
inline

Definition at line 416 of file types.h.

416 { return this->NowContains(*val); }
bool NowContains(i::Object *val)
Definition: types-inl.h:41

References v8::internal::TypeImpl< Config >::NowContains().

Referenced by v8::internal::TypeImpl< Config >::NowContains().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NowContains() [2/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::NowContains ( i::Object val)
inline

Definition at line 41 of file types-inl.h.

41  {
42  DisallowHeapAllocation no_allocation;
43  if (this->IsAny()) return true;
44  if (value->IsHeapObject()) {
45  i::Map* map = i::HeapObject::cast(value)->map();
46  for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) {
47  if (*it.Current() == map) return true;
48  }
49  }
50  return this->Contains(value);
51 }
Iterator< i::Map > Classes()
Definition: types.h:460

References v8::internal::TypeImpl< Config >::Iterator< T >::Done(), and map.

+ Here is the call graph for this function:

◆ NowIs() [1/2]

template<class Config >
template<class TypeHandle >
bool v8::internal::TypeImpl< Config >::NowIs ( TypeHandle  that)
inline

Definition at line 414 of file types.h.

414 { return this->NowIs(*that); }
bool NowIs(TypeImpl *that)
Definition: types.cc:472

References v8::internal::TypeImpl< Config >::NowIs().

Referenced by v8::internal::TypeImpl< Config >::NowIs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NowIs() [2/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::NowIs ( TypeImpl< Config > *  that)

Definition at line 472 of file types.cc.

472  {
473  DisallowHeapAllocation no_allocation;
474 
475  // TODO(rossberg): this is incorrect for
476  // Union(Constant(V), T)->NowIs(Class(M))
477  // but fuzzing does not cover that!
478  if (this->IsConstant()) {
479  i::Object* object = *this->AsConstant()->Value();
480  if (object->IsHeapObject()) {
481  i::Map* map = i::HeapObject::cast(object)->map();
482  for (Iterator<i::Map> it = that->Classes(); !it.Done(); it.Advance()) {
483  if (*it.Current() == map) return true;
484  }
485  }
486  }
487  return this->Is(that);
488 }

References v8::internal::TypeImpl< Config >::AsConstant(), v8::internal::TypeImpl< Config >::IsConstant(), and v8::internal::TypeImpl< Config >::ConstantType::Value().

Referenced by v8::internal::Map::FindLastMatchMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NowOf() [1/2]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::NowOf ( i::Handle< i::Object value,
Region region 
)
inlinestatic

Definition at line 409 of file types.h.

409  {
410  return NowOf(*value, region);
411  }
static TypeHandle NowOf(i::Object *value, Region *region)
Definition: types-inl.h:30

References v8::internal::TypeImpl< Config >::NowOf().

+ Here is the call graph for this function:

◆ NowOf() [2/2]

template<class Config >
TypeImpl< Config >::TypeHandle v8::internal::TypeImpl< Config >::NowOf ( i::Object value,
Region region 
)
inlinestatic

Definition at line 30 of file types-inl.h.

31  {
32  if (value->IsSmi() ||
33  i::HeapObject::cast(value)->map()->instance_type() == HEAP_NUMBER_TYPE) {
34  return Of(value, region);
35  }
36  return Class(i::handle(i::HeapObject::cast(value)->map()), region);
37 }
static TypeHandle Of(double value, Region *region)
Definition: types.h:376
static TypeHandle Class(i::Handle< i::Map > map, Region *region)
Definition: types.h:327
@ HEAP_NUMBER_TYPE
Definition: objects.h:669

References v8::internal::handle(), v8::internal::HEAP_NUMBER_TYPE, and map.

Referenced by v8::internal::IC::CurrentTypeOf(), and v8::internal::TypeImpl< Config >::NowOf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NowStable()

template<class Config >
bool v8::internal::TypeImpl< Config >::NowStable

Definition at line 493 of file types.cc.

493  {
494  DisallowHeapAllocation no_allocation;
495  for (Iterator<i::Map> it = this->Classes(); !it.Done(); it.Advance()) {
496  if (!it.Current()->is_stable()) return false;
497  }
498  return true;
499 }

References v8::internal::TypeImpl< Config >::Classes().

+ Here is the call graph for this function:

◆ NumClasses()

template<class Config >
int v8::internal::TypeImpl< Config >::NumClasses

Definition at line 830 of file types.cc.

830  {
831  DisallowHeapAllocation no_allocation;
832  if (this->IsClass()) {
833  return 1;
834  } else if (this->IsUnion()) {
835  int result = 0;
836  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
837  if (this->AsUnion()->Get(i)->IsClass()) ++result;
838  }
839  return result;
840  } else {
841  return 0;
842  }
843 }

References v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::IsClass(), and v8::internal::TypeImpl< Config >::IsUnion().

Referenced by v8::internal::HGraphBuilder::BuildCompareNil().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NumConstants()

template<class Config >
int v8::internal::TypeImpl< Config >::NumConstants

Definition at line 847 of file types.cc.

847  {
848  DisallowHeapAllocation no_allocation;
849  if (this->IsConstant()) {
850  return 1;
851  } else if (this->IsUnion()) {
852  int result = 0;
853  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
854  if (this->AsUnion()->Get(i)->IsConstant()) ++result;
855  }
856  return result;
857  } else {
858  return 0;
859  }
860 }

References v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::IsConstant(), and v8::internal::TypeImpl< Config >::IsUnion().

+ Here is the call graph for this function:

◆ Of() [1/3]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Of ( double  value,
Region region 
)
inlinestatic

Definition at line 376 of file types.h.

376  {
377  return Config::from_bitset(BitsetType::Lub(value), region);
378  }

References v8::internal::TypeImpl< Config >::BitsetType::Lub().

Referenced by v8::internal::TypeImpl< Config >::Of().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Of() [2/3]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Of ( i::Handle< i::Object value,
Region region 
)
inlinestatic

Definition at line 382 of file types.h.

382  {
383  return Of(*value, region);
384  }

References v8::internal::TypeImpl< Config >::Of().

+ Here is the call graph for this function:

◆ Of() [3/3]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Of ( i::Object value,
Region region 
)
inlinestatic

Definition at line 379 of file types.h.

379  {
380  return Config::from_bitset(BitsetType::Lub(value), region);
381  }

References v8::internal::TypeImpl< Config >::BitsetType::Lub().

+ Here is the call graph for this function:

◆ Overlap()

template<class Config >
bool v8::internal::TypeImpl< Config >::Overlap ( RangeType lhs,
RangeType rhs 
)
staticprotected

Definition at line 45 of file types.cc.

47  {
48  DisallowHeapAllocation no_allocation;
49  typename TypeImpl<Config>::Limits lim = Intersect(Limits(lhs), Limits(rhs));
50  return lim.min->Number() <= lim.max->Number();
51 }

References v8::internal::TypeImpl< Config >::Limits::max, and v8::internal::TypeImpl< Config >::Limits::min.

◆ PrintTo()

template<class Config >
void v8::internal::TypeImpl< Config >::PrintTo ( OStream os,
PrintDimension  dim = BOTH_DIMS 
)

Definition at line 1034 of file types.cc.

1034  { // NOLINT
1035  DisallowHeapAllocation no_allocation;
1036  if (dim != REPRESENTATION_DIM) {
1037  if (this->IsBitset()) {
1038  BitsetType::Print(os, SEMANTIC(this->AsBitset()));
1039  } else if (this->IsClass()) {
1040  os << "Class(" << static_cast<void*>(*this->AsClass()->Map()) << " < ";
1041  BitsetType::New(BitsetType::Lub(this))->PrintTo(os, dim);
1042  os << ")";
1043  } else if (this->IsConstant()) {
1044  os << "Constant(" << Brief(*this->AsConstant()->Value()) << ")";
1045  } else if (this->IsRange()) {
1046  os << "Range(" << this->AsRange()->Min()->Number()
1047  << ", " << this->AsRange()->Max()->Number() << ")";
1048  } else if (this->IsContext()) {
1049  os << "Context(";
1050  this->AsContext()->Outer()->PrintTo(os, dim);
1051  os << ")";
1052  } else if (this->IsUnion()) {
1053  os << "(";
1054  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
1055  TypeHandle type_i = this->AsUnion()->Get(i);
1056  if (i > 0) os << " | ";
1057  type_i->PrintTo(os, dim);
1058  }
1059  os << ")";
1060  } else if (this->IsArray()) {
1061  os << "Array(";
1062  AsArray()->Element()->PrintTo(os, dim);
1063  os << ")";
1064  } else if (this->IsFunction()) {
1065  if (!this->AsFunction()->Receiver()->IsAny()) {
1066  this->AsFunction()->Receiver()->PrintTo(os, dim);
1067  os << ".";
1068  }
1069  os << "(";
1070  for (int i = 0; i < this->AsFunction()->Arity(); ++i) {
1071  if (i > 0) os << ", ";
1072  this->AsFunction()->Parameter(i)->PrintTo(os, dim);
1073  }
1074  os << ")->";
1075  this->AsFunction()->Result()->PrintTo(os, dim);
1076  } else {
1077  UNREACHABLE();
1078  }
1079  }
1080  if (dim == BOTH_DIMS) os << "/";
1081  if (dim != SEMANTIC_DIM) {
1083  }
1084 }
static void Print(OStream &os, bitset)
Definition: types.cc:998
i::Handle< i::Map > Map()
Definition: types.h:719
TypeHandle Parameter(int i)
Definition: types.h:856
ContextType * AsContext()
Definition: types.h:445
ClassType * AsClass()
Definition: types.h:442
void PrintTo(OStream &os, PrintDimension dim=BOTH_DIMS)
Definition: types.cc:1034
ArrayType * AsArray()
Definition: types.h:446
FunctionType * AsFunction()
Definition: types.h:447
#define REPRESENTATION(k)
Definition: types.h:160
#define SEMANTIC(k)
Definition: types.h:161

References v8::internal::TypeImpl< Config >::FunctionType::Arity(), v8::internal::TypeImpl< Config >::AsArray(), v8::internal::TypeImpl< Config >::AsBitset(), v8::internal::TypeImpl< Config >::AsClass(), v8::internal::TypeImpl< Config >::AsConstant(), v8::internal::TypeImpl< Config >::AsContext(), v8::internal::TypeImpl< Config >::AsFunction(), v8::internal::TypeImpl< Config >::AsRange(), v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::BitsetLub(), v8::internal::TypeImpl< Config >::BOTH_DIMS, v8::internal::TypeImpl< Config >::ArrayType::Element(), v8::internal::TypeImpl< Config >::StructuralType::Get(), v8::internal::TypeImpl< Config >::IsAny(), v8::internal::TypeImpl< Config >::IsArray(), v8::internal::TypeImpl< Config >::IsBitset(), v8::internal::TypeImpl< Config >::IsClass(), v8::internal::TypeImpl< Config >::IsConstant(), v8::internal::TypeImpl< Config >::IsContext(), v8::internal::TypeImpl< Config >::IsFunction(), v8::internal::TypeImpl< Config >::IsRange(), v8::internal::TypeImpl< Config >::IsUnion(), v8::internal::TypeImpl< Config >::BitsetType::Lub(), v8::internal::TypeImpl< Config >::ClassType::Map(), v8::internal::TypeImpl< Config >::RangeType::Max(), v8::internal::TypeImpl< Config >::RangeType::Min(), v8::internal::TypeImpl< Config >::BitsetType::New(), v8::internal::TypeImpl< Config >::ContextType::Outer(), v8::internal::TypeImpl< Config >::FunctionType::Parameter(), v8::internal::TypeImpl< Config >::BitsetType::Print(), v8::internal::TypeImpl< Config >::PrintTo(), v8::internal::TypeImpl< Config >::FunctionType::Receiver(), REPRESENTATION, v8::internal::TypeImpl< Config >::REPRESENTATION_DIM, v8::internal::TypeImpl< Config >::FunctionType::Result(), SEMANTIC, v8::internal::TypeImpl< Config >::SEMANTIC_DIM, and UNREACHABLE.

Referenced by v8::internal::compiler::operator<<(), v8::internal::Map::PrintGeneralization(), and v8::internal::TypeImpl< Config >::PrintTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Range()

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::Range ( i::Handle< i::Object min,
i::Handle< i::Object max,
Region region 
)
inlinestatic

Definition at line 333 of file types.h.

334  {
335  return RangeType::New(min, max, region);
336  }

References v8::internal::min(), and v8::internal::TypeImpl< Config >::RangeType::New().

+ Here is the call graph for this function:

◆ SimplyEquals() [1/2]

template<class Config >
template<class TypeHandle >
bool v8::internal::TypeImpl< Config >::SimplyEquals ( TypeHandle  that)
inlineprotected

Definition at line 549 of file types.h.

549 { return this->SimplyEquals(*that); }

References v8::internal::TypeImpl< Config >::SimplyEquals().

Referenced by v8::internal::TypeImpl< Config >::SimplyEquals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SimplyEquals() [2/2]

template<class Config >
bool v8::internal::TypeImpl< Config >::SimplyEquals ( TypeImpl< Config > *  that)
protected

Definition at line 395 of file types.cc.

395  {
396  DisallowHeapAllocation no_allocation;
397  if (this->IsClass()) {
398  return that->IsClass()
399  && *this->AsClass()->Map() == *that->AsClass()->Map();
400  }
401  if (this->IsConstant()) {
402  return that->IsConstant()
403  && *this->AsConstant()->Value() == *that->AsConstant()->Value();
404  }
405  if (this->IsContext()) {
406  return that->IsContext()
407  && this->AsContext()->Outer()->Equals(that->AsContext()->Outer());
408  }
409  if (this->IsArray()) {
410  return that->IsArray()
411  && this->AsArray()->Element()->Equals(that->AsArray()->Element());
412  }
413  if (this->IsFunction()) {
414  if (!that->IsFunction()) return false;
415  FunctionType* this_fun = this->AsFunction();
416  FunctionType* that_fun = that->AsFunction();
417  if (this_fun->Arity() != that_fun->Arity() ||
418  !this_fun->Result()->Equals(that_fun->Result()) ||
419  !this_fun->Receiver()->Equals(that_fun->Receiver())) {
420  return false;
421  }
422  for (int i = 0, n = this_fun->Arity(); i < n; ++i) {
423  if (!this_fun->Parameter(i)->Equals(that_fun->Parameter(i))) return false;
424  }
425  return true;
426  }
427  UNREACHABLE();
428  return false;
429 }

References v8::internal::TypeImpl< Config >::AsClass(), v8::internal::TypeImpl< Config >::IsClass(), v8::internal::TypeImpl< Config >::IsConstant(), and v8::internal::TypeImpl< Config >::ClassType::Map().

+ Here is the call graph for this function:

◆ SlowIs()

template<class Config >
bool v8::internal::TypeImpl< Config >::SlowIs ( TypeImpl< Config > *  that)
protected

Definition at line 434 of file types.cc.

434  {
435  DisallowHeapAllocation no_allocation;
436 
437  if (that->IsBitset()) {
438  return BitsetType::Is(this->BitsetLub(), that->AsBitset());
439  }
440  if (this->IsBitset()) {
441  return BitsetType::Is(this->AsBitset(), that->BitsetGlb());
442  }
443 
444  // (T1 \/ ... \/ Tn) <= T if (T1 <= T) /\ ... /\ (Tn <= T)
445  if (this->IsUnion()) {
446  for (int i = 0, n = this->AsUnion()->Length(); i < n; ++i) {
447  if (!this->AsUnion()->Get(i)->Is(that)) return false;
448  }
449  return true;
450  }
451 
452  // T <= (T1 \/ ... \/ Tn) if (T <= T1) \/ ... \/ (T <= Tn)
453  if (that->IsUnion()) {
454  for (int i = 0, n = that->AsUnion()->Length(); i < n; ++i) {
455  if (this->Is(that->AsUnion()->Get(i))) return true;
456  if (i > 1 && this->IsRange()) return false; // Shortcut.
457  }
458  return false;
459  }
460 
461  if (that->IsRange()) {
462  return (this->IsRange() && Contains(that->AsRange(), this->AsRange()))
463  || (this->IsConstant() &&
464  Contains(that->AsRange(), *this->AsConstant()->Value()));
465  }
466  if (this->IsRange()) return false;
467  return this->SimplyEquals(that);
468 }
static bool Is(bitset bits1, bitset bits2)
Definition: types.h:592

References v8::internal::TypeImpl< Config >::AsBitset(), v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::BitsetGlb(), v8::internal::TypeImpl< Config >::BitsetLub(), v8::internal::TypeImpl< Config >::BitsetType::Is(), v8::internal::TypeImpl< Config >::Is(), v8::internal::TypeImpl< Config >::IsBitset(), and v8::internal::TypeImpl< Config >::IsUnion().

Referenced by v8::internal::TypeImpl< Config >::Is().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unhandle()

template<class Config >
TypeImpl* v8::internal::TypeImpl< Config >::unhandle ( )
inlineprotected

Definition at line 499 of file types.h.

499 { return this; }

◆ Union() [1/2]

template<class Config >
TypeImpl< Config >::Limits v8::internal::TypeImpl< Config >::Union ( Limits  lhs,
Limits  rhs 
)
staticprotected

Definition at line 34 of file types.cc.

35  {
36  DisallowHeapAllocation no_allocation;
37  Limits result(lhs);
38  if (lhs.min->Number() > rhs.min->Number()) result.min = rhs.min;
39  if (lhs.max->Number() < rhs.max->Number()) result.max = rhs.max;
40  return result;
41 }

References v8::internal::TypeImpl< Config >::Limits::max, and v8::internal::TypeImpl< Config >::Limits::min.

◆ Union() [2/2]

template<class Config >
TypeImpl< Config >::TypeHandle v8::internal::TypeImpl< Config >::Union ( TypeHandle  type1,
TypeHandle  type2,
Region reg 
)
static

Definition at line 737 of file types.cc.

738  {
739 
740  // Fast case: bit sets.
741  if (type1->IsBitset() && type2->IsBitset()) {
742  return BitsetType::New(type1->AsBitset() | type2->AsBitset(), region);
743  }
744 
745  // Fast case: top or bottom types.
746  if (type1->IsAny() || type2->IsNone()) return type1;
747  if (type2->IsAny() || type1->IsNone()) return type2;
748 
749  // Semi-fast case.
750  if (type1->Is(type2)) return type2;
751  if (type2->Is(type1)) return type1;
752 
753  // Slow case: create union.
754  int size1 = type1->IsUnion() ? type1->AsUnion()->Length() : 1;
755  int size2 = type2->IsUnion() ? type2->AsUnion()->Length() : 1;
756  if (!AddIsSafe(size1, size2)) return Any(region);
757  int size = size1 + size2;
758  if (!AddIsSafe(size, 2)) return Any(region);
759  size += 2;
760  UnionHandle result = UnionType::New(size, region);
761  size = 0;
762 
763  // Deal with bitsets.
765  type1->BitsetGlb() | type2->BitsetGlb(), region);
766  result->Set(size++, bits);
767 
768  // Deal with ranges.
769  TypeHandle range = None(region);
770  RangeType* range1 = type1->GetRange();
771  RangeType* range2 = type2->GetRange();
772  if (range1 != NULL && range2 != NULL) {
773  range = RangeType::New(Union(Limits(range1), Limits(range2)), region);
774  } else if (range1 != NULL) {
775  range = handle(range1);
776  } else if (range2 != NULL) {
777  range = handle(range2);
778  }
779  result->Set(size++, range);
780 
781  size = AddToUnion(type1, result, size, region);
782  size = AddToUnion(type2, result, size, region);
783  return NormalizeUnion(result, size);
784 }
static Config::template Handle< T >::type handle(T *type)
Definition: types.h:496
static TypeHandle Union(TypeHandle type1, TypeHandle type2, Region *reg)
Definition: types.cc:737

References v8::internal::AddIsSafe(), v8::internal::TypeImpl< Config >::AddToUnion(), v8::internal::TypeImpl< Config >::GetRange(), v8::internal::TypeImpl< Config >::handle(), v8::internal::TypeImpl< Config >::BitsetType::New(), v8::internal::TypeImpl< Config >::RangeType::New(), v8::internal::TypeImpl< Config >::UnionType::New(), v8::None, v8::internal::TypeImpl< Config >::NormalizeUnion(), NULL, and size.

Referenced by v8::internal::Map::GeneralizeFieldType(), and v8::internal::TypeImpl< Config >::UpdateRange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRange()

template<class Config >
int v8::internal::TypeImpl< Config >::UpdateRange ( RangeHandle  type,
UnionHandle  result,
int  size,
Region region 
)
staticprotected

Definition at line 656 of file types.cc.

657  {
658  TypeHandle old_range = result->Get(1);
659  DCHECK(old_range->IsRange() || old_range->IsNone());
660  if (range->Is(old_range)) return size;
661  if (!old_range->Is(range->unhandle())) {
662  range = RangeType::New(
663  Union(Limits(range->AsRange()), Limits(old_range->AsRange())), region);
664  }
665  result->Set(1, range);
666 
667  // Remove any components that just got subsumed.
668  for (int i = 2; i < size; ) {
669  if (result->Get(i)->Is(range->unhandle())) {
670  result->Set(i, result->Get(--size));
671  } else {
672  ++i;
673  }
674  }
675  return size;
676 }

References DCHECK, v8::internal::TypeImpl< Config >::RangeType::New(), size, and v8::internal::TypeImpl< Config >::Union().

Referenced by v8::internal::TypeImpl< Config >::IntersectAux().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Iterator

template<class Config >
template<class >
friend class Iterator
friend

Definition at line 490 of file types.h.

◆ TypeImpl

template<class Config >
template<class >
friend class TypeImpl
friend

Definition at line 491 of file types.h.


The documentation for this class was generated from the following files: