| 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_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.h" | 10 #include "vm/flow_graph.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 | 27 |
| 28 static const intptr_t kNoVirtualRegister = -1; | 28 static const intptr_t kNoVirtualRegister = -1; |
| 29 static const intptr_t kTempVirtualRegister = -2; | 29 static const intptr_t kTempVirtualRegister = -2; |
| 30 static const intptr_t kIllegalPosition = -1; | 30 static const intptr_t kIllegalPosition = -1; |
| 31 static const intptr_t kMaxPosition = 0x7FFFFFFF; | 31 static const intptr_t kMaxPosition = 0x7FFFFFFF; |
| 32 static const intptr_t kPairVirtualRegisterOffset = 1; | 32 static const intptr_t kPairVirtualRegisterOffset = 1; |
| 33 | 33 |
| 34 // Definitions which have pair representations | 34 // Definitions which have pair representations |
| 35 // (kPairOfTagged or kPairOfUnboxedDouble) use two virtual register names. | 35 // (kPairOfTagged) use two virtual register names. |
| 36 // At SSA index allocation time each definition reserves two SSA indexes, | 36 // At SSA index allocation time each definition reserves two SSA indexes, |
| 37 // the second index is only used for pairs. This function maps from the first | 37 // the second index is only used for pairs. This function maps from the first |
| 38 // SSA index to the second. | 38 // SSA index to the second. |
| 39 static intptr_t ToSecondPairVreg(intptr_t vreg) { | 39 static intptr_t ToSecondPairVreg(intptr_t vreg) { |
| 40 // Map vreg to its pair vreg. | 40 // Map vreg to its pair vreg. |
| 41 return vreg + kPairVirtualRegisterOffset; | 41 return vreg + kPairVirtualRegisterOffset; |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 static intptr_t MinPosition(intptr_t a, intptr_t b) { | 45 static intptr_t MinPosition(intptr_t a, intptr_t b) { |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 } else { | 779 } else { |
| 780 return Location::kRegister; | 780 return Location::kRegister; |
| 781 } | 781 } |
| 782 } | 782 } |
| 783 | 783 |
| 784 | 784 |
| 785 static Location::Kind RegisterKindForResult(Instruction* instr) { | 785 static Location::Kind RegisterKindForResult(Instruction* instr) { |
| 786 const Representation rep = instr->representation(); | 786 const Representation rep = instr->representation(); |
| 787 #if !defined(TARGET_ARCH_DBC) | 787 #if !defined(TARGET_ARCH_DBC) |
| 788 if ((rep == kUnboxedDouble) || (rep == kUnboxedFloat32x4) || | 788 if ((rep == kUnboxedDouble) || (rep == kUnboxedFloat32x4) || |
| 789 (rep == kUnboxedInt32x4) || (rep == kUnboxedFloat64x2) || | 789 (rep == kUnboxedInt32x4) || (rep == kUnboxedFloat64x2)) { |
| 790 (rep == kPairOfUnboxedDouble)) { | |
| 791 return Location::kFpuRegister; | 790 return Location::kFpuRegister; |
| 792 } else { | 791 } else { |
| 793 return Location::kRegister; | 792 return Location::kRegister; |
| 794 } | 793 } |
| 795 #else | 794 #else |
| 796 // DBC supports only unboxed doubles and does not have distinguished FPU | 795 // DBC supports only unboxed doubles and does not have distinguished FPU |
| 797 // registers. | 796 // registers. |
| 798 ASSERT((rep != kUnboxedFloat32x4) && (rep != kUnboxedInt32x4) && | 797 ASSERT((rep != kUnboxedFloat32x4) && (rep != kUnboxedInt32x4) && |
| 799 (rep != kUnboxedFloat64x2) && (rep != kPairOfUnboxedDouble)); | 798 (rep != kUnboxedFloat64x2)); |
| 800 return Location::kRegister; | 799 return Location::kRegister; |
| 801 #endif | 800 #endif |
| 802 } | 801 } |
| 803 | 802 |
| 804 | 803 |
| 805 // | 804 // |
| 806 // When describing shape of live ranges in comments below we are going to use | 805 // When describing shape of live ranges in comments below we are going to use |
| 807 // the following notation: | 806 // the following notation: |
| 808 // | 807 // |
| 809 // B block entry | 808 // B block entry |
| (...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3089 FlowGraphPrinter printer(flow_graph_, true); | 3088 FlowGraphPrinter printer(flow_graph_, true); |
| 3090 printer.PrintBlocks(); | 3089 printer.PrintBlocks(); |
| 3091 #endif | 3090 #endif |
| 3092 } | 3091 } |
| 3093 THR_Print("----------------------------------------------\n"); | 3092 THR_Print("----------------------------------------------\n"); |
| 3094 } | 3093 } |
| 3095 } | 3094 } |
| 3096 | 3095 |
| 3097 | 3096 |
| 3098 } // namespace dart | 3097 } // namespace dart |
| OLD | NEW |