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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1167.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4636 matching lines...) Expand 10 before | Expand all | Expand 10 after
4647 BAILOUT("delete with global variable"); 4647 BAILOUT("delete with global variable");
4648 } else { 4648 } else {
4649 BAILOUT("delete with non-global variable"); 4649 BAILOUT("delete with non-global variable");
4650 } 4650 }
4651 } else if (op == Token::NOT) { 4651 } else if (op == Token::NOT) {
4652 if (ast_context()->IsTest()) { 4652 if (ast_context()->IsTest()) {
4653 TestContext* context = TestContext::cast(ast_context()); 4653 TestContext* context = TestContext::cast(ast_context());
4654 VisitForControl(expr->expression(), 4654 VisitForControl(expr->expression(),
4655 context->if_false(), 4655 context->if_false(),
4656 context->if_true()); 4656 context->if_true());
4657 } else { 4657 } else if (ast_context()->IsValue()) {
4658 HSubgraph* true_graph = CreateEmptySubgraph(); 4658 HSubgraph* true_graph = CreateEmptySubgraph();
4659 HSubgraph* false_graph = CreateEmptySubgraph(); 4659 HSubgraph* false_graph = CreateEmptySubgraph();
4660 VISIT_FOR_CONTROL(expr->expression(), 4660 VISIT_FOR_CONTROL(expr->expression(),
4661 false_graph->entry_block(), 4661 false_graph->entry_block(),
4662 true_graph->entry_block()); 4662 true_graph->entry_block());
4663 true_graph->entry_block()->SetJoinId(expr->expression()->id()); 4663 true_graph->entry_block()->SetJoinId(expr->expression()->id());
4664 true_graph->environment()->Push(graph_->GetConstantTrue()); 4664 true_graph->environment()->Push(graph_->GetConstantTrue());
4665 4665
4666 false_graph->entry_block()->SetJoinId(expr->expression()->id()); 4666 false_graph->entry_block()->SetJoinId(expr->expression()->id());
4667 false_graph->environment()->Push(graph_->GetConstantFalse()); 4667 false_graph->environment()->Push(graph_->GetConstantFalse());
4668 4668
4669 current_subgraph_->AppendJoin(true_graph, false_graph, expr); 4669 current_subgraph_->AppendJoin(true_graph, false_graph, expr);
4670 ast_context()->ReturnValue(Pop()); 4670 ast_context()->ReturnValue(Pop());
4671 } else {
4672 ASSERT(ast_context()->IsEffect());
4673 VISIT_FOR_EFFECT(expr->expression());
4671 } 4674 }
4675
4672 } else if (op == Token::BIT_NOT || op == Token::SUB) { 4676 } else if (op == Token::BIT_NOT || op == Token::SUB) {
4673 VISIT_FOR_VALUE(expr->expression()); 4677 VISIT_FOR_VALUE(expr->expression());
4674 HValue* value = Pop(); 4678 HValue* value = Pop();
4675 HInstruction* instr = NULL; 4679 HInstruction* instr = NULL;
4676 switch (op) { 4680 switch (op) {
4677 case Token::BIT_NOT: 4681 case Token::BIT_NOT:
4678 instr = new HBitNot(value); 4682 instr = new HBitNot(value);
4679 break; 4683 break;
4680 case Token::SUB: 4684 case Token::SUB:
4681 instr = new HMul(graph_->GetConstantMinus1(), value); 4685 instr = new HMul(graph_->GetConstantMinus1(), value);
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
6037 } 6041 }
6038 } 6042 }
6039 6043
6040 #ifdef DEBUG 6044 #ifdef DEBUG
6041 if (graph_ != NULL) graph_->Verify(); 6045 if (graph_ != NULL) graph_->Verify();
6042 if (allocator_ != NULL) allocator_->Verify(); 6046 if (allocator_ != NULL) allocator_->Verify();
6043 #endif 6047 #endif
6044 } 6048 }
6045 6049
6046 } } // namespace v8::internal 6050 } } // namespace v8::internal
OLDNEW
« 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