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

Side by Side Diff: src/parsing/preparser.cc

Issue 2507293003: [counters] Fix runtime-call-stats wrt background parsing (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 6
7 #include "src/allocation.h" 7 #include "src/allocation.h"
8 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // it is used) are generally omitted. 173 // it is used) are generally omitted.
174 174
175 PreParser::Expression PreParser::ParseFunctionLiteral( 175 PreParser::Expression PreParser::ParseFunctionLiteral(
176 Identifier function_name, Scanner::Location function_name_location, 176 Identifier function_name, Scanner::Location function_name_location,
177 FunctionNameValidity function_name_validity, FunctionKind kind, 177 FunctionNameValidity function_name_validity, FunctionKind kind,
178 int function_token_pos, FunctionLiteral::FunctionType function_type, 178 int function_token_pos, FunctionLiteral::FunctionType function_type,
179 LanguageMode language_mode, bool* ok) { 179 LanguageMode language_mode, bool* ok) {
180 // Function :: 180 // Function ::
181 // '(' FormalParameterList? ')' '{' FunctionBody '}' 181 // '(' FormalParameterList? ')' '{' FunctionBody '}'
182 const RuntimeCallStats::CounterId counters[2][2] = { 182 const RuntimeCallStats::CounterId counters[2][2] = {
183 {&RuntimeCallStats::PreParseWithVariableResolution, 183 {&RuntimeCallStats::PreParseBackgroundWithVariableResolution,
184 &RuntimeCallStats::PreParseBackgroundWithVariableResolution}, 184 &RuntimeCallStats::PreParseWithVariableResolution},
185 {&RuntimeCallStats::PreParseNoVariableResolution, 185 {&RuntimeCallStats::PreParseBackgroundNoVariableResolution,
186 &RuntimeCallStats::PreParseBackgroundNoVariableResolution}}; 186 &RuntimeCallStats::PreParseNoVariableResolution}};
187 RuntimeCallTimerScope runtime_timer( 187 RuntimeCallTimerScope runtime_timer(
188 runtime_call_stats_, 188 runtime_call_stats_,
189 counters[track_unresolved_variables_][parsing_on_main_thread_]); 189 counters[track_unresolved_variables_][parsing_on_main_thread_]);
190 190
191 // Parse function body. 191 // Parse function body.
192 PreParserStatementList body; 192 PreParserStatementList body;
193 DeclarationScope* function_scope = NewFunctionScope(kind); 193 DeclarationScope* function_scope = NewFunctionScope(kind);
194 function_scope->SetLanguageMode(language_mode); 194 function_scope->SetLanguageMode(language_mode);
195 FunctionState function_state(&function_state_, &scope_state_, function_scope); 195 FunctionState function_state(&function_state_, &scope_state_, function_scope);
196 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); 196 DuplicateFinder duplicate_finder(scanner()->unicode_cache());
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 } 298 }
299 } 299 }
300 300
301 #undef CHECK_OK 301 #undef CHECK_OK
302 #undef CHECK_OK_CUSTOM 302 #undef CHECK_OK_CUSTOM
303 303
304 304
305 } // namespace internal 305 } // namespace internal
306 } // namespace v8 306 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698