v8
3.14.5(node0.10.28)
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, Zone *zone) |
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 109 of file jsregexp.h.
|
static |
Definition at line 256 of file jsregexp.cc.
References JSRegExp::ATOM.
Referenced by RegExpImpl::Compile().
|
static |
Definition at line 340 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 281 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::ToAsciiVector(), and String::FlatContent::ToUC16Vector().
Referenced by RegExpImpl::AtomExec(), and RegExpImpl::GlobalCache::FetchNext().
|
static |
Definition at line 168 of file jsregexp.cc.
References ASSERT, RegExpImpl::AtomCompile(), RegExpCompileData::capture_count, FixedArray::cast(), Isolate::compilation_cache(), RegExpAtom::data(), v8::internal::DELETE_ON_EXIT, 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(), RegExpParser::ParseRegExp(), CompilationCache::PutRegExp(), RegExpCompileData::simple, and RegExpCompileData::tree.
Referenced by v8::internal::RUNTIME_FUNCTION().
|
static |
Definition at line 66 of file jsregexp.cc.
References ARRAY_SIZE, and Execution::New().
Referenced by Execution::NewJSRegExp(), and v8::internal::RUNTIME_FUNCTION().
|
static |
Definition at line 232 of file jsregexp.cc.
References ASSERT, JSRegExp::ATOM, RegExpImpl::AtomExec(), JSRegExp::IRREGEXP, RegExpImpl::IrregexpExec(), Handle< T >::is_null(), Handle< T >::null(), and UNREACHABLE.
Referenced by v8::internal::RUNTIME_FUNCTION().
|
inlinestatic |
Definition at line 199 of file jsregexp.h.
References Smi::cast(), FixedArray::get(), and RegExpImpl::kFirstCapture.
|
inlinestatic |
Definition at line 219 of file jsregexp.h.
References Smi::cast(), FixedArray::get(), and RegExpImpl::kLastCaptureCount.
|
static |
Definition at line 504 of file jsregexp.cc.
References ByteArray::cast(), JSRegExp::code_index(), and FixedArray::get().
Referenced by RegExpImpl::IrregexpExecRaw().
|
static |
Definition at line 637 of file jsregexp.cc.
References ASSERT, ASSERT_EQ, FixedArray::cast(), Isolate::factory(), 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 550 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(), RegExpImpl::RE_EXCEPTION, RegExpImpl::RE_FAILURE, RegExpImpl::RE_SUCCESS, NativeRegExpMacroAssembler::RETRY, Isolate::StackOverflow(), v8::internal::STATIC_ASSERT(), NativeRegExpMacroAssembler::SUCCESS, and UNREACHABLE.
Referenced by RegExpImpl::GlobalCache::FetchNext(), and RegExpImpl::IrregexpExec().
|
static |
Definition at line 514 of file jsregexp.cc.
References JSRegExp::IRREGEXP.
Referenced by RegExpImpl::Compile().
|
static |
Definition at line 483 of file jsregexp.cc.
References Smi::cast(), FixedArray::get(), and JSRegExp::kIrregexpMaxRegisterCountIndex.
|
static |
Definition at line 509 of file jsregexp.cc.
References Code::cast(), JSRegExp::code_index(), and FixedArray::get().
Referenced by RegExpImpl::IrregexpExecRaw().
|
static |
Definition at line 494 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 499 of file jsregexp.cc.
References Smi::cast(), FixedArray::get(), and JSRegExp::kIrregexpMaxRegisterCountIndex.
Referenced by RegExpImpl::IrregexpExecRaw(), and RegExpImpl::IrregexpPrepare().
Definition at line 527 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 215 of file jsregexp.h.
References Smi::FromInt(), RegExpImpl::kFirstCapture, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
static |
Definition at line 489 of file jsregexp.cc.
References Smi::FromInt(), JSRegExp::kIrregexpMaxRegisterCountIndex, and FixedArray::set().
|
inlinestatic |
Definition at line 203 of file jsregexp.h.
References Smi::FromInt(), RegExpImpl::kLastCaptureCount, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
inlinestatic |
Definition at line 211 of file jsregexp.h.
References RegExpImpl::kLastInput, and FixedArray::set().
Referenced by RegExpImpl::SetLastMatchInfo().
|
static |
Definition at line 685 of file jsregexp.cc.
References FixedArray::cast(), 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 207 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 185 of file jsregexp.h.
Referenced by RegExpImpl::GetCapture(), and RegExpImpl::SetCapture().
|
static |
Definition at line 195 of file jsregexp.h.
|
static |
Definition at line 182 of file jsregexp.h.
Referenced by RegExpImpl::GetLastCaptureCount(), and RegExpImpl::SetLastCaptureCount().
|
static |
Definition at line 189 of file jsregexp.h.
|
static |
Definition at line 184 of file jsregexp.h.
Referenced by RegExpImpl::SetLastInput().
|
static |
Definition at line 193 of file jsregexp.h.
|
static |
Definition at line 186 of file jsregexp.h.
Referenced by RegExpImpl::SetLastMatchInfo().
|
static |
Definition at line 183 of file jsregexp.h.
Referenced by RegExpImpl::SetLastSubject().
|
static |
Definition at line 191 of file jsregexp.h.
|
static |
Definition at line 236 of file jsregexp.h.
Referenced by RegExpCompiler::Assemble().
|
static |
Definition at line 237 of file jsregexp.h.
Referenced by RegExpCompiler::Assemble().