| 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" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 | 26 |
| 27 class FunctionEntry BASE_EMBEDDED { | 27 class FunctionEntry BASE_EMBEDDED { |
| 28 public: | 28 public: |
| 29 enum { | 29 enum { |
| 30 kStartPositionIndex, | 30 kStartPositionIndex, |
| 31 kEndPositionIndex, | 31 kEndPositionIndex, |
| 32 kLiteralCountIndex, | 32 kLiteralCountIndex, |
| 33 kPropertyCountIndex, | 33 kPropertyCountIndex, |
| 34 kLanguageModeIndex, | 34 kLanguageModeIndex, |
| 35 kUsesSuperPropertyIndex, |
| 35 kSize | 36 kSize |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 explicit FunctionEntry(Vector<unsigned> backing) | 39 explicit FunctionEntry(Vector<unsigned> backing) |
| 39 : backing_(backing) { } | 40 : backing_(backing) { } |
| 40 | 41 |
| 41 FunctionEntry() : backing_() { } | 42 FunctionEntry() : backing_() { } |
| 42 | 43 |
| 43 int start_pos() { return backing_[kStartPositionIndex]; } | 44 int start_pos() { return backing_[kStartPositionIndex]; } |
| 44 int end_pos() { return backing_[kEndPositionIndex]; } | 45 int end_pos() { return backing_[kEndPositionIndex]; } |
| 45 int literal_count() { return backing_[kLiteralCountIndex]; } | 46 int literal_count() { return backing_[kLiteralCountIndex]; } |
| 46 int property_count() { return backing_[kPropertyCountIndex]; } | 47 int property_count() { return backing_[kPropertyCountIndex]; } |
| 47 LanguageMode language_mode() { | 48 LanguageMode language_mode() { |
| 48 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); | 49 DCHECK(is_valid_language_mode(backing_[kLanguageModeIndex])); |
| 49 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); | 50 return static_cast<LanguageMode>(backing_[kLanguageModeIndex]); |
| 50 } | 51 } |
| 52 bool uses_super_property() { return backing_[kUsesSuperPropertyIndex]; } |
| 51 | 53 |
| 52 bool is_valid() { return !backing_.is_empty(); } | 54 bool is_valid() { return !backing_.is_empty(); } |
| 53 | 55 |
| 54 private: | 56 private: |
| 55 Vector<unsigned> backing_; | 57 Vector<unsigned> backing_; |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 | 60 |
| 59 // Wrapper around ScriptData to provide parser-specific functionality. | 61 // Wrapper around ScriptData to provide parser-specific functionality. |
| 60 class ParseData { | 62 class ParseData { |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 } | 980 } |
| 979 | 981 |
| 980 | 982 |
| 981 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, | 983 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, |
| 982 int start, Expression* tag) { | 984 int start, Expression* tag) { |
| 983 return parser_->CloseTemplateLiteral(state, start, tag); | 985 return parser_->CloseTemplateLiteral(state, start, tag); |
| 984 } | 986 } |
| 985 } } // namespace v8::internal | 987 } } // namespace v8::internal |
| 986 | 988 |
| 987 #endif // V8_PARSER_H_ | 989 #endif // V8_PARSER_H_ |
| OLD | NEW |