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

Side by Side Diff: src/hydrogen.cc

Issue 23452049: Allow IfBuilder's to join existing (captured) continuations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nit Created 7 years, 3 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 | « src/hydrogen.h ('k') | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 : last_true_block_; 797 : last_true_block_;
798 HBasicBlock* false_block = did_else_ && (first_false_block_ != NULL) 798 HBasicBlock* false_block = did_else_ && (first_false_block_ != NULL)
799 ? builder_->current_block() 799 ? builder_->current_block()
800 : first_false_block_; 800 : first_false_block_;
801 continuation->Capture(true_block, false_block, position_); 801 continuation->Capture(true_block, false_block, position_);
802 captured_ = true; 802 captured_ = true;
803 End(); 803 End();
804 } 804 }
805 805
806 806
807 void HGraphBuilder::IfBuilder::JoinContinuation(HIfContinuation* continuation) {
808 ASSERT(!finished_);
809 ASSERT(!captured_);
810 HBasicBlock* true_block = last_true_block_ == NULL
811 ? first_true_block_
812 : last_true_block_;
813 HBasicBlock* false_block = did_else_ && (first_false_block_ != NULL)
814 ? builder_->current_block()
815 : first_false_block_;
816 if (true_block != NULL && !true_block->IsFinished()) {
817 ASSERT(continuation->IsTrueReachable());
818 true_block->GotoNoSimulate(continuation->true_branch());
819 }
820 if (false_block != NULL && !false_block->IsFinished()) {
821 ASSERT(continuation->IsFalseReachable());
822 false_block->GotoNoSimulate(continuation->false_branch());
823 }
824 captured_ = true;
825 End();
826 }
827
828
807 void HGraphBuilder::IfBuilder::Then() { 829 void HGraphBuilder::IfBuilder::Then() {
808 ASSERT(!captured_); 830 ASSERT(!captured_);
809 ASSERT(!finished_); 831 ASSERT(!finished_);
810 did_then_ = true; 832 did_then_ = true;
811 if (needs_compare_) { 833 if (needs_compare_) {
812 // Handle if's without any expressions, they jump directly to the "else" 834 // Handle if's without any expressions, they jump directly to the "else"
813 // branch. However, we must pretend that the "then" branch is reachable, 835 // branch. However, we must pretend that the "then" branch is reachable,
814 // so that the graph builder visits it and sees any live range extending 836 // so that the graph builder visits it and sees any live range extending
815 // constructs within it. 837 // constructs within it.
816 HConstant* constant_false = builder_->graph()->GetConstantFalse(); 838 HConstant* constant_false = builder_->graph()->GetConstantFalse();
(...skipping 8816 matching lines...) Expand 10 before | Expand all | Expand 10 after
9633 if (ShouldProduceTraceOutput()) { 9655 if (ShouldProduceTraceOutput()) {
9634 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9656 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9635 } 9657 }
9636 9658
9637 #ifdef DEBUG 9659 #ifdef DEBUG
9638 graph_->Verify(false); // No full verify. 9660 graph_->Verify(false); // No full verify.
9639 #endif 9661 #endif
9640 } 9662 }
9641 9663
9642 } } // namespace v8::internal 9664 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698