Commit 25c57e78 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[parsing] Update the comment on BuildUnaryExpression.

R=adamk@chromium.org

Bug: 
Change-Id: Ic5668ba70065c7315c354b9921b3c493080da2a7
Reviewed-on: https://chromium-review.googlesource.com/803254Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49812}
parent c53f4f69
......@@ -760,17 +760,11 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
bool CollapseNaryExpression(Expression** x, Expression* y, Token::Value op,
int pos, const SourceRange& range);
// Rewrites the following types of unary expressions:
// not <literal> -> true / false
// + <numeric literal> -> <numeric literal>
// - <numeric literal> -> <numeric literal with value negated>
// Returns a UnaryExpression or, in one of the following cases, a Literal.
// ! <literal> -> true / false
// The following rewriting rules enable the collection of type feedback
// without any special stub and the multiplication is removed later in
// Crankshaft's canonicalization pass.
// + foo -> foo * 1
// - foo -> foo * (-1)
// ~ foo -> foo ^(~0)
// + <Number literal> -> <Number literal>
// - <Number literal> -> <Number literal with value negated>
// ~ <literal> -> true / false
Expression* BuildUnaryExpression(Expression* expression, Token::Value op,
int pos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment