Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/ast.h

Issue 1176453002: Optimize trivial regexp disjunctions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make test faster Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/jsregexp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after
2859 RegExpNode* on_success) override; 2859 RegExpNode* on_success) override;
2860 RegExpDisjunction* AsDisjunction() override; 2860 RegExpDisjunction* AsDisjunction() override;
2861 Interval CaptureRegisters() override; 2861 Interval CaptureRegisters() override;
2862 bool IsDisjunction() override; 2862 bool IsDisjunction() override;
2863 bool IsAnchoredAtStart() override; 2863 bool IsAnchoredAtStart() override;
2864 bool IsAnchoredAtEnd() override; 2864 bool IsAnchoredAtEnd() override;
2865 int min_match() override { return min_match_; } 2865 int min_match() override { return min_match_; }
2866 int max_match() override { return max_match_; } 2866 int max_match() override { return max_match_; }
2867 ZoneList<RegExpTree*>* alternatives() { return alternatives_; } 2867 ZoneList<RegExpTree*>* alternatives() { return alternatives_; }
2868 private: 2868 private:
2869 bool SortConsecutiveAtoms(RegExpCompiler* compiler);
2870 void RationalizeConsecutiveAtoms(RegExpCompiler* compiler);
2871 void FixSingleCharacterDisjunctions(RegExpCompiler* compiler);
2869 ZoneList<RegExpTree*>* alternatives_; 2872 ZoneList<RegExpTree*>* alternatives_;
2870 int min_match_; 2873 int min_match_;
2871 int max_match_; 2874 int max_match_;
2872 }; 2875 };
2873 2876
2874 2877
2875 class RegExpAlternative final : public RegExpTree { 2878 class RegExpAlternative final : public RegExpTree {
2876 public: 2879 public:
2877 explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes); 2880 explicit RegExpAlternative(ZoneList<RegExpTree*>* nodes);
2878 void* Accept(RegExpVisitor* visitor, void* data) override; 2881 void* Accept(RegExpVisitor* visitor, void* data) override;
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 3596
3594 private: 3597 private:
3595 Zone* zone_; 3598 Zone* zone_;
3596 AstValueFactory* ast_value_factory_; 3599 AstValueFactory* ast_value_factory_;
3597 }; 3600 };
3598 3601
3599 3602
3600 } } // namespace v8::internal 3603 } } // namespace v8::internal
3601 3604
3602 #endif // V8_AST_H_ 3605 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/jsregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698