Chromium Code Reviews| Index: src/parser.h |
| diff --git a/src/parser.h b/src/parser.h |
| index 0c9857a2731d97715d17209f2c916445dfa7576a..e7d170d7514baedc4c78ebcf9430a7c4227f1c69 100644 |
| --- a/src/parser.h |
| +++ b/src/parser.h |
| @@ -456,6 +456,8 @@ class ParserTraits { |
| // Returns true if the expression is of type "this.foo". |
| static bool IsThisProperty(Expression* expression); |
| + static bool IsIdentifier(Expression* expression); |
| + |
| static bool IsBoilerplateProperty(ObjectLiteral::Property* property) { |
| return ObjectLiteral::IsBoilerplateProperty(property); |
| } |
| @@ -505,6 +507,21 @@ class ParserTraits { |
| Expression** x, Expression* y, Token::Value op, int pos, |
| AstNodeFactory<AstConstructionVisitor>* factory); |
| + // Returns true if we can shortcut the unary expression ("not <literal>" or |
| + // "+/- <numeric literal>"). In that case, *expression will be changed to the |
| + // shortcut. |
| + bool ShortcutLiteralUnaryExpression( |
|
rossberg
2014/03/19 11:41:46
Nit: not sure I like the name. This is doing const
|
| + Expression** expression, Token::Value op, int pos, |
| + AstNodeFactory<AstConstructionVisitor>* factory); |
| + |
| + // Returns true if we can desugar '+foo' into 'foo*1' (plus other similar |
| + // constructs). This enables the collection of type feedback without any |
| + // special stub and the multiplication is removed later in Crankshaft's |
| + // canonicalization pass. |
| + bool AddUnaryExpressionTypeFeedback( |
|
rossberg
2014/03/19 11:41:46
Similarly here. I'd perhaps call this RewriteUnary
marja
2014/03/19 12:12:43
Done.
|
| + Expression** expression, Token::Value op, int pos, |
| + AstNodeFactory<AstConstructionVisitor>* factory); |
| + |
| // Reporting errors. |
| void ReportMessageAt(Scanner::Location source_location, |
| const char* message, |
| @@ -568,7 +585,7 @@ class ParserTraits { |
| int function_token_position, |
| FunctionLiteral::FunctionType type, |
| bool* ok); |
| - Expression* ParseUnaryExpression(bool* ok); |
| + Expression* ParsePostfixExpression(bool* ok); |
| private: |
| Parser* parser_; |