comparison graal/GraalCompiler/src/com/sun/c1x/ir/AccessField.java @ 2539:fa3bda50cbfd

More clean up on Value.Flags.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 27 Apr 2011 20:22:05 +0200
parents e1ba5a93e997
children 3fc322165071
comparison
equal deleted inserted replaced
2538:e1ba5a93e997 2539:fa3bda50cbfd
34 */ 34 */
35 public abstract class AccessField extends StateSplit { 35 public abstract class AccessField extends StateSplit {
36 36
37 private Value object; 37 private Value object;
38 protected final RiField field; 38 protected final RiField field;
39 private boolean needsPatching;
39 40
40 /** 41 /**
41 * Constructs a new access field object. 42 * Constructs a new access field object.
42 * @param kind the result kind of the access 43 * @param kind the result kind of the access
43 * @param object the instruction producing the receiver object 44 * @param object the instruction producing the receiver object
51 this.object = object; 52 this.object = object;
52 this.field = field; 53 this.field = field;
53 if (!isLoaded || (C1XOptions.TestPatching && !Modifier.isVolatile(field.accessFlags()))) { 54 if (!isLoaded || (C1XOptions.TestPatching && !Modifier.isVolatile(field.accessFlags()))) {
54 // require patching if the field is not loaded (i.e. resolved), 55 // require patching if the field is not loaded (i.e. resolved),
55 // or if patch testing is turned on (but not if the field is volatile) 56 // or if patch testing is turned on (but not if the field is volatile)
56 setFlag(Flag.NeedsPatching); 57 needsPatching = true;
57 } 58 }
58 initFlag(Flag.IsLoaded, isLoaded); 59 initFlag(Flag.IsLoaded, isLoaded);
59 if (isLoaded && object.isNonNull()) { 60 if (isLoaded && object.isNonNull()) {
60 eliminateNullCheck(); 61 eliminateNullCheck();
61 } 62 }
113 /** 114 /**
114 * Checks whether this field access will require patching. 115 * Checks whether this field access will require patching.
115 * @return {@code true} if this field access will require patching 116 * @return {@code true} if this field access will require patching
116 */ 117 */
117 public boolean needsPatching() { 118 public boolean needsPatching() {
118 return checkFlag(Flag.NeedsPatching); 119 return needsPatching;
119 } 120 }
120 121
121 /** 122 /**
122 * Checks whether this field access may cause a trap or an exception, which 123 * Checks whether this field access may cause a trap or an exception, which
123 * is if it either requires a null check or needs patching. 124 * is if it either requires a null check or needs patching.