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_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_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/parsing/parser-base.h" | 10 #include "src/parsing/parser-base.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super, | 471 FunctionLiteral* DefaultConstructor(const AstRawString* name, bool call_super, |
472 bool requires_class_field_init, int pos, | 472 bool requires_class_field_init, int pos, |
473 int end_pos, LanguageMode language_mode); | 473 int end_pos, LanguageMode language_mode); |
474 | 474 |
475 // Skip over a lazy function, either using cached data if we have it, or | 475 // Skip over a lazy function, either using cached data if we have it, or |
476 // by parsing the function with PreParser. Consumes the ending }. | 476 // by parsing the function with PreParser. Consumes the ending }. |
477 // If may_abort == true, the (pre-)parser may decide to abort skipping | 477 // If may_abort == true, the (pre-)parser may decide to abort skipping |
478 // in order to force the function to be eagerly parsed, after all. | 478 // in order to force the function to be eagerly parsed, after all. |
479 LazyParsingResult SkipLazyFunctionBody(int* materialized_literal_count, | 479 LazyParsingResult SkipLazyFunctionBody(int* materialized_literal_count, |
480 int* expected_property_count, | 480 int* expected_property_count, |
481 bool may_abort, bool* ok); | 481 bool is_inner_function, bool may_abort, |
| 482 bool* ok); |
482 | 483 |
483 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( | 484 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( |
484 SingletonLogger* logger, bool may_abort); | 485 SingletonLogger* logger, bool is_inner_function, bool may_abort); |
485 | 486 |
486 Block* BuildParameterInitializationBlock( | 487 Block* BuildParameterInitializationBlock( |
487 const ParserFormalParameters& parameters, bool* ok); | 488 const ParserFormalParameters& parameters, bool* ok); |
488 Block* BuildRejectPromiseOnException(Block* block, bool* ok); | 489 Block* BuildRejectPromiseOnException(Block* block, bool* ok); |
489 | 490 |
490 // Consumes the ending }. | 491 // Consumes the ending }. |
491 ZoneList<Statement*>* ParseEagerFunctionBody( | 492 ZoneList<Statement*>* ParseEagerFunctionBody( |
492 const AstRawString* function_name, int pos, | 493 const AstRawString* function_name, int pos, |
493 const ParserFormalParameters& parameters, FunctionKind kind, | 494 const ParserFormalParameters& parameters, FunctionKind kind, |
494 FunctionLiteral::FunctionType function_type, bool* ok); | 495 FunctionLiteral::FunctionType function_type, bool* ok); |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 | 1057 |
1057 V8_INLINE ZoneList<Expression*>* GetNonPatternList() const { | 1058 V8_INLINE ZoneList<Expression*>* GetNonPatternList() const { |
1058 return function_state_->non_patterns_to_rewrite(); | 1059 return function_state_->non_patterns_to_rewrite(); |
1059 } | 1060 } |
1060 | 1061 |
1061 V8_INLINE void CountUsage(v8::Isolate::UseCounterFeature feature) { | 1062 V8_INLINE void CountUsage(v8::Isolate::UseCounterFeature feature) { |
1062 ++use_counts_[feature]; | 1063 ++use_counts_[feature]; |
1063 } | 1064 } |
1064 | 1065 |
1065 // Parser's private field members. | 1066 // Parser's private field members. |
| 1067 friend class DiscardableZoneScope; // Uses reusable_preparser_. |
1066 | 1068 |
1067 Scanner scanner_; | 1069 Scanner scanner_; |
1068 PreParser* reusable_preparser_; | 1070 PreParser* reusable_preparser_; |
1069 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 1071 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
1070 | 1072 |
1071 friend class ParserTarget; | 1073 friend class ParserTarget; |
1072 friend class ParserTargetScope; | 1074 friend class ParserTargetScope; |
1073 ParserTarget* target_stack_; // for break, continue statements | 1075 ParserTarget* target_stack_; // for break, continue statements |
1074 | 1076 |
1075 ScriptCompiler::CompileOptions compile_options_; | 1077 ScriptCompiler::CompileOptions compile_options_; |
(...skipping 11 matching lines...) Expand all Loading... |
1087 | 1089 |
1088 #ifdef DEBUG | 1090 #ifdef DEBUG |
1089 void Print(AstNode* node); | 1091 void Print(AstNode* node); |
1090 #endif // DEBUG | 1092 #endif // DEBUG |
1091 }; | 1093 }; |
1092 | 1094 |
1093 } // namespace internal | 1095 } // namespace internal |
1094 } // namespace v8 | 1096 } // namespace v8 |
1095 | 1097 |
1096 #endif // V8_PARSING_PARSER_H_ | 1098 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |