Lines Matching refs:regexp

5 #include "src/regexp/regexp.h"
12 #include "src/objects/js-regexp-inl.h"
13 #include "src/regexp/experimental/experimental.h"
14 #include "src/regexp/regexp-bytecode-generator.h"
15 #include "src/regexp/regexp-bytecodes.h"
16 #include "src/regexp/regexp-compiler.h"
17 #include "src/regexp/regexp-dotprinter.h"
18 #include "src/regexp/regexp-interpreter.h"
19 #include "src/regexp/regexp-macro-assembler-arch.h"
20 #include "src/regexp/regexp-macro-assembler-tracer.h"
21 #include "src/regexp/regexp-parser.h"
22 #include "src/regexp/regexp-utils.h"
45 // This ensures that the regexp is compiled for the subject, and that
48 // as its "registers" argument. If the regexp cannot be compiled,
50 static int IrregexpPrepare(Isolate* isolate, Handle<JSRegExp> regexp,
57 static int AtomExecRaw(Isolate* isolate, Handle<JSRegExp> regexp,
61 static Handle<Object> AtomExec(Isolate* isolate, Handle<JSRegExp> regexp,
71 static int IrregexpExecRaw(Isolate* isolate, Handle<JSRegExp> regexp,
80 Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject,
153 bool RegExp::IsUnmodifiedRegExp(Isolate* isolate, Handle<JSRegExp> regexp) {
154 return RegExpUtils::IsUnmodifiedRegExp(isolate, regexp);
159 // Identifies the sort of regexps where the regexp engine is faster
173 // We declare a regexp low-alphabet if it has at least 3 times as many
233 // TODO(mbid): The error could provide a reason for why the regexp can't
266 // Compilation succeeded so the data is set on the regexp
303 Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject,
306 return ExperimentalRegExp::OneshotExec(isolate, regexp, subject, index,
311 MaybeHandle<Object> RegExp::Exec(Isolate* isolate, Handle<JSRegExp> regexp,
315 switch (regexp->type_tag()) {
319 return RegExpImpl::AtomExec(isolate, regexp, subject, index,
322 return RegExpImpl::IrregexpExec(isolate, regexp, subject, index,
325 return ExperimentalRegExp::Exec(isolate, regexp, subject, index,
354 int RegExpImpl::AtomExecRaw(Isolate* isolate, Handle<JSRegExp> regexp,
363 String needle = regexp->atom_pattern();
422 // Ensures that the regexp object contains a compiled version of the
436 // regexp after the decision to tier up has been made. If the tiering up
464 // representing an uncompiled regexp here. If we're using the tier-up
465 // strategy, entry can still be a smi representing an uncompiled regexp, when
466 // compiling the regexp before the tier-up, or it can contain a trampoline to
467 // the regexp interpreter, in which case the bytecode field contains compiled
468 // bytecode, when recompiling the regexp after the tier-up. If the
470 // representing an uncompiled regexp, even though we're "recompiling" after
551 // The compilation target is a kBytecode if we're interpreting all regexp
555 // native code for all regexp objects.
641 int RegExpImpl::IrregexpPrepare(Isolate* isolate, Handle<JSRegExp> regexp,
647 if (!RegExpImpl::EnsureCompiledIrregexp(isolate, regexp, subject,
654 return JSRegExp::RegistersForCaptureCount(regexp->capture_count());
657 int RegExpImpl::IrregexpExecRaw(Isolate* isolate, Handle<JSRegExp> regexp,
664 JSRegExp::RegistersForCaptureCount(regexp->capture_count()));
668 if (!regexp->ShouldProduceBytecode()) {
670 EnsureCompiledIrregexp(isolate, regexp, subject, is_one_byte);
671 // The stack is used to allocate registers for the compiled regexp code.
675 int res = NativeRegExpMacroAssembler::Match(regexp, subject, output,
698 DCHECK(regexp->ShouldProduceBytecode());
703 isolate, regexp, subject, output, output_size, index);
717 if (FLAG_regexp_tier_up) regexp->ResetLastTierUpTick();
719 EnsureCompiledIrregexp(isolate, regexp, subject, is_one_byte);
728 Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> subject,
731 DCHECK_EQ(regexp->type_tag(), JSRegExp::IRREGEXP);
736 if (FLAG_trace_regexp_bytecodes && regexp->ShouldProduceBytecode()) {
737 PrintF("\n\nRegexp match: /%s/\n\n", regexp->source().ToCString().get());
742 // For very long subject strings, the regexp interpreter is currently much
748 regexp->MarkTierUpForNextExec();
758 RegExpImpl::IrregexpPrepare(isolate, regexp, subject);
775 RegExpImpl::IrregexpExecRaw(isolate, regexp, subject, previous_index,
784 int capture_count = regexp->capture_count();
788 return ExperimentalRegExp::OneshotExec(isolate, regexp, subject,
804 // regexp, RegExpExecStub finds that the match info is too small, it restarts
812 // regexp fuzzer, where we pass our own custom RegExpMatchInfo to
814 // info and execute the regexp without side effects.
844 // would like to keep track of the amount of regexp code on the heap. This
846 // total regexp code compiled including code that has subsequently been freed
910 // Native regexp implementation.
954 // Interpreted regexp implementation.
1044 RegExpGlobalCache::RegExpGlobalCache(Handle<JSRegExp> regexp,
1048 regexp_(regexp),
1051 DCHECK(IsGlobal(JSRegExp::AsRegExpFlags(regexp->flags())));
1071 if (regexp->ShouldProduceBytecode()) {
1072 // Global loop in interpreted regexp is not implemented. We choose the
1083 if (!ExperimentalRegExp::IsCompiled(regexp, isolate_) &&
1084 !ExperimentalRegExp::Compile(isolate_, regexp)) {
1090 JSRegExp::RegistersForCaptureCount(regexp->capture_count());
1106 // to the compiled regexp.