| 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 659 |
| 660 | 660 |
| 661 // Magical syntax support. | 661 // Magical syntax support. |
| 662 Expression* ParseV8Intrinsic(bool* ok); | 662 Expression* ParseV8Intrinsic(bool* ok); |
| 663 | 663 |
| 664 bool is_generator() const { return current_function_state_->is_generator(); } | 664 bool is_generator() const { return current_function_state_->is_generator(); } |
| 665 | 665 |
| 666 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); | 666 bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode* visit_mode); |
| 667 | 667 |
| 668 Handle<String> LiteralString(PretenureFlag tenured) { | 668 Handle<String> LiteralString(PretenureFlag tenured) { |
| 669 if (scanner().is_literal_ascii()) { | 669 return scanner().GetLiteralString(tenured); |
| 670 return isolate_->factory()->NewStringFromAscii( | |
| 671 scanner().literal_ascii_string(), tenured); | |
| 672 } else { | |
| 673 return isolate_->factory()->NewStringFromTwoByte( | |
| 674 scanner().literal_utf16_string(), tenured); | |
| 675 } | |
| 676 } | 670 } |
| 677 | 671 |
| 678 Handle<String> NextLiteralString(PretenureFlag tenured) { | 672 Handle<String> NextLiteralString(PretenureFlag tenured) { |
| 679 if (scanner().is_next_literal_ascii()) { | 673 return scanner().GetNextLiteralString(tenured); |
| 680 return isolate_->factory()->NewStringFromAscii( | |
| 681 scanner().next_literal_ascii_string(), tenured); | |
| 682 } else { | |
| 683 return isolate_->factory()->NewStringFromTwoByte( | |
| 684 scanner().next_literal_utf16_string(), tenured); | |
| 685 } | |
| 686 } | 674 } |
| 687 | 675 |
| 688 Handle<String> GetSymbol(); | 676 Handle<String> GetSymbol(); |
| 689 | 677 |
| 690 // Get odd-ball literals. | 678 // Get odd-ball literals. |
| 691 Literal* GetLiteralUndefined(int position); | 679 Literal* GetLiteralUndefined(int position); |
| 692 Literal* GetLiteralTheHole(int position); | 680 Literal* GetLiteralTheHole(int position); |
| 693 | 681 |
| 694 Handle<String> ParseIdentifier(bool* ok); | 682 Handle<String> ParseIdentifier(bool* ok); |
| 695 Handle<String> ParseIdentifierOrStrictReservedWord( | 683 Handle<String> ParseIdentifierOrStrictReservedWord( |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 private: | 807 private: |
| 820 static const int kLiteralTypeSlot = 0; | 808 static const int kLiteralTypeSlot = 0; |
| 821 static const int kElementsSlot = 1; | 809 static const int kElementsSlot = 1; |
| 822 | 810 |
| 823 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 811 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 824 }; | 812 }; |
| 825 | 813 |
| 826 } } // namespace v8::internal | 814 } } // namespace v8::internal |
| 827 | 815 |
| 828 #endif // V8_PARSER_H_ | 816 #endif // V8_PARSER_H_ |
| OLD | NEW |