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

Side by Side Diff: src/parser.h

Issue 207633003: Move new expression parsing funcs to ParserBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: code review Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 468
469 static bool IsArrayIndex(Handle<String> string, uint32_t* index) { 469 static bool IsArrayIndex(Handle<String> string, uint32_t* index) {
470 return !string.is_null() && string->AsArrayIndex(index); 470 return !string.is_null() && string->AsArrayIndex(index);
471 } 471 }
472 472
473 // Functions for encapsulating the differences between parsing and preparsing; 473 // Functions for encapsulating the differences between parsing and preparsing;
474 // operations interleaved with the recursive descent. 474 // operations interleaved with the recursive descent.
475 static void PushLiteralName(FuncNameInferrer* fni, Handle<String> id) { 475 static void PushLiteralName(FuncNameInferrer* fni, Handle<String> id) {
476 fni->PushLiteralName(id); 476 fni->PushLiteralName(id);
477 } 477 }
478 void PushPropertyName(FuncNameInferrer* fni, Expression* expression);
478 479
479 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( 480 static void CheckFunctionLiteralInsideTopLevelObjectLiteral(
480 Scope* scope, Expression* value, bool* has_function) { 481 Scope* scope, Expression* value, bool* has_function) {
481 if (scope->DeclarationScope()->is_global_scope() && 482 if (scope->DeclarationScope()->is_global_scope() &&
482 value->AsFunctionLiteral() != NULL) { 483 value->AsFunctionLiteral() != NULL) {
483 *has_function = true; 484 *has_function = true;
484 value->AsFunctionLiteral()->set_pretenure(); 485 value->AsFunctionLiteral()->set_pretenure();
485 } 486 }
486 } 487 }
487 488
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // "null" return type creators. 543 // "null" return type creators.
543 static Handle<String> EmptyIdentifier() { 544 static Handle<String> EmptyIdentifier() {
544 return Handle<String>(); 545 return Handle<String>();
545 } 546 }
546 static Expression* EmptyExpression() { 547 static Expression* EmptyExpression() {
547 return NULL; 548 return NULL;
548 } 549 }
549 static Literal* EmptyLiteral() { 550 static Literal* EmptyLiteral() {
550 return NULL; 551 return NULL;
551 } 552 }
553 // Used in error return values.
552 static ZoneList<Expression*>* NullExpressionList() { 554 static ZoneList<Expression*>* NullExpressionList() {
553 return NULL; 555 return NULL;
554 } 556 }
555 557
556 // Odd-ball literal creators. 558 // Odd-ball literal creators.
557 Literal* GetLiteralTheHole(int position, 559 Literal* GetLiteralTheHole(int position,
558 AstNodeFactory<AstConstructionVisitor>* factory); 560 AstNodeFactory<AstConstructionVisitor>* factory);
559 561
560 // Producing data during the recursive descent. 562 // Producing data during the recursive descent.
561 Handle<String> GetSymbol(Scanner* scanner = NULL); 563 Handle<String> GetSymbol(Scanner* scanner = NULL);
(...skipping 20 matching lines...) Expand all
582 // Temporary glue; these functions will move to ParserBase. 584 // Temporary glue; these functions will move to ParserBase.
583 Expression* ParseV8Intrinsic(bool* ok); 585 Expression* ParseV8Intrinsic(bool* ok);
584 FunctionLiteral* ParseFunctionLiteral( 586 FunctionLiteral* ParseFunctionLiteral(
585 Handle<String> name, 587 Handle<String> name,
586 Scanner::Location function_name_location, 588 Scanner::Location function_name_location,
587 bool name_is_strict_reserved, 589 bool name_is_strict_reserved,
588 bool is_generator, 590 bool is_generator,
589 int function_token_position, 591 int function_token_position,
590 FunctionLiteral::FunctionType type, 592 FunctionLiteral::FunctionType type,
591 bool* ok); 593 bool* ok);
592 Expression* ParseMemberWithNewPrefixesExpression(bool* ok);
593 594
594 private: 595 private:
595 Parser* parser_; 596 Parser* parser_;
596 }; 597 };
597 598
598 599
599 class Parser : public ParserBase<ParserTraits> { 600 class Parser : public ParserBase<ParserTraits> {
600 public: 601 public:
601 explicit Parser(CompilationInfo* info); 602 explicit Parser(CompilationInfo* info);
602 ~Parser() { 603 ~Parser() {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 WhileStatement* ParseWhileStatement(ZoneStringList* labels, bool* ok); 719 WhileStatement* ParseWhileStatement(ZoneStringList* labels, bool* ok);
719 Statement* ParseForStatement(ZoneStringList* labels, bool* ok); 720 Statement* ParseForStatement(ZoneStringList* labels, bool* ok);
720 Statement* ParseThrowStatement(bool* ok); 721 Statement* ParseThrowStatement(bool* ok);
721 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value); 722 Expression* MakeCatchContext(Handle<String> id, VariableProxy* value);
722 TryStatement* ParseTryStatement(bool* ok); 723 TryStatement* ParseTryStatement(bool* ok);
723 DebuggerStatement* ParseDebuggerStatement(bool* ok); 724 DebuggerStatement* ParseDebuggerStatement(bool* ok);
724 725
725 // Support for hamony block scoped bindings. 726 // Support for hamony block scoped bindings.
726 Block* ParseScopedBlock(ZoneStringList* labels, bool* ok); 727 Block* ParseScopedBlock(ZoneStringList* labels, bool* ok);
727 728
728 Expression* ParseMemberWithNewPrefixesExpression(bool* ok);
729 Expression* ParseMemberExpression(bool* ok);
730 Expression* ParseMemberExpressionContinuation(Expression* expression,
731 bool* ok);
732 // Initialize the components of a for-in / for-of statement. 729 // Initialize the components of a for-in / for-of statement.
733 void InitializeForEachStatement(ForEachStatement* stmt, 730 void InitializeForEachStatement(ForEachStatement* stmt,
734 Expression* each, 731 Expression* each,
735 Expression* subject, 732 Expression* subject,
736 Statement* body); 733 Statement* body);
737 734
738 FunctionLiteral* ParseFunctionLiteral( 735 FunctionLiteral* ParseFunctionLiteral(
739 Handle<String> name, 736 Handle<String> name,
740 Scanner::Location function_name_location, 737 Scanner::Location function_name_location,
741 bool name_is_strict_reserved, 738 bool name_is_strict_reserved,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 private: 839 private:
843 static const int kLiteralTypeSlot = 0; 840 static const int kLiteralTypeSlot = 0;
844 static const int kElementsSlot = 1; 841 static const int kElementsSlot = 1;
845 842
846 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 843 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
847 }; 844 };
848 845
849 } } // namespace v8::internal 846 } } // namespace v8::internal
850 847
851 #endif // V8_PARSER_H_ 848 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698