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

Side by Side Diff: src/regexp/regexp-ast.h

Issue 1801573002: Version 5.0.71.17 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: Created 4 years, 9 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 | « src/regexp/jsregexp.cc ('k') | test/cctest/test-regexp.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_REGEXP_REGEXP_AST_H_ 5 #ifndef V8_REGEXP_REGEXP_AST_H_
6 #define V8_REGEXP_REGEXP_AST_H_ 6 #define V8_REGEXP_REGEXP_AST_H_
7 7
8 #include "src/objects.h" 8 #include "src/objects.h"
9 #include "src/utils.h" 9 #include "src/utils.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 }; 71 };
72 72
73 73
74 // Represents code units in the range from from_ to to_, both ends are 74 // Represents code units in the range from from_ to to_, both ends are
75 // inclusive. 75 // inclusive.
76 class CharacterRange { 76 class CharacterRange {
77 public: 77 public:
78 CharacterRange() : from_(0), to_(0) {} 78 CharacterRange() : from_(0), to_(0) {}
79 // For compatibility with the CHECK_OK macro 79 // For compatibility with the CHECK_OK macro
80 CharacterRange(void* null) { DCHECK_NULL(null); } // NOLINT 80 CharacterRange(void* null) { DCHECK_NULL(null); } // NOLINT
81 CharacterRange(uc32 from, uc32 to) : from_(from), to_(to) {}
82 static void AddClassEscape(uc16 type, ZoneList<CharacterRange>* ranges, 81 static void AddClassEscape(uc16 type, ZoneList<CharacterRange>* ranges,
83 Zone* zone); 82 Zone* zone);
84 static Vector<const int> GetWordBounds(); 83 static Vector<const int> GetWordBounds();
85 static inline CharacterRange Singleton(uc32 value) { 84 static inline CharacterRange Singleton(uc32 value) {
86 return CharacterRange(value, value); 85 return CharacterRange(value, value);
87 } 86 }
88 static inline CharacterRange Range(uc32 from, uc32 to) { 87 static inline CharacterRange Range(uc32 from, uc32 to) {
89 DCHECK(0 <= from && to <= String::kMaxCodePoint); 88 DCHECK(0 <= from && to <= String::kMaxCodePoint);
90 DCHECK(static_cast<uint32_t>(from) <= static_cast<uint32_t>(to)); 89 DCHECK(static_cast<uint32_t>(from) <= static_cast<uint32_t>(to));
91 return CharacterRange(from, to); 90 return CharacterRange(from, to);
(...skipping 27 matching lines...) Expand all
119 // adjacent ranges are merged. The resulting list may be shorter than the 118 // adjacent ranges are merged. The resulting list may be shorter than the
120 // original, but cannot be longer. 119 // original, but cannot be longer.
121 static void Canonicalize(ZoneList<CharacterRange>* ranges); 120 static void Canonicalize(ZoneList<CharacterRange>* ranges);
122 // Negate the contents of a character range in canonical form. 121 // Negate the contents of a character range in canonical form.
123 static void Negate(ZoneList<CharacterRange>* src, 122 static void Negate(ZoneList<CharacterRange>* src,
124 ZoneList<CharacterRange>* dst, Zone* zone); 123 ZoneList<CharacterRange>* dst, Zone* zone);
125 static const int kStartMarker = (1 << 24); 124 static const int kStartMarker = (1 << 24);
126 static const int kPayloadMask = (1 << 24) - 1; 125 static const int kPayloadMask = (1 << 24) - 1;
127 126
128 private: 127 private:
128 CharacterRange(uc32 from, uc32 to) : from_(from), to_(to) {}
129
129 uc32 from_; 130 uc32 from_;
130 uc32 to_; 131 uc32 to_;
131 }; 132 };
132 133
133 134
134 class CharacterSet final BASE_EMBEDDED { 135 class CharacterSet final BASE_EMBEDDED {
135 public: 136 public:
136 explicit CharacterSet(uc16 standard_set_type) 137 explicit CharacterSet(uc16 standard_set_type)
137 : ranges_(NULL), standard_set_type_(standard_set_type) {} 138 : ranges_(NULL), standard_set_type_(standard_set_type) {}
138 explicit CharacterSet(ZoneList<CharacterRange>* ranges) 139 explicit CharacterSet(ZoneList<CharacterRange>* ranges)
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 RegExpEmpty* AsEmpty() override; 511 RegExpEmpty* AsEmpty() override;
511 bool IsEmpty() override; 512 bool IsEmpty() override;
512 int min_match() override { return 0; } 513 int min_match() override { return 0; }
513 int max_match() override { return 0; } 514 int max_match() override { return 0; }
514 }; 515 };
515 516
516 } // namespace internal 517 } // namespace internal
517 } // namespace v8 518 } // namespace v8
518 519
519 #endif // V8_REGEXP_REGEXP_AST_H_ 520 #endif // V8_REGEXP_REGEXP_AST_H_
OLDNEW
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698