| Index: src/parsing/preparser.h
|
| diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
|
| index 280f1df5f855c4e096b926a342c1d71d43072367..ca5c182c685c7a506087553878261a50808512af 100644
|
| --- a/src/parsing/preparser.h
|
| +++ b/src/parsing/preparser.h
|
| @@ -200,10 +200,20 @@ class PreParserExpression {
|
| ExpressionTypeField::encode(kNoTemplateTagExpression));
|
| }
|
|
|
| + static PreParserExpression Empty() {
|
| + return PreParserExpression(TypeField::encode(kExpression) |
|
| + ExpressionTypeField::encode(kEmptyExpression));
|
| + }
|
| +
|
| bool IsIdentifier() const {
|
| return TypeField::decode(code_) == kIdentifierExpression;
|
| }
|
|
|
| + bool IsEmptyExpression() const {
|
| + return TypeField::decode(code_) == kExpression &&
|
| + ExpressionTypeField::decode(code_) == kEmptyExpression;
|
| + }
|
| +
|
| PreParserIdentifier AsIdentifier() const {
|
| DCHECK(IsIdentifier());
|
| return PreParserIdentifier(IdentifierTypeField::decode(code_));
|
| @@ -316,7 +326,8 @@ class PreParserExpression {
|
| kCallEvalExpression,
|
| kSuperCallReference,
|
| kNoTemplateTagExpression,
|
| - kAssignment
|
| + kAssignment,
|
| + kEmptyExpression
|
| };
|
|
|
| explicit PreParserExpression(uint32_t expression_code)
|
| @@ -334,7 +345,7 @@ class PreParserExpression {
|
|
|
| // The rest of the bits are interpreted depending on the value
|
| // of the Type field, so they can share the storage.
|
| - typedef BitField<ExpressionType, TypeField::kNext, 3> ExpressionTypeField;
|
| + typedef BitField<ExpressionType, TypeField::kNext, 4> ExpressionTypeField;
|
| typedef BitField<bool, TypeField::kNext, 1> IsUseStrictField;
|
| typedef BitField<PreParserIdentifier::Type, TypeField::kNext, 10>
|
| IdentifierTypeField;
|
| @@ -662,6 +673,10 @@ class PreParserTraits {
|
| return expression.IsIdentifier();
|
| }
|
|
|
| + static bool IsEmptyExpression(PreParserExpression expression) {
|
| + return expression.IsEmptyExpression();
|
| + }
|
| +
|
| static PreParserIdentifier AsIdentifier(PreParserExpression expression) {
|
| return expression.AsIdentifier();
|
| }
|
| @@ -772,7 +787,7 @@ class PreParserTraits {
|
| return PreParserIdentifier::Default();
|
| }
|
| static PreParserExpression EmptyExpression() {
|
| - return PreParserExpression::Default();
|
| + return PreParserExpression::Empty();
|
| }
|
| static PreParserExpression EmptyLiteral() {
|
| return PreParserExpression::Default();
|
|
|