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

Side by Side Diff: src/hydrogen.cc

Issue 7008009: Do not push a redundant value context in crankshaft. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after
5065 5065
5066 // Translate right subexpression by visiting it in the same AST 5066 // Translate right subexpression by visiting it in the same AST
5067 // context as the entire expression. 5067 // context as the entire expression.
5068 if (eval_right->HasPredecessor()) { 5068 if (eval_right->HasPredecessor()) {
5069 eval_right->SetJoinId(expr->RightId()); 5069 eval_right->SetJoinId(expr->RightId());
5070 set_current_block(eval_right); 5070 set_current_block(eval_right);
5071 Visit(expr->right()); 5071 Visit(expr->right());
5072 } 5072 }
5073 5073
5074 } else if (ast_context()->IsValue()) { 5074 } else if (ast_context()->IsValue()) {
5075 CHECK_ALIVE(VisitForValue(expr->left())); 5075 CHECK_ALIVE(Visit(expr->left()));
5076 ASSERT(current_block() != NULL); 5076 ASSERT(current_block() != NULL);
5077 5077
5078 // We need an extra block to maintain edge-split form. 5078 // We need an extra block to maintain edge-split form.
5079 HBasicBlock* empty_block = graph()->CreateBasicBlock(); 5079 HBasicBlock* empty_block = graph()->CreateBasicBlock();
5080 HBasicBlock* eval_right = graph()->CreateBasicBlock(); 5080 HBasicBlock* eval_right = graph()->CreateBasicBlock();
5081 HTest* test = is_logical_and 5081 HTest* test = is_logical_and
5082 ? new(zone()) HTest(Top(), eval_right, empty_block) 5082 ? new(zone()) HTest(Top(), eval_right, empty_block)
5083 : new(zone()) HTest(Top(), empty_block, eval_right); 5083 : new(zone()) HTest(Top(), empty_block, eval_right);
5084 current_block()->Finish(test); 5084 current_block()->Finish(test);
5085 5085
5086 set_current_block(eval_right); 5086 set_current_block(eval_right);
5087 Drop(1); // Value of the left subexpression. 5087 Drop(1); // Value of the left subexpression.
5088 CHECK_BAILOUT(VisitForValue(expr->right())); 5088 CHECK_BAILOUT(Visit(expr->right()));
5089 5089
5090 HBasicBlock* join_block = 5090 HBasicBlock* join_block =
5091 CreateJoin(empty_block, current_block(), expr->id()); 5091 CreateJoin(empty_block, current_block(), expr->id());
5092 set_current_block(join_block); 5092 set_current_block(join_block);
5093 ast_context()->ReturnValue(Pop()); 5093 ast_context()->ReturnValue(Pop());
5094 5094
5095 } else { 5095 } else {
5096 ASSERT(ast_context()->IsEffect()); 5096 ASSERT(ast_context()->IsEffect());
5097 // In an effect context, we don't need the value of the left subexpression, 5097 // In an effect context, we don't need the value of the left subexpression,
5098 // only its control flow and side effects. We need an extra block to 5098 // only its control flow and side effects. We need an extra block to
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
6230 } 6230 }
6231 } 6231 }
6232 6232
6233 #ifdef DEBUG 6233 #ifdef DEBUG
6234 if (graph_ != NULL) graph_->Verify(); 6234 if (graph_ != NULL) graph_->Verify();
6235 if (allocator_ != NULL) allocator_->Verify(); 6235 if (allocator_ != NULL) allocator_->Verify();
6236 #endif 6236 #endif
6237 } 6237 }
6238 6238
6239 } } // namespace v8::internal 6239 } } // namespace v8::internal
OLDNEW
« 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