V8 Project
v8::internal::DispatchTableConstructor Class Reference

#include <jsregexp.h>

+ Inheritance diagram for v8::internal::DispatchTableConstructor:
+ Collaboration diagram for v8::internal::DispatchTableConstructor:

Public Member Functions

 DispatchTableConstructor (DispatchTable *table, bool ignore_case, Zone *zone)
 
void BuildTable (ChoiceNode *node)
 
void AddRange (CharacterRange range)
 
void AddInverse (ZoneList< CharacterRange > *ranges)
 
DispatchTabletable ()
 
void set_choice_index (int value)
 
- Public Member Functions inherited from v8::internal::NodeVisitor
virtual ~NodeVisitor ()
 
virtual void VisitLoopChoice (LoopChoiceNode *that)
 

Protected Attributes

DispatchTabletable_
 
int choice_index_
 
bool ignore_case_
 
Zonezone_
 

Detailed Description

Definition at line 1554 of file jsregexp.h.

Constructor & Destructor Documentation

◆ DispatchTableConstructor()

v8::internal::DispatchTableConstructor::DispatchTableConstructor ( DispatchTable table,
bool  ignore_case,
Zone zone 
)
inline

Definition at line 1556 of file jsregexp.h.

Member Function Documentation

◆ AddInverse()

void v8::internal::DispatchTableConstructor::AddInverse ( ZoneList< CharacterRange > *  ranges)

Definition at line 5983 of file jsregexp.cc.

5983  {
5984  ranges->Sort(CompareRangeByFrom);
5985  uc16 last = 0;
5986  for (int i = 0; i < ranges->length(); i++) {
5987  CharacterRange range = ranges->at(i);
5988  if (last < range.from())
5989  AddRange(CharacterRange(last, range.from() - 1));
5990  if (range.to() >= last) {
5991  if (range.to() == String::kMaxUtf16CodeUnit) {
5992  return;
5993  } else {
5994  last = range.to() + 1;
5995  }
5996  }
5997  }
5998  AddRange(CharacterRange(last, String::kMaxUtf16CodeUnit));
5999 }
void AddRange(CharacterRange range)
Definition: jsregexp.h:1565
static const int kMaxUtf16CodeUnit
Definition: objects.h:8813
static int CompareRangeByFrom(const CharacterRange *a, const CharacterRange *b)
Definition: jsregexp.cc:5977
uint16_t uc16
Definition: globals.h:184

References AddRange(), v8::internal::List< T, AllocationPolicy >::at(), v8::internal::CompareRangeByFrom(), v8::internal::CharacterRange::from(), v8::internal::String::kMaxUtf16CodeUnit, v8::internal::List< T, AllocationPolicy >::Sort(), and v8::internal::CharacterRange::to().

+ Here is the call graph for this function:

◆ AddRange()

void v8::internal::DispatchTableConstructor::AddRange ( CharacterRange  range)
inline

Definition at line 1565 of file jsregexp.h.

1565  {
1566  table()->AddRange(range, choice_index_, zone_);
1567  }
void AddRange(CharacterRange range, int value, Zone *zone)
Definition: jsregexp.cc:5619

References v8::internal::DispatchTable::AddRange(), choice_index_, table(), and zone_.

Referenced by AddInverse(), and v8::internal::AddDispatchRange::Call().

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

◆ BuildTable()

void v8::internal::DispatchTableConstructor::BuildTable ( ChoiceNode node)

Definition at line 5928 of file jsregexp.cc.

5928  {
5929  node->set_being_calculated(true);
5930  ZoneList<GuardedAlternative>* alternatives = node->alternatives();
5931  for (int i = 0; i < alternatives->length(); i++) {
5933  alternatives->at(i).node()->Accept(this);
5934  }
5935  node->set_being_calculated(false);
5936 }

References v8::internal::ChoiceNode::alternatives(), v8::internal::List< T, AllocationPolicy >::at(), v8::internal::ChoiceNode::set_being_calculated(), and set_choice_index().

Referenced by v8::internal::ChoiceNode::GetTable().

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

◆ set_choice_index()

void v8::internal::DispatchTableConstructor::set_choice_index ( int  value)
inline

Definition at line 1577 of file jsregexp.h.

1577 { choice_index_ = value; }

References choice_index_.

Referenced by BuildTable().

+ Here is the caller graph for this function:

◆ table()

DispatchTable* v8::internal::DispatchTableConstructor::table ( )
inline

Definition at line 1576 of file jsregexp.h.

1576 { return table_; }

References table_.

Referenced by AddRange().

+ Here is the caller graph for this function:

Member Data Documentation

◆ choice_index_

int v8::internal::DispatchTableConstructor::choice_index_
protected

Definition at line 1581 of file jsregexp.h.

Referenced by AddRange(), and set_choice_index().

◆ ignore_case_

bool v8::internal::DispatchTableConstructor::ignore_case_
protected

Definition at line 1582 of file jsregexp.h.

◆ table_

DispatchTable* v8::internal::DispatchTableConstructor::table_
protected

Definition at line 1580 of file jsregexp.h.

Referenced by table().

◆ zone_

Zone* v8::internal::DispatchTableConstructor::zone_
protected

Definition at line 1583 of file jsregexp.h.

Referenced by AddRange().


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