comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotField.java @ 1941:79d04223b8a5

Added caching for resolved types and resolved fields. This is crucial, because the local load elimination will lead to wrong results, if field equality (of two RiField objects with the same object and the same RiType) is not given. The caching makes sure that the default equals implementation is sufficient.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Tue, 28 Dec 2010 18:33:26 +0100
parents 2c754f3a2722
children 3c0a889a176b
comparison
equal deleted inserted replaced
1940:e92a9a73324e 1941:79d04223b8a5
65 public RiType holder() { 65 public RiType holder() {
66 return holder; 66 return holder;
67 } 67 }
68 68
69 @Override 69 @Override
70 public boolean equals(Object obj) {
71 if (obj instanceof HotSpotField) {
72 HotSpotField other = (HotSpotField) obj;
73 return other.offset == offset && other.holder.equals(holder());
74 }
75 return false;
76 }
77
78 @Override
70 public boolean isResolved() { 79 public boolean isResolved() {
71 return offset != -1; 80 return offset != -1;
72 } 81 }
73 82
74 @Override 83 @Override