v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <jsregexp.h>
Data Structures | |
class | GlobalCache |
Public Types | |
enum | IrregexpResult { RE_FAILURE = 0, RE_SUCCESS = 1, RE_EXCEPTION = -1 } |
Static Public Member Functions | |
static bool | UsesNativeRegExp () |
static Handle< Object > | CreateRegExpLiteral (Handle< JSFunction > constructor, Handle< String > pattern, Handle< String > flags, bool *has_pending_exception) |
static Handle< String > | ToString (Handle< Object > value) |
static Handle< Object > | Compile (Handle< JSRegExp > re, Handle< String > pattern, Handle< String > flags) |
static Handle< Object > | Exec (Handle< JSRegExp > regexp, Handle< String > subject, int index, Handle< JSArray > lastMatchInfo) |
static void | IrregexpInitialize (Handle< JSRegExp > re, Handle< String > pattern, JSRegExp::Flags flags, int capture_register_count) |
static void | AtomCompile (Handle< JSRegExp > re, Handle< String > pattern, JSRegExp::Flags flags, Handle< String > match_pattern) |
static int | AtomExecRaw (Handle< JSRegExp > regexp, Handle< String > subject, int index, int32_t *output, int output_size) |
static Handle< Object > | AtomExec (Handle< JSRegExp > regexp, Handle< String > subject, int index, Handle< JSArray > lastMatchInfo) |
static int | IrregexpPrepare (Handle< JSRegExp > regexp, Handle< String > subject) |
static int | IrregexpExecRaw (Handle< JSRegExp > regexp, Handle< String > subject, int index, int32_t *output, int output_size) |
static Handle< Object > | IrregexpExec (Handle< JSRegExp > regexp, Handle< String > subject, int index, Handle< JSArray > lastMatchInfo) |
static Handle< JSArray > | SetLastMatchInfo (Handle< JSArray > last_match_info, Handle< String > subject, int capture_count, int32_t *match) |
static int | GetCapture (FixedArray *array, int index) |
static void | SetLastCaptureCount (FixedArray *array, int to) |
static void | SetLastSubject (FixedArray *array, String *to) |
static void | SetLastInput (FixedArray *array, String *to) |
static void | SetCapture (FixedArray *array, int index, int to) |
static int | GetLastCaptureCount (FixedArray *array) |
static int | IrregexpMaxRegisterCount (FixedArray *re) |
static void | SetIrregexpMaxRegisterCount (FixedArray *re, int value) |
static int | IrregexpNumberOfCaptures (FixedArray *re) |
static int | IrregexpNumberOfRegisters (FixedArray *re) |
static ByteArray * | IrregexpByteCode (FixedArray *re, bool is_ascii) |
static Code * | IrregexpNativeCode (FixedArray *re, bool is_ascii) |
Static Public Attributes | |
static const int | kLastCaptureCount = 0 |
static const int | kLastSubject = 1 |
static const int | kLastInput = 2 |
static const int | kFirstCapture = 3 |
static const int | kLastMatchOverhead = 3 |
static const int | kLastCaptureCountOffset |
static const int | kLastSubjectOffset |
static const int | kLastInputOffset |
static const int | kFirstCaptureOffset |
static const int | kRegExpExecutableMemoryLimit = 16 * MB |
static const int | kRegWxpCompiledLimit = 1 * MB |
Definition at line 45 of file jsregexp.h.
enum IrregexpResult |
Enumerator | |
---|---|
RE_FAILURE | |
RE_SUCCESS | |
RE_EXCEPTION |
Definition at line 108 of file jsregexp.h.
|
static |
Definition at line 258 of file jsregexp.cc.
References JSRegExp::ATOM.
Referenced by RegExpImpl::Compile().
|
static |
Definition at line 342 of file jsregexp.cc.
References ASSERT_EQ, RegExpImpl::AtomExecRaw(), FixedArray::cast(), Isolate::factory(), Isolate::kJSRegexpStaticOffsetsVectorSize, v8::internal::kNumRegisters, RegExpImpl::RE_FAILURE, RegExpImpl::RE_SUCCESS, and v8::internal::STATIC_ASSERT().
Referenced by RegExpImpl::Exec().
|
static |
Definition at line 283 of file jsregexp.cc.
References ASSERT, ASSERT_LT, String::cast(), v8::internal::FlattenString(), String::GetFlatContent(), String::FlatContent::IsAscii(), String::FlatContent::IsFlat(), String::IsFlat(), JSRegExp::kAtomPatternIndex, String::length(), RegExpImpl::RE_FAILURE, v8::internal::SearchString(), String::FlatContent::ToOneByteVector(), and String::FlatContent::ToUC16Vector().
Referenced by RegExpImpl::AtomExec().
|
static |
Definition at line 171 of file jsregexp.cc.
References ASSERT, RegExpImpl::AtomCompile(), RegExpCompileData::capture_count, FixedArray::cast(), Isolate::compilation_cache(), RegExpCompileData::error, Isolate::factory(), v8::internal::FlattenGetString(), RegExpImpl::IrregexpInitialize(), JSRegExp::Flags::is_ignore_case(), JSRegExp::Flags::is_multiline(), Handle< T >::is_null(), LOG, CompilationCache::LookupRegExp(), Factory::NewStringFromTwoByte(), Handle< T >::null(), CompilationCache::PutRegExp(), RegExpCompileData::simple, and RegExpCompileData::tree.
Referenced by v8::internal::RUNTIME_FUNCTION().
|
static |
Definition at line 69 of file jsregexp.cc.
References ARRAY_SIZE, and Execution::New().
Referenced by Execution::NewJSRegExp(), and v8::internal::RUNTIME_FUNCTION().
|
static |
Definition at line 234 of file jsregexp.cc.
References ASSERT, JSRegExp::ATOM, RegExpImpl::AtomExec(), JSRegExp::IRREGEXP, RegExpImpl::IrregexpExec(), Handle< T >::null(), and UNREACHABLE.
Referenced by v8::internal::RUNTIME_FUNCTION().
|
inlinestatic |
Definition at line 198 of file jsregexp.h.
References Smi::cast(), FixedArray::get(), and RegExpImpl::kFirstCapture.
|
inlinestatic |
Definition at line 218 of file jsregexp.h.
References Smi::cast(), FixedArray::get(), and RegExpImpl::kLastCaptureCount.
|
static |
Definition at line 506 of file jsregexp.cc.
References ByteArray::cast(), JSRegExp::code_index(), and FixedArray::get().
Referenced by RegExpImpl::IrregexpExecRaw().
|
static |
Definition at line 640 of file jsregexp.cc.
References ASSERT, ASSERT_EQ, FixedArray::cast(), Isolate::factory(), SmartPointerBase< Deallocator, T >::get(), Isolate::has_pending_exception(), JSRegExp::IRREGEXP, RegExpImpl::IrregexpExecRaw(), RegExpImpl::IrregexpNumberOfCaptures(), RegExpImpl::IrregexpPrepare(), Isolate::kJSRegexpStaticOffsetsVectorSize, Handle< T >::null(), v8::internal::NULL, v8::internal::PrintF(), RegExpImpl::RE_EXCEPTION, RegExpImpl::RE_FAILURE, RegExpImpl::RE_SUCCESS, RegExpImpl::SetLastMatchInfo(), and String::ToCString().
Referenced by RegExpImpl::Exec().
|
static |
Definition at line 552 of file jsregexp.cc.
References ASSERT, FixedArray::cast(), v8::internal::code(), NativeRegExpMacroAssembler::EXCEPTION, NativeRegExpMacroAssembler::FAILURE, Isolate::has_pending_exception(), RegExpImpl::IrregexpByteCode(), RegExpImpl::IrregexpNativeCode(), RegExpImpl::IrregexpNumberOfCaptures(), RegExpImpl::IrregexpNumberOfRegisters(), RegExpImpl::IrregexpPrepare(), IrregexpInterpreter::Match(), NativeRegExpMacroAssembler::Match(), OS::MemCopy(), RegExpImpl::RE_EXCEPTION, RegExpImpl::RE_FAILURE, RegExpImpl::RE_SUCCESS, NativeRegExpMacroAssembler::RETRY, Isolate::StackOverflow(), v8::internal::STATIC_ASSERT(), NativeRegExpMacroAssembler::SUCCESS, and UNREACHABLE.
Referenced by RegExpImpl::IrregexpExec().
|
static |
Definition at line 516 of file jsregexp.cc.
References JSRegExp::IRREGEXP.
Referenced by RegExpImpl::Compile().
|
static |
Definition at line 485 of file jsregexp.cc.
References Smi::cast(), FixedArray::get(), and JSRegExp::kIrregexpMaxRegisterCountIndex.
|
static |
Definition at line 511 of file jsregexp.cc.
References Code::cast(), JSRegExp::code_index(), and FixedArray::get().
Referenced by RegExpImpl::IrregexpExecRaw().
|
static |
Definition at line 496 of file jsregexp.cc.
References Smi::cast(), FixedArray::get(), and JSRegExp::kIrregexpCaptureCountIndex.
Referenced by RegExpImpl::IrregexpExec(), RegExpImpl::IrregexpExecRaw(), and RegExpImpl::IrregexpPrepare().
|
static |
Definition at line 501 of file jsregexp.cc.
References Smi::cast(), FixedArray::get(), and JSRegExp::kIrregexpMaxRegisterCountIndex.
Referenced by RegExpImpl::IrregexpExecRaw(), and RegExpImpl::IrregexpPrepare().
Definition at line 529 of file jsregexp.cc.
References FixedArray::cast(), v8::internal::FlattenString(), RegExpImpl::IrregexpNumberOfCaptures(), and RegExpImpl::IrregexpNumberOfRegisters().
Referenced by RegExpImpl::GlobalCache::GlobalCache(), RegExpImpl::IrregexpExec(), and RegExpImpl::IrregexpExecRaw().
|
inlinestatic |
Definition at line 214 of file jsregexp.h.
References Smi::FromInt(), RegExpImpl::kFirstCapture, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
static |
Definition at line 491 of file jsregexp.cc.
References Smi::FromInt(), JSRegExp::kIrregexpMaxRegisterCountIndex, and FixedArray::set().
|
inlinestatic |
Definition at line 202 of file jsregexp.h.
References Smi::FromInt(), RegExpImpl::kLastCaptureCount, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
inlinestatic |
Definition at line 210 of file jsregexp.h.
References RegExpImpl::kLastInput, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
static |
Definition at line 688 of file jsregexp.cc.
References ASSERT, FixedArray::cast(), JSArray::EnsureSize(), RegExpImpl::kLastMatchOverhead, v8::internal::NULL, RegExpImpl::SetCapture(), RegExpImpl::SetLastCaptureCount(), RegExpImpl::SetLastInput(), and RegExpImpl::SetLastSubject().
Referenced by RegExpImpl::IrregexpExec(), and v8::internal::RUNTIME_FUNCTION().
|
inlinestatic |
Definition at line 206 of file jsregexp.h.
References RegExpImpl::kLastSubject, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
inlinestatic |
Definition at line 48 of file jsregexp.h.
|
static |
Definition at line 184 of file jsregexp.h.
Referenced by RegExpImpl::GetCapture(), and RegExpImpl::SetCapture().
|
static |
Definition at line 194 of file jsregexp.h.
|
static |
Definition at line 181 of file jsregexp.h.
Referenced by RegExpImpl::GetLastCaptureCount(), and RegExpImpl::SetLastCaptureCount().
|
static |
Definition at line 188 of file jsregexp.h.
|
static |
Definition at line 183 of file jsregexp.h.
Referenced by RegExpImpl::SetLastInput().
|
static |
Definition at line 192 of file jsregexp.h.
|
static |
Definition at line 185 of file jsregexp.h.
Referenced by RegExpImpl::SetLastMatchInfo().
|
static |
Definition at line 182 of file jsregexp.h.
Referenced by RegExpImpl::SetLastSubject().
|
static |
Definition at line 190 of file jsregexp.h.
|
static |
Definition at line 235 of file jsregexp.h.
Referenced by RegExpCompiler::Assemble().
|
static |
Definition at line 236 of file jsregexp.h.
Referenced by RegExpCompiler::Assemble().