Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::NegativeLookaroundChoiceNode Class Reference

#include <regexp.h>

Inheritance diagram for dart::NegativeLookaroundChoiceNode:
dart::ChoiceNode dart::RegExpNode dart::ZoneAllocated

Public Member Functions

 NegativeLookaroundChoiceNode (GuardedAlternative this_must_fail, GuardedAlternative then_do_this, Zone *zone)
 
virtual intptr_t EatsAtLeast (intptr_t still_to_find, intptr_t budget, bool not_at_start)
 
virtual void GetQuickCheckDetails (QuickCheckDetails *details, RegExpCompiler *compiler, intptr_t characters_filled_in, bool not_at_start)
 
virtual void FillInBMInfo (intptr_t offset, intptr_t budget, BoyerMooreLookahead *bm, bool not_at_start)
 
virtual bool try_to_emit_quick_check_for_alternative (bool is_first)
 
virtual RegExpNodeFilterOneByte (intptr_t depth)
 
- Public Member Functions inherited from dart::ChoiceNode
 ChoiceNode (intptr_t expected_size, Zone *zone)
 
virtual void Accept (NodeVisitor *visitor)
 
void AddAlternative (GuardedAlternative node)
 
ZoneGrowableArray< GuardedAlternative > * alternatives ()
 
virtual void Emit (RegExpCompiler *compiler, Trace *trace)
 
virtual intptr_t EatsAtLeast (intptr_t still_to_find, intptr_t budget, bool not_at_start)
 
intptr_t EatsAtLeastHelper (intptr_t still_to_find, intptr_t budget, RegExpNode *ignore_this_node, bool not_at_start)
 
virtual void GetQuickCheckDetails (QuickCheckDetails *details, RegExpCompiler *compiler, intptr_t characters_filled_in, bool not_at_start)
 
virtual void FillInBMInfo (intptr_t offset, intptr_t budget, BoyerMooreLookahead *bm, bool not_at_start)
 
bool being_calculated ()
 
bool not_at_start ()
 
void set_not_at_start ()
 
void set_being_calculated (bool b)
 
virtual bool try_to_emit_quick_check_for_alternative (bool is_first)
 
virtual RegExpNodeFilterOneByte (intptr_t depth)
 
virtual bool read_backward ()
 
- Public Member Functions inherited from dart::RegExpNode
 RegExpNode (Zone *zone)
 
virtual ~RegExpNode ()
 
virtual void Accept (NodeVisitor *visitor)=0
 
virtual void Emit (RegExpCompiler *compiler, Trace *trace)=0
 
virtual intptr_t EatsAtLeast (intptr_t still_to_find, intptr_t budget, bool not_at_start)=0
 
bool EmitQuickCheck (RegExpCompiler *compiler, Trace *bounds_check_trace, Trace *trace, bool preload_has_checked_bounds, BlockLabel *on_possible_success, QuickCheckDetails *details_return, bool fall_through_on_failure)
 
virtual void GetQuickCheckDetails (QuickCheckDetails *details, RegExpCompiler *compiler, intptr_t characters_filled_in, bool not_at_start)=0
 
virtual intptr_t GreedyLoopTextLength ()
 
virtual RegExpNodeGetSuccessorOfOmnivorousTextNode (RegExpCompiler *compiler)
 
virtual void FillInBMInfo (intptr_t offset, intptr_t budget, BoyerMooreLookahead *bm, bool not_at_start)
 
virtual RegExpNodeFilterOneByte (intptr_t depth)
 
RegExpNodereplacement ()
 
RegExpNodeset_replacement (RegExpNode *replacement)
 
void SaveBMInfo (BoyerMooreLookahead *bm, bool not_at_start, intptr_t offset)
 
BlockLabellabel ()
 
NodeInfoinfo ()
 
BoyerMooreLookaheadbm_info (bool not_at_start)
 
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)
 

Additional Inherited Members

- Static Public Attributes inherited from dart::RegExpNode
static constexpr intptr_t kNodeIsTooComplexForGreedyLoops = -1
 
static constexpr intptr_t kRecursionBudget = 200
 
static constexpr intptr_t kMaxCopiesCodeGenerated = 10
 
- Protected Types inherited from dart::RegExpNode
enum  LimitResult { DONE , CONTINUE }
 
- Protected Member Functions inherited from dart::ChoiceNode
intptr_t GreedyLoopTextLengthForAlternative (const GuardedAlternative *alternative)
 
- Protected Member Functions inherited from dart::RegExpNode
LimitResult LimitVersions (RegExpCompiler *compiler, Trace *trace)
 
void set_bm_info (bool not_at_start, BoyerMooreLookahead *bm)
 
- Protected Attributes inherited from dart::ChoiceNode
ZoneGrowableArray< GuardedAlternative > * alternatives_
 
- Protected Attributes inherited from dart::RegExpNode
RegExpNodereplacement_
 

Detailed Description

Definition at line 975 of file regexp.h.

Constructor & Destructor Documentation

◆ NegativeLookaroundChoiceNode()

dart::NegativeLookaroundChoiceNode::NegativeLookaroundChoiceNode ( GuardedAlternative  this_must_fail,
GuardedAlternative  then_do_this,
Zone zone 
)
inlineexplicit

Definition at line 977 of file regexp.h.

980 : ChoiceNode(2, zone) {
981 AddAlternative(this_must_fail);
982 AddAlternative(then_do_this);
983 }
ChoiceNode(intptr_t expected_size, Zone *zone)
Definition: regexp.h:896
void AddAlternative(GuardedAlternative node)
Definition: regexp.h:903
Zone * zone() const
Definition: regexp.h:483

Member Function Documentation

◆ EatsAtLeast()

intptr_t dart::NegativeLookaroundChoiceNode::EatsAtLeast ( intptr_t  still_to_find,
intptr_t  budget,
bool  not_at_start 
)
virtual

Reimplemented from dart::ChoiceNode.

Definition at line 1536 of file regexp.cc.

1538 {
1539 if (budget <= 0) return 0;
1540 // Alternative 0 is the negative lookahead, alternative 1 is what comes
1541 // afterwards.
1542 RegExpNode* node = (*alternatives_)[1].node();
1543 return node->EatsAtLeast(still_to_find, budget - 1, not_at_start);
1544}
bool not_at_start()
Definition: regexp.h:925
RegExpNode(Zone *zone)
Definition: regexp.h:386

◆ FillInBMInfo()

virtual void dart::NegativeLookaroundChoiceNode::FillInBMInfo ( intptr_t  offset,
intptr_t  budget,
BoyerMooreLookahead bm,
bool  not_at_start 
)
inlinevirtual

Reimplemented from dart::ChoiceNode.

Definition at line 991 of file regexp.h.

994 {
995 (*alternatives_)[1].node()->FillInBMInfo(offset, budget - 1, bm,
997 if (offset == 0) set_bm_info(not_at_start, bm);
998 }
void set_bm_info(bool not_at_start, BoyerMooreLookahead *bm)
Definition: regexp.h:491
SeparatedVector2 offset

◆ FilterOneByte()

RegExpNode * dart::NegativeLookaroundChoiceNode::FilterOneByte ( intptr_t  depth)
virtual

Reimplemented from dart::ChoiceNode.

Definition at line 2099 of file regexp.cc.

2099 {
2100 if (info()->replacement_calculated) return replacement();
2101 if (depth < 0) return this;
2102 if (info()->visited) return this;
2103 VisitMarker marker(info());
2104 // Alternative 0 is the negative lookahead, alternative 1 is what comes
2105 // afterwards.
2106 RegExpNode* node = (*alternatives_)[1].node();
2107 RegExpNode* replacement = node->FilterOneByte(depth - 1);
2108 if (replacement == nullptr) return set_replacement(nullptr);
2109 (*alternatives_)[1].set_node(replacement);
2110
2111 RegExpNode* neg_node = (*alternatives_)[0].node();
2112 RegExpNode* neg_replacement = neg_node->FilterOneByte(depth - 1);
2113 // If the negative lookahead is always going to fail then
2114 // we don't need to check it.
2115 if (neg_replacement == nullptr) return set_replacement(replacement);
2116 (*alternatives_)[0].set_node(neg_replacement);
2117 return set_replacement(this);
2118}
static const char marker[]
NodeInfo * info()
Definition: regexp.h:477
virtual RegExpNode * FilterOneByte(intptr_t depth)
Definition: regexp.h:449
RegExpNode * set_replacement(RegExpNode *replacement)
Definition: regexp.h:455
RegExpNode * replacement()
Definition: regexp.h:451

◆ GetQuickCheckDetails()

void dart::NegativeLookaroundChoiceNode::GetQuickCheckDetails ( QuickCheckDetails details,
RegExpCompiler compiler,
intptr_t  characters_filled_in,
bool  not_at_start 
)
virtual

Reimplemented from dart::ChoiceNode.

Definition at line 1546 of file regexp.cc.

1550 {
1551 // Alternative 0 is the negative lookahead, alternative 1 is what comes
1552 // afterwards.
1553 RegExpNode* node = (*alternatives_)[1].node();
1554 return node->GetQuickCheckDetails(details, compiler, filled_in, not_at_start);
1555}

◆ try_to_emit_quick_check_for_alternative()

virtual bool dart::NegativeLookaroundChoiceNode::try_to_emit_quick_check_for_alternative ( bool  is_first)
inlinevirtual

Reimplemented from dart::ChoiceNode.

Definition at line 1004 of file regexp.h.

1004 {
1005 return !is_first;
1006 }

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