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

#include <types.h>

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

Classes

struct  BitsetMin
 

Protected Member Functions

bitset Bitset ()
 
- Protected Member Functions inherited from v8::internal::TypeImpl< Config >
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

static TypeImplNew (bitset bits)
 
static TypeHandle New (bitset bits, Region *region)
 
static bool IsInhabited (bitset bits)
 
static bool Is (bitset bits1, bitset bits2)
 
static double Min (bitset)
 
static double Max (bitset)
 
static bitset Glb (TypeImpl *type)
 
static bitset Lub (TypeImpl *type)
 
static bitset Lub (i::Object *value)
 
static bitset Lub (double value)
 
static bitset Lub (int32_t value)
 
static bitset Lub (uint32_t value)
 
static bitset Lub (i::Map *map)
 
static bitset Lub (Limits lim)
 
static const char * Name (bitset)
 
static void Print (OStream &os, bitset)
 
- Static Protected Member Functions inherited from v8::internal::TypeImpl< Config >
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)
 

Static Private Member Functions

static const BitsetMinBitsetMins ()
 
static size_t BitsetMinsSize ()
 

Static Private Attributes

static const BitsetMin BitsetMins31 []
 
static const BitsetMin BitsetMins32 []
 

Friends

class TypeImpl< Config >
 

Additional Inherited Members

- Public Types inherited from v8::internal::TypeImpl< Config >
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 inherited from v8::internal::TypeImpl< Config >
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 inherited from v8::internal::TypeImpl< Config >
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)
 

Detailed Description

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

Definition at line 564 of file types.h.

Member Function Documentation

◆ Bitset()

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

Definition at line 575 of file types.h.

575 { return Config::as_bitset(this); }

◆ BitsetMins()

template<class Config >
static const BitsetMin* v8::internal::TypeImpl< Config >::BitsetType::BitsetMins ( )
inlinestaticprivate

Definition at line 621 of file types.h.

621  {
623  }
static const BitsetMin BitsetMins32[]
Definition: types.h:620
static const BitsetMin BitsetMins31[]
Definition: types.h:619
static bool SmiValuesAre31Bits()
Definition: v8.h:5807

References v8::internal::SmiValuesAre31Bits().

+ Here is the call graph for this function:

◆ BitsetMinsSize()

template<class Config >
static size_t v8::internal::TypeImpl< Config >::BitsetType::BitsetMinsSize ( )
inlinestaticprivate

Definition at line 624 of file types.h.

624  {
625  return i::SmiValuesAre31Bits() ? 7 : 5;
626  /* arraysize(BitsetMins31) : arraysize(BitsetMins32); */
627  // Using arraysize here doesn't compile on Windows.
628  }

References v8::internal::SmiValuesAre31Bits().

+ Here is the call graph for this function:

◆ Glb()

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Glb ( TypeImpl type)
staticprotected

Definition at line 120 of file types.cc.

120  {
121  DisallowHeapAllocation no_allocation;
122  if (type->IsBitset()) {
123  return type->AsBitset();
124  } else if (type->IsUnion()) {
125  SLOW_DCHECK(type->AsUnion()->Wellformed());
126  return type->AsUnion()->Get(0)->BitsetGlb(); // Shortcut.
127  // (The remaining BitsetGlb's are None anyway).
128  } else {
129  return kNone;
130  }
131 }
#define SLOW_DCHECK(condition)
Definition: checks.h:30
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110

References v8::internal::TypeImpl< Config >::AsBitset(), v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::StructuralType::Get(), v8::internal::TypeImpl< Config >::IsBitset(), v8::internal::TypeImpl< Config >::IsUnion(), SLOW_DCHECK, and v8::internal::TypeImpl< Config >::UnionType::Wellformed().

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

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

◆ Is()

template<class Config >
static bool v8::internal::TypeImpl< Config >::BitsetType::Is ( bitset  bits1,
bitset  bits2 
)
inlinestaticprotected

Definition at line 592 of file types.h.

592  {
593  return (bits1 | bits2) == bits2;
594  }

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

+ Here is the caller graph for this function:

◆ IsInhabited()

template<class Config >
static bool v8::internal::TypeImpl< Config >::BitsetType::IsInhabited ( bitset  bits)
inlinestaticprotected

Definition at line 588 of file types.h.

588  {
589  return bits & kSemantic;
590  }

◆ Lub() [1/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( double  value)
staticprotected

Definition at line 273 of file types.cc.

273  {
274  DisallowHeapAllocation no_allocation;
275  if (i::IsMinusZero(value)) return kMinusZero;
276  if (std::isnan(value)) return kNaN;
277  if (IsUint32Double(value)) return Lub(FastD2UI(value));
278  if (IsInt32Double(value)) return Lub(FastD2I(value));
279  return kOtherNumber;
280 }
static bitset Lub(TypeImpl *type)
Definition: types.cc:137
static bool IsUint32Double(double value)
Definition: conversions.h:180
static bool IsInt32Double(double value)
Definition: conversions.h:169
unsigned int FastD2UI(double x)
int FastD2I(double x)
Definition: conversions.h:57
static bool IsMinusZero(double value)
Definition: conversions.h:154

References v8::internal::FastD2I(), v8::internal::FastD2UI(), v8::internal::IsInt32Double(), v8::internal::IsMinusZero(), and v8::internal::IsUint32Double().

+ Here is the call graph for this function:

◆ Lub() [2/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( i::Map map)
staticprotected

Definition at line 164 of file types.cc.

164  {
165  DisallowHeapAllocation no_allocation;
166  switch (map->instance_type()) {
167  case STRING_TYPE:
169  case CONS_STRING_TYPE:
171  case SLICED_STRING_TYPE:
179  return kOtherString;
188  return kInternalizedString;
189  case SYMBOL_TYPE:
190  return kSymbol;
191  case ODDBALL_TYPE: {
192  Heap* heap = map->GetHeap();
193  if (map == heap->undefined_map()) return kUndefined;
194  if (map == heap->null_map()) return kNull;
195  if (map == heap->boolean_map()) return kBoolean;
196  DCHECK(map == heap->the_hole_map() ||
197  map == heap->uninitialized_map() ||
198  map == heap->no_interceptor_result_sentinel_map() ||
199  map == heap->termination_exception_map() ||
200  map == heap->arguments_marker_map());
201  return kInternal & kTaggedPtr;
202  }
203  case HEAP_NUMBER_TYPE:
204  return kNumber & kTaggedPtr;
205  case JS_VALUE_TYPE:
206  case JS_DATE_TYPE:
207  case JS_OBJECT_TYPE:
210  case JS_MODULE_TYPE:
215  case JS_TYPED_ARRAY_TYPE:
216  case JS_DATA_VIEW_TYPE:
217  case JS_SET_TYPE:
218  case JS_MAP_TYPE:
221  case JS_WEAK_MAP_TYPE:
222  case JS_WEAK_SET_TYPE:
223  if (map->is_undetectable()) return kUndetectable;
224  return kOtherObject;
225  case JS_ARRAY_TYPE:
226  return kArray;
227  case JS_FUNCTION_TYPE:
228  return kFunction;
229  case JS_REGEXP_TYPE:
230  return kRegExp;
231  case JS_PROXY_TYPE:
233  return kProxy;
234  case MAP_TYPE:
235  // When compiling stub templates, the meta map is used as a place holder
236  // for the actual map with which the template is later instantiated.
237  // We treat it as a kind of type variable whose upper bound is Any.
238  // TODO(rossberg): for caching of CompareNilIC stubs to work correctly,
239  // we must exclude Undetectable here. This makes no sense, really,
240  // because it means that the template isn't actually parametric.
241  // Also, it doesn't apply elsewhere. 8-(
242  // We ought to find a cleaner solution for compiling stubs parameterised
243  // over type or class variables, esp ones with bounds...
244  return kDetectable;
248  case ACCESSOR_PAIR_TYPE:
249  case FIXED_ARRAY_TYPE:
250  case FOREIGN_TYPE:
251  case CODE_TYPE:
252  return kInternal & kTaggedPtr;
253  default:
254  UNREACHABLE();
255  return kNone;
256  }
257 }
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
#define UNREACHABLE()
Definition: logging.h:30
#define DCHECK(condition)
Definition: logging.h:205
@ EXTERNAL_STRING_TYPE
Definition: objects.h:642
@ JS_REGEXP_TYPE
Definition: objects.h:748
@ SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE
Definition: objects.h:623
@ SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE
Definition: objects.h:626
@ SLICED_STRING_TYPE
Definition: objects.h:638
@ JS_VALUE_TYPE
Definition: objects.h:728
@ JS_DATE_TYPE
Definition: objects.h:730
@ JS_GLOBAL_PROXY_TYPE
Definition: objects.h:737
@ DECLARED_ACCESSOR_INFO_TYPE
Definition: objects.h:697
@ JS_ARRAY_TYPE
Definition: objects.h:738
@ FIXED_ARRAY_TYPE
Definition: objects.h:717
@ JS_MODULE_TYPE
Definition: objects.h:734
@ JS_OBJECT_TYPE
Definition: objects.h:731
@ JS_TYPED_ARRAY_TYPE
Definition: objects.h:740
@ CONS_ONE_BYTE_STRING_TYPE
Definition: objects.h:636
@ JS_DATA_VIEW_TYPE
Definition: objects.h:741
@ JS_GENERATOR_OBJECT_TYPE
Definition: objects.h:733
@ EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE
Definition: objects.h:646
@ JS_WEAK_SET_TYPE
Definition: objects.h:747
@ ODDBALL_TYPE
Definition: objects.h:663
@ SLICED_ONE_BYTE_STRING_TYPE
Definition: objects.h:640
@ JS_CONTEXT_EXTENSION_OBJECT_TYPE
Definition: objects.h:732
@ ONE_BYTE_STRING_TYPE
Definition: objects.h:633
@ HEAP_NUMBER_TYPE
Definition: objects.h:669
@ JS_MAP_ITERATOR_TYPE
Definition: objects.h:745
@ EXECUTABLE_ACCESSOR_INFO_TYPE
Definition: objects.h:698
@ JS_FUNCTION_TYPE
Definition: objects.h:749
@ JS_FUNCTION_PROXY_TYPE
Definition: objects.h:726
@ SHARED_FUNCTION_INFO_TYPE
Definition: objects.h:719
@ JS_SET_ITERATOR_TYPE
Definition: objects.h:744
@ EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE
Definition: objects.h:620
@ INTERNALIZED_STRING_TYPE
Definition: objects.h:612
@ ACCESSOR_PAIR_TYPE
Definition: objects.h:699
@ JS_GLOBAL_OBJECT_TYPE
Definition: objects.h:735
@ SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE
Definition: objects.h:653
@ EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE
Definition: objects.h:618
@ SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE
Definition: objects.h:629
@ EXTERNAL_INTERNALIZED_STRING_TYPE
Definition: objects.h:616
@ CONS_STRING_TYPE
Definition: objects.h:635
@ JS_ARRAY_BUFFER_TYPE
Definition: objects.h:739
@ JS_PROXY_TYPE
Definition: objects.h:727
@ EXTERNAL_ONE_BYTE_STRING_TYPE
Definition: objects.h:644
@ SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE
Definition: objects.h:651
@ JS_BUILTINS_OBJECT_TYPE
Definition: objects.h:736
@ ONE_BYTE_INTERNALIZED_STRING_TYPE
Definition: objects.h:614
@ FOREIGN_TYPE
Definition: objects.h:671
@ SHORT_EXTERNAL_STRING_TYPE
Definition: objects.h:649
@ JS_WEAK_MAP_TYPE
Definition: objects.h:746

References v8::internal::ACCESSOR_PAIR_TYPE, v8::internal::CODE_TYPE, v8::internal::CONS_ONE_BYTE_STRING_TYPE, v8::internal::CONS_STRING_TYPE, DCHECK, v8::internal::DECLARED_ACCESSOR_INFO_TYPE, v8::internal::EXECUTABLE_ACCESSOR_INFO_TYPE, v8::internal::EXTERNAL_INTERNALIZED_STRING_TYPE, v8::internal::EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, v8::internal::EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE, v8::internal::EXTERNAL_ONE_BYTE_STRING_TYPE, v8::internal::EXTERNAL_STRING_TYPE, v8::internal::EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, v8::internal::FIXED_ARRAY_TYPE, v8::internal::FOREIGN_TYPE, v8::internal::HEAP_NUMBER_TYPE, v8::internal::INTERNALIZED_STRING_TYPE, v8::internal::JS_ARRAY_BUFFER_TYPE, v8::internal::JS_ARRAY_TYPE, v8::internal::JS_BUILTINS_OBJECT_TYPE, v8::internal::JS_CONTEXT_EXTENSION_OBJECT_TYPE, v8::internal::JS_DATA_VIEW_TYPE, v8::internal::JS_DATE_TYPE, v8::internal::JS_FUNCTION_PROXY_TYPE, v8::internal::JS_FUNCTION_TYPE, v8::internal::JS_GENERATOR_OBJECT_TYPE, v8::internal::JS_GLOBAL_OBJECT_TYPE, v8::internal::JS_GLOBAL_PROXY_TYPE, v8::internal::JS_MAP_ITERATOR_TYPE, v8::internal::JS_MAP_TYPE, v8::internal::JS_MODULE_TYPE, v8::internal::JS_OBJECT_TYPE, v8::internal::JS_PROXY_TYPE, v8::internal::JS_REGEXP_TYPE, v8::internal::JS_SET_ITERATOR_TYPE, v8::internal::JS_SET_TYPE, v8::internal::JS_TYPED_ARRAY_TYPE, v8::internal::JS_VALUE_TYPE, v8::internal::JS_WEAK_MAP_TYPE, v8::internal::JS_WEAK_SET_TYPE, map, v8::internal::MAP_TYPE, v8::internal::ODDBALL_TYPE, v8::internal::ONE_BYTE_INTERNALIZED_STRING_TYPE, v8::internal::ONE_BYTE_STRING_TYPE, v8::internal::SHARED_FUNCTION_INFO_TYPE, v8::internal::SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE, v8::internal::SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, v8::internal::SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE, v8::internal::SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE, v8::internal::SHORT_EXTERNAL_STRING_TYPE, v8::internal::SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, v8::internal::SLICED_ONE_BYTE_STRING_TYPE, v8::internal::SLICED_STRING_TYPE, v8::internal::STRING_TYPE, v8::internal::SYMBOL_TYPE, and UNREACHABLE.

◆ Lub() [3/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( i::Object value)
staticprotected

Definition at line 262 of file types.cc.

262  {
263  DisallowHeapAllocation no_allocation;
264  if (value->IsNumber()) {
265  return Lub(value->Number()) & (value->IsSmi() ? kTaggedInt : kTaggedPtr);
266  }
267  return Lub(i::HeapObject::cast(value)->map());
268 }

References map, and v8::internal::Object::Number().

+ Here is the call graph for this function:

◆ Lub() [4/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( int32_t  value)
staticprotected

Definition at line 285 of file types.cc.

285  {
286  DisallowHeapAllocation no_allocation;
287  if (value >= 0x40000000) {
288  return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
289  }
290  if (value >= 0) return kUnsignedSmall;
291  if (value >= -0x40000000) return kOtherSignedSmall;
292  return i::SmiValuesAre31Bits() ? kOtherSigned32 : kOtherSignedSmall;
293 }

References v8::internal::SmiValuesAre31Bits().

+ Here is the call graph for this function:

◆ Lub() [5/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( Limits  lim)
staticprotected

Definition at line 337 of file types.cc.

337  {
338  DisallowHeapAllocation no_allocation;
339  double min = lim.min->Number();
340  double max = lim.max->Number();
341  int lub = kNone;
342  const BitsetMin* mins = BitsetMins();
343 
344  for (size_t i = 1; i < BitsetMinsSize(); ++i) {
345  if (min < mins[i].min) {
346  lub |= mins[i-1].bits;
347  if (max < mins[i].min) return lub;
348  }
349  }
350  return lub |= mins[BitsetMinsSize()-1].bits;
351 }
static size_t BitsetMinsSize()
Definition: types.h:624
static const BitsetMin * BitsetMins()
Definition: types.h:621
static int min(int a, int b)
Definition: liveedit.cc:273

References v8::internal::TypeImpl< Config >::BitsetType::BitsetMin::bits, v8::internal::TypeImpl< Config >::Limits::max, v8::internal::min(), and v8::internal::TypeImpl< Config >::Limits::min.

+ Here is the call graph for this function:

◆ Lub() [6/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( TypeImpl type)
staticprotected

Definition at line 137 of file types.cc.

137  {
138  DisallowHeapAllocation no_allocation;
139  if (type->IsBitset()) return type->AsBitset();
140  if (type->IsUnion()) {
141  int bitset = kNone;
142  for (int i = 0, n = type->AsUnion()->Length(); i < n; ++i) {
143  bitset |= type->AsUnion()->Get(i)->BitsetLub();
144  }
145  return bitset;
146  }
147  if (type->IsClass()) {
148  // Little hack to avoid the need for a region for handlification here...
149  return Config::is_class(type) ? Lub(*Config::as_class(type)) :
150  type->AsClass()->Bound(NULL)->AsBitset();
151  }
152  if (type->IsConstant()) return type->AsConstant()->Bound()->AsBitset();
153  if (type->IsRange()) return type->AsRange()->BitsetLub();
154  if (type->IsContext()) return kInternal & kTaggedPtr;
155  if (type->IsArray()) return kArray;
156  if (type->IsFunction()) return kFunction;
157  UNREACHABLE();
158  return kNone;
159 }
bitset AsBitset()
Definition: types.h:508
ClassType * AsClass()
Definition: types.h:442
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

References v8::internal::TypeImpl< Config >::AsBitset(), v8::internal::TypeImpl< Config >::AsClass(), v8::internal::TypeImpl< Config >::AsConstant(), v8::internal::TypeImpl< Config >::AsRange(), v8::internal::TypeImpl< Config >::AsUnion(), v8::internal::TypeImpl< Config >::RangeType::BitsetLub(), v8::internal::TypeImpl< Config >::ConstantType::Bound(), v8::internal::TypeImpl< Config >::ClassType::Bound(), v8::internal::TypeImpl< Config >::StructuralType::Get(), 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 >::StructuralType::Length(), NULL, and UNREACHABLE.

Referenced by v8::internal::TypeImpl< Config >::BitsetLub(), v8::internal::TypeImpl< Config >::ClassType::Bound(), v8::internal::TypeImpl< Config >::Contains(), v8::internal::TypeImpl< Config >::ClassType::New(), v8::internal::TypeImpl< Config >::Of(), and v8::internal::TypeImpl< Config >::PrintTo().

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

◆ Lub() [7/7]

template<class Config >
TypeImpl< Config >::bitset v8::internal::TypeImpl< Config >::BitsetType::Lub ( uint32_t  value)
staticprotected

Definition at line 298 of file types.cc.

298  {
299  DisallowHeapAllocation no_allocation;
300  if (value >= 0x80000000u) return kOtherUnsigned32;
301  if (value >= 0x40000000u) {
302  return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
303  }
304  return kUnsignedSmall;
305 }

References v8::internal::SmiValuesAre31Bits().

+ Here is the call graph for this function:

◆ Max()

template<class Config >
double v8::internal::TypeImpl< Config >::BitsetType::Max ( bitset  bits)
staticprotected

Definition at line 371 of file types.cc.

371  {
372  DisallowHeapAllocation no_allocation;
373  DCHECK(Is(bits, kNumber));
374  const BitsetMin* mins = BitsetMins();
375  bool mz = bits & kMinusZero;
376  if (BitsetType::Is(mins[BitsetMinsSize()-1].bits, bits)) {
377  return +V8_INFINITY;
378  }
379  for (size_t i = BitsetMinsSize()-1; i-- > 0; ) {
380  if (Is(SEMANTIC(mins[i].bits), bits)) {
381  return mz ?
382  std::max(0.0, mins[i+1].min - 1) : mins[i+1].min - 1;
383  }
384  }
385  if (mz) return 0;
386  return base::OS::nan_value();
387 }
static double nan_value()
static bool Is(bitset bits1, bitset bits2)
Definition: types.h:592
#define V8_INFINITY
Definition: globals.h:25
#define SEMANTIC(k)
Definition: types.h:161

◆ Min()

template<class Config >
double v8::internal::TypeImpl< Config >::BitsetType::Min ( bitset  bits)
staticprotected

Definition at line 355 of file types.cc.

355  {
356  DisallowHeapAllocation no_allocation;
357  DCHECK(Is(bits, kNumber));
358  const BitsetMin* mins = BitsetMins();
359  bool mz = SEMANTIC(bits & kMinusZero);
360  for (size_t i = 0; i < BitsetMinsSize(); ++i) {
361  if (Is(SEMANTIC(mins[i].bits), bits)) {
362  return mz ? std::min(0.0, mins[i].min) : mins[i].min;
363  }
364  }
365  if (mz) return 0;
366  return base::OS::nan_value();
367 }

References DCHECK, v8::internal::TypeImpl< Config >::Is(), v8::internal::min(), v8::internal::TypeImpl< Config >::BitsetType::BitsetMin::min, v8::base::OS::nan_value(), and SEMANTIC.

+ Here is the call graph for this function:

◆ Name()

template<class Config >
const char * v8::internal::TypeImpl< Config >::BitsetType::Name ( bitset  bits)
staticprotected

Definition at line 978 of file types.cc.

978  {
979  switch (bits) {
980  case REPRESENTATION(kAny): return "Any";
981  #define RETURN_NAMED_REPRESENTATION_TYPE(type, value) \
982  case REPRESENTATION(k##type): return #type;
984  #undef RETURN_NAMED_REPRESENTATION_TYPE
985 
986  #define RETURN_NAMED_SEMANTIC_TYPE(type, value) \
987  case SEMANTIC(k##type): return #type;
989  #undef RETURN_NAMED_SEMANTIC_TYPE
990 
991  default:
992  return NULL;
993  }
994 }
#define RETURN_NAMED_SEMANTIC_TYPE(type, value)
#define RETURN_NAMED_REPRESENTATION_TYPE(type, value)
#define REPRESENTATION_BITSET_TYPE_LIST(V)
Definition: types.h:163
#define REPRESENTATION(k)
Definition: types.h:160
#define SEMANTIC_BITSET_TYPE_LIST(V)
Definition: types.h:182

References NULL, REPRESENTATION, REPRESENTATION_BITSET_TYPE_LIST, RETURN_NAMED_REPRESENTATION_TYPE, RETURN_NAMED_SEMANTIC_TYPE, and SEMANTIC_BITSET_TYPE_LIST.

◆ New() [1/2]

template<class Config >
static TypeImpl* v8::internal::TypeImpl< Config >::BitsetType::New ( bitset  bits)
inlinestaticprotected

Definition at line 577 of file types.h.

577  {
578  DCHECK(bits == kNone || IsInhabited(bits));
579  return Config::from_bitset(bits);
580  }

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

Referenced by v8::internal::TypeImpl< Config >::ClassType::Bound(), v8::internal::TypeImpl< Config >::Contains(), v8::internal::TypeImpl< Config >::Convert(), v8::internal::TypeImpl< Config >::ClassType::New(), v8::internal::TypeImpl< ZoneTypeConfig >::BitsetType::Print(), v8::internal::TypeImpl< Config >::PrintTo(), and v8::internal::TypeImpl< Config >::Union().

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

◆ New() [2/2]

template<class Config >
static TypeHandle v8::internal::TypeImpl< Config >::BitsetType::New ( bitset  bits,
Region region 
)
inlinestaticprotected

Definition at line 581 of file types.h.

581  {
582  DCHECK(bits == kNone || IsInhabited(bits));
583  return Config::from_bitset(bits, region);
584  }

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

+ Here is the call graph for this function:

◆ Print()

template<class Config >
void v8::internal::TypeImpl< Config >::BitsetType::Print ( OStream os,
bitset  bits 
)
staticprotected

Definition at line 998 of file types.cc.

999  {
1000  DisallowHeapAllocation no_allocation;
1001  const char* name = Name(bits);
1002  if (name != NULL) {
1003  os << name;
1004  return;
1005  }
1006 
1007  static const bitset named_bitsets[] = {
1008 #define BITSET_CONSTANT(type, value) REPRESENTATION(k##type),
1010 #undef BITSET_CONSTANT
1011 
1012 #define BITSET_CONSTANT(type, value) SEMANTIC(k##type),
1014 #undef BITSET_CONSTANT
1015  };
1016 
1017  bool is_first = true;
1018  os << "(";
1019  for (int i(arraysize(named_bitsets) - 1); bits != 0 && i >= 0; --i) {
1020  bitset subset = named_bitsets[i];
1021  if ((bits & subset) == subset) {
1022  if (!is_first) os << " | ";
1023  is_first = false;
1024  os << Name(subset);
1025  bits -= subset;
1026  }
1027  }
1028  DCHECK(bits == 0);
1029  os << ")";
1030 }
static const char * Name(bitset)
Definition: types.cc:978
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 expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
#define arraysize(array)
Definition: macros.h:86
#define BITSET_CONSTANT(type, value)

References arraysize, BITSET_CONSTANT, DCHECK, name, NULL, REPRESENTATION_BITSET_TYPE_LIST, and SEMANTIC_BITSET_TYPE_LIST.

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

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ TypeImpl< Config >

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

Definition at line 533 of file types.h.

Member Data Documentation

◆ BitsetMins31

template<class Config >
const TypeImpl< Config >::BitsetType::BitsetMin v8::internal::TypeImpl< Config >::BitsetType::BitsetMins31
staticprivate
Initial value:
= {
{kOtherNumber, -V8_INFINITY},
{kOtherSigned32, kMinInt},
{kOtherSignedSmall, -0x40000000},
{kUnsignedSmall, 0},
{kOtherUnsigned31, 0x40000000},
{kOtherUnsigned32, 0x80000000},
{kOtherNumber, static_cast<double>(kMaxUInt32) + 1}
}
const int kMinInt
Definition: globals.h:110
const uint32_t kMaxUInt32
Definition: globals.h:120

Definition at line 619 of file types.h.

◆ BitsetMins32

template<class Config >
const TypeImpl< Config >::BitsetType::BitsetMin v8::internal::TypeImpl< Config >::BitsetType::BitsetMins32
staticprivate
Initial value:
= {
{kOtherNumber, -V8_INFINITY},
{kOtherSignedSmall, kMinInt},
{kUnsignedSmall, 0},
{kOtherUnsigned32, 0x80000000},
{kOtherNumber, static_cast<double>(kMaxUInt32) + 1}
}

Definition at line 620 of file types.h.


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