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

Unified Diff: src/char-predicates-inl.h

Issue 969353003: Speed up identifier, keyword and smi parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use char predicates Created 5 years, 10 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/char-predicates.h ('k') | src/scanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/char-predicates-inl.h
diff --git a/src/char-predicates-inl.h b/src/char-predicates-inl.h
index 71d1b06a9213504a495056e6e008b425c4888931..d90f919341f6c25223b6d72ba1eb548c49a9ae78 100644
--- a/src/char-predicates-inl.h
+++ b/src/char-predicates-inl.h
@@ -35,6 +35,13 @@ inline bool IsInRange(int value, int lower_limit, int higher_limit) {
static_cast<unsigned int>(higher_limit - lower_limit);
}
+inline bool IsAsciiIdentifier(uc32 c) {
+ return IsAlphaNumeric(c) || c == '$' || c == '_';
+}
+
+inline bool IsAlphaNumeric(uc32 c) {
+ return IsInRange(AsciiAlphaToLower(c), 'a', 'z') || IsDecimalDigit(c);
+}
inline bool IsDecimalDigit(uc32 c) {
// ECMA-262, 3rd, 7.8.3 (p 16)
« no previous file with comments | « src/char-predicates.h ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698