| 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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
| 6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/compiler.h" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
| (...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( | 791 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( |
| 792 SingletonLogger* logger); | 792 SingletonLogger* logger); |
| 793 | 793 |
| 794 // Consumes the ending }. | 794 // Consumes the ending }. |
| 795 ZoneList<Statement*>* ParseEagerFunctionBody( | 795 ZoneList<Statement*>* ParseEagerFunctionBody( |
| 796 const AstRawString* function_name, int pos, Variable* fvar, | 796 const AstRawString* function_name, int pos, Variable* fvar, |
| 797 Token::Value fvar_init_op, bool is_generator, bool* ok); | 797 Token::Value fvar_init_op, bool is_generator, bool* ok); |
| 798 | 798 |
| 799 void ThrowPendingError(); | 799 void ThrowPendingError(); |
| 800 | 800 |
| 801 void InternalizeUseCounts(); |
| 802 |
| 801 Isolate* isolate_; | 803 Isolate* isolate_; |
| 802 | 804 |
| 803 Handle<Script> script_; | 805 Handle<Script> script_; |
| 804 Scanner scanner_; | 806 Scanner scanner_; |
| 805 PreParser* reusable_preparser_; | 807 PreParser* reusable_preparser_; |
| 806 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 808 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
| 807 Target* target_stack_; // for break, continue statements | 809 Target* target_stack_; // for break, continue statements |
| 808 ScriptData** cached_data_; | 810 ScriptData** cached_data_; |
| 809 CachedDataMode cached_data_mode_; | 811 CachedDataMode cached_data_mode_; |
| 810 AstValueFactory* ast_value_factory_; | 812 AstValueFactory* ast_value_factory_; |
| 811 | 813 |
| 812 CompilationInfo* info_; | 814 CompilationInfo* info_; |
| 813 | 815 |
| 814 // Pending errors. | 816 // Pending errors. |
| 815 bool has_pending_error_; | 817 bool has_pending_error_; |
| 816 Scanner::Location pending_error_location_; | 818 Scanner::Location pending_error_location_; |
| 817 const char* pending_error_message_; | 819 const char* pending_error_message_; |
| 818 const AstRawString* pending_error_arg_; | 820 const AstRawString* pending_error_arg_; |
| 819 const char* pending_error_char_arg_; | 821 const char* pending_error_char_arg_; |
| 820 bool pending_error_is_reference_error_; | 822 bool pending_error_is_reference_error_; |
| 823 |
| 824 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; |
| 821 }; | 825 }; |
| 822 | 826 |
| 823 | 827 |
| 824 // Support for handling complex values (array and object literals) that | 828 // Support for handling complex values (array and object literals) that |
| 825 // can be fully handled at compile time. | 829 // can be fully handled at compile time. |
| 826 class CompileTimeValue: public AllStatic { | 830 class CompileTimeValue: public AllStatic { |
| 827 public: | 831 public: |
| 828 enum LiteralType { | 832 enum LiteralType { |
| 829 OBJECT_LITERAL_FAST_ELEMENTS, | 833 OBJECT_LITERAL_FAST_ELEMENTS, |
| 830 OBJECT_LITERAL_SLOW_ELEMENTS, | 834 OBJECT_LITERAL_SLOW_ELEMENTS, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 845 private: | 849 private: |
| 846 static const int kLiteralTypeSlot = 0; | 850 static const int kLiteralTypeSlot = 0; |
| 847 static const int kElementsSlot = 1; | 851 static const int kElementsSlot = 1; |
| 848 | 852 |
| 849 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 853 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 850 }; | 854 }; |
| 851 | 855 |
| 852 } } // namespace v8::internal | 856 } } // namespace v8::internal |
| 853 | 857 |
| 854 #endif // V8_PARSER_H_ | 858 #endif // V8_PARSER_H_ |
| OLD | NEW |