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

Unified Diff: src/parsing/parser.cc

Issue 2541793004: [counters] Use the correct timers for background parsing (Closed)
Patch Set: remove old code Created 4 years 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
« no previous file with comments | « no previous file | src/parsing/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698