95
96 @Override
97 public boolean equals(Object obj) {
98 if (obj instanceof RegisterCategory) {
99 RegisterCategory that = (RegisterCategory) obj;
100 return this.name.equals(that.name);
101 }
102 return false;
103 }
104 }
105
106 /**
107 * Creates a {@link Register} instance.
108 *
109 * @param number unique identifier for the register
110 * @param encoding the target machine encoding for the register
111 * @param name the mnemonic name for the register
112 * @param registerCategory the register category
113 */
114 public Register(int number, int encoding, String name, RegisterCategory registerCategory) {
115 this.number = number;
116 this.name = name;
117 this.registerCategory = registerCategory;
118 this.encoding = encoding;
119 }
120
121 public RegisterCategory getRegisterCategory() {
122 return registerCategory;
123 }
124
125 /**
126 * Determine whether this register needs to be part of the reference map.
127 */
128 public boolean mayContainReference() {
129 return registerCategory.mayContainReference;
130 }
131
132 /**
133 * Gets this register as a {@linkplain RegisterValue value} with a specified kind.
134 *
|
95
96 @Override
97 public boolean equals(Object obj) {
98 if (obj instanceof RegisterCategory) {
99 RegisterCategory that = (RegisterCategory) obj;
100 return this.name.equals(that.name);
101 }
102 return false;
103 }
104 }
105
106 /**
107 * Creates a {@link Register} instance.
108 *
109 * @param number unique identifier for the register
110 * @param encoding the target machine encoding for the register
111 * @param name the mnemonic name for the register
112 * @param registerCategory the register category
113 */
114 public Register(int number, int encoding, String name, RegisterCategory registerCategory) {
115 assert number < 64;
116 this.number = number;
117 this.name = name;
118 this.registerCategory = registerCategory;
119 this.encoding = encoding;
120 }
121
122 public RegisterCategory getRegisterCategory() {
123 return registerCategory;
124 }
125
126 /**
127 * Determine whether this register needs to be part of the reference map.
128 */
129 public boolean mayContainReference() {
130 return registerCategory.mayContainReference;
131 }
132
133 /**
134 * Gets this register as a {@linkplain RegisterValue value} with a specified kind.
135 *
|