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

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

Issue 792023002: Don't merge indirect entries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
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/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 BitVector* merged = new(isolate()) BitVector(isolate(), postorder().length()); 227 BitVector* merged = new(isolate()) BitVector(isolate(), postorder().length());
228 for (BlockIterator block_it = reverse_postorder_iterator(); 228 for (BlockIterator block_it = reverse_postorder_iterator();
229 !block_it.Done(); 229 !block_it.Done();
230 block_it.Advance()) { 230 block_it.Advance()) {
231 BlockEntryInstr* block = block_it.Current(); 231 BlockEntryInstr* block = block_it.Current();
232 if (block->IsGraphEntry()) continue; 232 if (block->IsGraphEntry()) continue;
233 if (merged->Contains(block->postorder_number())) continue; 233 if (merged->Contains(block->postorder_number())) continue;
234 234
235 Instruction* last = block->last_instruction(); 235 Instruction* last = block->last_instruction();
236 BlockEntryInstr* successor = NULL; 236 BlockEntryInstr* successor = NULL;
237 while ((last->SuccessorCount() == 1) && 237 while ((!last->IsIndirectGoto()) &&
238 (last->SuccessorCount() == 1) &&
239 (!last->SuccessorAt(0)->IsIndirectEntry()) &&
238 (last->SuccessorAt(0)->PredecessorCount() == 1) && 240 (last->SuccessorAt(0)->PredecessorCount() == 1) &&
239 (block->try_index() == last->SuccessorAt(0)->try_index())) { 241 (block->try_index() == last->SuccessorAt(0)->try_index())) {
240 successor = last->SuccessorAt(0); 242 successor = last->SuccessorAt(0);
241 ASSERT(last->IsGoto()); 243 ASSERT(last->IsGoto());
242 244
243 // Remove environment uses and unlink goto and block entry. 245 // Remove environment uses and unlink goto and block entry.
244 successor->UnuseAllInputs(); 246 successor->UnuseAllInputs();
245 last->previous()->LinkTo(successor->next()); 247 last->previous()->LinkTo(successor->next());
246 last->UnuseAllInputs(); 248 last->UnuseAllInputs();
247 249
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 } 1383 }
1382 1384
1383 1385
1384 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, 1386 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from,
1385 BlockEntryInstr* to) const { 1387 BlockEntryInstr* to) const {
1386 return available_at_[to->postorder_number()]->Contains( 1388 return available_at_[to->postorder_number()]->Contains(
1387 from->postorder_number()); 1389 from->postorder_number());
1388 } 1390 }
1389 1391
1390 } // namespace dart 1392 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698