V8 Project
v8::internal::NegativeSubmatchSuccess Class Reference

#include <jsregexp.h>

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

Public Member Functions

 NegativeSubmatchSuccess (int stack_pointer_reg, int position_reg, int clear_capture_count, int clear_capture_start, Zone *zone)
 
virtual void Emit (RegExpCompiler *compiler, Trace *trace)
 
- Public Member Functions inherited from v8::internal::EndNode
 EndNode (Action action, Zone *zone)
 
virtual void Accept (NodeVisitor *visitor)
 
virtual int EatsAtLeast (int still_to_find, int recursion_depth, 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)
 
- 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)
 
virtual RegExpNodeFilterOneByte (int depth, bool ignore_case)
 
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)
 

Private Attributes

int stack_pointer_register_
 
int current_position_register_
 
int clear_capture_count_
 
int clear_capture_start_
 

Additional Inherited Members

- Public Types inherited from v8::internal::EndNode
enum  Action { ACCEPT , BACKTRACK , NEGATIVE_SUBMATCH_SUCCESS }
 
- 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::RegExpNode
LimitResult LimitVersions (RegExpCompiler *compiler, Trace *trace)
 
void set_bm_info (bool not_at_start, BoyerMooreLookahead *bm)
 
- Protected Attributes inherited from v8::internal::RegExpNode
RegExpNodereplacement_
 

Detailed Description

Definition at line 994 of file jsregexp.h.

Constructor & Destructor Documentation

◆ NegativeSubmatchSuccess()

v8::internal::NegativeSubmatchSuccess::NegativeSubmatchSuccess ( int  stack_pointer_reg,
int  position_reg,
int  clear_capture_count,
int  clear_capture_start,
Zone zone 
)
inline

Definition at line 996 of file jsregexp.h.

1002  stack_pointer_register_(stack_pointer_reg),
1003  current_position_register_(position_reg),
1004  clear_capture_count_(clear_capture_count),
1005  clear_capture_start_(clear_capture_start) { }
EndNode(Action action, Zone *zone)
Definition: jsregexp.h:967
Zone * zone() const
Definition: jsregexp.h:668

Member Function Documentation

◆ Emit()

void v8::internal::NegativeSubmatchSuccess::Emit ( RegExpCompiler compiler,
Trace trace 
)
virtual

Reimplemented from v8::internal::EndNode.

Definition at line 1414 of file jsregexp.cc.

1414  {
1415  RegExpMacroAssembler* assembler = compiler->macro_assembler();
1416 
1417  // Omit flushing the trace. We discard the entire stack frame anyway.
1418 
1419  if (!label()->is_bound()) {
1420  // We are completely independent of the trace, since we ignore it,
1421  // so this code can be used as the generic version.
1422  assembler->Bind(label());
1423  }
1424 
1425  // Throw away everything on the backtrack stack since the start
1426  // of the negative submatch and restore the character position.
1427  assembler->ReadCurrentPositionFromRegister(current_position_register_);
1428  assembler->ReadStackPointerFromRegister(stack_pointer_register_);
1429  if (clear_capture_count_ > 0) {
1430  // Clear any captures that might have been performed during the success
1431  // of the body of the negative look-ahead.
1432  int clear_capture_end = clear_capture_start_ + clear_capture_count_ - 1;
1433  assembler->ClearRegisters(clear_capture_start_, clear_capture_end);
1434  }
1435  // Now that we have unwound the stack we find at the top of the stack the
1436  // backtrack that the BeginSubmatch node got.
1437  assembler->Backtrack();
1438 }

References v8::internal::RegExpMacroAssembler::Backtrack(), v8::internal::RegExpMacroAssembler::Bind(), v8::internal::RegExpMacroAssembler::ClearRegisters(), v8::internal::RegExpCompiler::macro_assembler(), v8::internal::RegExpMacroAssembler::ReadCurrentPositionFromRegister(), and v8::internal::RegExpMacroAssembler::ReadStackPointerFromRegister().

+ Here is the call graph for this function:

Member Data Documentation

◆ clear_capture_count_

int v8::internal::NegativeSubmatchSuccess::clear_capture_count_
private

Definition at line 1011 of file jsregexp.h.

◆ clear_capture_start_

int v8::internal::NegativeSubmatchSuccess::clear_capture_start_
private

Definition at line 1012 of file jsregexp.h.

◆ current_position_register_

int v8::internal::NegativeSubmatchSuccess::current_position_register_
private

Definition at line 1010 of file jsregexp.h.

◆ stack_pointer_register_

int v8::internal::NegativeSubmatchSuccess::stack_pointer_register_
private

Definition at line 1009 of file jsregexp.h.


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