Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1094)

Unified Diff: src/preparser.h

Issue 1123383005: Rely on ExpressionClassifier to match valid arrow function formals (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 3be19aa49eb1f76258c8e020ba160529bb6c175d..c5058649c10aa1c65a5478a7357306b5cfd37100 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -1195,16 +1195,6 @@ class PreParserExpression {
return TypeField::decode(code_) == kBinaryOperationExpression;
}
- bool is_single_parenthesized() const {
- return ParenthesizationField::decode(code_) != kNotParenthesized;
- }
-
- void increase_parenthesization_level() {
- code_ = ParenthesizationField::update(
- code_, is_single_parenthesized() ? kMultiParenthesizedExpression
- : kParanthesizedExpression);
- }
-
// Dummy implementation for making expression->somefunc() work in both Parser
// and PreParser.
PreParserExpression* operator->() { return this; }
@@ -1225,12 +1215,6 @@ class PreParserExpression {
kSpreadExpression
};
- enum Parenthesization {
- kNotParenthesized,
- kParanthesizedExpression,
- kMultiParenthesizedExpression
- };
-
enum ExpressionType {
kThisExpression,
kThisPropertyExpression,
@@ -1242,17 +1226,15 @@ class PreParserExpression {
explicit PreParserExpression(uint32_t expression_code)
: code_(expression_code) {}
- // The first five bits are for the Type and Parenthesization.
+ // The first three bits are for the Type.
typedef BitField<Type, 0, 3> TypeField;
- typedef BitField<Parenthesization, TypeField::kNext, 2> ParenthesizationField;
// The rest of the bits are interpreted depending on the value
// of the Type field, so they can share the storage.
- typedef BitField<ExpressionType, ParenthesizationField::kNext, 3>
- ExpressionTypeField;
- typedef BitField<bool, ParenthesizationField::kNext, 1> IsUseStrictField;
+ typedef BitField<ExpressionType, TypeField::kNext, 3> ExpressionTypeField;
+ typedef BitField<bool, TypeField::kNext, 1> IsUseStrictField;
typedef BitField<bool, IsUseStrictField::kNext, 1> IsUseStrongField;
- typedef BitField<PreParserIdentifier::Type, ParenthesizationField::kNext, 10>
+ typedef BitField<PreParserIdentifier::Type, TypeField::kNext, 10>
IdentifierTypeField;
uint32_t code_;
@@ -2372,7 +2354,6 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier,
// seeing the call parentheses.
parenthesized_function_ = (peek() == Token::FUNCTION);
result = this->ParseExpression(true, classifier, CHECK_OK);
- result->increase_parenthesization_level();
Expect(Token::RPAREN, CHECK_OK);
}
break;
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698