v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::RegExp Class Referencefinal

#include <regexp.h>

Inheritance diagram for v8::internal::RegExp:
Collaboration diagram for v8::internal::RegExp:

Public Types

enum  CallOrigin : int { kFromRuntime = 0 , kFromJs = 1 }
 
enum  IrregexpResult : int32_t {
  RE_FAILURE = kInternalRegExpFailure , RE_SUCCESS = kInternalRegExpSuccess , RE_EXCEPTION = kInternalRegExpException , RE_RETRY = kInternalRegExpRetry ,
  RE_FALLBACK_TO_EXPERIMENTAL = kInternalRegExpFallbackToExperimental
}
 

Static Public Member Functions

static bool CanGenerateBytecode ()
 
static V8_EXPORT_PRIVATE bool VerifyFlags (RegExpFlags flags)
 
template<class CharT >
static bool VerifySyntax (Zone *zone, uintptr_t stack_limit, const CharT *input, int input_length, RegExpFlags flags, RegExpError *regexp_error_out, const DisallowGarbageCollection &no_gc)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectCompile (Isolate *isolate, DirectHandle< JSRegExp > re, DirectHandle< String > pattern, RegExpFlags flags, uint32_t backtrack_limit)
 
static V8_WARN_UNUSED_RESULT bool EnsureFullyCompiled (Isolate *isolate, DirectHandle< RegExpData > re_data, DirectHandle< String > subject)
 
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT std::optional< int > Exec (Isolate *isolate, DirectHandle< JSRegExp > regexp, DirectHandle< String > subject, int index, int32_t *result_offsets_vector, uint32_t result_offsets_vector_length)
 
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectExec_Single (Isolate *isolate, DirectHandle< JSRegExp > regexp, DirectHandle< String > subject, int index, DirectHandle< RegExpMatchInfo > last_match_info)
 
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT std::optional< int > ExperimentalOneshotExec (Isolate *isolate, DirectHandle< JSRegExp > regexp, DirectHandle< String > subject, int index, int32_t *result_offsets_vector, uint32_t result_offsets_vector_length)
 
static V8_EXPORT_PRIVATE intptr_t AtomExecRaw (Isolate *isolate, Address data_address, Address subject_address, int32_t index, int32_t *result_offsets_vector, int32_t result_offsets_vector_length)
 
static DirectHandle< RegExpMatchInfoSetLastMatchInfo (Isolate *isolate, DirectHandle< RegExpMatchInfo > last_match_info, DirectHandle< String > subject, int capture_count, int32_t *match)
 
static V8_EXPORT_PRIVATE bool CompileForTesting (Isolate *isolate, Zone *zone, RegExpCompileData *input, RegExpFlags flags, DirectHandle< String > pattern, DirectHandle< String > sample_subject, bool is_one_byte)
 
static V8_EXPORT_PRIVATE void DotPrintForTesting (const char *label, RegExpNode *node)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectThrowRegExpException (Isolate *isolate, RegExpFlags flags, DirectHandle< String > pattern, RegExpError error)
 
static void ThrowRegExpException (Isolate *isolate, DirectHandle< RegExpData > re_data, RegExpError error_text)
 
static bool IsUnmodifiedRegExp (Isolate *isolate, DirectHandle< JSRegExp > regexp)
 
static DirectHandle< FixedArrayCreateCaptureNameMap (Isolate *isolate, ZoneVector< RegExpCapture * > *named_captures)
 

Static Public Attributes

static constexpr int kInternalRegExpFailure = 0
 
static constexpr int kInternalRegExpSuccess = 1
 
static constexpr int kInternalRegExpException = -1
 
static constexpr int kInternalRegExpRetry = -2
 
static constexpr int kInternalRegExpFallbackToExperimental = -3
 
static constexpr int kInternalRegExpSmallestResult = -3
 
static const int kRegExpTooLargeToOptimize = 20 * KB
 

Detailed Description

Definition at line 72 of file regexp.h.

Member Enumeration Documentation

◆ CallOrigin

Enumerator
kFromRuntime 
kFromJs 

Definition at line 103 of file regexp.h.

◆ IrregexpResult

Enumerator
RE_FAILURE 
RE_SUCCESS 
RE_EXCEPTION 
RE_RETRY 
RE_FALLBACK_TO_EXPERIMENTAL 

Definition at line 141 of file regexp.h.

Member Function Documentation

◆ AtomExecRaw()

intptr_t v8::internal::RegExp::AtomExecRaw ( Isolate * isolate,
Address data_address,
Address subject_address,
int32_t index,
int32_t * result_offsets_vector,
int32_t result_offsets_vector_length )
static

Definition at line 492 of file regexp.cc.

Here is the call graph for this function:

◆ CanGenerateBytecode()

bool v8::internal::RegExp::CanGenerateBytecode ( )
static

Definition at line 112 of file regexp.cc.

◆ Compile()

MaybeDirectHandle< Object > v8::internal::RegExp::Compile ( Isolate * isolate,
DirectHandle< JSRegExp > re,
DirectHandle< String > pattern,
RegExpFlags flags,
uint32_t backtrack_limit )
static

Definition at line 200 of file regexp.cc.

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

◆ CompileForTesting()

bool v8::internal::RegExp::CompileForTesting ( Isolate * isolate,
Zone * zone,
RegExpCompileData * input,
RegExpFlags flags,
DirectHandle< String > pattern,
DirectHandle< String > sample_subject,
bool is_one_byte )
static

Definition at line 952 of file regexp.cc.

Here is the call graph for this function:

◆ CreateCaptureNameMap()

DirectHandle< FixedArray > v8::internal::RegExp::CreateCaptureNameMap ( Isolate * isolate,
ZoneVector< RegExpCapture * > * named_captures )
static

Definition at line 588 of file regexp.cc.

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

◆ DotPrintForTesting()

void v8::internal::RegExp::DotPrintForTesting ( const char * label,
RegExpNode * node )
static

Definition at line 926 of file regexp.cc.

Here is the call graph for this function:

◆ EnsureFullyCompiled()

bool v8::internal::RegExp::EnsureFullyCompiled ( Isolate * isolate,
DirectHandle< RegExpData > re_data,
DirectHandle< String > subject )
static

Definition at line 294 of file regexp.cc.

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

◆ Exec()

std::optional< int > v8::internal::RegExp::Exec ( Isolate * isolate,
DirectHandle< JSRegExp > regexp,
DirectHandle< String > subject,
int index,
int32_t * result_offsets_vector,
uint32_t result_offsets_vector_length )
static

Definition at line 332 of file regexp.cc.

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

◆ Exec_Single()

MaybeDirectHandle< Object > v8::internal::RegExp::Exec_Single ( Isolate * isolate,
DirectHandle< JSRegExp > regexp,
DirectHandle< String > subject,
int index,
DirectHandle< RegExpMatchInfo > last_match_info )
static

Definition at line 358 of file regexp.cc.

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

◆ ExperimentalOneshotExec()

std::optional< int > v8::internal::RegExp::ExperimentalOneshotExec ( Isolate * isolate,
DirectHandle< JSRegExp > regexp,
DirectHandle< String > subject,
int index,
int32_t * result_offsets_vector,
uint32_t result_offsets_vector_length )
static

Definition at line 320 of file regexp.cc.

Here is the call graph for this function:

◆ IsUnmodifiedRegExp()

bool v8::internal::RegExp::IsUnmodifiedRegExp ( Isolate * isolate,
DirectHandle< JSRegExp > regexp )
static

Definition at line 166 of file regexp.cc.

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

◆ SetLastMatchInfo()

DirectHandle< RegExpMatchInfo > v8::internal::RegExp::SetLastMatchInfo ( Isolate * isolate,
DirectHandle< RegExpMatchInfo > last_match_info,
DirectHandle< String > subject,
int capture_count,
int32_t * match )
static

Definition at line 896 of file regexp.cc.

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

◆ ThrowRegExpException() [1/2]

void v8::internal::RegExp::ThrowRegExpException ( Isolate * isolate,
DirectHandle< RegExpData > re_data,
RegExpError error_text )
static

Definition at line 158 of file regexp.cc.

Here is the call graph for this function:

◆ ThrowRegExpException() [2/2]

MaybeDirectHandle< Object > v8::internal::RegExp::ThrowRegExpException ( Isolate * isolate,
RegExpFlags flags,
DirectHandle< String > pattern,
RegExpError error )
static

Definition at line 143 of file regexp.cc.

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

◆ VerifyFlags()

bool v8::internal::RegExp::VerifyFlags ( RegExpFlags flags)
static

Definition at line 117 of file regexp.cc.

Here is the caller graph for this function:

◆ VerifySyntax()

template<class CharT >
template bool v8::internal::RegExp::VerifySyntax< uint8_t > ( Zone * zone,
uintptr_t stack_limit,
const CharT * input,
int input_length,
RegExpFlags flags,
RegExpError * regexp_error_out,
const DisallowGarbageCollection & no_gc )
static

Definition at line 124 of file regexp.cc.

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

Member Data Documentation

◆ kInternalRegExpException

int v8::internal::RegExp::kInternalRegExpException = -1
staticconstexpr

Definition at line 136 of file regexp.h.

◆ kInternalRegExpFailure

int v8::internal::RegExp::kInternalRegExpFailure = 0
staticconstexpr

Definition at line 134 of file regexp.h.

◆ kInternalRegExpFallbackToExperimental

int v8::internal::RegExp::kInternalRegExpFallbackToExperimental = -3
staticconstexpr

Definition at line 138 of file regexp.h.

◆ kInternalRegExpRetry

int v8::internal::RegExp::kInternalRegExpRetry = -2
staticconstexpr

Definition at line 137 of file regexp.h.

◆ kInternalRegExpSmallestResult

int v8::internal::RegExp::kInternalRegExpSmallestResult = -3
staticconstexpr

Definition at line 139 of file regexp.h.

◆ kInternalRegExpSuccess

int v8::internal::RegExp::kInternalRegExpSuccess = 1
staticconstexpr

Definition at line 135 of file regexp.h.

◆ kRegExpTooLargeToOptimize

const int v8::internal::RegExp::kRegExpTooLargeToOptimize = 20 * KB
static

Definition at line 163 of file regexp.h.


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