Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/parsing/parser.h

Issue 2917263002: Move generator-close on exception from the generator function to the GeneratorResume builtin. (Closed)
Patch Set: Address comments & rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 // ! <literal> -> true / false 871 // ! <literal> -> true / false
869 // The following rewriting rules enable the collection of type feedback 872 // The following rewriting rules enable the collection of type feedback
870 // without any special stub and the multiplication is removed later in 873 // without any special stub and the multiplication is removed later in
871 // Crankshaft's canonicalization pass. 874 // Crankshaft's canonicalization pass.
872 // + foo -> foo * 1 875 // + foo -> foo * 1
873 // - foo -> foo * (-1) 876 // - foo -> foo * (-1)
874 // ~ foo -> foo ^(~0) 877 // ~ foo -> foo ^(~0)
875 Expression* BuildUnaryExpression(Expression* expression, Token::Value op, 878 Expression* BuildUnaryExpression(Expression* expression, Token::Value op,
876 int pos); 879 int pos);
877 880
878 Expression* BuildIteratorResult(Expression* value, bool done);
879
880 // Generate AST node that throws a ReferenceError with the given type. 881 // Generate AST node that throws a ReferenceError with the given type.
881 V8_INLINE Expression* NewThrowReferenceError( 882 V8_INLINE Expression* NewThrowReferenceError(
882 MessageTemplate::Template message, int pos) { 883 MessageTemplate::Template message, int pos) {
883 return NewThrowError(Runtime::kNewReferenceError, message, 884 return NewThrowError(Runtime::kNewReferenceError, message,
884 ast_value_factory()->empty_string(), pos); 885 ast_value_factory()->empty_string(), pos);
885 } 886 }
886 887
887 // Generate AST node that throws a SyntaxError with the given 888 // Generate AST node that throws a SyntaxError with the given
888 // type. The first argument may be null (in the handle sense) in 889 // type. The first argument may be null (in the handle sense) in
889 // which case no arguments are passed to the constructor. 890 // which case no arguments are passed to the constructor.
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 1224
1224 private: 1225 private:
1225 ParserTarget** variable_; 1226 ParserTarget** variable_;
1226 ParserTarget* previous_; 1227 ParserTarget* previous_;
1227 }; 1228 };
1228 1229
1229 } // namespace internal 1230 } // namespace internal
1230 } // namespace v8 1231 } // namespace v8
1231 1232
1232 #endif // V8_PARSING_PARSER_H_ 1233 #endif // V8_PARSING_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698