| Index: runtime/vm/parser.cc
|
| ===================================================================
|
| --- runtime/vm/parser.cc (revision 27120)
|
| +++ runtime/vm/parser.cc (working copy)
|
| @@ -64,7 +64,7 @@
|
| indent_++;
|
| }
|
| }
|
| - ~TraceParser() { indent_--; }
|
| + ~TraceParser() { if (FLAG_trace_parser) indent_--; }
|
| private:
|
| void PrintIndent() {
|
| for (int i = 0; i < indent_; i++) { OS::Print(". "); }
|
| @@ -345,7 +345,9 @@
|
|
|
| void Parser::SetPosition(intptr_t position) {
|
| if (position < TokenPos() && position != 0) {
|
| - CompilerStats::num_tokens_rewind += (TokenPos() - position);
|
| + if (FLAG_compiler_stats) {
|
| + CompilerStats::num_tokens_rewind += (TokenPos() - position);
|
| + }
|
| }
|
| tokens_iterator_.SetCurrentPosition(position);
|
| token_kind_ = Token::kILLEGAL;
|
| @@ -368,14 +370,18 @@
|
| ErrorMsg(TokenPos(), "%s", CurrentLiteral()->ToCString());
|
| }
|
| }
|
| - CompilerStats::num_token_checks++;
|
| + if (FLAG_compiler_stats) {
|
| + CompilerStats::num_token_checks++;
|
| + }
|
| return token_kind_;
|
| }
|
|
|
|
|
| Token::Kind Parser::LookaheadToken(int num_tokens) {
|
| - CompilerStats::num_tokens_lookahead++;
|
| - CompilerStats::num_token_checks++;
|
| + if (FLAG_compiler_stats) {
|
| + CompilerStats::num_tokens_lookahead++;
|
| + CompilerStats::num_token_checks++;
|
| + }
|
| return tokens_iterator_.LookaheadTokenKind(num_tokens);
|
| }
|
|
|
|
|