@@ -34,15 +34,13 @@ public final class RegisterOperand extends Operand {
34
34
35
35
/**
36
36
* Register object that this operand uses.
37
- * TODO: make this field private, it is accessed via generated code
38
37
*/
39
- public Register register ;
38
+ private Register register ;
40
39
41
40
/**
42
41
* Inferred data type of the contents of the register.
43
- * TODO: make this field private, it is accessed via generated code
44
42
*/
45
- public TypeReference type ;
43
+ private TypeReference type ;
46
44
47
45
/**
48
46
* Optimizations can use it for different purposes, as long as they
@@ -160,7 +158,7 @@ public Operand copy() {
160
158
* and/or scratchObject being copied
161
159
*/
162
160
public RegisterOperand copyRO () {
163
- RegisterOperand temp = new RegisterOperand (getRegister () , type );
161
+ RegisterOperand temp = new RegisterOperand (register , type );
164
162
temp .info = info ;
165
163
temp .flags = flags ;
166
164
temp .flags2 = flags2 ;
@@ -205,7 +203,7 @@ public RegisterOperand copyD2D() {
205
203
*/
206
204
@ Override
207
205
public boolean similar (Operand op ) {
208
- return (op instanceof RegisterOperand ) && (getRegister () == ((RegisterOperand ) op ).getRegister ());
206
+ return (op instanceof RegisterOperand ) && (register == ((RegisterOperand ) op ).getRegister ());
209
207
}
210
208
211
209
/**
@@ -216,7 +214,7 @@ public boolean similar(Operand op) {
216
214
*/
217
215
public void copyType (RegisterOperand rhs ) {
218
216
this .flags = rhs .flags ;
219
- this .setType (rhs .type ); // setting type this way will force checking of precision
217
+ this .setType (rhs .getType () ); // setting type this way will force checking of precision
220
218
}
221
219
222
220
@ Override
@@ -450,7 +448,7 @@ public RegisterOperand getNext() {
450
448
*/
451
449
@ Override
452
450
public String toString () {
453
- String s = getRegister () .toString ();
451
+ String s = register .toString ();
454
452
if (type != null ) {
455
453
if (type != TypeReference .VALIDATION_TYPE ) {
456
454
s = s + "(" + type .getName ();
@@ -497,7 +495,7 @@ public void setType(TypeReference t) {
497
495
* @param t the inferred data type of the contents of the register
498
496
*/
499
497
public void setPreciseType (TypeReference t ) {
500
- type = t ;
498
+ setType ( t ) ;
501
499
flags |= PRECISE_TYPE ;
502
500
if (VM .VerifyAssertions ) verifyPreciseType ();
503
501
}
0 commit comments