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

Unified Diff: runtime/vm/parser.h

Issue 293403009: Remove unused code, improve speed of Parser::CurrentToken (improvement seen in measurements and pro… (Closed) Base URL: http://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 | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.h
===================================================================
--- runtime/vm/parser.h (revision 36705)
+++ runtime/vm/parser.h (working copy)
@@ -240,7 +240,17 @@
}
intptr_t TokenPos() const { return tokens_iterator_.CurrentPosition(); }
- inline Token::Kind CurrentToken();
+
+ Token::Kind CurrentToken() {
hausner 2014/05/27 21:03:29 The performance now depends even more on the whim
+ if (token_kind_ == Token::kILLEGAL) {
+ ComputeCurrentToken();
+ }
+ CompilerStats::num_token_checks++;
+ return token_kind_;
+ }
+
+ void ComputeCurrentToken();
+
Token::Kind LookaheadToken(int num_tokens);
String* CurrentLiteral() const;
RawDouble* CurrentDoubleLiteral() const;
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698