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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const AstRawString* result = scanner()->CurrentSymbol(ast_value_factory()); | 79 const AstRawString* result = scanner()->CurrentSymbol(ast_value_factory()); |
80 DCHECK_NOT_NULL(result); | 80 DCHECK_NOT_NULL(result); |
81 symbol.string_ = result; | 81 symbol.string_ = result; |
82 } | 82 } |
83 return symbol; | 83 return symbol; |
84 } | 84 } |
85 | 85 |
86 PreParser::PreParseResult PreParser::PreParseFunction( | 86 PreParser::PreParseResult PreParser::PreParseFunction( |
87 FunctionKind kind, DeclarationScope* function_scope, bool parsing_module, | 87 FunctionKind kind, DeclarationScope* function_scope, bool parsing_module, |
88 bool is_inner_function, bool may_abort, int* use_counts) { | 88 bool is_inner_function, bool may_abort, int* use_counts) { |
89 RuntimeCallTimerScope runtime_timer( | |
90 runtime_call_stats_, | |
91 track_unresolved_variables_ | |
92 ? &RuntimeCallStats::PreParseWithVariableResolution | |
93 : &RuntimeCallStats::PreParseNoVariableResolution); | |
94 DCHECK_EQ(FUNCTION_SCOPE, function_scope->scope_type()); | 89 DCHECK_EQ(FUNCTION_SCOPE, function_scope->scope_type()); |
95 parsing_module_ = parsing_module; | 90 parsing_module_ = parsing_module; |
96 use_counts_ = use_counts; | 91 use_counts_ = use_counts; |
97 DCHECK(!track_unresolved_variables_); | 92 DCHECK(!track_unresolved_variables_); |
98 track_unresolved_variables_ = is_inner_function; | 93 track_unresolved_variables_ = is_inner_function; |
99 | 94 |
100 // The caller passes the function_scope which is not yet inserted into the | 95 // The caller passes the function_scope which is not yet inserted into the |
101 // scope_state_. All scopes above the function_scope are ignored by the | 96 // scope_state_. All scopes above the function_scope are ignored by the |
102 // PreParser. | 97 // PreParser. |
103 DCHECK_NULL(scope_state_); | 98 DCHECK_NULL(scope_state_); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 } | 294 } |
300 } | 295 } |
301 } | 296 } |
302 | 297 |
303 #undef CHECK_OK | 298 #undef CHECK_OK |
304 #undef CHECK_OK_CUSTOM | 299 #undef CHECK_OK_CUSTOM |
305 | 300 |
306 | 301 |
307 } // namespace internal | 302 } // namespace internal |
308 } // namespace v8 | 303 } // namespace v8 |
OLD | NEW |