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

Unified Diff: runtime/vm/scanner.h

Issue 316633002: Speed up identifying keywords in scanner, by using extra table. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « no previous file | runtime/vm/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.h
diff --git a/runtime/vm/scanner.h b/runtime/vm/scanner.h
index 3e1407cba92580d16c58d5f55ca0cd11e005d72b..92c29198fdfbdd6292d0ae2a1a0118b4cb0cf008 100644
--- a/runtime/vm/scanner.h
+++ b/runtime/vm/scanner.h
@@ -85,6 +85,8 @@ class Scanner : ValueObject {
const String** value);
private:
+ static const int kNumLowercaseChars = 26;
+
struct ScanContext {
ScanContext* next;
char string_delimiter;
@@ -205,7 +207,8 @@ class Scanner : ValueObject {
SourcePosition c0_pos_; // Source position of lookahead character c0_.
- static KeywordTable keywords_[Token::numKeywords];
+ static KeywordTable keywords_[Token::kNumKeywords];
+ static int keywords_char_offset_[kNumLowercaseChars];
};
« no previous file with comments | « no previous file | runtime/vm/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698