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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 Isolate* isolate() { return isolate_; } | 610 Isolate* isolate() { return isolate_; } |
611 CompilationInfo* info() const { return info_; } | 611 CompilationInfo* info() const { return info_; } |
612 | 612 |
613 // Called by ParseProgram after setting up the scanner. | 613 // Called by ParseProgram after setting up the scanner. |
614 FunctionLiteral* DoParseProgram(CompilationInfo* info, | 614 FunctionLiteral* DoParseProgram(CompilationInfo* info, |
615 Handle<String> source); | 615 Handle<String> source); |
616 | 616 |
617 void SetCachedData(); | 617 void SetCachedData(); |
618 | 618 |
619 bool inside_with() const { return scope_->inside_with(); } | 619 bool inside_with() const { return scope_->inside_with(); } |
620 CachedDataMode cached_data_mode() const { return info_->cached_data_mode(); } | 620 ScriptCompiler::CompileOptions compile_options() const { |
| 621 return info_->compile_options(); |
| 622 } |
621 Scope* DeclarationScope(VariableMode mode) { | 623 Scope* DeclarationScope(VariableMode mode) { |
622 return IsLexicalVariableMode(mode) | 624 return IsLexicalVariableMode(mode) |
623 ? scope_ : scope_->DeclarationScope(); | 625 ? scope_ : scope_->DeclarationScope(); |
624 } | 626 } |
625 | 627 |
626 // All ParseXXX functions take as the last argument an *ok parameter | 628 // All ParseXXX functions take as the last argument an *ok parameter |
627 // which is set to false if parsing failed; it is unchanged otherwise. | 629 // which is set to false if parsing failed; it is unchanged otherwise. |
628 // By making the 'exception handling' explicit, we are forced to check | 630 // By making the 'exception handling' explicit, we are forced to check |
629 // for failure at the call sites. | 631 // for failure at the call sites. |
630 void* ParseSourceElements(ZoneList<Statement*>* processor, int end_token, | 632 void* ParseSourceElements(ZoneList<Statement*>* processor, int end_token, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 void InternalizeUseCounts(); | 760 void InternalizeUseCounts(); |
759 | 761 |
760 Isolate* isolate_; | 762 Isolate* isolate_; |
761 | 763 |
762 Handle<Script> script_; | 764 Handle<Script> script_; |
763 Scanner scanner_; | 765 Scanner scanner_; |
764 PreParser* reusable_preparser_; | 766 PreParser* reusable_preparser_; |
765 Scope* original_scope_; // for ES5 function declarations in sloppy eval | 767 Scope* original_scope_; // for ES5 function declarations in sloppy eval |
766 Target* target_stack_; // for break, continue statements | 768 Target* target_stack_; // for break, continue statements |
767 ParseData* cached_parse_data_; | 769 ParseData* cached_parse_data_; |
768 CachedDataMode cached_data_mode_; | 770 ScriptCompiler::CompileOptions compile_options_; |
769 AstValueFactory* ast_value_factory_; | 771 AstValueFactory* ast_value_factory_; |
770 | 772 |
771 CompilationInfo* info_; | 773 CompilationInfo* info_; |
772 | 774 |
773 // Pending errors. | 775 // Pending errors. |
774 bool has_pending_error_; | 776 bool has_pending_error_; |
775 Scanner::Location pending_error_location_; | 777 Scanner::Location pending_error_location_; |
776 const char* pending_error_message_; | 778 const char* pending_error_message_; |
777 const AstRawString* pending_error_arg_; | 779 const AstRawString* pending_error_arg_; |
778 const char* pending_error_char_arg_; | 780 const char* pending_error_char_arg_; |
(...skipping 27 matching lines...) Expand all Loading... |
806 private: | 808 private: |
807 static const int kLiteralTypeSlot = 0; | 809 static const int kLiteralTypeSlot = 0; |
808 static const int kElementsSlot = 1; | 810 static const int kElementsSlot = 1; |
809 | 811 |
810 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 812 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
811 }; | 813 }; |
812 | 814 |
813 } } // namespace v8::internal | 815 } } // namespace v8::internal |
814 | 816 |
815 #endif // V8_PARSER_H_ | 817 #endif // V8_PARSER_H_ |
OLD | NEW |