| OLD | NEW |
| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 class CompilationInfo; | 41 class CompilationInfo; |
| 42 class FuncNameInferrer; | 42 class FuncNameInferrer; |
| 43 class ParserLog; | 43 class ParserLog; |
| 44 class PositionStack; | 44 class PositionStack; |
| 45 class Target; | 45 class Target; |
| 46 | 46 |
| 47 template <typename T> class ZoneListWrapper; | 47 template <typename T> class ZoneListWrapper; |
| 48 | 48 |
| 49 | 49 |
| 50 class ParserMessage : public Malloced { | |
| 51 public: | |
| 52 ParserMessage(Scanner::Location loc, const char* message, | |
| 53 Vector<const char*> args) | |
| 54 : loc_(loc), | |
| 55 message_(message), | |
| 56 args_(args) { } | |
| 57 ~ParserMessage(); | |
| 58 Scanner::Location location() { return loc_; } | |
| 59 const char* message() { return message_; } | |
| 60 Vector<const char*> args() { return args_; } | |
| 61 private: | |
| 62 Scanner::Location loc_; | |
| 63 const char* message_; | |
| 64 Vector<const char*> args_; | |
| 65 }; | |
| 66 | |
| 67 | |
| 68 class FunctionEntry BASE_EMBEDDED { | 50 class FunctionEntry BASE_EMBEDDED { |
| 69 public: | 51 public: |
| 70 enum { | 52 enum { |
| 71 kStartPositionIndex, | 53 kStartPositionIndex, |
| 72 kEndPositionIndex, | 54 kEndPositionIndex, |
| 73 kLiteralCountIndex, | 55 kLiteralCountIndex, |
| 74 kPropertyCountIndex, | 56 kPropertyCountIndex, |
| 75 kLanguageModeIndex, | 57 kLanguageModeIndex, |
| 76 kSize | 58 kSize |
| 77 }; | 59 }; |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 Expression* ParseNewExpression(bool* ok); | 628 Expression* ParseNewExpression(bool* ok); |
| 647 Expression* ParseMemberExpression(bool* ok); | 629 Expression* ParseMemberExpression(bool* ok); |
| 648 Expression* ParseNewPrefix(PositionStack* stack, bool* ok); | 630 Expression* ParseNewPrefix(PositionStack* stack, bool* ok); |
| 649 Expression* ParseMemberWithNewPrefixesExpression(PositionStack* stack, | 631 Expression* ParseMemberWithNewPrefixesExpression(PositionStack* stack, |
| 650 bool* ok); | 632 bool* ok); |
| 651 Expression* ParsePrimaryExpression(bool* ok); | 633 Expression* ParsePrimaryExpression(bool* ok); |
| 652 Expression* ParseArrayLiteral(bool* ok); | 634 Expression* ParseArrayLiteral(bool* ok); |
| 653 Expression* ParseObjectLiteral(bool* ok); | 635 Expression* ParseObjectLiteral(bool* ok); |
| 654 Expression* ParseRegExpLiteral(bool seen_equal, bool* ok); | 636 Expression* ParseRegExpLiteral(bool seen_equal, bool* ok); |
| 655 | 637 |
| 656 // Populate the constant properties fixed array for a materialized object | |
| 657 // literal. | |
| 658 void BuildObjectLiteralConstantProperties( | |
| 659 ZoneList<ObjectLiteral::Property*>* properties, | |
| 660 Handle<FixedArray> constants, | |
| 661 bool* is_simple, | |
| 662 bool* fast_elements, | |
| 663 int* depth, | |
| 664 bool* may_store_doubles); | |
| 665 | |
| 666 // Decide if a property should be in the object boilerplate. | |
| 667 bool IsBoilerplateProperty(ObjectLiteral::Property* property); | |
| 668 // If the expression is a literal, return the literal value; | |
| 669 // if the expression is a materialized literal and is simple return a | |
| 670 // compile time value as encoded by CompileTimeValue::GetValue(). | |
| 671 // Otherwise, return undefined literal as the placeholder | |
| 672 // in the object literal boilerplate. | |
| 673 Handle<Object> GetBoilerplateValue(Expression* expression); | |
| 674 | |
| 675 // Initialize the components of a for-in / for-of statement. | 638 // Initialize the components of a for-in / for-of statement. |
| 676 void InitializeForEachStatement(ForEachStatement* stmt, | 639 void InitializeForEachStatement(ForEachStatement* stmt, |
| 677 Expression* each, | 640 Expression* each, |
| 678 Expression* subject, | 641 Expression* subject, |
| 679 Statement* body); | 642 Statement* body); |
| 680 | 643 |
| 681 ZoneList<Expression*>* ParseArguments(bool* ok); | 644 ZoneList<Expression*>* ParseArguments(bool* ok); |
| 682 FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name, | 645 FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name, |
| 683 bool name_is_reserved, | 646 bool name_is_reserved, |
| 684 bool is_generator, | 647 bool is_generator, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 private: | 810 private: |
| 848 static const int kLiteralTypeSlot = 0; | 811 static const int kLiteralTypeSlot = 0; |
| 849 static const int kElementsSlot = 1; | 812 static const int kElementsSlot = 1; |
| 850 | 813 |
| 851 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 814 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 852 }; | 815 }; |
| 853 | 816 |
| 854 } } // namespace v8::internal | 817 } } // namespace v8::internal |
| 855 | 818 |
| 856 #endif // V8_PARSER_H_ | 819 #endif // V8_PARSER_H_ |
| OLD | NEW |