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

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

Issue 2509683002: [counters] Use separate counters for background parsing (Closed)
Patch Set: fixing cctest 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RuntimeCallTimerScope runtime_timer( 182 RuntimeCallTimerScope runtime_timer(
183 runtime_call_stats_, 183 runtime_call_stats_,
184 track_unresolved_variables_ 184 track_unresolved_variables_
185 ? &RuntimeCallStats::PreParseWithVariableResolution 185 ? parsing_on_main_thread_
186 : &RuntimeCallStats::PreParseNoVariableResolution); 186 ? &RuntimeCallStats::PreParseWithVariableResolution
187 : &RuntimeCallStats::PreParseBackgroundWithVariableResolution
188 : parsing_on_main_thread_
189 ? &RuntimeCallStats::PreParseNoVariableResolution
190 : &RuntimeCallStats::PreParseBackgroundNoVariableResolution);
187 191
188 // Parse function body. 192 // Parse function body.
189 PreParserStatementList body; 193 PreParserStatementList body;
190 DeclarationScope* function_scope = NewFunctionScope(kind); 194 DeclarationScope* function_scope = NewFunctionScope(kind);
191 function_scope->SetLanguageMode(language_mode); 195 function_scope->SetLanguageMode(language_mode);
192 FunctionState function_state(&function_state_, &scope_state_, function_scope); 196 FunctionState function_state(&function_state_, &scope_state_, function_scope);
193 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); 197 DuplicateFinder duplicate_finder(scanner()->unicode_cache());
194 ExpressionClassifier formals_classifier(this, &duplicate_finder); 198 ExpressionClassifier formals_classifier(this, &duplicate_finder);
195 199
196 Expect(Token::LPAREN, CHECK_OK); 200 Expect(Token::LPAREN, CHECK_OK);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 298 }
295 } 299 }
296 } 300 }
297 301
298 #undef CHECK_OK 302 #undef CHECK_OK
299 #undef CHECK_OK_CUSTOM 303 #undef CHECK_OK_CUSTOM
300 304
301 305
302 } // namespace internal 306 } // namespace internal
303 } // namespace v8 307 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698