| 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 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 | 1480 |
| 1481 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( | 1481 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( |
| 1482 HBasicBlock* dominator, HBasicBlock* dominated) { | 1482 HBasicBlock* dominator, HBasicBlock* dominated) { |
| 1483 int side_effects = 0; | 1483 int side_effects = 0; |
| 1484 for (int i = 0; i < dominated->predecessors()->length(); ++i) { | 1484 for (int i = 0; i < dominated->predecessors()->length(); ++i) { |
| 1485 HBasicBlock* block = dominated->predecessors()->at(i); | 1485 HBasicBlock* block = dominated->predecessors()->at(i); |
| 1486 if (dominator->block_id() < block->block_id() && | 1486 if (dominator->block_id() < block->block_id() && |
| 1487 block->block_id() < dominated->block_id() && | 1487 block->block_id() < dominated->block_id() && |
| 1488 visited_on_paths_.Add(block->block_id())) { | 1488 visited_on_paths_.Add(block->block_id())) { |
| 1489 side_effects |= block_side_effects_[block->block_id()]; | 1489 side_effects |= block_side_effects_[block->block_id()]; |
| 1490 if (block->IsLoopHeader()) { |
| 1491 side_effects |= loop_side_effects_[block->block_id()]; |
| 1492 } |
| 1490 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( | 1493 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( |
| 1491 dominator, block); | 1494 dominator, block); |
| 1492 } | 1495 } |
| 1493 } | 1496 } |
| 1494 return side_effects; | 1497 return side_effects; |
| 1495 } | 1498 } |
| 1496 | 1499 |
| 1497 | 1500 |
| 1498 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { | 1501 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { |
| 1499 TraceGVN("Analyzing block B%d%s\n", | 1502 TraceGVN("Analyzing block B%d%s\n", |
| (...skipping 5268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6768 } | 6771 } |
| 6769 } | 6772 } |
| 6770 | 6773 |
| 6771 #ifdef DEBUG | 6774 #ifdef DEBUG |
| 6772 if (graph_ != NULL) graph_->Verify(); | 6775 if (graph_ != NULL) graph_->Verify(); |
| 6773 if (allocator_ != NULL) allocator_->Verify(); | 6776 if (allocator_ != NULL) allocator_->Verify(); |
| 6774 #endif | 6777 #endif |
| 6775 } | 6778 } |
| 6776 | 6779 |
| 6777 } } // namespace v8::internal | 6780 } } // namespace v8::internal |
| OLD | NEW |