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

Unified Diff: src/hydrogen.cc

Issue 6537018: Fix incorrect deoptimization for logical not in an effect context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 10 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 | test/mjsunit/regress/regress-1167.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 677d9a03c66e9de7a38ce083d2ac219e67fad344..fd5ad728ecb8fef338dda36e378251bfe68dd911 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4654,7 +4654,7 @@ void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
VisitForControl(expr->expression(),
context->if_false(),
context->if_true());
- } else {
+ } else if (ast_context()->IsValue()) {
HSubgraph* true_graph = CreateEmptySubgraph();
HSubgraph* false_graph = CreateEmptySubgraph();
VISIT_FOR_CONTROL(expr->expression(),
@@ -4668,7 +4668,11 @@ void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) {
current_subgraph_->AppendJoin(true_graph, false_graph, expr);
ast_context()->ReturnValue(Pop());
+ } else {
+ ASSERT(ast_context()->IsEffect());
+ VISIT_FOR_EFFECT(expr->expression());
}
+
} else if (op == Token::BIT_NOT || op == Token::SUB) {
VISIT_FOR_VALUE(expr->expression());
HValue* value = Pop();
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1167.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698