| OLD | NEW |
| 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_allocator.h" | 5 #include "vm/flow_graph_allocator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 LiveRange* range = MakeLiveRangeForTemporary(); | 818 LiveRange* range = MakeLiveRangeForTemporary(); |
| 819 range->AddUseInterval(pos, pos + 1); | 819 range->AddUseInterval(pos, pos + 1); |
| 820 range->AddUse(pos, locs->temp_slot(j)); | 820 range->AddUse(pos, locs->temp_slot(j)); |
| 821 AddToUnallocated(range); | 821 AddToUnallocated(range); |
| 822 } else { | 822 } else { |
| 823 UNREACHABLE(); | 823 UNREACHABLE(); |
| 824 } | 824 } |
| 825 } | 825 } |
| 826 | 826 |
| 827 // Block all allocatable registers for calls and record the stack bitmap. | 827 // Block all allocatable registers for calls and record the stack bitmap. |
| 828 if (locs->is_call()) { | 828 if (locs->always_calls()) { |
| 829 // Expected shape of live range: | 829 // Expected shape of live range: |
| 830 // | 830 // |
| 831 // i i' | 831 // i i' |
| 832 // [--) | 832 // [--) |
| 833 // | 833 // |
| 834 // The stack bitmap describes the position i. | 834 // The stack bitmap describes the position i. |
| 835 for (intptr_t reg = 0; reg < kNumberOfCpuRegisters; reg++) { | 835 for (intptr_t reg = 0; reg < kNumberOfCpuRegisters; reg++) { |
| 836 BlockLocation(Location::RegisterLocation(static_cast<Register>(reg)), | 836 BlockLocation(Location::RegisterLocation(static_cast<Register>(reg)), |
| 837 pos, | 837 pos, |
| 838 pos + 1); | 838 pos + 1); |
| 839 } | 839 } |
| 840 | 840 |
| 841 #if defined(DEBUG) | 841 #if defined(DEBUG) |
| 842 // Verify that temps, inputs and output were specified as fixed | 842 // Verify that temps, inputs and output were specified as fixed |
| 843 // locations. Every register is blocked now so attempt to | 843 // locations. Every register is blocked now so attempt to |
| 844 // allocate will not succeed. | 844 // allocate will not succeed. |
| 845 for (intptr_t j = 0; j < locs->temp_count(); j++) { | 845 for (intptr_t j = 0; j < locs->temp_count(); j++) { |
| 846 ASSERT(!locs->temp(j).IsUnallocated()); | 846 ASSERT(!locs->temp(j).IsUnallocated()); |
| 847 } | 847 } |
| 848 | 848 |
| 849 for (intptr_t j = 0; j < locs->input_count(); j++) { | 849 for (intptr_t j = 0; j < locs->input_count(); j++) { |
| 850 ASSERT(!locs->in(j).IsUnallocated()); | 850 ASSERT(!locs->in(j).IsUnallocated()); |
| 851 } | 851 } |
| 852 | 852 |
| 853 ASSERT(!locs->out().IsUnallocated()); | 853 ASSERT(!locs->out().IsUnallocated()); |
| 854 #endif | 854 #endif |
| 855 } | 855 } |
| 856 | 856 |
| 857 if (locs->contains_call()) { | 857 if (locs->can_call()) { |
| 858 safepoints_.Add(current); | 858 safepoints_.Add(current); |
| 859 } | 859 } |
| 860 | 860 |
| 861 Definition* def = current->AsDefinition(); | 861 Definition* def = current->AsDefinition(); |
| 862 if (def == NULL) { | 862 if (def == NULL) { |
| 863 ASSERT(locs->out().IsInvalid()); | 863 ASSERT(locs->out().IsInvalid()); |
| 864 return; | 864 return; |
| 865 } | 865 } |
| 866 | 866 |
| 867 if (locs->out().IsInvalid()) { | 867 if (locs->out().IsInvalid()) { |
| (...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2035 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2036 function.ToFullyQualifiedCString()); | 2036 function.ToFullyQualifiedCString()); |
| 2037 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 2037 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 2038 printer.PrintBlocks(); | 2038 printer.PrintBlocks(); |
| 2039 OS::Print("----------------------------------------------\n"); | 2039 OS::Print("----------------------------------------------\n"); |
| 2040 } | 2040 } |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 | 2043 |
| 2044 } // namespace dart | 2044 } // namespace dart |
| OLD | NEW |