V8 Project
v8::internal::IrregexpInterpreter Class Reference

#include <interpreter-irregexp.h>

+ Collaboration diagram for v8::internal::IrregexpInterpreter:

Static Public Member Functions

static RegExpImpl::IrregexpResult Match (Isolate *isolate, Handle< ByteArray > code, Handle< String > subject, int *captures, int start_position)
 

Detailed Description

Definition at line 14 of file interpreter-irregexp.h.

Member Function Documentation

◆ Match()

RegExpImpl::IrregexpResult v8::internal::IrregexpInterpreter::Match ( Isolate isolate,
Handle< ByteArray code,
Handle< String subject,
int captures,
int  start_position 
)
static

Definition at line 575 of file interpreter-irregexp.cc.

580  {
581  DCHECK(subject->IsFlat());
582 
584  const byte* code_base = code_array->GetDataStartAddress();
585  uc16 previous_char = '\n';
586  String::FlatContent subject_content = subject->GetFlatContent();
587  if (subject_content.IsOneByte()) {
588  Vector<const uint8_t> subject_vector = subject_content.ToOneByteVector();
589  if (start_position != 0) previous_char = subject_vector[start_position - 1];
590  return RawMatch(isolate,
591  code_base,
592  subject_vector,
593  registers,
594  start_position,
595  previous_char);
596  } else {
597  DCHECK(subject_content.IsTwoByte());
598  Vector<const uc16> subject_vector = subject_content.ToUC16Vector();
599  if (start_position != 0) previous_char = subject_vector[start_position - 1];
600  return RawMatch(isolate,
601  code_base,
602  subject_vector,
603  registers,
604  start_position,
605  previous_char);
606  }
607 }
#define DCHECK(condition)
Definition: logging.h:205
static RegExpImpl::IrregexpResult RawMatch(Isolate *isolate, const byte *code_base, Vector< const Char > subject, int *registers, int current, uint32_t current_char)
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
uint16_t uc16
Definition: globals.h:184

References DCHECK, v8::internal::String::FlatContent::IsOneByte(), v8::internal::String::FlatContent::IsTwoByte(), v8::internal::RawMatch(), v8::internal::String::FlatContent::ToOneByteVector(), and v8::internal::String::FlatContent::ToUC16Vector().

Referenced by v8::internal::RegExpImpl::IrregexpExecRaw().

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

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