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

Unified Diff: src/parser.h

Issue 203193004: Move ParseUnaryExpression into ParserBase and add tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: oops Created 6 years, 9 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 | « no previous file | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698