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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 kUsesSuperPropertyIndex, |
| 219 kCallsEvalIndex, |
219 kSize | 220 kSize |
220 }; | 221 }; |
221 | 222 |
222 explicit FunctionEntry(Vector<unsigned> backing) | 223 explicit FunctionEntry(Vector<unsigned> backing) |
223 : backing_(backing) { } | 224 : backing_(backing) { } |
224 | 225 |
225 FunctionEntry() : backing_() { } | 226 FunctionEntry() : backing_() { } |
226 | 227 |
227 int start_pos() { return backing_[kStartPositionIndex]; } | 228 int start_pos() { return backing_[kStartPositionIndex]; } |
228 int end_pos() { return backing_[kEndPositionIndex]; } | 229 int end_pos() { return backing_[kEndPositionIndex]; } |
229 int literal_count() { return backing_[kLiteralCountIndex]; } | 230 int literal_count() { return backing_[kLiteralCountIndex]; } |
230 int property_count() { return backing_[kPropertyCountIndex]; } | 231 int property_count() { return backing_[kPropertyCountIndex]; } |
231 LanguageMode language_mode() { | 232 LanguageMode language_mode() { |
232 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); | 233 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); |
233 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); | 234 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); |
234 } | 235 } |
235 bool uses_super_property() { return backing_[kUsesSuperPropertyIndex]; } | 236 bool uses_super_property() { return backing_[kUsesSuperPropertyIndex]; } |
| 237 bool calls_eval() { return backing_[kCallsEvalIndex]; } |
236 | 238 |
237 bool is_valid() { return !backing_.is_empty(); } | 239 bool is_valid() { return !backing_.is_empty(); } |
238 | 240 |
239 private: | 241 private: |
240 Vector<unsigned> backing_; | 242 Vector<unsigned> backing_; |
241 }; | 243 }; |
242 | 244 |
243 | 245 |
244 // Wrapper around ScriptData to provide parser-specific functionality. | 246 // Wrapper around ScriptData to provide parser-specific functionality. |
245 class ParseData { | 247 class ParseData { |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 } | 1276 } |
1275 | 1277 |
1276 | 1278 |
1277 Expression* ParserTraits::SpreadCallNew( | 1279 Expression* ParserTraits::SpreadCallNew( |
1278 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1280 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
1279 return parser_->SpreadCallNew(function, args, pos); | 1281 return parser_->SpreadCallNew(function, args, pos); |
1280 } | 1282 } |
1281 } } // namespace v8::internal | 1283 } } // namespace v8::internal |
1282 | 1284 |
1283 #endif // V8_PARSER_H_ | 1285 #endif // V8_PARSER_H_ |
OLD | NEW |