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

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

Issue 2142333002: Refactor class declaration logic to the parser and runtime Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: minor cleanup per Adam Created 4 years, 5 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/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 typedef v8::internal::AstProperties AstProperties; 328 typedef v8::internal::AstProperties AstProperties;
329 329
330 typedef v8::internal::ExpressionClassifier<ParserTraits> 330 typedef v8::internal::ExpressionClassifier<ParserTraits>
331 ExpressionClassifier; 331 ExpressionClassifier;
332 332
333 // Return types for traversing functions. 333 // Return types for traversing functions.
334 typedef const AstRawString* Identifier; 334 typedef const AstRawString* Identifier;
335 typedef v8::internal::Expression* Expression; 335 typedef v8::internal::Expression* Expression;
336 typedef Yield* YieldExpression; 336 typedef Yield* YieldExpression;
337 typedef v8::internal::FunctionLiteral* FunctionLiteral; 337 typedef v8::internal::FunctionLiteral* FunctionLiteral;
338 typedef v8::internal::ClassLiteral* ClassLiteral;
339 typedef v8::internal::Literal* Literal; 338 typedef v8::internal::Literal* Literal;
340 typedef ObjectLiteral::Property* ObjectLiteralProperty; 339 typedef ObjectLiteral::Property* ObjectLiteralProperty;
341 typedef ZoneList<v8::internal::Expression*>* ExpressionList; 340 typedef ZoneList<v8::internal::Expression*>* ExpressionList;
342 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; 341 typedef ZoneList<ObjectLiteral::Property*>* PropertyList;
343 typedef ParserFormalParameters::Parameter FormalParameter; 342 typedef ParserFormalParameters::Parameter FormalParameter;
344 typedef ParserFormalParameters FormalParameters; 343 typedef ParserFormalParameters FormalParameters;
345 typedef ZoneList<v8::internal::Statement*>* StatementList; 344 typedef ZoneList<v8::internal::Statement*>* StatementList;
346 345
347 // For constructing objects returned by the traversing functions. 346 // For constructing objects returned by the traversing functions.
348 typedef AstNodeFactory Factory; 347 typedef AstNodeFactory Factory;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 int function_token_position, FunctionLiteral::FunctionType type, 573 int function_token_position, FunctionLiteral::FunctionType type,
575 LanguageMode language_mode, bool* ok); 574 LanguageMode language_mode, bool* ok);
576 V8_INLINE void SkipLazyFunctionBody( 575 V8_INLINE void SkipLazyFunctionBody(
577 int* materialized_literal_count, int* expected_property_count, bool* ok, 576 int* materialized_literal_count, int* expected_property_count, bool* ok,
578 Scanner::BookmarkScope* bookmark = nullptr); 577 Scanner::BookmarkScope* bookmark = nullptr);
579 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody( 578 V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody(
580 const AstRawString* name, int pos, 579 const AstRawString* name, int pos,
581 const ParserFormalParameters& parameters, FunctionKind kind, 580 const ParserFormalParameters& parameters, FunctionKind kind,
582 FunctionLiteral::FunctionType function_type, bool* ok); 581 FunctionLiteral::FunctionType function_type, bool* ok);
583 582
584 ClassLiteral* ParseClassLiteral(Type::ExpressionClassifier* classifier, 583 Expression* ParseClassLiteral(Type::ExpressionClassifier* classifier,
585 const AstRawString* name, 584 const AstRawString* name,
586 Scanner::Location class_name_location, 585 Scanner::Location class_name_location,
587 bool name_is_strict_reserved, int pos, 586 bool name_is_strict_reserved, int pos,
588 bool* ok); 587 bool* ok);
589 588
590 V8_INLINE void MarkCollectedTailCallExpressions(); 589 V8_INLINE void MarkCollectedTailCallExpressions();
591 V8_INLINE void MarkTailPosition(Expression* expression); 590 V8_INLINE void MarkTailPosition(Expression* expression);
592 591
593 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope, 592 V8_INLINE void CheckConflictingVarDeclarations(v8::internal::Scope* scope,
594 bool* ok); 593 bool* ok);
595 594
596 class TemplateLiteral : public ZoneObject { 595 class TemplateLiteral : public ZoneObject {
597 public: 596 public:
598 TemplateLiteral(Zone* zone, int pos) 597 TemplateLiteral(Zone* zone, int pos)
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 bool accept_IN, int pos, bool* ok); 980 bool accept_IN, int pos, bool* ok);
982 981
983 void RewriteDoExpression(Expression* expr, bool* ok); 982 void RewriteDoExpression(Expression* expr, bool* ok);
984 983
985 FunctionLiteral* ParseFunctionLiteral( 984 FunctionLiteral* ParseFunctionLiteral(
986 const AstRawString* name, Scanner::Location function_name_location, 985 const AstRawString* name, Scanner::Location function_name_location,
987 FunctionNameValidity function_name_validity, FunctionKind kind, 986 FunctionNameValidity function_name_validity, FunctionKind kind,
988 int function_token_position, FunctionLiteral::FunctionType type, 987 int function_token_position, FunctionLiteral::FunctionType type,
989 LanguageMode language_mode, bool* ok); 988 LanguageMode language_mode, bool* ok);
990 989
991 ClassLiteral* ParseClassLiteral(ExpressionClassifier* classifier, 990 Expression* ParseClassLiteral(ExpressionClassifier* classifier,
992 const AstRawString* name, 991 const AstRawString* name,
993 Scanner::Location class_name_location, 992 Scanner::Location class_name_location,
994 bool name_is_strict_reserved, int pos, 993 bool name_is_strict_reserved, int pos,
995 bool* ok); 994 bool* ok);
996 995
997 // Magical syntax support. 996 // Magical syntax support.
998 Expression* ParseV8Intrinsic(bool* ok); 997 Expression* ParseV8Intrinsic(bool* ok);
999 998
1000 // Get odd-ball literals. 999 // Get odd-ball literals.
1001 Literal* GetLiteralUndefined(int position); 1000 Literal* GetLiteralUndefined(int position);
1002 1001
1003 // Check if the scope has conflicting var/let declarations from different 1002 // Check if the scope has conflicting var/let declarations from different
1004 // scopes. This covers for example 1003 // scopes. This covers for example
1005 // 1004 //
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1297
1299 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1298 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1300 return parser_->ParseDoExpression(ok); 1299 return parser_->ParseDoExpression(ok);
1301 } 1300 }
1302 1301
1303 1302
1304 } // namespace internal 1303 } // namespace internal
1305 } // namespace v8 1304 } // namespace v8
1306 1305
1307 #endif // V8_PARSING_PARSER_H_ 1306 #endif // V8_PARSING_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698