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 is_inner_function, bool may_abort, | 481 bool may_abort, bool* ok); |
482 bool* ok); | |
483 | 482 |
484 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( | 483 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( |
485 SingletonLogger* logger, bool is_inner_function, bool may_abort); | 484 SingletonLogger* logger, bool may_abort); |
486 | 485 |
487 Block* BuildParameterInitializationBlock( | 486 Block* BuildParameterInitializationBlock( |
488 const ParserFormalParameters& parameters, bool* ok); | 487 const ParserFormalParameters& parameters, bool* ok); |
489 Block* BuildRejectPromiseOnException(Block* block, bool* ok); | 488 Block* BuildRejectPromiseOnException(Block* block, bool* ok); |
490 | 489 |
491 // Consumes the ending }. | 490 // Consumes the ending }. |
492 ZoneList<Statement*>* ParseEagerFunctionBody( | 491 ZoneList<Statement*>* ParseEagerFunctionBody( |
493 const AstRawString* function_name, int pos, | 492 const AstRawString* function_name, int pos, |
494 const ParserFormalParameters& parameters, FunctionKind kind, | 493 const ParserFormalParameters& parameters, FunctionKind kind, |
495 FunctionLiteral::FunctionType function_type, bool* ok); | 494 FunctionLiteral::FunctionType function_type, bool* ok); |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 | 1056 |
1058 V8_INLINE ZoneList<Expression*>* GetNonPatternList() const { | 1057 V8_INLINE ZoneList<Expression*>* GetNonPatternList() const { |
1059 return function_state_->non_patterns_to_rewrite(); | 1058 return function_state_->non_patterns_to_rewrite(); |
1060 } | 1059 } |
1061 | 1060 |
1062 V8_INLINE void CountUsage(v8::Isolate::UseCounterFeature feature) { | 1061 V8_INLINE void CountUsage(v8::Isolate::UseCounterFeature feature) { |
1063 ++use_counts_[feature]; | 1062 ++use_counts_[feature]; |
1064 } | 1063 } |
1065 | 1064 |
1066 // Parser's private field members. | 1065 // Parser's private field members. |
1067 friend class DiscardableZoneScope; // Uses reusable_preparser_. | |
1068 | 1066 |
1069 Scanner scanner_; | 1067 Scanner scanner_; |
1070 PreParser* reusable_preparser_; | 1068 PreParser* reusable_preparser_; |
1071 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 1069 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
1072 | 1070 |
1073 friend class ParserTarget; | 1071 friend class ParserTarget; |
1074 friend class ParserTargetScope; | 1072 friend class ParserTargetScope; |
1075 ParserTarget* target_stack_; // for break, continue statements | 1073 ParserTarget* target_stack_; // for break, continue statements |
1076 | 1074 |
1077 ScriptCompiler::CompileOptions compile_options_; | 1075 ScriptCompiler::CompileOptions compile_options_; |
(...skipping 11 matching lines...) Expand all Loading... |
1089 | 1087 |
1090 #ifdef DEBUG | 1088 #ifdef DEBUG |
1091 void Print(AstNode* node); | 1089 void Print(AstNode* node); |
1092 #endif // DEBUG | 1090 #endif // DEBUG |
1093 }; | 1091 }; |
1094 | 1092 |
1095 } // namespace internal | 1093 } // namespace internal |
1096 } // namespace v8 | 1094 } // namespace v8 |
1097 | 1095 |
1098 #endif // V8_PARSING_PARSER_H_ | 1096 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |