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

Side by Side Diff: src/parsing/preparser.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 unified diff | Download patch
« src/parsing/parser.cc ('K') | « src/parsing/parser.cc ('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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // it is used) are generally omitted. 178 // it is used) are generally omitted.
179 179
180 PreParser::Expression PreParser::ParseFunctionLiteral( 180 PreParser::Expression PreParser::ParseFunctionLiteral(
181 Identifier function_name, Scanner::Location function_name_location, 181 Identifier function_name, Scanner::Location function_name_location,
182 FunctionNameValidity function_name_validity, FunctionKind kind, 182 FunctionNameValidity function_name_validity, FunctionKind kind,
183 int function_token_pos, FunctionLiteral::FunctionType function_type, 183 int function_token_pos, FunctionLiteral::FunctionType function_type,
184 LanguageMode language_mode, bool* ok) { 184 LanguageMode language_mode, bool* ok) {
185 // Function :: 185 // Function ::
186 // '(' FormalParameterList? ')' '{' FunctionBody '}' 186 // '(' FormalParameterList? ')' '{' FunctionBody '}'
187 const RuntimeCallStats::CounterId counters[2][2] = { 187 const RuntimeCallStats::CounterId counters[2][2] = {
188 {&RuntimeCallStats::PreParseBackgroundNoVariableResolution,
189 &RuntimeCallStats::PreParseNoVariableResolution},
188 {&RuntimeCallStats::PreParseBackgroundWithVariableResolution, 190 {&RuntimeCallStats::PreParseBackgroundWithVariableResolution,
189 &RuntimeCallStats::PreParseWithVariableResolution}, 191 &RuntimeCallStats::PreParseWithVariableResolution}};
190 {&RuntimeCallStats::PreParseBackgroundNoVariableResolution,
191 &RuntimeCallStats::PreParseNoVariableResolution}};
192 RuntimeCallTimerScope runtime_timer( 192 RuntimeCallTimerScope runtime_timer(
193 runtime_call_stats_, 193 runtime_call_stats_,
194 counters[track_unresolved_variables_][parsing_on_main_thread_]); 194 counters[track_unresolved_variables_][parsing_on_main_thread_]);
195 195
196 // Parse function body. 196 // Parse function body.
197 PreParserStatementList body; 197 PreParserStatementList body;
198 DeclarationScope* function_scope = NewFunctionScope(kind); 198 DeclarationScope* function_scope = NewFunctionScope(kind);
199 function_scope->SetLanguageMode(language_mode); 199 function_scope->SetLanguageMode(language_mode);
200 FunctionState function_state(&function_state_, &scope_state_, function_scope); 200 FunctionState function_state(&function_state_, &scope_state_, function_scope);
201 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); 201 DuplicateFinder duplicate_finder(scanner()->unicode_cache());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 } 307 }
308 } 308 }
309 309
310 #undef CHECK_OK 310 #undef CHECK_OK
311 #undef CHECK_OK_CUSTOM 311 #undef CHECK_OK_CUSTOM
312 312
313 313
314 } // namespace internal 314 } // namespace internal
315 } // namespace v8 315 } // namespace v8
OLDNEW
« src/parsing/parser.cc ('K') | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698