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_PARSING_PREPARSER_H | 5 #ifndef V8_PARSING_PREPARSER_H |
6 #define V8_PARSING_PREPARSER_H | 6 #define V8_PARSING_PREPARSER_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 | 932 |
933 inline PreParserExpression RewriteNonPattern( | 933 inline PreParserExpression RewriteNonPattern( |
934 PreParserExpression expr, const ExpressionClassifier* classifier, | 934 PreParserExpression expr, const ExpressionClassifier* classifier, |
935 bool* ok); | 935 bool* ok); |
936 inline PreParserExpression RewriteNonPatternObjectLiteralProperty( | 936 inline PreParserExpression RewriteNonPatternObjectLiteralProperty( |
937 PreParserExpression property, const ExpressionClassifier* classifier, | 937 PreParserExpression property, const ExpressionClassifier* classifier, |
938 bool* ok); | 938 bool* ok); |
939 | 939 |
940 inline PreParserExpression RewriteYieldStar( | 940 inline PreParserExpression RewriteYieldStar( |
941 PreParserExpression generator, PreParserExpression expr, int pos); | 941 PreParserExpression generator, PreParserExpression expr, int pos); |
| 942 inline PreParserExpression RewriteInstanceof(PreParserExpression lhs, |
| 943 PreParserExpression rhs, |
| 944 int pos); |
942 | 945 |
943 private: | 946 private: |
944 PreParser* pre_parser_; | 947 PreParser* pre_parser_; |
945 }; | 948 }; |
946 | 949 |
947 | 950 |
948 // Preparsing checks a JavaScript program and emits preparse-data that helps | 951 // Preparsing checks a JavaScript program and emits preparse-data that helps |
949 // a later parsing to be faster. | 952 // a later parsing to be faster. |
950 // See preparse-data-format.h for the data format. | 953 // See preparse-data-format.h for the data format. |
951 | 954 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 return property; | 1139 return property; |
1137 } | 1140 } |
1138 | 1141 |
1139 | 1142 |
1140 PreParserExpression PreParserTraits::RewriteYieldStar( | 1143 PreParserExpression PreParserTraits::RewriteYieldStar( |
1141 PreParserExpression generator, PreParserExpression expression, int pos) { | 1144 PreParserExpression generator, PreParserExpression expression, int pos) { |
1142 return pre_parser_->factory()->NewYield( | 1145 return pre_parser_->factory()->NewYield( |
1143 generator, expression, Yield::kDelegating, pos); | 1146 generator, expression, Yield::kDelegating, pos); |
1144 } | 1147 } |
1145 | 1148 |
| 1149 PreParserExpression PreParserTraits::RewriteInstanceof(PreParserExpression lhs, |
| 1150 PreParserExpression rhs, |
| 1151 int pos) { |
| 1152 return PreParserExpression::Default(); |
| 1153 } |
1146 | 1154 |
1147 PreParserStatementList PreParser::ParseEagerFunctionBody( | 1155 PreParserStatementList PreParser::ParseEagerFunctionBody( |
1148 PreParserIdentifier function_name, int pos, | 1156 PreParserIdentifier function_name, int pos, |
1149 const PreParserFormalParameters& parameters, FunctionKind kind, | 1157 const PreParserFormalParameters& parameters, FunctionKind kind, |
1150 FunctionLiteral::FunctionType function_type, bool* ok) { | 1158 FunctionLiteral::FunctionType function_type, bool* ok) { |
1151 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); | 1159 ParsingModeScope parsing_mode(this, PARSE_EAGERLY); |
1152 | 1160 |
1153 ParseStatementList(Token::RBRACE, ok); | 1161 ParseStatementList(Token::RBRACE, ok); |
1154 if (!*ok) return PreParserStatementList(); | 1162 if (!*ok) return PreParserStatementList(); |
1155 | 1163 |
1156 Expect(Token::RBRACE, ok); | 1164 Expect(Token::RBRACE, ok); |
1157 return PreParserStatementList(); | 1165 return PreParserStatementList(); |
1158 } | 1166 } |
1159 | 1167 |
1160 | 1168 |
1161 PreParserStatementList PreParserTraits::ParseEagerFunctionBody( | 1169 PreParserStatementList PreParserTraits::ParseEagerFunctionBody( |
1162 PreParserIdentifier function_name, int pos, | 1170 PreParserIdentifier function_name, int pos, |
1163 const PreParserFormalParameters& parameters, FunctionKind kind, | 1171 const PreParserFormalParameters& parameters, FunctionKind kind, |
1164 FunctionLiteral::FunctionType function_type, bool* ok) { | 1172 FunctionLiteral::FunctionType function_type, bool* ok) { |
1165 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1173 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1166 kind, function_type, ok); | 1174 kind, function_type, ok); |
1167 } | 1175 } |
1168 | 1176 |
1169 } // namespace internal | 1177 } // namespace internal |
1170 } // namespace v8 | 1178 } // namespace v8 |
1171 | 1179 |
1172 #endif // V8_PARSING_PREPARSER_H | 1180 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |