| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 | 930 |
| 931 | 931 |
| 932 void JoinEntryInstr::InsertPhi(PhiInstr* phi) { | 932 void JoinEntryInstr::InsertPhi(PhiInstr* phi) { |
| 933 // Lazily initialize the array of phis. | 933 // Lazily initialize the array of phis. |
| 934 if (phis_ == NULL) { | 934 if (phis_ == NULL) { |
| 935 phis_ = new ZoneGrowableArray<PhiInstr*>(1); | 935 phis_ = new ZoneGrowableArray<PhiInstr*>(1); |
| 936 } | 936 } |
| 937 phis_->Add(phi); | 937 phis_->Add(phi); |
| 938 } | 938 } |
| 939 | 939 |
| 940 void JoinEntryInstr::RemovePhi(PhiInstr* phi) { |
| 941 ASSERT(phis_ != NULL); |
| 942 for (intptr_t index = 0; index < phis_->length(); ++index) { |
| 943 if (phi == (*phis_)[index]) { |
| 944 (*phis_)[index] = phis_->Last(); |
| 945 phis_->RemoveLast(); |
| 946 return; |
| 947 } |
| 948 } |
| 949 } |
| 940 | 950 |
| 941 void JoinEntryInstr::RemoveDeadPhis(Definition* replacement) { | 951 void JoinEntryInstr::RemoveDeadPhis(Definition* replacement) { |
| 942 if (phis_ == NULL) return; | 952 if (phis_ == NULL) return; |
| 943 | 953 |
| 944 intptr_t to_index = 0; | 954 intptr_t to_index = 0; |
| 945 for (intptr_t from_index = 0; from_index < phis_->length(); ++from_index) { | 955 for (intptr_t from_index = 0; from_index < phis_->length(); ++from_index) { |
| 946 PhiInstr* phi = (*phis_)[from_index]; | 956 PhiInstr* phi = (*phis_)[from_index]; |
| 947 if (phi != NULL) { | 957 if (phi != NULL) { |
| 948 if (phi->is_alive()) { | 958 if (phi->is_alive()) { |
| 949 (*phis_)[to_index++] = phi; | 959 (*phis_)[to_index++] = phi; |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2549 default: | 2559 default: |
| 2550 UNREACHABLE(); | 2560 UNREACHABLE(); |
| 2551 } | 2561 } |
| 2552 return kPowRuntimeEntry; | 2562 return kPowRuntimeEntry; |
| 2553 } | 2563 } |
| 2554 | 2564 |
| 2555 | 2565 |
| 2556 #undef __ | 2566 #undef __ |
| 2557 | 2567 |
| 2558 } // namespace dart | 2568 } // namespace dart |
| OLD | NEW |