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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 comparison->InputAt(i)->set_instruction(this); | 765 comparison->InputAt(i)->set_instruction(this); |
766 } | 766 } |
767 } | 767 } |
768 | 768 |
769 | 769 |
770 void BranchInstr::RawSetInputAt(intptr_t i, Value* value) { | 770 void BranchInstr::RawSetInputAt(intptr_t i, Value* value) { |
771 comparison()->RawSetInputAt(i, value); | 771 comparison()->RawSetInputAt(i, value); |
772 } | 772 } |
773 | 773 |
774 | 774 |
775 // A misleadingly named function for use in template functions that replace | |
776 // both definitions with definitions and branch comparisons with | |
777 // comparisons. In the branch case, leave the branch intact and replace its | |
778 // comparison with a new comparison not currently in the graph. | |
779 void BranchInstr::ReplaceWith(ComparisonInstr* other, | |
780 ForwardInstructionIterator* ignored) { | |
781 SetComparison(other); | |
782 } | |
783 | |
784 | |
785 void BranchInstr::SetComparison(ComparisonInstr* new_comparison) { | 775 void BranchInstr::SetComparison(ComparisonInstr* new_comparison) { |
786 for (intptr_t i = new_comparison->InputCount() - 1; i >= 0; --i) { | 776 for (intptr_t i = new_comparison->InputCount() - 1; i >= 0; --i) { |
787 Value* input = new_comparison->InputAt(i); | 777 Value* input = new_comparison->InputAt(i); |
788 input->definition()->AddInputUse(input); | 778 input->definition()->AddInputUse(input); |
789 input->set_instruction(this); | 779 input->set_instruction(this); |
790 } | 780 } |
791 // There should be no need to copy or unuse an environment. | 781 // There should be no need to copy or unuse an environment. |
792 ASSERT(comparison()->env() == NULL); | 782 ASSERT(comparison()->env() == NULL); |
793 ASSERT(new_comparison->env() == NULL); | 783 ASSERT(new_comparison->env() == NULL); |
794 // Remove the current comparison's input uses. | 784 // Remove the current comparison's input uses. |
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2944 return kCosRuntimeEntry; | 2934 return kCosRuntimeEntry; |
2945 default: | 2935 default: |
2946 UNREACHABLE(); | 2936 UNREACHABLE(); |
2947 } | 2937 } |
2948 return kSinRuntimeEntry; | 2938 return kSinRuntimeEntry; |
2949 } | 2939 } |
2950 | 2940 |
2951 #undef __ | 2941 #undef __ |
2952 | 2942 |
2953 } // namespace dart | 2943 } // namespace dart |
OLD | NEW |