OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |