Chromium Code Reviews| 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
| 6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/compiler.h" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 | 565 |
| 566 // Utility functions | 566 // Utility functions |
| 567 int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope, | 567 int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope, |
| 568 Scanner::Location* dupe_loc, | 568 Scanner::Location* dupe_loc, |
| 569 bool* ok); | 569 bool* ok); |
| 570 V8_INLINE AstValueFactory* ast_value_factory(); | 570 V8_INLINE AstValueFactory* ast_value_factory(); |
| 571 | 571 |
| 572 // Temporary glue; these functions will move to ParserBase. | 572 // Temporary glue; these functions will move to ParserBase. |
| 573 Expression* ParseV8Intrinsic(bool* ok); | 573 Expression* ParseV8Intrinsic(bool* ok); |
| 574 FunctionLiteral* ParseFunctionLiteral( | 574 FunctionLiteral* ParseFunctionLiteral( |
| 575 const AstRawString* name, | 575 const AstRawString* name, Scanner::Location function_name_location, |
| 576 Scanner::Location function_name_location, | |
| 577 bool name_is_strict_reserved, | 576 bool name_is_strict_reserved, |
| 578 bool is_generator, | 577 FunctionLiteral::IsGeneratorFlag is_generator, |
|
marja
2014/08/22 08:22:46
Are these flag mutually exclusive; Afaik an arrow
rossberg
2014/08/22 09:34:31
Generator methods can be concise, too. But that's
arv (Not doing code reviews)
2014/08/22 23:16:02
I initially added kConciseMethod to FunctionLitera
| |
| 579 int function_token_position, | 578 FunctionLiteral::IsArrowFlag is_arrow, |
| 580 FunctionLiteral::FunctionType type, | 579 FunctionLiteral::IsConciseMethodFlag is_concise_method, |
| 581 FunctionLiteral::ArityRestriction arity_restriction, | 580 int function_token_position, FunctionLiteral::FunctionType type, |
| 582 bool* ok); | 581 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| 583 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, | 582 V8_INLINE void SkipLazyFunctionBody(const AstRawString* name, |
| 584 int* materialized_literal_count, | 583 int* materialized_literal_count, |
| 585 int* expected_property_count, bool* ok); | 584 int* expected_property_count, bool* ok); |
| 586 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( | 585 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( |
| 587 const AstRawString* name, int pos, Variable* fvar, | 586 const AstRawString* name, int pos, Variable* fvar, |
| 588 Token::Value fvar_init_op, bool is_generator, bool* ok); | 587 Token::Value fvar_init_op, bool is_generator, bool* ok); |
| 589 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, | 588 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, |
| 590 bool* ok); | 589 bool* ok); |
| 591 | 590 |
| 592 private: | 591 private: |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 void InitializeForEachStatement(ForEachStatement* stmt, | 725 void InitializeForEachStatement(ForEachStatement* stmt, |
| 727 Expression* each, | 726 Expression* each, |
| 728 Expression* subject, | 727 Expression* subject, |
| 729 Statement* body); | 728 Statement* body); |
| 730 Statement* DesugarLetBindingsInForStatement( | 729 Statement* DesugarLetBindingsInForStatement( |
| 731 Scope* inner_scope, ZoneList<const AstRawString*>* names, | 730 Scope* inner_scope, ZoneList<const AstRawString*>* names, |
| 732 ForStatement* loop, Statement* init, Expression* cond, Statement* next, | 731 ForStatement* loop, Statement* init, Expression* cond, Statement* next, |
| 733 Statement* body, bool* ok); | 732 Statement* body, bool* ok); |
| 734 | 733 |
| 735 FunctionLiteral* ParseFunctionLiteral( | 734 FunctionLiteral* ParseFunctionLiteral( |
| 736 const AstRawString* name, | 735 const AstRawString* name, Scanner::Location function_name_location, |
| 737 Scanner::Location function_name_location, | |
| 738 bool name_is_strict_reserved, | 736 bool name_is_strict_reserved, |
| 739 bool is_generator, | 737 FunctionLiteral::IsGeneratorFlag is_generator, |
| 740 int function_token_position, | 738 FunctionLiteral::IsArrowFlag is_arrow, |
| 741 FunctionLiteral::FunctionType type, | 739 FunctionLiteral::IsConciseMethodFlag is_concise_method, |
| 742 FunctionLiteral::ArityRestriction arity_restriction, | 740 int function_token_position, FunctionLiteral::FunctionType type, |
| 743 bool* ok); | 741 FunctionLiteral::ArityRestriction arity_restriction, bool* ok); |
| 744 | 742 |
| 745 // Magical syntax support. | 743 // Magical syntax support. |
| 746 Expression* ParseV8Intrinsic(bool* ok); | 744 Expression* ParseV8Intrinsic(bool* ok); |
| 747 | 745 |
| 748 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); | 746 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); |
| 749 | 747 |
| 750 // Get odd-ball literals. | 748 // Get odd-ball literals. |
| 751 Literal* GetLiteralUndefined(int position); | 749 Literal* GetLiteralUndefined(int position); |
| 752 | 750 |
| 753 // For harmony block scoping mode: Check if the scope has conflicting var/let | 751 // For harmony block scoping mode: Check if the scope has conflicting var/let |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 890 private: | 888 private: |
| 891 static const int kLiteralTypeSlot = 0; | 889 static const int kLiteralTypeSlot = 0; |
| 892 static const int kElementsSlot = 1; | 890 static const int kElementsSlot = 1; |
| 893 | 891 |
| 894 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 892 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 895 }; | 893 }; |
| 896 | 894 |
| 897 } } // namespace v8::internal | 895 } } // namespace v8::internal |
| 898 | 896 |
| 899 #endif // V8_PARSER_H_ | 897 #endif // V8_PARSER_H_ |
| OLD | NEW |