comparison agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1
comparison
equal deleted inserted replaced
110:a49a647afe9a 113:ba764ed4b6f2
41 /** Used for nonstatic fields only */ 41 /** Used for nonstatic fields only */
42 private long offset; 42 private long offset;
43 /** Used for static fields only */ 43 /** Used for static fields only */
44 private Address staticFieldAddress; 44 private Address staticFieldAddress;
45 45
46 // Copy constructor to create NarrowOopField from OopField.
47 public BasicField(Field fld) {
48 BasicField field = (BasicField)fld;
49
50 this.db = field.db;
51 this.containingType = field.containingType;
52 this.name = field.name;
53 this.type = field.type;
54 this.size = field.size;
55 this.isStatic = field.isStatic;
56 this.offset = field.offset;
57 this.staticFieldAddress = field.staticFieldAddress;
58 }
46 /** offsetInBytes is ignored if the field is static; 59 /** offsetInBytes is ignored if the field is static;
47 staticFieldAddress is used only if the field is static. */ 60 staticFieldAddress is used only if the field is static. */
48 public BasicField(BasicTypeDataBase db, Type containingType, String name, Type type, 61 public BasicField(BasicTypeDataBase db, Type containingType, String name, Type type,
49 boolean isStatic, long offsetInBytes, Address staticFieldAddress) { 62 boolean isStatic, long offsetInBytes, Address staticFieldAddress) {
50 this.db = db; 63 this.db = db;
159 if (isStatic) { 172 if (isStatic) {
160 throw new WrongTypeException(); 173 throw new WrongTypeException();
161 } 174 }
162 return addr.getOopHandleAt(offset); 175 return addr.getOopHandleAt(offset);
163 } 176 }
177 public OopHandle getNarrowOopHandle(Address addr)
178 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException {
179 if (isStatic) {
180 throw new WrongTypeException();
181 }
182 return addr.getCompOopHandleAt(offset);
183 }
164 184
165 //-------------------------------------------------------------------------------- 185 //--------------------------------------------------------------------------------
166 // Dereferencing operations for static fields 186 // Dereferencing operations for static fields
167 // 187 //
168 188
232 if (!isStatic) { 252 if (!isStatic) {
233 throw new WrongTypeException(); 253 throw new WrongTypeException();
234 } 254 }
235 return staticFieldAddress.getOopHandleAt(0); 255 return staticFieldAddress.getOopHandleAt(0);
236 } 256 }
257 public OopHandle getNarrowOopHandle()
258 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException {
259 if (!isStatic) {
260 throw new WrongTypeException();
261 }
262 return staticFieldAddress.getCompOopHandleAt(0);
263 }
237 } 264 }