OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 typedef typename Types::StatementList StatementListT; | 184 typedef typename Types::StatementList StatementListT; |
185 typedef typename Types::Block BlockT; | 185 typedef typename Types::Block BlockT; |
186 typedef typename v8::internal::ExpressionClassifier<Types> | 186 typedef typename v8::internal::ExpressionClassifier<Types> |
187 ExpressionClassifier; | 187 ExpressionClassifier; |
188 | 188 |
189 // All implementation-specific methods must be called through this. | 189 // All implementation-specific methods must be called through this. |
190 Impl* impl() { return static_cast<Impl*>(this); } | 190 Impl* impl() { return static_cast<Impl*>(this); } |
191 const Impl* impl() const { return static_cast<const Impl*>(this); } | 191 const Impl* impl() const { return static_cast<const Impl*>(this); } |
192 | 192 |
193 ParserBase(Zone* zone, Scanner* scanner, uintptr_t stack_limit, | 193 ParserBase(Zone* zone, Scanner* scanner, uintptr_t stack_limit, |
194 v8::Extension* extension, AstValueFactory* ast_value_factory, | 194 v8::Extension* extension, AstValueFactory* ast_value_factory) |
195 ParserRecorder* log) | |
196 : scope_state_(nullptr), | 195 : scope_state_(nullptr), |
197 function_state_(nullptr), | 196 function_state_(nullptr), |
198 extension_(extension), | 197 extension_(extension), |
199 fni_(nullptr), | 198 fni_(nullptr), |
200 ast_value_factory_(ast_value_factory), | 199 ast_value_factory_(ast_value_factory), |
201 ast_node_factory_(ast_value_factory), | 200 ast_node_factory_(ast_value_factory), |
202 log_(log), | |
203 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. | 201 mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. |
204 parsing_module_(false), | 202 parsing_module_(false), |
205 stack_limit_(stack_limit), | 203 stack_limit_(stack_limit), |
206 zone_(zone), | 204 zone_(zone), |
207 classifier_(nullptr), | 205 classifier_(nullptr), |
208 scanner_(scanner), | 206 scanner_(scanner), |
209 stack_overflow_(false), | 207 stack_overflow_(false), |
210 default_eager_compile_hint_(FunctionLiteral::kShouldLazyCompile), | 208 default_eager_compile_hint_(FunctionLiteral::kShouldLazyCompile), |
211 allow_lazy_(false), | 209 allow_lazy_(false), |
212 allow_natives_(false), | 210 allow_natives_(false), |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 } | 1435 } |
1438 | 1436 |
1439 // Parser base's protected field members. | 1437 // Parser base's protected field members. |
1440 | 1438 |
1441 ScopeState* scope_state_; // Scope stack. | 1439 ScopeState* scope_state_; // Scope stack. |
1442 FunctionState* function_state_; // Function state stack. | 1440 FunctionState* function_state_; // Function state stack. |
1443 v8::Extension* extension_; | 1441 v8::Extension* extension_; |
1444 FuncNameInferrer* fni_; | 1442 FuncNameInferrer* fni_; |
1445 AstValueFactory* ast_value_factory_; // Not owned. | 1443 AstValueFactory* ast_value_factory_; // Not owned. |
1446 typename Types::Factory ast_node_factory_; | 1444 typename Types::Factory ast_node_factory_; |
1447 ParserRecorder* log_; | |
1448 Mode mode_; | 1445 Mode mode_; |
1449 bool parsing_module_; | 1446 bool parsing_module_; |
1450 uintptr_t stack_limit_; | 1447 uintptr_t stack_limit_; |
1451 | 1448 |
1452 // Parser base's private field members. | 1449 // Parser base's private field members. |
1453 | 1450 |
1454 private: | 1451 private: |
1455 Zone* zone_; | 1452 Zone* zone_; |
1456 ExpressionClassifier* classifier_; | 1453 ExpressionClassifier* classifier_; |
1457 | 1454 |
(...skipping 4014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5472 has_seen_constructor_ = true; | 5469 has_seen_constructor_ = true; |
5473 return; | 5470 return; |
5474 } | 5471 } |
5475 } | 5472 } |
5476 | 5473 |
5477 | 5474 |
5478 } // namespace internal | 5475 } // namespace internal |
5479 } // namespace v8 | 5476 } // namespace v8 |
5480 | 5477 |
5481 #endif // V8_PARSING_PARSER_BASE_H | 5478 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |