| 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 #ifndef VM_LOCATIONS_H_ | 5 #ifndef VM_LOCATIONS_H_ |
| 6 #define VM_LOCATIONS_H_ | 6 #define VM_LOCATIONS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/bitfield.h" | 10 #include "vm/bitfield.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 kRegister | 35 kRegister |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 Location() : value_(KindField::encode(kInvalid)) { } | 38 Location() : value_(KindField::encode(kInvalid)) { } |
| 39 | 39 |
| 40 Kind kind() const { return KindField::decode(value_); } | 40 Kind kind() const { return KindField::decode(value_); } |
| 41 | 41 |
| 42 // Unallocated locations. | 42 // Unallocated locations. |
| 43 enum Policy { | 43 enum Policy { |
| 44 kRequiresRegister, | 44 kRequiresRegister, |
| 45 kSameAsFirstInput | 45 kSameAsFirstInput, |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 static Location UnallocatedLocation(Policy policy) { | 48 static Location UnallocatedLocation(Policy policy) { |
| 49 return Location(kUnallocated, PolicyField::encode(policy)); | 49 return Location(kUnallocated, PolicyField::encode(policy)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Any free register is suitable to replace this unallocated location. | 52 // Any free register is suitable to replace this unallocated location. |
| 53 static Location RequiresRegister() { | 53 static Location RequiresRegister() { |
| 54 return UnallocatedLocation(kRequiresRegister); | 54 return UnallocatedLocation(kRequiresRegister); |
| 55 } | 55 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 private: | 130 private: |
| 131 // TODO(vegorov): replace with ZoneArray. | 131 // TODO(vegorov): replace with ZoneArray. |
| 132 GrowableArray<Location> input_locations_; | 132 GrowableArray<Location> input_locations_; |
| 133 Location output_location_; | 133 Location output_location_; |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 | 136 |
| 137 } // namespace dart | 137 } // namespace dart |
| 138 | 138 |
| 139 #endif // VM_LOCATIONS_H_ | 139 #endif // VM_LOCATIONS_H_ |
| OLD | NEW |