Chromium Code Reviews| Index: src/parsing/parser.cc |
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
| index f442d25dc525cc4061ef08520dd802aba163c4f0..012bc6e00ed3ea3284d2cdce57e99a12af6dea20 100644 |
| --- a/src/parsing/parser.cc |
| +++ b/src/parsing/parser.cc |
| @@ -2728,12 +2728,20 @@ FunctionLiteral* Parser::ParseFunctionLiteral( |
| scope->start_position(), scope->end_position(), |
| function_name->byte_length(), function_name->raw_data()); |
| } |
| - if (is_lazy_top_level_function) { |
| - CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, |
| - PreParseNoVariableResolution); |
| - } else if (temp_zoned_) { |
| - CHANGE_CURRENT_RUNTIME_COUNTER(runtime_call_stats_, |
| - PreParseWithVariableResolution); |
| + if (V8_UNLIKELY(FLAG_runtime_stats)) { |
| + if (is_lazy_top_level_function) { |
| + RuntimeCallStats::CorrectCurrentCounterId( |
| + runtime_call_stats_, |
| + parsing_on_main_thread_ |
| + ? &RuntimeCallStats::PreParseNoVariableResolution |
| + : &RuntimeCallStats::PreParseBackgroundNoVariableResolution); |
| + } else if (temp_zoned_) { |
| + RuntimeCallStats::CorrectCurrentCounterId( |
| + runtime_call_stats_, |
| + parsing_on_main_thread_ |
| + ? &RuntimeCallStats::PreParseWithVariableResolution |
| + : &RuntimeCallStats::PreParseBackgroundWithVariableResolution); |
| + } |
|
vogelheim
2016/12/01 15:57:42
For my understanding: What about the 'else' case,
|
| } |
| // Validate function name. We can do this only after parsing the function, |