Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: runtime/vm/flow_graph.cc

Issue 10939036: A simpler scheme for garbage collection of ureachable phi inputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bug when multiple predecessors are unreachable. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | runtime/vm/flow_graph_builder.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.h" 5 #include "vm/flow_graph.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 graph_entry_->DiscoverBlocks(NULL, // Entry block predecessor. 44 graph_entry_->DiscoverBlocks(NULL, // Entry block predecessor.
45 &preorder_, 45 &preorder_,
46 &postorder_, 46 &postorder_,
47 &parent_, 47 &parent_,
48 &assigned_vars_, 48 &assigned_vars_,
49 variable_count(), 49 variable_count(),
50 num_non_copied_params()); 50 num_non_copied_params());
51 // Number blocks in reverse postorder. 51 // Number blocks in reverse postorder.
52 intptr_t block_count = postorder_.length(); 52 intptr_t block_count = postorder_.length();
53 for (intptr_t i = 0; i < block_count; ++i) { 53 for (intptr_t i = 0; i < block_count; ++i) {
54 postorder_[i]->set_block_id(block_count - i - 1);
55 reverse_postorder_.Add(postorder_[block_count - i - 1]); 54 reverse_postorder_.Add(postorder_[block_count - i - 1]);
56 } 55 }
57 // Link instructions backwards for optimized compilation. 56 // Link instructions backwards for optimized compilation.
58 // TODO(zerny): The builder should do this at construction time. 57 // TODO(zerny): The builder should do this at construction time.
59 for (intptr_t i = 0; i < block_count; ++i) { 58 for (intptr_t i = 0; i < block_count; ++i) {
60 BlockEntryInstr* entry = postorder_[i]; 59 BlockEntryInstr* entry = postorder_[i];
61 Instruction* previous = entry; 60 Instruction* previous = entry;
62 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { 61 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
63 Instruction* current = it.Current(); 62 Instruction* current = it.Current();
64 current->set_previous(previous); 63 current->set_previous(previous);
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 // TODO(zerny): Support multiple exits. 789 // TODO(zerny): Support multiple exits.
791 UNREACHABLE(); 790 UNREACHABLE();
792 } 791 }
793 792
794 // TODO(zerny): Adjust pre/post orders. 793 // TODO(zerny): Adjust pre/post orders.
795 // TODO(zerny): Update dominator tree. 794 // TODO(zerny): Update dominator tree.
796 } 795 }
797 796
798 797
799 } // namespace dart 798 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.h » ('j') | runtime/vm/flow_graph_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698