V8 Project
v8::internal::NegativeLookaheadChoiceNode Class Reference

#include <jsregexp.h>

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

Public Member Functions

 NegativeLookaheadChoiceNode (GuardedAlternative this_must_fail, GuardedAlternative then_do_this, Zone *zone)
 
virtual int EatsAtLeast (int still_to_find, int budget, bool not_at_start)
 
virtual void GetQuickCheckDetails (QuickCheckDetails *details, RegExpCompiler *compiler, int characters_filled_in, bool not_at_start)
 
virtual void FillInBMInfo (int offset, int budget, BoyerMooreLookahead *bm, bool not_at_start)
 
virtual bool try_to_emit_quick_check_for_alternative (bool is_first)
 
virtual RegExpNodeFilterOneByte (int depth, bool ignore_case)
 
- Public Member Functions inherited from v8::internal::ChoiceNode
 ChoiceNode (int expected_size, Zone *zone)
 
virtual void Accept (NodeVisitor *visitor)
 
void AddAlternative (GuardedAlternative node)
 
ZoneList< GuardedAlternative > * alternatives ()
 
DispatchTableGetTable (bool ignore_case)
 
virtual void Emit (RegExpCompiler *compiler, Trace *trace)
 
int EatsAtLeastHelper (int still_to_find, int budget, RegExpNode *ignore_this_node, bool not_at_start)
 
bool being_calculated ()
 
bool not_at_start ()
 
void set_not_at_start ()
 
void set_being_calculated (bool b)
 
- Public Member Functions inherited from v8::internal::RegExpNode
 RegExpNode (Zone *zone)
 
virtual ~RegExpNode ()
 
bool EmitQuickCheck (RegExpCompiler *compiler, Trace *bounds_check_trace, Trace *trace, bool preload_has_checked_bounds, Label *on_possible_success, QuickCheckDetails *details_return, bool fall_through_on_failure)
 
virtual int GreedyLoopTextLength ()
 
virtual RegExpNodeGetSuccessorOfOmnivorousTextNode (RegExpCompiler *compiler)
 
RegExpNodereplacement ()
 
RegExpNodeset_replacement (RegExpNode *replacement)
 
void SaveBMInfo (BoyerMooreLookahead *bm, bool not_at_start, int offset)
 
Label * label ()
 
NodeInfoinfo ()
 
BoyerMooreLookaheadbm_info (bool not_at_start)
 
Zonezone () const
 
- Public Member Functions inherited from v8::internal::ZoneObject
 INLINE (void *operator new(size_t size, Zone *zone))
 
void operator delete (void *, size_t)
 
void operator delete (void *pointer, Zone *zone)
 

Additional Inherited Members

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

Detailed Description

Definition at line 1131 of file jsregexp.h.

Constructor & Destructor Documentation

◆ NegativeLookaheadChoiceNode()

v8::internal::NegativeLookaheadChoiceNode::NegativeLookaheadChoiceNode ( GuardedAlternative  this_must_fail,
GuardedAlternative  then_do_this,
Zone zone 
)
inlineexplicit

Definition at line 1133 of file jsregexp.h.

1136  : ChoiceNode(2, zone) {
1137  AddAlternative(this_must_fail);
1138  AddAlternative(then_do_this);
1139  }
ChoiceNode(int expected_size, Zone *zone)
Definition: jsregexp.h:1053
void AddAlternative(GuardedAlternative node)
Definition: jsregexp.h:1061
Zone * zone() const
Definition: jsregexp.h:668

References v8::internal::ChoiceNode::AddAlternative().

+ Here is the call graph for this function:

Member Function Documentation

◆ EatsAtLeast()

int v8::internal::NegativeLookaheadChoiceNode::EatsAtLeast ( int  still_to_find,
int  budget,
bool  not_at_start 
)
virtual

Reimplemented from v8::internal::ChoiceNode.

Definition at line 2347 of file jsregexp.cc.

2349  {
2350  if (budget <= 0) return 0;
2351  // Alternative 0 is the negative lookahead, alternative 1 is what comes
2352  // afterwards.
2353  RegExpNode* node = alternatives_->at(1).node();
2354  return node->EatsAtLeast(still_to_find, budget - 1, not_at_start);
2355 }
ZoneList< GuardedAlternative > * alternatives_
Definition: jsregexp.h:1092
RegExpNode(Zone *zone)
Definition: jsregexp.h:573

References v8::internal::RegExpNode::EatsAtLeast().

+ Here is the call graph for this function:

◆ FillInBMInfo()

virtual void v8::internal::NegativeLookaheadChoiceNode::FillInBMInfo ( int  offset,
int  budget,
BoyerMooreLookahead bm,
bool  not_at_start 
)
inlinevirtual

Reimplemented from v8::internal::ChoiceNode.

Definition at line 1145 of file jsregexp.h.

1148  {
1149  alternatives_->at(1).node()->FillInBMInfo(
1150  offset, budget - 1, bm, not_at_start);
1151  if (offset == 0) set_bm_info(not_at_start, bm);
1152  }
void set_bm_info(bool not_at_start, BoyerMooreLookahead *bm)
Definition: jsregexp.h:676

References v8::internal::ChoiceNode::alternatives_, v8::internal::ChoiceNode::not_at_start(), and v8::internal::RegExpNode::set_bm_info().

+ Here is the call graph for this function:

◆ FilterOneByte()

RegExpNode * v8::internal::NegativeLookaheadChoiceNode::FilterOneByte ( int  depth,
bool  ignore_case 
)
virtual

Reimplemented from v8::internal::ChoiceNode.

Definition at line 2912 of file jsregexp.cc.

2913  {
2914  if (info()->replacement_calculated) return replacement();
2915  if (depth < 0) return this;
2916  if (info()->visited) return this;
2917  VisitMarker marker(info());
2918  // Alternative 0 is the negative lookahead, alternative 1 is what comes
2919  // afterwards.
2920  RegExpNode* node = alternatives_->at(1).node();
2921  RegExpNode* replacement = node->FilterOneByte(depth - 1, ignore_case);
2922  if (replacement == NULL) return set_replacement(NULL);
2923  alternatives_->at(1).set_node(replacement);
2924 
2925  RegExpNode* neg_node = alternatives_->at(0).node();
2926  RegExpNode* neg_replacement = neg_node->FilterOneByte(depth - 1, ignore_case);
2927  // If the negative lookahead is always going to fail then
2928  // we don't need to check it.
2929  if (neg_replacement == NULL) return set_replacement(replacement);
2930  alternatives_->at(0).set_node(neg_replacement);
2931  return set_replacement(this);
2932 }
RegExpNode * replacement()
Definition: jsregexp.h:636
RegExpNode * set_replacement(RegExpNode *replacement)
Definition: jsregexp.h:640
virtual RegExpNode * FilterOneByte(int depth, bool ignore_case)
Definition: jsregexp.h:632
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References v8::internal::RegExpNode::FilterOneByte(), and NULL.

+ Here is the call graph for this function:

◆ GetQuickCheckDetails()

void v8::internal::NegativeLookaheadChoiceNode::GetQuickCheckDetails ( QuickCheckDetails details,
RegExpCompiler compiler,
int  characters_filled_in,
bool  not_at_start 
)
virtual

Reimplemented from v8::internal::ChoiceNode.

Definition at line 2358 of file jsregexp.cc.

2362  {
2363  // Alternative 0 is the negative lookahead, alternative 1 is what comes
2364  // afterwards.
2365  RegExpNode* node = alternatives_->at(1).node();
2366  return node->GetQuickCheckDetails(details, compiler, filled_in, not_at_start);
2367 }

References v8::internal::RegExpNode::GetQuickCheckDetails().

+ Here is the call graph for this function:

◆ try_to_emit_quick_check_for_alternative()

virtual bool v8::internal::NegativeLookaheadChoiceNode::try_to_emit_quick_check_for_alternative ( bool  is_first)
inlinevirtual

Reimplemented from v8::internal::ChoiceNode.

Definition at line 1158 of file jsregexp.h.

1158  {
1159  return !is_first;
1160  }

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