diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-12-04 08:20:37 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-12-06 15:23:33 +0100 |
commit | 9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3 (patch) | |
tree | 2b0c843168dafb939d8df8a15b2aa72b76dee51d /deps/v8/src/regexp/jsregexp.h | |
parent | b8fbe69db1292307adb2c2b2e0d5ef48c4ab2faf (diff) | |
download | android-node-v8-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.tar.gz android-node-v8-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.tar.bz2 android-node-v8-9b4bf7de6c9a7c25f116c7a502384c20b5cfaea3.zip |
deps: update V8 to 7.1.302.28
PR-URL: https://github.com/nodejs/node/pull/23423
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/regexp/jsregexp.h')
-rw-r--r-- | deps/v8/src/regexp/jsregexp.h | 179 |
1 files changed, 86 insertions, 93 deletions
diff --git a/deps/v8/src/regexp/jsregexp.h b/deps/v8/src/regexp/jsregexp.h index fd2a90521d..ee9d167aa2 100644 --- a/deps/v8/src/regexp/jsregexp.h +++ b/deps/v8/src/regexp/jsregexp.h @@ -592,9 +592,9 @@ class SeqRegExpNode: public RegExpNode { : RegExpNode(on_success->zone()), on_success_(on_success) { } RegExpNode* on_success() { return on_success_; } void set_on_success(RegExpNode* node) { on_success_ = node; } - virtual RegExpNode* FilterOneByte(int depth); - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start) { + RegExpNode* FilterOneByte(int depth) override; + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override { on_success_->FillInBMInfo(isolate, offset, budget - 1, bm, not_at_start); if (offset == 0) set_bm_info(not_at_start, bm); } @@ -636,21 +636,22 @@ class ActionNode: public SeqRegExpNode { int repetition_register, int repetition_limit, RegExpNode* on_success); - virtual void Accept(NodeVisitor* visitor); - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int filled_in, - bool not_at_start) { + void Accept(NodeVisitor* visitor) override; + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int budget, bool not_at_start) override; + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int filled_in, + bool not_at_start) override { return on_success()->GetQuickCheckDetails( details, compiler, filled_in, not_at_start); } - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start); + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override; ActionType action_type() { return action_type_; } // TODO(erikcorry): We should allow some action nodes in greedy loops. - virtual int GreedyLoopTextLength() { return kNodeIsTooComplexForGreedyLoops; } + int GreedyLoopTextLength() override { + return kNodeIsTooComplexForGreedyLoops; + } private: union { @@ -714,23 +715,22 @@ class TextNode: public SeqRegExpNode { bool read_backward, RegExpNode* on_success, JSRegExp::Flags flags); - virtual void Accept(NodeVisitor* visitor); - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int characters_filled_in, - bool not_at_start); + void Accept(NodeVisitor* visitor) override; + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int budget, bool not_at_start) override; + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int characters_filled_in, + bool not_at_start) override; ZoneList<TextElement>* elements() { return elms_; } bool read_backward() { return read_backward_; } void MakeCaseIndependent(Isolate* isolate, bool is_one_byte); - virtual int GreedyLoopTextLength(); - virtual RegExpNode* GetSuccessorOfOmnivorousTextNode( - RegExpCompiler* compiler); - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start); + int GreedyLoopTextLength() override; + RegExpNode* GetSuccessorOfOmnivorousTextNode( + RegExpCompiler* compiler) override; + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override; void CalculateOffsets(); - virtual RegExpNode* FilterOneByte(int depth); + RegExpNode* FilterOneByte(int depth) override; private: enum TextEmitPassType { @@ -779,15 +779,14 @@ class AssertionNode: public SeqRegExpNode { static AssertionNode* AfterNewline(RegExpNode* on_success) { return new(on_success->zone()) AssertionNode(AFTER_NEWLINE, on_success); } - virtual void Accept(NodeVisitor* visitor); - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int filled_in, - bool not_at_start); - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start); + void Accept(NodeVisitor* visitor) override; + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int budget, bool not_at_start) override; + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int filled_in, + bool not_at_start) override; + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override; AssertionType assertion_type() { return assertion_type_; } private: @@ -811,22 +810,20 @@ class BackReferenceNode: public SeqRegExpNode { end_reg_(end_reg), flags_(flags), read_backward_(read_backward) {} - virtual void Accept(NodeVisitor* visitor); + void Accept(NodeVisitor* visitor) override; int start_register() { return start_reg_; } int end_register() { return end_reg_; } bool read_backward() { return read_backward_; } - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, - int recursion_depth, - bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int characters_filled_in, - bool not_at_start) { + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int recursion_depth, + bool not_at_start) override; + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int characters_filled_in, + bool not_at_start) override { return; } - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start); + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override; private: int start_reg_; @@ -840,20 +837,20 @@ class EndNode: public RegExpNode { public: enum Action { ACCEPT, BACKTRACK, NEGATIVE_SUBMATCH_SUCCESS }; EndNode(Action action, Zone* zone) : RegExpNode(zone), action_(action) {} - virtual void Accept(NodeVisitor* visitor); - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, - int recursion_depth, - bool not_at_start) { return 0; } - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int characters_filled_in, - bool not_at_start) { + void Accept(NodeVisitor* visitor) override; + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int recursion_depth, + bool not_at_start) override { + return 0; + } + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int characters_filled_in, + bool not_at_start) override { // Returning 0 from EatsAtLeast should ensure we never get here. UNREACHABLE(); } - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start) { + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override { // Returning 0 from EatsAtLeast should ensure we never get here. UNREACHABLE(); } @@ -875,7 +872,7 @@ class NegativeSubmatchSuccess: public EndNode { current_position_register_(position_reg), clear_capture_count_(clear_capture_count), clear_capture_start_(clear_capture_start) { } - virtual void Emit(RegExpCompiler* compiler, Trace* trace); + void Emit(RegExpCompiler* compiler, Trace* trace) override; private: int stack_pointer_register_; @@ -930,24 +927,23 @@ class ChoiceNode: public RegExpNode { table_(nullptr), not_at_start_(false), being_calculated_(false) {} - virtual void Accept(NodeVisitor* visitor); + void Accept(NodeVisitor* visitor) override; void AddAlternative(GuardedAlternative node) { alternatives()->Add(node, zone()); } ZoneList<GuardedAlternative>* alternatives() { return alternatives_; } DispatchTable* GetTable(bool ignore_case); - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start); + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int budget, bool not_at_start) override; int EatsAtLeastHelper(int still_to_find, int budget, RegExpNode* ignore_this_node, bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int characters_filled_in, - bool not_at_start); - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start); + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int characters_filled_in, + bool not_at_start) override; + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override; bool being_calculated() { return being_calculated_; } bool not_at_start() { return not_at_start_; } @@ -956,7 +952,7 @@ class ChoiceNode: public RegExpNode { virtual bool try_to_emit_quick_check_for_alternative(bool is_first) { return true; } - virtual RegExpNode* FilterOneByte(int depth); + RegExpNode* FilterOneByte(int depth) override; virtual bool read_backward() { return false; } protected: @@ -1009,13 +1005,12 @@ class NegativeLookaroundChoiceNode : public ChoiceNode { AddAlternative(this_must_fail); AddAlternative(then_do_this); } - virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int characters_filled_in, - bool not_at_start); - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start) { + int EatsAtLeast(int still_to_find, int budget, bool not_at_start) override; + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int characters_filled_in, + bool not_at_start) override; + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override { alternatives_->at(1).node()->FillInBMInfo(isolate, offset, budget - 1, bm, not_at_start); if (offset == 0) set_bm_info(not_at_start, bm); @@ -1025,10 +1020,10 @@ class NegativeLookaroundChoiceNode : public ChoiceNode { // starts by loading enough characters for the alternative that takes fewest // characters, but on a negative lookahead the negative branch did not take // part in that calculation (EatsAtLeast) so the assumptions don't hold. - virtual bool try_to_emit_quick_check_for_alternative(bool is_first) { + bool try_to_emit_quick_check_for_alternative(bool is_first) override { return !is_first; } - virtual RegExpNode* FilterOneByte(int depth); + RegExpNode* FilterOneByte(int depth) override; }; @@ -1042,20 +1037,19 @@ class LoopChoiceNode: public ChoiceNode { read_backward_(read_backward) {} void AddLoopAlternative(GuardedAlternative alt); void AddContinueAlternative(GuardedAlternative alt); - virtual void Emit(RegExpCompiler* compiler, Trace* trace); - virtual int EatsAtLeast(int still_to_find, int budget, bool not_at_start); - virtual void GetQuickCheckDetails(QuickCheckDetails* details, - RegExpCompiler* compiler, - int characters_filled_in, - bool not_at_start); - virtual void FillInBMInfo(Isolate* isolate, int offset, int budget, - BoyerMooreLookahead* bm, bool not_at_start); + void Emit(RegExpCompiler* compiler, Trace* trace) override; + int EatsAtLeast(int still_to_find, int budget, bool not_at_start) override; + void GetQuickCheckDetails(QuickCheckDetails* details, + RegExpCompiler* compiler, int characters_filled_in, + bool not_at_start) override; + void FillInBMInfo(Isolate* isolate, int offset, int budget, + BoyerMooreLookahead* bm, bool not_at_start) override; RegExpNode* loop_node() { return loop_node_; } RegExpNode* continue_node() { return continue_node_; } bool body_can_be_zero_length() { return body_can_be_zero_length_; } - virtual bool read_backward() { return read_backward_; } - virtual void Accept(NodeVisitor* visitor); - virtual RegExpNode* FilterOneByte(int depth); + bool read_backward() override { return read_backward_; } + void Accept(NodeVisitor* visitor) override; + RegExpNode* FilterOneByte(int depth) override; private: // AddAlternative is made private for loop nodes because alternatives @@ -1404,7 +1398,7 @@ struct PreloadState { class NodeVisitor { public: - virtual ~NodeVisitor() { } + virtual ~NodeVisitor() = default; #define DECLARE_VISIT(Type) \ virtual void Visit##Type(Type##Node* that) = 0; FOR_EACH_NODE_TYPE(DECLARE_VISIT) @@ -1466,11 +1460,10 @@ class Analysis: public NodeVisitor { : isolate_(isolate), is_one_byte_(is_one_byte), error_message_(nullptr) {} void EnsureAnalyzed(RegExpNode* node); -#define DECLARE_VISIT(Type) \ - virtual void Visit##Type(Type##Node* that); -FOR_EACH_NODE_TYPE(DECLARE_VISIT) +#define DECLARE_VISIT(Type) void Visit##Type(Type##Node* that) override; + FOR_EACH_NODE_TYPE(DECLARE_VISIT) #undef DECLARE_VISIT - virtual void VisitLoopChoice(LoopChoiceNode* that); + void VisitLoopChoice(LoopChoiceNode* that) override; bool has_failed() { return error_message_ != nullptr; } const char* error_message() { |