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

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

Issue 10735071: Introduce Goto instructions to the flow graph. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaked instruction numbering. Created 8 years, 5 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
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_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/flow_graph_builder.h" 7 #include "vm/flow_graph_builder.h"
8 #include "vm/il_printer.h" 8 #include "vm/il_printer.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (next_comp->IsBooleanNegate()) { 515 if (next_comp->IsBooleanNegate()) {
516 Instruction* next_next_instr = next_instr->next(); 516 Instruction* next_next_instr = next_instr->next();
517 if ((next_next_instr != NULL) && next_next_instr->IsBranch()) { 517 if ((next_next_instr != NULL) && next_next_instr->IsBranch()) {
518 BooleanNegateComp* negate = next_comp->AsBooleanNegate(); 518 BooleanNegateComp* negate = next_comp->AsBooleanNegate();
519 BranchInstr* branch = next_next_instr->AsBranch(); 519 BranchInstr* branch = next_next_instr->AsBranch();
520 if ((branch->value()->AsUse()->definition() == next_instr) && 520 if ((branch->value()->AsUse()->definition() == next_instr) &&
521 (negate->value()->AsUse()->definition() == instr)) { 521 (negate->value()->AsUse()->definition() == instr)) {
522 comp->MarkFusedWithBranch(branch); 522 comp->MarkFusedWithBranch(branch);
523 branch->MarkFusedWithComparison(comp); 523 branch->MarkFusedWithComparison(comp);
524 branch->set_is_negated(true); 524 branch->set_is_negated(true);
525 525 // Remove the comparison and the boolean negation from the graph.
526 // Remove comparison and boolean negation from the graph.
527 branch->set_previous(instr->previous()); 526 branch->set_previous(instr->previous());
528 instr->previous()->set_next(branch); 527 instr->previous()->set_next(branch);
529 return; 528 return;
530 } 529 }
531 } 530 }
532 } 531 }
533 } 532 }
534 } 533 }
535 534
536 535
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 LocationSummary* locs = it.Current()->locs(); 596 LocationSummary* locs = it.Current()->locs();
598 if ((locs != NULL) && locs->is_call()) { 597 if ((locs != NULL) && locs->is_call()) {
599 is_leaf_ = false; 598 is_leaf_ = false;
600 return; 599 return;
601 } 600 }
602 } 601 }
603 } 602 }
604 } 603 }
605 604
606 } // namespace dart 605 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698