| 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 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 | 1485 |
| 1486 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( | 1486 int HGlobalValueNumberer::CollectSideEffectsOnPathsToDominatedBlock( |
| 1487 HBasicBlock* dominator, HBasicBlock* dominated) { | 1487 HBasicBlock* dominator, HBasicBlock* dominated) { |
| 1488 int side_effects = 0; | 1488 int side_effects = 0; |
| 1489 for (int i = 0; i < dominated->predecessors()->length(); ++i) { | 1489 for (int i = 0; i < dominated->predecessors()->length(); ++i) { |
| 1490 HBasicBlock* block = dominated->predecessors()->at(i); | 1490 HBasicBlock* block = dominated->predecessors()->at(i); |
| 1491 if (dominator->block_id() < block->block_id() && | 1491 if (dominator->block_id() < block->block_id() && |
| 1492 block->block_id() < dominated->block_id() && | 1492 block->block_id() < dominated->block_id() && |
| 1493 visited_on_paths_.Add(block->block_id())) { | 1493 visited_on_paths_.Add(block->block_id())) { |
| 1494 side_effects |= block_side_effects_[block->block_id()]; | 1494 side_effects |= block_side_effects_[block->block_id()]; |
| 1495 if (block->IsLoopHeader()) { |
| 1496 side_effects |= loop_side_effects_[block->block_id()]; |
| 1497 } |
| 1495 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( | 1498 side_effects |= CollectSideEffectsOnPathsToDominatedBlock( |
| 1496 dominator, block); | 1499 dominator, block); |
| 1497 } | 1500 } |
| 1498 } | 1501 } |
| 1499 return side_effects; | 1502 return side_effects; |
| 1500 } | 1503 } |
| 1501 | 1504 |
| 1502 | 1505 |
| 1503 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { | 1506 void HGlobalValueNumberer::AnalyzeBlock(HBasicBlock* block, HValueMap* map) { |
| 1504 TraceGVN("Analyzing block B%d%s\n", | 1507 TraceGVN("Analyzing block B%d%s\n", |
| (...skipping 4834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6339 } | 6342 } |
| 6340 } | 6343 } |
| 6341 | 6344 |
| 6342 #ifdef DEBUG | 6345 #ifdef DEBUG |
| 6343 if (graph_ != NULL) graph_->Verify(); | 6346 if (graph_ != NULL) graph_->Verify(); |
| 6344 if (allocator_ != NULL) allocator_->Verify(); | 6347 if (allocator_ != NULL) allocator_->Verify(); |
| 6345 #endif | 6348 #endif |
| 6346 } | 6349 } |
| 6347 | 6350 |
| 6348 } } // namespace v8::internal | 6351 } } // namespace v8::internal |
| OLD | NEW |