Commit 62d19db5 authored by cbruni's avatar cbruni Committed by Commit bot

[counters] Use the correct timers for background parsing

BUG=

Review-Url: https://codereview.chromium.org/2541793004
Cr-Commit-Position: refs/heads/master@{#41436}
parent d4c3fa8d
......@@ -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);
}
}
// Validate function name. We can do this only after parsing the function,
......
......@@ -185,10 +185,10 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
// Function ::
// '(' FormalParameterList? ')' '{' FunctionBody '}'
const RuntimeCallStats::CounterId counters[2][2] = {
{&RuntimeCallStats::PreParseBackgroundWithVariableResolution,
&RuntimeCallStats::PreParseWithVariableResolution},
{&RuntimeCallStats::PreParseBackgroundNoVariableResolution,
&RuntimeCallStats::PreParseNoVariableResolution}};
&RuntimeCallStats::PreParseNoVariableResolution},
{&RuntimeCallStats::PreParseBackgroundWithVariableResolution,
&RuntimeCallStats::PreParseWithVariableResolution}};
RuntimeCallTimerScope runtime_timer(
runtime_call_stats_,
counters[track_unresolved_variables_][parsing_on_main_thread_]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment