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

Unified Diff: src/scanner.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/unicode-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.h
diff --git a/src/scanner.h b/src/scanner.h
index 92588905ad609b7ea64d8c5c7c2007d3e55d409b..5e18649671cb5f8e651b876f340776359d2fad75 100644
--- a/src/scanner.h
+++ b/src/scanner.h
@@ -25,6 +25,7 @@ namespace internal {
class AstRawString;
class AstValueFactory;
class ParserRecorder;
+class UnicodeCache;
// Returns the value (0 .. 15) of a hexadecimal character c.
@@ -109,45 +110,6 @@ class Utf16CharacterStream {
// ---------------------------------------------------------------------
-// Caching predicates used by scanners.
-
-class UnicodeCache {
- public:
- UnicodeCache() {}
- typedef unibrow::Utf8Decoder<512> Utf8Decoder;
-
- StaticResource<Utf8Decoder>* utf8_decoder() {
- return &utf8_decoder_;
- }
-
- bool IsIdentifierStart(unibrow::uchar c) { return kIsIdentifierStart.get(c); }
- bool IsIdentifierPart(unibrow::uchar c) { return kIsIdentifierPart.get(c); }
- bool IsLineTerminator(unibrow::uchar c) { return kIsLineTerminator.get(c); }
- bool IsLineTerminatorSequence(unibrow::uchar c, unibrow::uchar next) {
- if (!IsLineTerminator(c)) return false;
- if (c == 0x000d && next == 0x000a) return false; // CR with following LF.
- return true;
- }
-
- bool IsWhiteSpace(unibrow::uchar c) { return kIsWhiteSpace.get(c); }
- bool IsWhiteSpaceOrLineTerminator(unibrow::uchar c) {
- return kIsWhiteSpaceOrLineTerminator.get(c);
- }
-
- private:
- unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart;
- unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart;
- unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator;
- unibrow::Predicate<WhiteSpace, 128> kIsWhiteSpace;
- unibrow::Predicate<WhiteSpaceOrLineTerminator, 128>
- kIsWhiteSpaceOrLineTerminator;
- StaticResource<Utf8Decoder> utf8_decoder_;
-
- DISALLOW_COPY_AND_ASSIGN(UnicodeCache);
-};
-
-
-// ---------------------------------------------------------------------
// DuplicateFinder discovers duplicate symbols.
class DuplicateFinder {
« no previous file with comments | « src/runtime/runtime.h ('k') | src/unicode-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698