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" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 }; | 208 }; |
209 | 209 |
210 class FunctionEntry BASE_EMBEDDED { | 210 class FunctionEntry BASE_EMBEDDED { |
211 public: | 211 public: |
212 enum { | 212 enum { |
213 kStartPositionIndex, | 213 kStartPositionIndex, |
214 kEndPositionIndex, | 214 kEndPositionIndex, |
215 kLiteralCountIndex, | 215 kLiteralCountIndex, |
216 kPropertyCountIndex, | 216 kPropertyCountIndex, |
217 kLanguageModeIndex, | 217 kLanguageModeIndex, |
218 kUsesSuperPropertyIndex, | 218 kNeedsHomeObjectIndex, |
219 kSize | 219 kSize |
220 }; | 220 }; |
221 | 221 |
222 explicit FunctionEntry(Vector<unsigned> backing) | 222 explicit FunctionEntry(Vector<unsigned> backing) |
223 : backing_(backing) { } | 223 : backing_(backing) { } |
224 | 224 |
225 FunctionEntry() : backing_() { } | 225 FunctionEntry() : backing_() { } |
226 | 226 |
227 int start_pos() { return backing_[kStartPositionIndex]; } | 227 int start_pos() { return backing_[kStartPositionIndex]; } |
228 int end_pos() { return backing_[kEndPositionIndex]; } | 228 int end_pos() { return backing_[kEndPositionIndex]; } |
229 int literal_count() { return backing_[kLiteralCountIndex]; } | 229 int literal_count() { return backing_[kLiteralCountIndex]; } |
230 int property_count() { return backing_[kPropertyCountIndex]; } | 230 int property_count() { return backing_[kPropertyCountIndex]; } |
231 LanguageMode language_mode() { | 231 LanguageMode language_mode() { |
232 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); | 232 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); |
233 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); | 233 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); |
234 } | 234 } |
235 bool uses_super_property() { return backing_[kUsesSuperPropertyIndex]; } | 235 bool needs_home_object() { return backing_[kNeedsHomeObjectIndex]; } |
236 | 236 |
237 bool is_valid() { return !backing_.is_empty(); } | 237 bool is_valid() { return !backing_.is_empty(); } |
238 | 238 |
239 private: | 239 private: |
240 Vector<unsigned> backing_; | 240 Vector<unsigned> backing_; |
241 }; | 241 }; |
242 | 242 |
243 | 243 |
244 // Wrapper around ScriptData to provide parser-specific functionality. | 244 // Wrapper around ScriptData to provide parser-specific functionality. |
245 class ParseData { | 245 class ParseData { |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 } | 1274 } |
1275 | 1275 |
1276 | 1276 |
1277 Expression* ParserTraits::SpreadCallNew( | 1277 Expression* ParserTraits::SpreadCallNew( |
1278 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1278 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
1279 return parser_->SpreadCallNew(function, args, pos); | 1279 return parser_->SpreadCallNew(function, args, pos); |
1280 } | 1280 } |
1281 } } // namespace v8::internal | 1281 } } // namespace v8::internal |
1282 | 1282 |
1283 #endif // V8_PARSER_H_ | 1283 #endif // V8_PARSER_H_ |
OLD | NEW |