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 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 | 1496 |
1497 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( | 1497 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( |
1498 HBasicBlock* dominator, HBasicBlock* dominated) { | 1498 HBasicBlock* dominator, HBasicBlock* dominated) { |
1499 int side_effects = 0; | 1499 int side_effects = 0; |
1500 for (int i = 0; i < dominated->predecessors()->length(); ++i) { | 1500 for (int i = 0; i < dominated->predecessors()->length(); ++i) { |
1501 HBasicBlock* block = dominated->predecessors()->at(i); | 1501 HBasicBlock* block = dominated->predecessors()->at(i); |
1502 if (dominator->block_id() < block->block_id() && | 1502 if (dominator->block_id() < block->block_id() && |
1503 block->block_id() < dominated->block_id() && | 1503 block->block_id() < dominated->block_id() && |
1504 visited_on_paths_.Add(block->block_id())) { | 1504 visited_on_paths_.Add(block->block_id())) { |
1505 side_effects |= block_side_effects_[block->block_id()]; | 1505 side_effects |= block_side_effects_[block->block_id()]; |
| 1506 if (block->IsLoopHeader()) { |
| 1507 side_effects |= loop_side_effects_[block->block_id()]; |
| 1508 } |
1506 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( | 1509 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( |
1507 dominator, block); | 1510 dominator, block); |
1508 } | 1511 } |
1509 } | 1512 } |
1510 return side_effects; | 1513 return side_effects; |
1511 } | 1514 } |
1512 | 1515 |
1513 | 1516 |
1514 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { | 1517 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { |
1515 TraceGVN("Analyzing block B%d%s\n", | 1518 TraceGVN("Analyzing block B%d%s\n", |
(...skipping 5494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7010 } | 7013 } |
7011 } | 7014 } |
7012 | 7015 |
7013 #ifdef DEBUG | 7016 #ifdef DEBUG |
7014 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 7017 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
7015 if (allocator_ != NULL) allocator_->Verify(); | 7018 if (allocator_ != NULL) allocator_->Verify(); |
7016 #endif | 7019 #endif |
7017 } | 7020 } |
7018 | 7021 |
7019 } } // namespace v8::internal | 7022 } } // namespace v8::internal |
OLD | NEW |