OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 static const unsigned kHeaderSize = 4; | 113 static const unsigned kHeaderSize = 4; |
114 | 114 |
115 private: | 115 private: |
116 unsigned Read(int position); | 116 unsigned Read(int position); |
117 unsigned* ReadAddress(int position); | 117 unsigned* ReadAddress(int position); |
118 int EntryCount(); | 118 int EntryCount(); |
119 FunctionEntry nth(int n); | 119 FunctionEntry nth(int n); |
120 | 120 |
121 Vector<unsigned> store_; | 121 Vector<unsigned> store_; |
122 | 122 |
| 123 // Read strings written by ParserRecorder::WriteString. |
| 124 static const char* ReadString(unsigned* start, int* chars); |
| 125 |
123 // The last entry returned. This is used to make lookup faster: | 126 // The last entry returned. This is used to make lookup faster: |
124 // the next entry to return is typically the next entry so lookup | 127 // the next entry to return is typically the next entry so lookup |
125 // will usually be much faster if we start from the last entry. | 128 // will usually be much faster if we start from the last entry. |
126 int last_entry_; | 129 int last_entry_; |
127 }; | 130 }; |
128 | 131 |
129 | 132 |
130 // The parser: Takes a script and and context information, and builds a | 133 // The parser: Takes a script and and context information, and builds a |
131 // FunctionLiteral AST node. Returns NULL and deallocates any allocated | 134 // FunctionLiteral AST node. Returns NULL and deallocates any allocated |
132 // AST nodes if parsing failed. | 135 // AST nodes if parsing failed. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 static const int kTypeSlot = 0; | 193 static const int kTypeSlot = 0; |
191 static const int kElementsSlot = 1; | 194 static const int kElementsSlot = 1; |
192 | 195 |
193 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 196 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
194 }; | 197 }; |
195 | 198 |
196 | 199 |
197 } } // namespace v8::internal | 200 } } // namespace v8::internal |
198 | 201 |
199 #endif // V8_PARSER_H_ | 202 #endif // V8_PARSER_H_ |
OLD | NEW |