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

Side by Side Diff: src/unicode-cache.h

Issue 1287893006: Separate UnicodeCache out into an own file. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/scanner.h ('k') | src/unicode-cache-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_UNICODE_CACHE_H_
6 #define V8_UNICODE_CACHE_H_
7
8 #include "src/base/macros.h"
9 #include "src/char-predicates.h"
10 #include "src/unicode.h"
11 #include "src/unicode-decoder.h"
12
13 namespace v8 {
14 namespace internal {
15
16 // Caching predicates used by scanners.
17 class UnicodeCache {
18 public:
19 UnicodeCache() {}
20 typedef unibrow::Utf8Decoder<512> Utf8Decoder;
21
22 StaticResource<Utf8Decoder>* utf8_decoder() { return &utf8_decoder_; }
23
24 inline bool IsIdentifierStart(unibrow::uchar c);
25 inline bool IsIdentifierPart(unibrow::uchar c);
26 inline bool IsLineTerminator(unibrow::uchar c);
27 inline bool IsLineTerminatorSequence(unibrow::uchar c, unibrow::uchar next);
28
29 inline bool IsWhiteSpace(unibrow::uchar c);
30 inline bool IsWhiteSpaceOrLineTerminator(unibrow::uchar c);
31
32 private:
33 unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart;
34 unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart;
35 unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator;
36 unibrow::Predicate<WhiteSpace, 128> kIsWhiteSpace;
37 unibrow::Predicate<WhiteSpaceOrLineTerminator, 128>
38 kIsWhiteSpaceOrLineTerminator;
39 StaticResource<Utf8Decoder> utf8_decoder_;
40
41 DISALLOW_COPY_AND_ASSIGN(UnicodeCache);
42 };
43
44 } // namespace internal
45 } // namespace v8
46
47 #endif // V8_UNICODE_CACHE_H_
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | src/unicode-cache-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698