| 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_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 | 710 |
| 711 void FlowGraphOptimizer::InsertConversionsFor(Definition* def) { | 711 void FlowGraphOptimizer::InsertConversionsFor(Definition* def) { |
| 712 const Representation from_rep = def->representation(); | 712 const Representation from_rep = def->representation(); |
| 713 | 713 |
| 714 for (Value::Iterator it(def->input_use_list()); | 714 for (Value::Iterator it(def->input_use_list()); |
| 715 !it.Done(); | 715 !it.Done(); |
| 716 it.Advance()) { | 716 it.Advance()) { |
| 717 ConvertUse(it.Current(), from_rep); | 717 ConvertUse(it.Current(), from_rep); |
| 718 } | 718 } |
| 719 | 719 |
| 720 for (Value::Iterator it(def->env_use_list()); | 720 if (flow_graph()->graph_entry()->SuccessorCount() > 1) { |
| 721 !it.Done(); | 721 for (Value::Iterator it(def->env_use_list()); |
| 722 it.Advance()) { | 722 !it.Done(); |
| 723 Value* use = it.Current(); | 723 it.Advance()) { |
| 724 if (use->instruction()->MayThrow() && | 724 Value* use = it.Current(); |
| 725 use->instruction()->GetBlock()->InsideTryBlock()) { | 725 if (use->instruction()->MayThrow() && |
| 726 // Environment uses at calls inside try-blocks must be converted to | 726 use->instruction()->GetBlock()->InsideTryBlock()) { |
| 727 // tagged representation. | 727 // Environment uses at calls inside try-blocks must be converted to |
| 728 ConvertEnvironmentUse(it.Current(), from_rep); | 728 // tagged representation. |
| 729 ConvertEnvironmentUse(it.Current(), from_rep); |
| 730 } |
| 729 } | 731 } |
| 730 } | 732 } |
| 731 } | 733 } |
| 732 | 734 |
| 733 | 735 |
| 734 static void UnboxPhi(PhiInstr* phi) { | 736 static void UnboxPhi(PhiInstr* phi) { |
| 735 Representation unboxed = phi->representation(); | 737 Representation unboxed = phi->representation(); |
| 736 | 738 |
| 737 switch (phi->Type()->ToCid()) { | 739 switch (phi->Type()->ToCid()) { |
| 738 case kDoubleCid: | 740 case kDoubleCid: |
| (...skipping 9320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10059 | 10061 |
| 10060 // Insert materializations at environment uses. | 10062 // Insert materializations at environment uses. |
| 10061 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 10063 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 10062 CreateMaterializationAt( | 10064 CreateMaterializationAt( |
| 10063 exits_collector_.exits()[i], alloc, *slots); | 10065 exits_collector_.exits()[i], alloc, *slots); |
| 10064 } | 10066 } |
| 10065 } | 10067 } |
| 10066 | 10068 |
| 10067 | 10069 |
| 10068 } // namespace dart | 10070 } // namespace dart |
| OLD | NEW |