Chromium Code Reviews| 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; |