equal
deleted
inserted
replaced
271 field.getType()); |
271 field.getType()); |
272 } |
272 } |
273 return (OopField) field; |
273 return (OopField) field; |
274 } |
274 } |
275 |
275 |
|
276 public NarrowOopField getNarrowOopField(String fieldName) throws WrongTypeException { |
|
277 return (NarrowOopField) new BasicNarrowOopField(getOopField(fieldName)); |
|
278 } |
|
279 |
276 public AddressField getAddressField(String fieldName) { |
280 public AddressField getAddressField(String fieldName) { |
277 // This type can not be inferred (for now), so provide a wrapper |
281 // This type can not be inferred (for now), so provide a wrapper |
278 Field field = getField(fieldName); |
282 Field field = getField(fieldName); |
279 if (field == null) { |
283 if (field == null) { |
280 return null; |
284 return null; |
285 /** This method should only be used by the builder of the |
289 /** This method should only be used by the builder of the |
286 TypeDataBase. Throws a RuntimeException if a field with this |
290 TypeDataBase. Throws a RuntimeException if a field with this |
287 name was already present in this class. */ |
291 name was already present in this class. */ |
288 public void addField(Field field) { |
292 public void addField(Field field) { |
289 if (nameToFieldMap.get(field.getName()) != null) { |
293 if (nameToFieldMap.get(field.getName()) != null) { |
290 throw new RuntimeException("field of name \"" + field.getName() + "\" already present"); |
294 throw new RuntimeException("field of name \"" + field.getName() + "\" already present in type " + this); |
291 } |
295 } |
292 |
296 |
293 nameToFieldMap.put(field.getName(), field); |
297 nameToFieldMap.put(field.getName(), field); |
294 fieldList.add(field); |
298 fieldList.add(field); |
295 } |
299 } |