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/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 ZoneList<CaseClause*>* cases, Scope* scope); | 345 ZoneList<CaseClause*>* cases, Scope* scope); |
346 void RewriteCatchPattern(CatchInfo* catch_info, bool* ok); | 346 void RewriteCatchPattern(CatchInfo* catch_info, bool* ok); |
347 void ValidateCatchBlock(const CatchInfo& catch_info, bool* ok); | 347 void ValidateCatchBlock(const CatchInfo& catch_info, bool* ok); |
348 Statement* RewriteTryStatement(Block* try_block, Block* catch_block, | 348 Statement* RewriteTryStatement(Block* try_block, Block* catch_block, |
349 Block* finally_block, | 349 Block* finally_block, |
350 const CatchInfo& catch_info, int pos); | 350 const CatchInfo& catch_info, int pos); |
351 | 351 |
352 void ParseAndRewriteGeneratorFunctionBody(int pos, FunctionKind kind, | 352 void ParseAndRewriteGeneratorFunctionBody(int pos, FunctionKind kind, |
353 ZoneList<Statement*>* body, | 353 ZoneList<Statement*>* body, |
354 bool* ok); | 354 bool* ok); |
| 355 void ParseAndRewriteAsyncGeneratorFunctionBody(int pos, FunctionKind kind, |
| 356 ZoneList<Statement*>* body, |
| 357 bool* ok); |
355 void CreateFunctionNameAssignment(const AstRawString* function_name, int pos, | 358 void CreateFunctionNameAssignment(const AstRawString* function_name, int pos, |
356 FunctionLiteral::FunctionType function_type, | 359 FunctionLiteral::FunctionType function_type, |
357 DeclarationScope* function_scope, | 360 DeclarationScope* function_scope, |
358 ZoneList<Statement*>* result, int index); | 361 ZoneList<Statement*>* result, int index); |
359 | 362 |
360 Statement* DeclareFunction(const AstRawString* variable_name, | 363 Statement* DeclareFunction(const AstRawString* variable_name, |
361 FunctionLiteral* function, VariableMode mode, | 364 FunctionLiteral* function, VariableMode mode, |
362 int pos, bool is_sloppy_block_function, | 365 int pos, bool is_sloppy_block_function, |
363 ZoneList<const AstRawString*>* names, bool* ok); | 366 ZoneList<const AstRawString*>* names, bool* ok); |
364 V8_INLINE Statement* DeclareClass(const AstRawString* variable_name, | 367 V8_INLINE Statement* DeclareClass(const AstRawString* variable_name, |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 // ! <literal> -> true / false | 870 // ! <literal> -> true / false |
868 // The following rewriting rules enable the collection of type feedback | 871 // The following rewriting rules enable the collection of type feedback |
869 // without any special stub and the multiplication is removed later in | 872 // without any special stub and the multiplication is removed later in |
870 // Crankshaft's canonicalization pass. | 873 // Crankshaft's canonicalization pass. |
871 // + foo -> foo * 1 | 874 // + foo -> foo * 1 |
872 // - foo -> foo * (-1) | 875 // - foo -> foo * (-1) |
873 // ~ foo -> foo ^(~0) | 876 // ~ foo -> foo ^(~0) |
874 Expression* BuildUnaryExpression(Expression* expression, Token::Value op, | 877 Expression* BuildUnaryExpression(Expression* expression, Token::Value op, |
875 int pos); | 878 int pos); |
876 | 879 |
877 Expression* BuildIteratorResult(Expression* value, bool done); | |
878 | |
879 // Generate AST node that throws a ReferenceError with the given type. | 880 // Generate AST node that throws a ReferenceError with the given type. |
880 V8_INLINE Expression* NewThrowReferenceError( | 881 V8_INLINE Expression* NewThrowReferenceError( |
881 MessageTemplate::Template message, int pos) { | 882 MessageTemplate::Template message, int pos) { |
882 return NewThrowError(Runtime::kNewReferenceError, message, | 883 return NewThrowError(Runtime::kNewReferenceError, message, |
883 ast_value_factory()->empty_string(), pos); | 884 ast_value_factory()->empty_string(), pos); |
884 } | 885 } |
885 | 886 |
886 // Generate AST node that throws a SyntaxError with the given | 887 // Generate AST node that throws a SyntaxError with the given |
887 // type. The first argument may be null (in the handle sense) in | 888 // type. The first argument may be null (in the handle sense) in |
888 // which case no arguments are passed to the constructor. | 889 // which case no arguments are passed to the constructor. |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 | 1223 |
1223 private: | 1224 private: |
1224 ParserTarget** variable_; | 1225 ParserTarget** variable_; |
1225 ParserTarget* previous_; | 1226 ParserTarget* previous_; |
1226 }; | 1227 }; |
1227 | 1228 |
1228 } // namespace internal | 1229 } // namespace internal |
1229 } // namespace v8 | 1230 } // namespace v8 |
1230 | 1231 |
1231 #endif // V8_PARSING_PARSER_H_ | 1232 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |