| 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/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/parsing/parser-base.h" | 10 #include "src/parsing/parser-base.h" |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 return expression; | 559 return expression; |
| 560 } | 560 } |
| 561 PreParserExpression NewNumberLiteral(double number, | 561 PreParserExpression NewNumberLiteral(double number, |
| 562 int pos) { | 562 int pos) { |
| 563 return PreParserExpression::Default(); | 563 return PreParserExpression::Default(); |
| 564 } | 564 } |
| 565 PreParserExpression NewUndefinedLiteral(int pos) { | 565 PreParserExpression NewUndefinedLiteral(int pos) { |
| 566 return PreParserExpression::Default(); | 566 return PreParserExpression::Default(); |
| 567 } | 567 } |
| 568 PreParserExpression NewRegExpLiteral(PreParserIdentifier js_pattern, | 568 PreParserExpression NewRegExpLiteral(PreParserIdentifier js_pattern, |
| 569 int js_flags, int literal_index, | 569 int js_flags, int pos) { |
| 570 int pos) { | |
| 571 return PreParserExpression::Default(); | 570 return PreParserExpression::Default(); |
| 572 } | 571 } |
| 573 PreParserExpression NewArrayLiteral(PreParserExpressionList values, | 572 PreParserExpression NewArrayLiteral(PreParserExpressionList values, |
| 574 int first_spread_index, int literal_index, | 573 int first_spread_index, int pos) { |
| 575 int pos) { | |
| 576 return PreParserExpression::ArrayLiteral(values.variables_); | 574 return PreParserExpression::ArrayLiteral(values.variables_); |
| 577 } | 575 } |
| 578 PreParserExpression NewClassLiteralProperty(PreParserExpression key, | 576 PreParserExpression NewClassLiteralProperty(PreParserExpression key, |
| 579 PreParserExpression value, | 577 PreParserExpression value, |
| 580 ClassLiteralProperty::Kind kind, | 578 ClassLiteralProperty::Kind kind, |
| 581 bool is_static, | 579 bool is_static, |
| 582 bool is_computed_name) { | 580 bool is_computed_name) { |
| 583 return PreParserExpression::Default(); | 581 return PreParserExpression::Default(); |
| 584 } | 582 } |
| 585 PreParserExpression NewObjectLiteralProperty(PreParserExpression key, | 583 PreParserExpression NewObjectLiteralProperty(PreParserExpression key, |
| 586 PreParserExpression value, | 584 PreParserExpression value, |
| 587 ObjectLiteralProperty::Kind kind, | 585 ObjectLiteralProperty::Kind kind, |
| 588 bool is_computed_name) { | 586 bool is_computed_name) { |
| 589 return PreParserExpression::Default(value.variables_); | 587 return PreParserExpression::Default(value.variables_); |
| 590 } | 588 } |
| 591 PreParserExpression NewObjectLiteralProperty(PreParserExpression key, | 589 PreParserExpression NewObjectLiteralProperty(PreParserExpression key, |
| 592 PreParserExpression value, | 590 PreParserExpression value, |
| 593 bool is_computed_name) { | 591 bool is_computed_name) { |
| 594 return PreParserExpression::Default(value.variables_); | 592 return PreParserExpression::Default(value.variables_); |
| 595 } | 593 } |
| 596 PreParserExpression NewObjectLiteral(PreParserExpressionList properties, | 594 PreParserExpression NewObjectLiteral(PreParserExpressionList properties, |
| 597 int literal_index, | |
| 598 int boilerplate_properties, int pos, | 595 int boilerplate_properties, int pos, |
| 599 bool has_rest_property) { | 596 bool has_rest_property) { |
| 600 return PreParserExpression::ObjectLiteral(properties.variables_); | 597 return PreParserExpression::ObjectLiteral(properties.variables_); |
| 601 } | 598 } |
| 602 PreParserExpression NewVariableProxy(void* variable) { | 599 PreParserExpression NewVariableProxy(void* variable) { |
| 603 return PreParserExpression::Default(); | 600 return PreParserExpression::Default(); |
| 604 } | 601 } |
| 605 PreParserExpression NewProperty(PreParserExpression obj, | 602 PreParserExpression NewProperty(PreParserExpression obj, |
| 606 PreParserExpression key, | 603 PreParserExpression key, |
| 607 int pos) { | 604 int pos) { |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 if (track_unresolved_variables_) { | 1575 if (track_unresolved_variables_) { |
| 1579 DCHECK(FLAG_lazy_inner_functions); | 1576 DCHECK(FLAG_lazy_inner_functions); |
| 1580 if (params.variables_ != nullptr) { | 1577 if (params.variables_ != nullptr) { |
| 1581 for (auto variable : *params.variables_) { | 1578 for (auto variable : *params.variables_) { |
| 1582 parameters->scope->DeclareVariableName(variable->raw_name(), VAR); | 1579 parameters->scope->DeclareVariableName(variable->raw_name(), VAR); |
| 1583 } | 1580 } |
| 1584 } | 1581 } |
| 1585 } | 1582 } |
| 1586 } | 1583 } |
| 1587 | 1584 |
| 1588 V8_INLINE void ReindexLiterals(const PreParserFormalParameters& parameters) {} | |
| 1589 | |
| 1590 V8_INLINE PreParserExpression NoTemplateTag() { | 1585 V8_INLINE PreParserExpression NoTemplateTag() { |
| 1591 return PreParserExpression::NoTemplateTag(); | 1586 return PreParserExpression::NoTemplateTag(); |
| 1592 } | 1587 } |
| 1593 | 1588 |
| 1594 V8_INLINE static bool IsTaggedTemplate(const PreParserExpression tag) { | 1589 V8_INLINE static bool IsTaggedTemplate(const PreParserExpression tag) { |
| 1595 return !tag.IsNoTemplateTag(); | 1590 return !tag.IsNoTemplateTag(); |
| 1596 } | 1591 } |
| 1597 | 1592 |
| 1598 V8_INLINE void MaterializeUnspreadArgumentsLiterals(int count) { | 1593 V8_INLINE void MaterializeUnspreadArgumentsLiterals(int count) { |
| 1599 for (int i = 0; i < count; ++i) { | 1594 for (int i = 0; i < count; ++i) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 function_state_->NextMaterializedLiteralIndex(); | 1651 function_state_->NextMaterializedLiteralIndex(); |
| 1657 function_state_->NextMaterializedLiteralIndex(); | 1652 function_state_->NextMaterializedLiteralIndex(); |
| 1658 } | 1653 } |
| 1659 return EmptyExpression(); | 1654 return EmptyExpression(); |
| 1660 } | 1655 } |
| 1661 | 1656 |
| 1662 } // namespace internal | 1657 } // namespace internal |
| 1663 } // namespace v8 | 1658 } // namespace v8 |
| 1664 | 1659 |
| 1665 #endif // V8_PARSING_PREPARSER_H | 1660 #endif // V8_PARSING_PREPARSER_H |
| OLD | NEW |