| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_allocator.h" | 5 #include "vm/flow_graph_allocator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
| 10 #include "vm/flow_graph.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // When we encounter a use of a value inside a block we optimistically | 367 // When we encounter a use of a value inside a block we optimistically |
| 368 // expand the first use interval to cover the block from the start | 368 // expand the first use interval to cover the block from the start |
| 369 // to the last use in the block and then we shrink it if we encounter | 369 // to the last use in the block and then we shrink it if we encounter |
| 370 // definition of the value inside the same block. | 370 // definition of the value inside the same block. |
| 371 if (first_use_interval_ == NULL) { | 371 if (first_use_interval_ == NULL) { |
| 372 // Definition without a use. | 372 // Definition without a use. |
| 373 first_use_interval_ = new UseInterval(pos, pos + 1, NULL); | 373 first_use_interval_ = new UseInterval(pos, pos + 1, NULL); |
| 374 last_use_interval_ = first_use_interval_; | 374 last_use_interval_ = first_use_interval_; |
| 375 } else { | 375 } else { |
| 376 // Shrink the first use interval. It was optimistically expanded to | 376 // Shrink the first use interval. It was optimistically expanded to |
| 377 // cover the the block from the start to the last use in the block. | 377 // cover the block from the start to the last use in the block. |
| 378 ASSERT(first_use_interval_->start_ <= pos); | 378 ASSERT(first_use_interval_->start_ <= pos); |
| 379 first_use_interval_->start_ = pos; | 379 first_use_interval_->start_ = pos; |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 | 383 |
| 384 LiveRange* FlowGraphAllocator::GetLiveRange(intptr_t vreg) { | 384 LiveRange* FlowGraphAllocator::GetLiveRange(intptr_t vreg) { |
| 385 if (live_ranges_[vreg] == NULL) { | 385 if (live_ranges_[vreg] == NULL) { |
| 386 Representation rep = value_representations_[vreg]; | 386 Representation rep = value_representations_[vreg]; |
| 387 ASSERT(rep != kNoRepresentation); | 387 ASSERT(rep != kNoRepresentation); |
| (...skipping 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3012 FlowGraphPrinter printer(flow_graph_, true); | 3012 FlowGraphPrinter printer(flow_graph_, true); |
| 3013 printer.PrintBlocks(); | 3013 printer.PrintBlocks(); |
| 3014 #endif | 3014 #endif |
| 3015 } | 3015 } |
| 3016 THR_Print("----------------------------------------------\n"); | 3016 THR_Print("----------------------------------------------\n"); |
| 3017 } | 3017 } |
| 3018 } | 3018 } |
| 3019 | 3019 |
| 3020 | 3020 |
| 3021 } // namespace dart | 3021 } // namespace dart |
| OLD | NEW |