| 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 #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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 kRegister = 8, | 90 kRegister = 8, |
| 91 | 91 |
| 92 // FpuRegister location represents a fixed fpu register. Payload contains | 92 // FpuRegister location represents a fixed fpu register. Payload contains |
| 93 // its code. | 93 // its code. |
| 94 kFpuRegister = 12, | 94 kFpuRegister = 12, |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 Location() : value_(kInvalidLocation) { | 97 Location() : value_(kInvalidLocation) { |
| 98 // Verify that non-tagged location kinds do not interfere with location tags | 98 // Verify that non-tagged location kinds do not interfere with location tags |
| 99 // (kConstantTag and kPairLocationTag). | 99 // (kConstantTag and kPairLocationTag). |
| 100 COMPILE_ASSERT(((kInvalid & kLocationTagMask) != kConstantTag), | 100 COMPILE_ASSERT((kInvalid & kLocationTagMask) != kConstantTag); |
| 101 invalid_conflicts_with_constant_tag); | 101 COMPILE_ASSERT((kInvalid & kLocationTagMask) != kPairLocationTag); |
| 102 COMPILE_ASSERT(((kInvalid & kLocationTagMask) != kPairLocationTag), | |
| 103 invalid_conflicts_with_pair_tag); | |
| 104 | 102 |
| 105 COMPILE_ASSERT(((kUnallocated & kLocationTagMask) != kConstantTag), | 103 COMPILE_ASSERT((kUnallocated & kLocationTagMask) != kConstantTag); |
| 106 unallocated_conflicts_with_constant_tag); | 104 COMPILE_ASSERT((kUnallocated & kLocationTagMask) != kPairLocationTag); |
| 107 COMPILE_ASSERT(((kUnallocated & kLocationTagMask) != kPairLocationTag), | |
| 108 unallocated_conflicts_with_pair_tag); | |
| 109 | 105 |
| 110 COMPILE_ASSERT(((kStackSlot & kLocationTagMask) != kConstantTag), | 106 COMPILE_ASSERT((kStackSlot & kLocationTagMask) != kConstantTag); |
| 111 stackslot_conflicts_with_constant_tag); | 107 COMPILE_ASSERT((kStackSlot & kLocationTagMask) != kPairLocationTag); |
| 112 COMPILE_ASSERT(((kStackSlot & kLocationTagMask) != kPairLocationTag), | |
| 113 stackslot_conflicts_with_pair_tag); | |
| 114 | 108 |
| 115 COMPILE_ASSERT(((kDoubleStackSlot & kLocationTagMask) != kConstantTag), | 109 COMPILE_ASSERT((kDoubleStackSlot & kLocationTagMask) != kConstantTag); |
| 116 doublestackslot_conflicts_with_constant_tag); | 110 COMPILE_ASSERT((kDoubleStackSlot & kLocationTagMask) != kPairLocationTag); |
| 117 COMPILE_ASSERT(((kDoubleStackSlot & kLocationTagMask) != kPairLocationTag), | |
| 118 doublestackslot_conflicts_with_pair_tag); | |
| 119 | 111 |
| 120 COMPILE_ASSERT(((kQuadStackSlot & kLocationTagMask) != kConstantTag), | 112 COMPILE_ASSERT((kQuadStackSlot & kLocationTagMask) != kConstantTag); |
| 121 quadstackslot_conflicts_with_constant_tag); | 113 COMPILE_ASSERT((kQuadStackSlot & kLocationTagMask) != kPairLocationTag); |
| 122 COMPILE_ASSERT(((kQuadStackSlot & kLocationTagMask) != kPairLocationTag), | |
| 123 quadstackslot_conflicts_with_pair_tag); | |
| 124 | 114 |
| 125 COMPILE_ASSERT(((kRegister & kLocationTagMask) != kConstantTag), | 115 COMPILE_ASSERT((kRegister & kLocationTagMask) != kConstantTag); |
| 126 register_conflicts_with_constant_tag); | 116 COMPILE_ASSERT((kRegister & kLocationTagMask) != kPairLocationTag); |
| 127 COMPILE_ASSERT(((kRegister & kLocationTagMask) != kPairLocationTag), | |
| 128 register_conflicts_with_pair_tag); | |
| 129 | 117 |
| 130 COMPILE_ASSERT(((kFpuRegister & kLocationTagMask) != kConstantTag), | 118 COMPILE_ASSERT((kFpuRegister & kLocationTagMask) != kConstantTag); |
| 131 fpuregister_conflicts_with_constant_tag); | 119 COMPILE_ASSERT((kFpuRegister & kLocationTagMask) != kPairLocationTag); |
| 132 COMPILE_ASSERT(((kFpuRegister & kLocationTagMask) != kPairLocationTag), | |
| 133 fpuregister_conflicts_with_pair_tag); | |
| 134 | 120 |
| 135 // Verify tags and tagmask. | 121 // Verify tags and tagmask. |
| 136 COMPILE_ASSERT(((kConstantTag & kLocationTagMask) == kConstantTag), | 122 COMPILE_ASSERT((kConstantTag & kLocationTagMask) == kConstantTag); |
| 137 bad_constant_tag); | |
| 138 | 123 |
| 139 COMPILE_ASSERT(((kPairLocationTag & kLocationTagMask) == kPairLocationTag), | 124 COMPILE_ASSERT((kPairLocationTag & kLocationTagMask) == kPairLocationTag); |
| 140 bad_pair_tag); | |
| 141 | 125 |
| 142 ASSERT(IsInvalid()); | 126 ASSERT(IsInvalid()); |
| 143 } | 127 } |
| 144 | 128 |
| 145 Location(const Location& other) : ValueObject(), value_(other.value_) { } | 129 Location(const Location& other) : ValueObject(), value_(other.value_) { } |
| 146 | 130 |
| 147 Location& operator=(const Location& other) { | 131 Location& operator=(const Location& other) { |
| 148 value_ = other.value_; | 132 value_ = other.value_; |
| 149 return *this; | 133 return *this; |
| 150 } | 134 } |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 BitmapBuilder* stack_bitmap_; | 615 BitmapBuilder* stack_bitmap_; |
| 632 | 616 |
| 633 const ContainsCall contains_call_; | 617 const ContainsCall contains_call_; |
| 634 RegisterSet live_registers_; | 618 RegisterSet live_registers_; |
| 635 }; | 619 }; |
| 636 | 620 |
| 637 | 621 |
| 638 } // namespace dart | 622 } // namespace dart |
| 639 | 623 |
| 640 #endif // VM_LOCATIONS_H_ | 624 #endif // VM_LOCATIONS_H_ |
| OLD | NEW |