Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Attributes | List of all members
dart::RegExpMacroAssembler Class Referenceabstract

#include <regexp_assembler.h>

Inheritance diagram for dart::RegExpMacroAssembler:
dart::ZoneAllocated dart::BytecodeRegExpMacroAssembler dart::IRRegExpMacroAssembler

Public Types

enum  { kParamRegExpIndex = 0 , kParamStringIndex , kParamStartOffsetIndex , kParamCount }
 
enum  IrregexpImplementation { kBytecodeImplementation , kIRImplementation }
 
enum  GlobalMode { NOT_GLOBAL , GLOBAL , GLOBAL_NO_ZERO_LENGTH_CHECK , GLOBAL_UNICODE }
 

Public Member Functions

 RegExpMacroAssembler (Zone *zone)
 
virtual ~RegExpMacroAssembler ()
 
virtual intptr_t stack_limit_slack ()=0
 
virtual bool CanReadUnaligned ()=0
 
virtual void AdvanceCurrentPosition (intptr_t by)=0
 
virtual void AdvanceRegister (intptr_t reg, intptr_t by)=0
 
virtual void Backtrack ()=0
 
virtual void BindBlock (BlockLabel *label)=0
 
virtual void CheckAtStart (BlockLabel *on_at_start)=0
 
virtual void CheckCharacter (unsigned c, BlockLabel *on_equal)=0
 
virtual void CheckCharacterAfterAnd (unsigned c, unsigned and_with, BlockLabel *on_equal)=0
 
virtual void CheckCharacterGT (uint16_t limit, BlockLabel *on_greater)=0
 
virtual void CheckCharacterLT (uint16_t limit, BlockLabel *on_less)=0
 
virtual void CheckGreedyLoop (BlockLabel *on_tos_equals_current_position)=0
 
virtual void CheckNotAtStart (intptr_t cp_offset, BlockLabel *on_not_at_start)=0
 
virtual void CheckNotBackReference (intptr_t start_reg, bool read_backward, BlockLabel *on_no_match)=0
 
virtual void CheckNotBackReferenceIgnoreCase (intptr_t start_reg, bool read_backward, bool unicode, BlockLabel *on_no_match)=0
 
virtual void CheckNotCharacter (unsigned c, BlockLabel *on_not_equal)=0
 
virtual void CheckNotCharacterAfterAnd (unsigned c, unsigned and_with, BlockLabel *on_not_equal)=0
 
virtual void CheckNotCharacterAfterMinusAnd (uint16_t c, uint16_t minus, uint16_t and_with, BlockLabel *on_not_equal)=0
 
virtual void CheckCharacterInRange (uint16_t from, uint16_t to, BlockLabel *on_in_range)=0
 
virtual void CheckCharacterNotInRange (uint16_t from, uint16_t to, BlockLabel *on_not_in_range)=0
 
virtual void CheckBitInTable (const TypedData &table, BlockLabel *on_bit_set)=0
 
virtual void CheckPreemption (bool is_backtrack)
 
virtual void CheckPosition (intptr_t cp_offset, BlockLabel *on_outside_input)
 
virtual bool CheckSpecialCharacterClass (uint16_t type, BlockLabel *on_no_match)
 
virtual void Fail ()=0
 
virtual void IfRegisterGE (intptr_t reg, intptr_t comparand, BlockLabel *if_ge)=0
 
virtual void IfRegisterLT (intptr_t reg, intptr_t comparand, BlockLabel *if_lt)=0
 
virtual void IfRegisterEqPos (intptr_t reg, BlockLabel *if_eq)=0
 
virtual IrregexpImplementation Implementation ()=0
 
virtual bool IsClosed () const =0
 
virtual void GoTo (BlockLabel *to)=0
 
virtual void LoadCurrentCharacter (intptr_t cp_offset, BlockLabel *on_end_of_input, bool check_bounds=true, intptr_t characters=1)=0
 
virtual void PopCurrentPosition ()=0
 
virtual void PopRegister (intptr_t register_index)=0
 
virtual void Print (const char *str)=0
 
virtual void PrintBlocks ()=0
 
virtual void PushBacktrack (BlockLabel *label)=0
 
virtual void PushCurrentPosition ()=0
 
virtual void PushRegister (intptr_t register_index)=0
 
virtual void ReadCurrentPositionFromRegister (intptr_t reg)=0
 
virtual void ReadStackPointerFromRegister (intptr_t reg)=0
 
virtual void SetCurrentPositionFromEnd (intptr_t by)=0
 
virtual void SetRegister (intptr_t register_index, intptr_t to)=0
 
virtual bool Succeed ()=0
 
virtual void WriteCurrentPositionToRegister (intptr_t reg, intptr_t cp_offset)=0
 
virtual void ClearRegisters (intptr_t reg_from, intptr_t reg_to)=0
 
virtual void WriteStackPointerToRegister (intptr_t reg)=0
 
void CheckNotInSurrogatePair (intptr_t cp_offset, BlockLabel *on_failure)
 
void set_slow_safe (bool ssc)
 
bool slow_safe ()
 
void set_global_mode (GlobalMode mode)
 
bool global ()
 
bool global_with_zero_length_check ()
 
bool global_unicode ()
 
Zonezone () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Static Public Attributes

static constexpr intptr_t kMaxRegister = (1 << 16) - 1
 
static constexpr intptr_t kMaxCPOffset = (1 << 15) - 1
 
static constexpr intptr_t kMinCPOffset = -(1 << 15)
 
static constexpr intptr_t kTableSizeBits = 7
 
static constexpr intptr_t kTableSize = 1 << kTableSizeBits
 
static constexpr intptr_t kTableMask = kTableSize - 1
 

Detailed Description

Definition at line 96 of file regexp_assembler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kParamRegExpIndex 
kParamStringIndex 
kParamStartOffsetIndex 
kParamCount 

Definition at line 107 of file regexp_assembler.h.

◆ GlobalMode

Enumerator
NOT_GLOBAL 
GLOBAL 
GLOBAL_NO_ZERO_LENGTH_CHECK 
GLOBAL_UNICODE 

Definition at line 244 of file regexp_assembler.h.

◆ IrregexpImplementation

Enumerator
kBytecodeImplementation 
kIRImplementation 

Definition at line 114 of file regexp_assembler.h.

Constructor & Destructor Documentation

◆ RegExpMacroAssembler()

dart::RegExpMacroAssembler::RegExpMacroAssembler ( Zone zone)
explicit

Definition at line 110 of file regexp_assembler.cc.

111 : slow_safe_compiler_(false), global_mode_(NOT_GLOBAL), zone_(zone) {}

◆ ~RegExpMacroAssembler()

dart::RegExpMacroAssembler::~RegExpMacroAssembler ( )
virtual

Definition at line 113 of file regexp_assembler.cc.

113{}

Member Function Documentation

◆ AdvanceCurrentPosition()

virtual void dart::RegExpMacroAssembler::AdvanceCurrentPosition ( intptr_t  by)
pure virtual

◆ AdvanceRegister()

virtual void dart::RegExpMacroAssembler::AdvanceRegister ( intptr_t  reg,
intptr_t  by 
)
pure virtual

◆ Backtrack()

virtual void dart::RegExpMacroAssembler::Backtrack ( )
pure virtual

◆ BindBlock()

virtual void dart::RegExpMacroAssembler::BindBlock ( BlockLabel label)
pure virtual

◆ CanReadUnaligned()

virtual bool dart::RegExpMacroAssembler::CanReadUnaligned ( )
pure virtual

◆ CheckAtStart()

virtual void dart::RegExpMacroAssembler::CheckAtStart ( BlockLabel on_at_start)
pure virtual

◆ CheckBitInTable()

virtual void dart::RegExpMacroAssembler::CheckBitInTable ( const TypedData table,
BlockLabel on_bit_set 
)
pure virtual

◆ CheckCharacter()

virtual void dart::RegExpMacroAssembler::CheckCharacter ( unsigned  c,
BlockLabel on_equal 
)
pure virtual

◆ CheckCharacterAfterAnd()

virtual void dart::RegExpMacroAssembler::CheckCharacterAfterAnd ( unsigned  c,
unsigned  and_with,
BlockLabel on_equal 
)
pure virtual

◆ CheckCharacterGT()

virtual void dart::RegExpMacroAssembler::CheckCharacterGT ( uint16_t  limit,
BlockLabel on_greater 
)
pure virtual

◆ CheckCharacterInRange()

virtual void dart::RegExpMacroAssembler::CheckCharacterInRange ( uint16_t  from,
uint16_t  to,
BlockLabel on_in_range 
)
pure virtual

◆ CheckCharacterLT()

virtual void dart::RegExpMacroAssembler::CheckCharacterLT ( uint16_t  limit,
BlockLabel on_less 
)
pure virtual

◆ CheckCharacterNotInRange()

virtual void dart::RegExpMacroAssembler::CheckCharacterNotInRange ( uint16_t  from,
uint16_t  to,
BlockLabel on_not_in_range 
)
pure virtual

◆ CheckGreedyLoop()

virtual void dart::RegExpMacroAssembler::CheckGreedyLoop ( BlockLabel on_tos_equals_current_position)
pure virtual

◆ CheckNotAtStart()

virtual void dart::RegExpMacroAssembler::CheckNotAtStart ( intptr_t  cp_offset,
BlockLabel on_not_at_start 
)
pure virtual

◆ CheckNotBackReference()

virtual void dart::RegExpMacroAssembler::CheckNotBackReference ( intptr_t  start_reg,
bool  read_backward,
BlockLabel on_no_match 
)
pure virtual

◆ CheckNotBackReferenceIgnoreCase()

virtual void dart::RegExpMacroAssembler::CheckNotBackReferenceIgnoreCase ( intptr_t  start_reg,
bool  read_backward,
bool  unicode,
BlockLabel on_no_match 
)
pure virtual

◆ CheckNotCharacter()

virtual void dart::RegExpMacroAssembler::CheckNotCharacter ( unsigned  c,
BlockLabel on_not_equal 
)
pure virtual

◆ CheckNotCharacterAfterAnd()

virtual void dart::RegExpMacroAssembler::CheckNotCharacterAfterAnd ( unsigned  c,
unsigned  and_with,
BlockLabel on_not_equal 
)
pure virtual

◆ CheckNotCharacterAfterMinusAnd()

virtual void dart::RegExpMacroAssembler::CheckNotCharacterAfterMinusAnd ( uint16_t  c,
uint16_t  minus,
uint16_t  and_with,
BlockLabel on_not_equal 
)
pure virtual

◆ CheckNotInSurrogatePair()

void dart::RegExpMacroAssembler::CheckNotInSurrogatePair ( intptr_t  cp_offset,
BlockLabel on_failure 
)

Definition at line 115 of file regexp_assembler.cc.

116 {
117 BlockLabel ok;
118 // Check that current character is not a trail surrogate.
119 LoadCurrentCharacter(cp_offset, &ok);
122 // Check that previous character is not a lead surrogate.
123 LoadCurrentCharacter(cp_offset - 1, &ok);
125 on_failure);
126 BindBlock(&ok);
127}
static bool ok(int result)
virtual void CheckCharacterInRange(uint16_t from, uint16_t to, BlockLabel *on_in_range)=0
virtual void CheckCharacterNotInRange(uint16_t from, uint16_t to, BlockLabel *on_not_in_range)=0
virtual void BindBlock(BlockLabel *label)=0
virtual void LoadCurrentCharacter(intptr_t cp_offset, BlockLabel *on_end_of_input, bool check_bounds=true, intptr_t characters=1)=0
static constexpr int32_t kLeadSurrogateStart
Definition: unicode.h:159
static constexpr int32_t kTrailSurrogateStart
Definition: unicode.h:161
static constexpr int32_t kTrailSurrogateEnd
Definition: unicode.h:162
static constexpr int32_t kLeadSurrogateEnd
Definition: unicode.h:160

◆ CheckPosition()

virtual void dart::RegExpMacroAssembler::CheckPosition ( intptr_t  cp_offset,
BlockLabel on_outside_input 
)
inlinevirtual

Reimplemented in dart::IRRegExpMacroAssembler.

Definition at line 181 of file regexp_assembler.h.

181 {
182 LoadCurrentCharacter(cp_offset, on_outside_input, true);
183 }

◆ CheckPreemption()

virtual void dart::RegExpMacroAssembler::CheckPreemption ( bool  is_backtrack)
inlinevirtual

Definition at line 177 of file regexp_assembler.h.

177{}

◆ CheckSpecialCharacterClass()

virtual bool dart::RegExpMacroAssembler::CheckSpecialCharacterClass ( uint16_t  type,
BlockLabel on_no_match 
)
inlinevirtual

Reimplemented in dart::IRRegExpMacroAssembler.

Definition at line 188 of file regexp_assembler.h.

189 {
190 return false;
191 }

◆ ClearRegisters()

virtual void dart::RegExpMacroAssembler::ClearRegisters ( intptr_t  reg_from,
intptr_t  reg_to 
)
pure virtual

◆ Fail()

virtual void dart::RegExpMacroAssembler::Fail ( )
pure virtual

◆ global()

bool dart::RegExpMacroAssembler::global ( )
inline

Definition at line 253 of file regexp_assembler.h.

253{ return global_mode_ != NOT_GLOBAL; }

◆ global_unicode()

bool dart::RegExpMacroAssembler::global_unicode ( )
inline

Definition at line 257 of file regexp_assembler.h.

257{ return global_mode_ == GLOBAL_UNICODE; }

◆ global_with_zero_length_check()

bool dart::RegExpMacroAssembler::global_with_zero_length_check ( )
inline

Definition at line 254 of file regexp_assembler.h.

254 {
255 return global_mode_ == GLOBAL || global_mode_ == GLOBAL_UNICODE;
256 }

◆ GoTo()

virtual void dart::RegExpMacroAssembler::GoTo ( BlockLabel to)
pure virtual

◆ IfRegisterEqPos()

virtual void dart::RegExpMacroAssembler::IfRegisterEqPos ( intptr_t  reg,
BlockLabel if_eq 
)
pure virtual

◆ IfRegisterGE()

virtual void dart::RegExpMacroAssembler::IfRegisterGE ( intptr_t  reg,
intptr_t  comparand,
BlockLabel if_ge 
)
pure virtual

◆ IfRegisterLT()

virtual void dart::RegExpMacroAssembler::IfRegisterLT ( intptr_t  reg,
intptr_t  comparand,
BlockLabel if_lt 
)
pure virtual

◆ Implementation()

virtual IrregexpImplementation dart::RegExpMacroAssembler::Implementation ( )
pure virtual

◆ IsClosed()

virtual bool dart::RegExpMacroAssembler::IsClosed ( ) const
pure virtual

◆ LoadCurrentCharacter()

virtual void dart::RegExpMacroAssembler::LoadCurrentCharacter ( intptr_t  cp_offset,
BlockLabel on_end_of_input,
bool  check_bounds = true,
intptr_t  characters = 1 
)
pure virtual

◆ PopCurrentPosition()

virtual void dart::RegExpMacroAssembler::PopCurrentPosition ( )
pure virtual

◆ PopRegister()

virtual void dart::RegExpMacroAssembler::PopRegister ( intptr_t  register_index)
pure virtual

◆ Print()

virtual void dart::RegExpMacroAssembler::Print ( const char *  str)
pure virtual

◆ PrintBlocks()

virtual void dart::RegExpMacroAssembler::PrintBlocks ( )
pure virtual

◆ PushBacktrack()

virtual void dart::RegExpMacroAssembler::PushBacktrack ( BlockLabel label)
pure virtual

◆ PushCurrentPosition()

virtual void dart::RegExpMacroAssembler::PushCurrentPosition ( )
pure virtual

◆ PushRegister()

virtual void dart::RegExpMacroAssembler::PushRegister ( intptr_t  register_index)
pure virtual

◆ ReadCurrentPositionFromRegister()

virtual void dart::RegExpMacroAssembler::ReadCurrentPositionFromRegister ( intptr_t  reg)
pure virtual

◆ ReadStackPointerFromRegister()

virtual void dart::RegExpMacroAssembler::ReadStackPointerFromRegister ( intptr_t  reg)
pure virtual

◆ set_global_mode()

void dart::RegExpMacroAssembler::set_global_mode ( GlobalMode  mode)
inline

Definition at line 252 of file regexp_assembler.h.

252{ global_mode_ = mode; }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

◆ set_slow_safe()

void dart::RegExpMacroAssembler::set_slow_safe ( bool  ssc)
inline

Definition at line 241 of file regexp_assembler.h.

241{ slow_safe_compiler_ = ssc; }

◆ SetCurrentPositionFromEnd()

virtual void dart::RegExpMacroAssembler::SetCurrentPositionFromEnd ( intptr_t  by)
pure virtual

◆ SetRegister()

virtual void dart::RegExpMacroAssembler::SetRegister ( intptr_t  register_index,
intptr_t  to 
)
pure virtual

◆ slow_safe()

bool dart::RegExpMacroAssembler::slow_safe ( )
inline

Definition at line 242 of file regexp_assembler.h.

242{ return slow_safe_compiler_; }

◆ stack_limit_slack()

virtual intptr_t dart::RegExpMacroAssembler::stack_limit_slack ( )
pure virtual

◆ Succeed()

virtual bool dart::RegExpMacroAssembler::Succeed ( )
pure virtual

◆ WriteCurrentPositionToRegister()

virtual void dart::RegExpMacroAssembler::WriteCurrentPositionToRegister ( intptr_t  reg,
intptr_t  cp_offset 
)
pure virtual

◆ WriteStackPointerToRegister()

virtual void dart::RegExpMacroAssembler::WriteStackPointerToRegister ( intptr_t  reg)
pure virtual

◆ zone()

Zone * dart::RegExpMacroAssembler::zone ( ) const
inline

Definition at line 259 of file regexp_assembler.h.

259{ return zone_; }

Member Data Documentation

◆ kMaxCPOffset

constexpr intptr_t dart::RegExpMacroAssembler::kMaxCPOffset = (1 << 15) - 1
staticconstexpr

Definition at line 100 of file regexp_assembler.h.

◆ kMaxRegister

constexpr intptr_t dart::RegExpMacroAssembler::kMaxRegister = (1 << 16) - 1
staticconstexpr

Definition at line 99 of file regexp_assembler.h.

◆ kMinCPOffset

constexpr intptr_t dart::RegExpMacroAssembler::kMinCPOffset = -(1 << 15)
staticconstexpr

Definition at line 101 of file regexp_assembler.h.

◆ kTableMask

constexpr intptr_t dart::RegExpMacroAssembler::kTableMask = kTableSize - 1
staticconstexpr

Definition at line 105 of file regexp_assembler.h.

◆ kTableSize

constexpr intptr_t dart::RegExpMacroAssembler::kTableSize = 1 << kTableSizeBits
staticconstexpr

Definition at line 104 of file regexp_assembler.h.

◆ kTableSizeBits

constexpr intptr_t dart::RegExpMacroAssembler::kTableSizeBits = 7
staticconstexpr

Definition at line 103 of file regexp_assembler.h.


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