[parsing] Update the comment on BuildUnaryExpression.

R=adamk@chromium.org

Bug: 
Change-Id: Ic5668ba70065c7315c354b9921b3c493080da2a7
Reviewed-on: https://chromium-review.googlesource.com/803254
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49812}
This commit is contained in:
Georg Neis 2017-12-01 08:32:25 +01:00 committed by Commit Bot
parent c53f4f6968
commit 25c57e7877

View File

@ -760,17 +760,11 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
bool CollapseNaryExpression(Expression** x, Expression* y, Token::Value op, bool CollapseNaryExpression(Expression** x, Expression* y, Token::Value op,
int pos, const SourceRange& range); int pos, const SourceRange& range);
// Rewrites the following types of unary expressions: // Returns a UnaryExpression or, in one of the following cases, a Literal.
// not <literal> -> true / false
// + <numeric literal> -> <numeric literal>
// - <numeric literal> -> <numeric literal with value negated>
// ! <literal> -> true / false // ! <literal> -> true / false
// The following rewriting rules enable the collection of type feedback // + <Number literal> -> <Number literal>
// without any special stub and the multiplication is removed later in // - <Number literal> -> <Number literal with value negated>
// Crankshaft's canonicalization pass. // ~ <literal> -> true / false
// + foo -> foo * 1
// - foo -> foo * (-1)
// ~ foo -> foo ^(~0)
Expression* BuildUnaryExpression(Expression* expression, Token::Value op, Expression* BuildUnaryExpression(Expression* expression, Token::Value op,
int pos); int pos);