| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 | 165 |
| 166 class PreParserApi { | 166 class PreParserApi { |
| 167 public: | 167 public: |
| 168 // Pre-parse a character stream and return full preparse data. | 168 // Pre-parse a character stream and return full preparse data. |
| 169 // | 169 // |
| 170 // This interface is here instead of in preparser.h because it instantiates a | 170 // This interface is here instead of in preparser.h because it instantiates a |
| 171 // preparser recorder object that is suited to the parser's purposes. Also, | 171 // preparser recorder object that is suited to the parser's purposes. Also, |
| 172 // the preparser doesn't know about ScriptDataImpl. | 172 // the preparser doesn't know about ScriptDataImpl. |
| 173 static ScriptDataImpl* PreParse(Utf16CharacterStream* source); | 173 static ScriptDataImpl* PreParse(Isolate* isolate, |
| 174 Utf16CharacterStream* source); |
| 174 }; | 175 }; |
| 175 | 176 |
| 176 | 177 |
| 177 // ---------------------------------------------------------------------------- | 178 // ---------------------------------------------------------------------------- |
| 178 // REGEXP PARSING | 179 // REGEXP PARSING |
| 179 | 180 |
| 180 // A BufferedZoneList is an automatically growing list, just like (and backed | 181 // A BufferedZoneList is an automatically growing list, just like (and backed |
| 181 // by) a ZoneList, that is optimized for the case of adding and removing | 182 // by) a ZoneList, that is optimized for the case of adding and removing |
| 182 // a single element. The last element added is stored outside the backing list, | 183 // a single element. The last element added is stored outside the backing list, |
| 183 // and if no more than one element is ever added, the ZoneList isn't even | 184 // and if no more than one element is ever added, the ZoneList isn't even |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 public: | 888 public: |
| 888 enum LiteralType { | 889 enum LiteralType { |
| 889 OBJECT_LITERAL_FAST_ELEMENTS, | 890 OBJECT_LITERAL_FAST_ELEMENTS, |
| 890 OBJECT_LITERAL_SLOW_ELEMENTS, | 891 OBJECT_LITERAL_SLOW_ELEMENTS, |
| 891 ARRAY_LITERAL | 892 ARRAY_LITERAL |
| 892 }; | 893 }; |
| 893 | 894 |
| 894 static bool IsCompileTimeValue(Expression* expression); | 895 static bool IsCompileTimeValue(Expression* expression); |
| 895 | 896 |
| 896 // Get the value as a compile time value. | 897 // Get the value as a compile time value. |
| 897 static Handle<FixedArray> GetValue(Expression* expression); | 898 static Handle<FixedArray> GetValue(Isolate* isolate, Expression* expression); |
| 898 | 899 |
| 899 // Get the type of a compile time value returned by GetValue(). | 900 // Get the type of a compile time value returned by GetValue(). |
| 900 static LiteralType GetLiteralType(Handle<FixedArray> value); | 901 static LiteralType GetLiteralType(Handle<FixedArray> value); |
| 901 | 902 |
| 902 // Get the elements array of a compile time value returned by GetValue(). | 903 // Get the elements array of a compile time value returned by GetValue(). |
| 903 static Handle<FixedArray> GetElements(Handle<FixedArray> value); | 904 static Handle<FixedArray> GetElements(Handle<FixedArray> value); |
| 904 | 905 |
| 905 private: | 906 private: |
| 906 static const int kLiteralTypeSlot = 0; | 907 static const int kLiteralTypeSlot = 0; |
| 907 static const int kElementsSlot = 1; | 908 static const int kElementsSlot = 1; |
| 908 | 909 |
| 909 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 910 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 910 }; | 911 }; |
| 911 | 912 |
| 912 } } // namespace v8::internal | 913 } } // namespace v8::internal |
| 913 | 914 |
| 914 #endif // V8_PARSER_H_ | 915 #endif // V8_PARSER_H_ |
| OLD | NEW |