comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeResolved.java @ 2284:569d3fe7d65c

non-static VMEntries and VMExits, CompilationServer simplifications
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 07 Apr 2011 15:32:25 +0200
parents 231bf6b9f5ad
children 762de4b26788
comparison
equal deleted inserted replaced
2282:0309d394eb5f 2284:569d3fe7d65c
46 private int instanceSize; 46 private int instanceSize;
47 private RiType componentType; 47 private RiType componentType;
48 private HashMap<Integer, RiField> fieldCache; 48 private HashMap<Integer, RiField> fieldCache;
49 private RiConstantPool pool; 49 private RiConstantPool pool;
50 50
51 private HotSpotTypeResolved() {
52 super(null);
53 }
54
51 @Override 55 @Override
52 public int accessFlags() { 56 public int accessFlags() {
53 return accessFlags; 57 return accessFlags;
54 } 58 }
55 59
56 @Override 60 @Override
57 public RiType arrayOf() { 61 public RiType arrayOf() {
58 return Compiler.getVMEntries().RiType_arrayOf(this); 62 return compiler.getVMEntries().RiType_arrayOf(this);
59 } 63 }
60 64
61 @Override 65 @Override
62 public RiType componentType() { 66 public RiType componentType() {
63 return Compiler.getVMEntries().RiType_componentType(this); 67 return compiler.getVMEntries().RiType_componentType(this);
64 } 68 }
65 69
66 @Override 70 @Override
67 public RiType uniqueConcreteSubtype() { 71 public RiType uniqueConcreteSubtype() {
68 return Compiler.getVMEntries().RiType_uniqueConcreteSubtype(this); 72 return compiler.getVMEntries().RiType_uniqueConcreteSubtype(this);
69 } 73 }
70 74
71 @Override 75 @Override
72 public RiType exactType() { 76 public RiType exactType() {
73 if (Modifier.isFinal(accessFlags)) { 77 if (Modifier.isFinal(accessFlags)) {
143 } 147 }
144 148
145 @Override 149 @Override
146 public boolean isSubtypeOf(RiType other) { 150 public boolean isSubtypeOf(RiType other) {
147 if (other instanceof HotSpotTypeResolved) { 151 if (other instanceof HotSpotTypeResolved) {
148 return Compiler.getVMEntries().RiType_isSubtypeOf(this, other); 152 return compiler.getVMEntries().RiType_isSubtypeOf(this, other);
149 } 153 }
150 // No resolved type is a subtype of an unresolved type. 154 // No resolved type is a subtype of an unresolved type.
151 return false; 155 return false;
152 } 156 }
153 157
162 } 166 }
163 167
164 @Override 168 @Override
165 public RiMethod resolveMethodImpl(RiMethod method) { 169 public RiMethod resolveMethodImpl(RiMethod method) {
166 assert method instanceof HotSpotMethod; 170 assert method instanceof HotSpotMethod;
167 return Compiler.getVMEntries().RiType_resolveMethodImpl(this, method.name(), method.signature().asString()); 171 return compiler.getVMEntries().RiType_resolveMethodImpl(this, method.name(), method.signature().asString());
168 } 172 }
169 173
170 @Override 174 @Override
171 public String toString() { 175 public String toString() {
172 return "HotSpotType<" + simpleName + ", resolved>"; 176 return "HotSpotType<" + simpleName + ", resolved>";
173 } 177 }
174 178
175 public RiConstantPool constantPool() { 179 public RiConstantPool constantPool() {
176 // TODO: Implement constant pool without the need for VmId and cache the constant pool. 180 // TODO: Implement constant pool without the need for VmId and cache the constant pool.
177 return Compiler.getVMEntries().RiType_constantPool(this); 181 return compiler.getVMEntries().RiType_constantPool(this);
178 } 182 }
179 183
180 public int instanceSize() { 184 public int instanceSize() {
181 return instanceSize; 185 return instanceSize;
182 } 186 }
190 } else { 194 } else {
191 result = fieldCache.get(offset); 195 result = fieldCache.get(offset);
192 } 196 }
193 197
194 if (result == null) { 198 if (result == null) {
195 result = new HotSpotField(this, name, type, offset); 199 result = new HotSpotField(compiler, this, name, type, offset);
196 fieldCache.put(offset, result); 200 fieldCache.put(offset, result);
197 } 201 }
198 202
199 return result; 203 return result;
200 } 204 }