OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
Jakob Kummerow
2012/02/22 11:36:06
nit: 2012
| |
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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
577 // Initialize the live_in sets for each block to NULL. | 577 // Initialize the live_in sets for each block to NULL. |
578 int block_count = graph_->blocks()->length(); | 578 int block_count = graph_->blocks()->length(); |
579 live_in_sets_.Initialize(block_count); | 579 live_in_sets_.Initialize(block_count); |
580 live_in_sets_.AddBlock(NULL, block_count); | 580 live_in_sets_.AddBlock(NULL, block_count); |
581 } | 581 } |
582 | 582 |
583 | 583 |
584 BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) { | 584 BitVector* LAllocator::ComputeLiveOut(HBasicBlock* block) { |
585 // Compute live out for the given block, except not including backward | 585 // Compute live out for the given block, except not including backward |
586 // successor edges. | 586 // successor edges. |
587 BitVector* live_out = new(zone_) BitVector(next_virtual_register_); | 587 BitVector* live_out = new(zone_) BitVector(next_virtual_register_, zone_); |
588 | 588 |
589 // Process all successor blocks. | 589 // Process all successor blocks. |
590 for (HSuccessorIterator it(block->end()); !it.Done(); it.Advance()) { | 590 for (HSuccessorIterator it(block->end()); !it.Done(); it.Advance()) { |
591 // Add values live on entry to the successor. Note the successor's | 591 // Add values live on entry to the successor. Note the successor's |
592 // live_in will not be computed yet for backwards edges. | 592 // live_in will not be computed yet for backwards edges. |
593 HBasicBlock* successor = it.Current(); | 593 HBasicBlock* successor = it.Current(); |
594 BitVector* live_in = live_in_sets_[successor->block_id()]; | 594 BitVector* live_in = live_in_sets_[successor->block_id()]; |
595 if (live_in != NULL) live_out->Union(*live_in); | 595 if (live_in != NULL) live_out->Union(*live_in); |
596 | 596 |
597 // All phi input operands corresponding to this successor edge are live | 597 // All phi input operands corresponding to this successor edge are live |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2132 LiveRange* current = live_ranges()->at(i); | 2132 LiveRange* current = live_ranges()->at(i); |
2133 if (current != NULL) current->Verify(); | 2133 if (current != NULL) current->Verify(); |
2134 } | 2134 } |
2135 } | 2135 } |
2136 | 2136 |
2137 | 2137 |
2138 #endif | 2138 #endif |
2139 | 2139 |
2140 | 2140 |
2141 } } // namespace v8::internal | 2141 } } // namespace v8::internal |
OLD | NEW |