Commit cc2d376f authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Optimize && and || in test context.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1160683003

Cr-Commit-Position: refs/heads/master@{#28648}
parent dea59184
......@@ -2805,6 +2805,8 @@ void AstGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) {
Visit(expr->right());
} else if (ast_context()->IsEffect()) {
environment()->Pop();
} else if (ast_context()->IsTest()) {
environment()->Poke(0, jsgraph()->TrueConstant());
}
compare_if.Else();
if (!is_logical_and) {
......@@ -2812,6 +2814,8 @@ void AstGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) {
Visit(expr->right());
} else if (ast_context()->IsEffect()) {
environment()->Pop();
} else if (ast_context()->IsTest()) {
environment()->Poke(0, jsgraph()->FalseConstant());
}
compare_if.End();
ast_context()->ReplaceValue();
......
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