V8 Project
unibrow::Predicate< T, size > Class Template Reference

#include <unicode.h>

+ Inheritance diagram for unibrow::Predicate< T, size >:
+ Collaboration diagram for unibrow::Predicate< T, size >:

Classes

struct  CacheEntry
 

Public Member Functions

 Predicate ()
 
bool get (uchar c)
 

Private Member Functions

bool CalculateValue (uchar c)
 

Private Attributes

CacheEntry entries_ [kSize]
 

Static Private Attributes

static const int kSize = size
 
static const int kMask = kSize - 1
 

Friends

class Test
 

Detailed Description

template<class T, int size = 256>
class unibrow::Predicate< T, size >

Definition at line 27 of file unicode.h.

Constructor & Destructor Documentation

◆ Predicate()

template<class T , int size = 256>
unibrow::Predicate< T, size >::Predicate ( )
inline

Definition at line 29 of file unicode.h.

29 { }

Member Function Documentation

◆ CalculateValue()

template<class T , int s>
bool unibrow::Predicate< T, s >::CalculateValue ( uchar  c)
private

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

21  {
22  bool result = T::Is(code_point);
23  entries_[code_point & kMask] = CacheEntry(code_point, result);
24  return result;
25 }
CacheEntry entries_[kSize]
Definition: unicode.h:44
static const int kMask
Definition: unicode.h:43
bool Is(Object *obj)

References v8::internal::Is().

+ Here is the call graph for this function:

◆ get()

template<class T , int s>
bool unibrow::Predicate< T, s >::get ( uchar  c)
inline

Definition at line 14 of file unicode-inl.h.

14  {
15  CacheEntry entry = entries_[code_point & kMask];
16  if (entry.code_point_ == code_point) return entry.value_;
17  return CalculateValue(code_point);
18 }
bool CalculateValue(uchar c)
Definition: unicode-inl.h:20

References unibrow::Predicate< T, size >::CacheEntry::code_point_, and unibrow::Predicate< T, size >::CacheEntry::value_.

Referenced by v8::internal::UnicodeCache::IsLineTerminator().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Test

template<class T , int size = 256>
friend class Test
friend

Definition at line 32 of file unicode.h.

Member Data Documentation

◆ entries_

template<class T , int size = 256>
CacheEntry unibrow::Predicate< T, size >::entries_[kSize]
private

Definition at line 44 of file unicode.h.

◆ kMask

template<class T , int size = 256>
const int unibrow::Predicate< T, size >::kMask = kSize - 1
staticprivate

Definition at line 43 of file unicode.h.

◆ kSize

template<class T , int size = 256>
const int unibrow::Predicate< T, size >::kSize = size
staticprivate

Definition at line 42 of file unicode.h.


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