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

Unified Diff: runtime/vm/parser.cc

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
« runtime/vm/parser.h ('K') | « runtime/vm/parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 36705)
+++ runtime/vm/parser.cc (working copy)
@@ -393,15 +393,12 @@
}
-Token::Kind Parser::CurrentToken() {
- if (token_kind_ == Token::kILLEGAL) {
- token_kind_ = tokens_iterator_.CurrentTokenKind();
- if (token_kind_ == Token::kERROR) {
- ErrorMsg(TokenPos(), "%s", CurrentLiteral()->ToCString());
- }
+void Parser::ComputeCurrentToken() {
+ ASSERT(token_kind_ == Token::kILLEGAL);
+ token_kind_ = tokens_iterator_.CurrentTokenKind();
+ if (token_kind_ == Token::kERROR) {
+ ErrorMsg(TokenPos(), "%s", CurrentLiteral()->ToCString());
}
- CompilerStats::num_token_checks++;
- return token_kind_;
}
« runtime/vm/parser.h ('K') | « runtime/vm/parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698