| OLD | NEW |
| 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 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 | 1476 |
| 1477 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( | 1477 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( |
| 1478 HBasicBlock* dominator, HBasicBlock* dominated) { | 1478 HBasicBlock* dominator, HBasicBlock* dominated) { |
| 1479 int side_effects = 0; | 1479 int side_effects = 0; |
| 1480 for (int i = 0; i < dominated->predecessors()->length(); ++i) { | 1480 for (int i = 0; i < dominated->predecessors()->length(); ++i) { |
| 1481 HBasicBlock* block = dominated->predecessors()->at(i); | 1481 HBasicBlock* block = dominated->predecessors()->at(i); |
| 1482 if (dominator->block_id() < block->block_id() && | 1482 if (dominator->block_id() < block->block_id() && |
| 1483 block->block_id() < dominated->block_id() && | 1483 block->block_id() < dominated->block_id() && |
| 1484 visited_on_paths_.Add(block->block_id())) { | 1484 visited_on_paths_.Add(block->block_id())) { |
| 1485 side_effects |= block_side_effects_[block->block_id()]; | 1485 side_effects |= block_side_effects_[block->block_id()]; |
| 1486 if (block->IsLoopHeader()) { |
| 1487 side_effects |= loop_side_effects_[block->block_id()]; |
| 1488 } |
| 1486 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( | 1489 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( |
| 1487 dominator, block); | 1490 dominator, block); |
| 1488 } | 1491 } |
| 1489 } | 1492 } |
| 1490 return side_effects; | 1493 return side_effects; |
| 1491 } | 1494 } |
| 1492 | 1495 |
| 1493 | 1496 |
| 1494 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { | 1497 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { |
| 1495 TraceGVN("Analyzing block B%d%s\n", | 1498 TraceGVN("Analyzing block B%d%s\n", |
| (...skipping 5285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6781 } | 6784 } |
| 6782 } | 6785 } |
| 6783 | 6786 |
| 6784 #ifdef DEBUG | 6787 #ifdef DEBUG |
| 6785 if (graph_ != NULL) graph_->Verify(); | 6788 if (graph_ != NULL) graph_->Verify(); |
| 6786 if (allocator_ != NULL) allocator_->Verify(); | 6789 if (allocator_ != NULL) allocator_->Verify(); |
| 6787 #endif | 6790 #endif |
| 6788 } | 6791 } |
| 6789 | 6792 |
| 6790 } } // namespace v8::internal | 6793 } } // namespace v8::internal |
| OLD | NEW |