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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 // Report syntax error | 564 // Report syntax error |
565 void ReportInvalidPreparseData(Handle<String> name, bool* ok); | 565 void ReportInvalidPreparseData(Handle<String> name, bool* ok); |
566 | 566 |
567 void set_pre_parse_data(ScriptDataImpl *data) { | 567 void set_pre_parse_data(ScriptDataImpl *data) { |
568 pre_parse_data_ = data; | 568 pre_parse_data_ = data; |
569 symbol_cache_.Initialize(data ? data->symbol_count() : 0, zone()); | 569 symbol_cache_.Initialize(data ? data->symbol_count() : 0, zone()); |
570 } | 570 } |
571 | 571 |
572 bool inside_with() const { return scope_->inside_with(); } | 572 bool inside_with() const { return scope_->inside_with(); } |
573 Scanner& scanner() { return scanner_; } | |
574 Mode mode() const { return mode_; } | 573 Mode mode() const { return mode_; } |
575 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } | 574 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } |
576 bool is_extended_mode() { | 575 bool is_extended_mode() { |
577 ASSERT(scope_ != NULL); | 576 ASSERT(scope_ != NULL); |
578 return scope_->is_extended_mode(); | 577 return scope_->is_extended_mode(); |
579 } | 578 } |
580 Scope* DeclarationScope(VariableMode mode) { | 579 Scope* DeclarationScope(VariableMode mode) { |
581 return IsLexicalVariableMode(mode) | 580 return IsLexicalVariableMode(mode) |
582 ? scope_ : scope_->DeclarationScope(); | 581 ? scope_ : scope_->DeclarationScope(); |
583 } | 582 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 int function_token_position, | 661 int function_token_position, |
663 FunctionLiteral::FunctionType type, | 662 FunctionLiteral::FunctionType type, |
664 bool* ok); | 663 bool* ok); |
665 | 664 |
666 // Magical syntax support. | 665 // Magical syntax support. |
667 Expression* ParseV8Intrinsic(bool* ok); | 666 Expression* ParseV8Intrinsic(bool* ok); |
668 | 667 |
669 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); | 668 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); |
670 | 669 |
671 Handle<String> LiteralString(PretenureFlag tenured) { | 670 Handle<String> LiteralString(PretenureFlag tenured) { |
672 if (scanner().is_literal_ascii()) { | 671 if (scanner()->is_literal_ascii()) { |
673 return isolate_->factory()->NewStringFromAscii( | 672 return isolate_->factory()->NewStringFromAscii( |
674 scanner().literal_ascii_string(), tenured); | 673 scanner()->literal_ascii_string(), tenured); |
675 } else { | 674 } else { |
676 return isolate_->factory()->NewStringFromTwoByte( | 675 return isolate_->factory()->NewStringFromTwoByte( |
677 scanner().literal_utf16_string(), tenured); | 676 scanner()->literal_utf16_string(), tenured); |
678 } | 677 } |
679 } | 678 } |
680 | 679 |
681 // Get odd-ball literals. | 680 // Get odd-ball literals. |
682 Literal* GetLiteralUndefined(int position); | 681 Literal* GetLiteralUndefined(int position); |
683 Literal* GetLiteralTheHole(int position); | 682 Literal* GetLiteralTheHole(int position); |
684 | 683 |
685 // Determine if the expression is a variable proxy and mark it as being used | 684 // Determine if the expression is a variable proxy and mark it as being used |
686 // in an assignment or with a increment/decrement operator. This is currently | 685 // in an assignment or with a increment/decrement operator. This is currently |
687 // used on for the statically checking assignments to harmony const bindings. | 686 // used on for the statically checking assignments to harmony const bindings. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 private: | 785 private: |
787 static const int kLiteralTypeSlot = 0; | 786 static const int kLiteralTypeSlot = 0; |
788 static const int kElementsSlot = 1; | 787 static const int kElementsSlot = 1; |
789 | 788 |
790 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 789 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
791 }; | 790 }; |
792 | 791 |
793 } } // namespace v8::internal | 792 } } // namespace v8::internal |
794 | 793 |
795 #endif // V8_PARSER_H_ | 794 #endif // V8_PARSER_H_ |
OLD | NEW |