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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1160683003: [turbofan] Optimize && and || in test context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 194e068ce1a08455ee5862bf35f9737a0c964a34..9778c79b1e714473d0d974001f70422b3ab0b545 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698