V8 Project
v8::internal::EnumSet< E, T > Class Template Reference

#include <utils.h>

+ Inheritance diagram for v8::internal::EnumSet< E, T >:
+ Collaboration diagram for v8::internal::EnumSet< E, T >:

Public Member Functions

 EnumSet (T bits=0)
 
bool IsEmpty () const
 
bool Contains (E element) const
 
bool ContainsAnyOf (const EnumSet &set) const
 
void Add (E element)
 
void Add (const EnumSet &set)
 
void Remove (E element)
 
void Remove (const EnumSet &set)
 
void RemoveAll ()
 
void Intersect (const EnumSet &set)
 
T ToIntegral () const
 
bool operator== (const EnumSet &set)
 
bool operator!= (const EnumSet &set)
 
EnumSet< E, Toperator| (const EnumSet &set) const
 

Private Member Functions

T Mask (E element) const
 

Private Attributes

T bits_
 

Detailed Description

template<class E, class T = int>
class v8::internal::EnumSet< E, T >

Definition at line 847 of file utils.h.

Constructor & Destructor Documentation

◆ EnumSet()

template<class E , class T = int>
v8::internal::EnumSet< E, T >::EnumSet ( T  bits = 0)
inlineexplicit

Definition at line 849 of file utils.h.

849 : bits_(bits) {}

Member Function Documentation

◆ Add() [1/2]

template<class E , class T = int>
void v8::internal::EnumSet< E, T >::Add ( const EnumSet< E, T > &  set)
inline

Definition at line 856 of file utils.h.

856 { bits_ |= set.bits_; }

References v8::internal::EnumSet< E, T >::bits_.

◆ Add() [2/2]

template<class E , class T = int>
void v8::internal::EnumSet< E, T >::Add ( element)
inline

Definition at line 855 of file utils.h.

855 { bits_ |= Mask(element); }
T Mask(E element) const
Definition: utils.h:869

References v8::internal::EnumSet< E, T >::bits_, and v8::internal::EnumSet< E, T >::Mask().

Referenced by v8::internal::HCheckMapsEffects::Process(), v8::internal::HLoadEliminationEffects::Process(), v8::internal::HValue::SetAllSideEffects(), v8::internal::HValue::SetChangesFlag(), v8::internal::HValue::SetDependsOnFlag(), v8::internal::HCheckMapsEffects::Union(), v8::internal::HLoadEliminationEffects::Union(), and v8::internal::CompareNilICStub::UpdateStatus().

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

◆ Contains()

template<class E , class T = int>
bool v8::internal::EnumSet< E, T >::Contains ( element) const
inline

Definition at line 851 of file utils.h.

851 { return (bits_ & Mask(element)) != 0; }

References v8::internal::EnumSet< E, T >::bits_, and v8::internal::EnumSet< E, T >::Mask().

Referenced by v8::internal::HCheckMapsEffects::Apply(), v8::internal::HLoadEliminationEffects::Apply(), v8::internal::HValue::CheckChangesFlag(), v8::internal::HValue::CheckDependsOnFlag(), v8::internal::CompareNilICStub::GetICState(), v8::internal::CompareNilICStub::GetType(), v8::internal::CompareNilICStub::IsMonomorphic(), v8::internal::operator<<(), and v8::internal::CompareNilICStub::UpdateStatus().

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

◆ ContainsAnyOf()

template<class E , class T = int>
bool v8::internal::EnumSet< E, T >::ContainsAnyOf ( const EnumSet< E, T > &  set) const
inline

Definition at line 852 of file utils.h.

852  {
853  return (bits_ & set.bits_) != 0;
854  }

References v8::internal::EnumSet< E, T >::bits_.

Referenced by v8::internal::HValue::HasObservableSideEffects(), v8::internal::HValue::HasSideEffects(), and v8::internal::HStoreEliminationPhase::ProcessInstr().

+ Here is the caller graph for this function:

◆ Intersect()

template<class E , class T = int>
void v8::internal::EnumSet< E, T >::Intersect ( const EnumSet< E, T > &  set)
inline

Definition at line 860 of file utils.h.

860 { bits_ &= set.bits_; }

References v8::internal::EnumSet< E, T >::bits_.

Referenced by v8::internal::HValue::ObservableChangesFlags(), and v8::internal::HValue::SideEffectFlags().

+ Here is the caller graph for this function:

◆ IsEmpty()

template<class E , class T = int>
bool v8::internal::EnumSet< E, T >::IsEmpty ( ) const
inline

Definition at line 850 of file utils.h.

850 { return bits_ == 0; }

References v8::internal::EnumSet< E, T >::bits_.

Referenced by v8::internal::operator<<().

+ Here is the caller graph for this function:

◆ Mask()

template<class E , class T = int>
T v8::internal::EnumSet< E, T >::Mask ( element) const
inlineprivate

Definition at line 869 of file utils.h.

869  {
870  // The strange typing in DCHECK is necessary to avoid stupid warnings, see:
871  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43680
872  DCHECK(static_cast<int>(element) < static_cast<int>(sizeof(T) * CHAR_BIT));
873  return static_cast<T>(1) << element;
874  }
#define DCHECK(condition)
Definition: logging.h:205
#define T(name, string, precedence)
Definition: token.cc:25

References DCHECK, and T.

Referenced by v8::internal::EnumSet< E, T >::Add(), v8::internal::EnumSet< E, T >::Contains(), and v8::internal::EnumSet< E, T >::Remove().

+ Here is the caller graph for this function:

◆ operator!=()

template<class E , class T = int>
bool v8::internal::EnumSet< E, T >::operator!= ( const EnumSet< E, T > &  set)
inline

Definition at line 863 of file utils.h.

863 { return bits_ != set.bits_; }

References v8::internal::EnumSet< E, T >::bits_.

◆ operator==()

template<class E , class T = int>
bool v8::internal::EnumSet< E, T >::operator== ( const EnumSet< E, T > &  set)
inline

Definition at line 862 of file utils.h.

862 { return bits_ == set.bits_; }

References v8::internal::EnumSet< E, T >::bits_.

◆ operator|()

template<class E , class T = int>
EnumSet<E, T> v8::internal::EnumSet< E, T >::operator| ( const EnumSet< E, T > &  set) const
inline

Definition at line 864 of file utils.h.

864  {
865  return EnumSet<E, T>(bits_ | set.bits_);
866  }

References v8::internal::EnumSet< E, T >::bits_.

◆ Remove() [1/2]

template<class E , class T = int>
void v8::internal::EnumSet< E, T >::Remove ( const EnumSet< E, T > &  set)
inline

Definition at line 858 of file utils.h.

858 { bits_ &= ~set.bits_; }

References v8::internal::EnumSet< E, T >::bits_.

◆ Remove() [2/2]

template<class E , class T = int>
void v8::internal::EnumSet< E, T >::Remove ( element)
inline

Definition at line 857 of file utils.h.

857 { bits_ &= ~Mask(element); }

References v8::internal::EnumSet< E, T >::bits_, and v8::internal::EnumSet< E, T >::Mask().

Referenced by v8::internal::HValue::AllObservableSideEffectsFlagSet(), v8::internal::HValue::AllSideEffectsFlagSet(), v8::internal::HValue::ClearAllSideEffects(), v8::internal::HValue::ClearChangesFlag(), and v8::internal::HValue::ClearDependsOnFlag().

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

◆ RemoveAll()

template<class E , class T = int>
void v8::internal::EnumSet< E, T >::RemoveAll ( )
inline

Definition at line 859 of file utils.h.

859 { bits_ = 0; }

References v8::internal::EnumSet< E, T >::bits_.

Referenced by v8::internal::CompareNilICStub::UpdateStatus().

+ Here is the caller graph for this function:

◆ ToIntegral()

template<class E , class T = int>
T v8::internal::EnumSet< E, T >::ToIntegral ( ) const
inline

Definition at line 861 of file utils.h.

861 { return bits_; }

References v8::internal::EnumSet< E, T >::bits_.

Referenced by v8::internal::ToBooleanStub::GetExtraICState(), v8::internal::ToBooleanStub::Types::IsGeneric(), and v8::internal::CompareNilICStub::UpdateStatus().

+ Here is the caller graph for this function:

Member Data Documentation

◆ bits_


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