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/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 int pos) { | 514 int pos) { |
515 return PreParserExpression::Default(); | 515 return PreParserExpression::Default(); |
516 } | 516 } |
517 PreParserExpression NewCountOperation(Token::Value op, | 517 PreParserExpression NewCountOperation(Token::Value op, |
518 bool is_prefix, | 518 bool is_prefix, |
519 PreParserExpression expression, | 519 PreParserExpression expression, |
520 int pos) { | 520 int pos) { |
521 return PreParserExpression::Default(); | 521 return PreParserExpression::Default(); |
522 } | 522 } |
523 PreParserExpression NewCall(PreParserExpression expression, | 523 PreParserExpression NewCall(PreParserExpression expression, |
524 PreParserExpressionList arguments, | 524 PreParserExpressionList arguments, int pos, |
525 int pos) { | 525 Call::PossiblyEval possibly_eval) { |
526 if (expression.IsIdentifier() && expression.AsIdentifier().IsEval()) { | 526 if (possibly_eval == Call::IS_POSSIBLY_EVAL) { |
| 527 DCHECK(expression.IsIdentifier() && expression.AsIdentifier().IsEval()); |
527 return PreParserExpression::CallEval(); | 528 return PreParserExpression::CallEval(); |
528 } | 529 } |
529 return PreParserExpression::Call(); | 530 return PreParserExpression::Call(); |
530 } | 531 } |
531 PreParserExpression NewCallNew(PreParserExpression expression, | 532 PreParserExpression NewCallNew(PreParserExpression expression, |
532 PreParserExpressionList arguments, | 533 PreParserExpressionList arguments, |
533 int pos) { | 534 int pos) { |
534 return PreParserExpression::Default(); | 535 return PreParserExpression::Default(); |
535 } | 536 } |
536 PreParserExpression NewCallRuntime(const AstRawString* name, | 537 PreParserExpression NewCallRuntime(const AstRawString* name, |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 void PreParserTraits::MaterializeUnspreadArgumentsLiterals(int count) { | 1170 void PreParserTraits::MaterializeUnspreadArgumentsLiterals(int count) { |
1170 for (int i = 0; i < count; ++i) { | 1171 for (int i = 0; i < count; ++i) { |
1171 pre_parser_->function_state_->NextMaterializedLiteralIndex(); | 1172 pre_parser_->function_state_->NextMaterializedLiteralIndex(); |
1172 } | 1173 } |
1173 } | 1174 } |
1174 | 1175 |
1175 | 1176 |
1176 PreParserExpression PreParserTraits::SpreadCall(PreParserExpression function, | 1177 PreParserExpression PreParserTraits::SpreadCall(PreParserExpression function, |
1177 PreParserExpressionList args, | 1178 PreParserExpressionList args, |
1178 int pos) { | 1179 int pos) { |
1179 return pre_parser_->factory()->NewCall(function, args, pos); | 1180 return pre_parser_->factory()->NewCall(function, args, pos, Call::NOT_EVAL); |
1180 } | 1181 } |
1181 | 1182 |
1182 PreParserExpression PreParserTraits::SpreadCallNew(PreParserExpression function, | 1183 PreParserExpression PreParserTraits::SpreadCallNew(PreParserExpression function, |
1183 PreParserExpressionList args, | 1184 PreParserExpressionList args, |
1184 int pos) { | 1185 int pos) { |
1185 return pre_parser_->factory()->NewCallNew(function, args, pos); | 1186 return pre_parser_->factory()->NewCallNew(function, args, pos); |
1186 } | 1187 } |
1187 | 1188 |
1188 void PreParserTraits::ParseArrowFunctionFormalParameterList( | 1189 void PreParserTraits::ParseArrowFunctionFormalParameterList( |
1189 PreParserFormalParameters* parameters, PreParserExpression params, | 1190 PreParserFormalParameters* parameters, PreParserExpression params, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 const PreParserFormalParameters& parameters, FunctionKind kind, | 1259 const PreParserFormalParameters& parameters, FunctionKind kind, |
1259 FunctionLiteral::FunctionType function_type, bool* ok) { | 1260 FunctionLiteral::FunctionType function_type, bool* ok) { |
1260 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1261 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1261 kind, function_type, ok); | 1262 kind, function_type, ok); |
1262 } | 1263 } |
1263 | 1264 |
1264 } // namespace internal | 1265 } // namespace internal |
1265 } // namespace v8 | 1266 } // namespace v8 |
1266 | 1267 |
1267 #endif // V8_PARSING_PREPARSER_H | 1268 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |