| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 } | 668 } |
| 669 | 669 |
| 670 | 670 |
| 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 |
| 679 HBasicBlock* exit_block = loop_successor; |
| 678 if (break_block != NULL) { | 680 if (break_block != NULL) { |
| 679 if (loop_successor != NULL) loop_successor->Goto(break_block); | 681 if (loop_successor != NULL) loop_successor->Goto(break_block); |
| 680 break_block->SetJoinId(statement->ExitId()); | 682 break_block->SetJoinId(statement->ExitId()); |
| 681 return break_block; | 683 exit_block = break_block; |
| 682 } | 684 } |
| 683 return loop_successor; | 685 |
| 686 if (loop_entry->IsLoopHeader()) { |
| 687 loop_entry->loop_information()->set_exit_block(exit_block); |
| 688 } |
| 689 |
| 690 return exit_block; |
| 684 } | 691 } |
| 685 | 692 |
| 686 | 693 |
| 687 void HBasicBlock::FinishExit(HControlInstruction* instruction) { | 694 void HBasicBlock::FinishExit(HControlInstruction* instruction) { |
| 688 Finish(instruction); | 695 Finish(instruction); |
| 689 ClearEnvironment(); | 696 ClearEnvironment(); |
| 690 } | 697 } |
| 691 | 698 |
| 692 | 699 |
| 693 HGraph::HGraph(CompilationInfo* info) | 700 HGraph::HGraph(CompilationInfo* info) |
| (...skipping 9422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10116 } | 10123 } |
| 10117 } | 10124 } |
| 10118 | 10125 |
| 10119 #ifdef DEBUG | 10126 #ifdef DEBUG |
| 10120 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10127 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10121 if (allocator_ != NULL) allocator_->Verify(); | 10128 if (allocator_ != NULL) allocator_->Verify(); |
| 10122 #endif | 10129 #endif |
| 10123 } | 10130 } |
| 10124 | 10131 |
| 10125 } } // namespace v8::internal | 10132 } } // namespace v8::internal |
| OLD | NEW |