Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/regexp/regexp-compiler.h')
-rw-r--r--deps/v8/src/regexp/regexp-compiler.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/deps/v8/src/regexp/regexp-compiler.h b/deps/v8/src/regexp/regexp-compiler.h
index d083d5d9dd9..a35ffcd01a2 100644
--- a/deps/v8/src/regexp/regexp-compiler.h
+++ b/deps/v8/src/regexp/regexp-compiler.h
@@ -501,7 +501,7 @@ class RegExpCompiler {
struct CompilationResult final {
explicit CompilationResult(RegExpError err) : error(err) {}
- CompilationResult(Object code, int registers)
+ CompilationResult(Handle<Object> code, int registers)
: code(code), num_registers(registers) {}
static CompilationResult RegExpTooBig() {
@@ -511,7 +511,7 @@ class RegExpCompiler {
bool Succeeded() const { return error == RegExpError::kNone; }
const RegExpError error = RegExpError::kNone;
- Object code;
+ Handle<Object> code;
int num_registers = 0;
};
@@ -519,11 +519,19 @@ class RegExpCompiler {
RegExpNode* start, int capture_count,
Handle<String> pattern);
+ // Preprocessing is the final step of node creation before analysis
+ // and assembly. It includes:
+ // - Wrapping the body of the regexp in capture 0.
+ // - Inserting the implicit .* before/after the regexp if necessary.
+ // - If the input is a one-byte string, filtering out nodes that can't match.
+ // - Fixing up regexp matches that start within a surrogate pair.
+ RegExpNode* PreprocessRegExp(RegExpCompileData* data, JSRegExp::Flags flags,
+ bool is_one_byte);
+
// If the regexp matching starts within a surrogate pair, step back to the
// lead surrogate and start matching from there.
- static RegExpNode* OptionallyStepBackToLeadSurrogate(RegExpCompiler* compiler,
- RegExpNode* on_success,
- JSRegExp::Flags flags);
+ RegExpNode* OptionallyStepBackToLeadSurrogate(RegExpNode* on_success,
+ JSRegExp::Flags flags);
inline void AddWork(RegExpNode* node) {
if (!node->on_work_list() && !node->label()->is_bound()) {