Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 671 HBasicBlock* HGraphBuilder::CreateLoop(IterationStatement* statement, | 671 HBasicBlock* HGraphBuilder::CreateLoop(IterationStatement* statement, |
| 672 HBasicBlock* loop_entry, | 672 HBasicBlock* loop_entry, |
| 673 HBasicBlock* body_exit, | 673 HBasicBlock* body_exit, |
| 674 HBasicBlock* loop_successor, | 674 HBasicBlock* loop_successor, |
| 675 HBasicBlock* break_block) { | 675 HBasicBlock* break_block) { |
| 676 if (body_exit != NULL) body_exit->Goto(loop_entry); | 676 if (body_exit != NULL) body_exit->Goto(loop_entry); |
| 677 loop_entry->PostProcessLoopHeader(statement); | 677 loop_entry->PostProcessLoopHeader(statement); |
| 678 if (break_block != NULL) { | 678 if (break_block != NULL) { |
| 679 if (loop_successor != NULL) loop_successor->Goto(break_block); | 679 if (loop_successor != NULL) loop_successor->Goto(break_block); |
| 680 break_block->SetJoinId(statement->ExitId()); | 680 break_block->SetJoinId(statement->ExitId()); |
| 681 if (loop_entry->IsLoopHeader()) { | |
| 682 loop_entry->loop_information()->set_exit_block(break_block); | |
| 683 } | |
| 681 return break_block; | 684 return break_block; |
| 682 } | 685 } |
| 686 if (loop_entry->IsLoopHeader()) { | |
| 687 loop_entry->loop_information()->set_exit_block(loop_successor); | |
| 688 } | |
|
danno
2013/01/10 15:33:27
a bit of a nit, but how about just setting exit_bl
Vyacheslav Egorov (Google)
2013/01/25 13:49:17
Done.
| |
| 683 return loop_successor; | 689 return loop_successor; |
| 684 } | 690 } |
| 685 | 691 |
| 686 | 692 |
| 687 void HBasicBlock::FinishExit(HControlInstruction* instruction) { | 693 void HBasicBlock::FinishExit(HControlInstruction* instruction) { |
| 688 Finish(instruction); | 694 Finish(instruction); |
| 689 ClearEnvironment(); | 695 ClearEnvironment(); |
| 690 } | 696 } |
| 691 | 697 |
| 692 | 698 |
| (...skipping 9423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10116 } | 10122 } |
| 10117 } | 10123 } |
| 10118 | 10124 |
| 10119 #ifdef DEBUG | 10125 #ifdef DEBUG |
| 10120 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10126 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10121 if (allocator_ != NULL) allocator_->Verify(); | 10127 if (allocator_ != NULL) allocator_->Verify(); |
| 10122 #endif | 10128 #endif |
| 10123 } | 10129 } |
| 10124 | 10130 |
| 10125 } } // namespace v8::internal | 10131 } } // namespace v8::internal |
| OLD | NEW |