comparison agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @ 12067:e22ee8e7ae62

8021948: Change InstanceKlass::_source_file_name and _generic_signature from Symbol* to constant pool indexes. Summary: Change InstanceKlass::_source_file_name and _generic_signature to u2 fields. Reviewed-by: coleenp, iklam
author jiangli
date Mon, 19 Aug 2013 14:59:54 -0400
parents 6bd680e9ea35
children 6b3ac96bada6
comparison
equal deleted inserted replaced
12061:e5003079dfa5 12067:e22ee8e7ae62
73 transitiveInterfaces = type.getAddressField("_transitive_interfaces"); 73 transitiveInterfaces = type.getAddressField("_transitive_interfaces");
74 fields = type.getAddressField("_fields"); 74 fields = type.getAddressField("_fields");
75 javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0); 75 javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0);
76 constants = new MetadataField(type.getAddressField("_constants"), 0); 76 constants = new MetadataField(type.getAddressField("_constants"), 0);
77 classLoaderData = type.getAddressField("_class_loader_data"); 77 classLoaderData = type.getAddressField("_class_loader_data");
78 sourceFileName = type.getAddressField("_source_file_name");
79 sourceDebugExtension = type.getAddressField("_source_debug_extension"); 78 sourceDebugExtension = type.getAddressField("_source_debug_extension");
80 innerClasses = type.getAddressField("_inner_classes"); 79 innerClasses = type.getAddressField("_inner_classes");
80 sourceFileNameIndex = new CIntField(type.getCIntegerField("_source_file_name_index"), 0);
81 nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), 0); 81 nonstaticFieldSize = new CIntField(type.getCIntegerField("_nonstatic_field_size"), 0);
82 staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), 0); 82 staticFieldSize = new CIntField(type.getCIntegerField("_static_field_size"), 0);
83 staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), 0); 83 staticOopFieldCount = new CIntField(type.getCIntegerField("_static_oop_field_count"), 0);
84 nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0); 84 nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0);
85 isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0); 85 isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0);
86 initState = new CIntField(type.getCIntegerField("_init_state"), 0); 86 initState = new CIntField(type.getCIntegerField("_init_state"), 0);
87 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0); 87 vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0);
88 itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0); 88 itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0);
89 breakpoints = type.getAddressField("_breakpoints"); 89 breakpoints = type.getAddressField("_breakpoints");
90 genericSignature = type.getAddressField("_generic_signature"); 90 genericSignatureIndex = new CIntField(type.getCIntegerField("_generic_signature_index"), 0);
91 majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0); 91 majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0);
92 minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0); 92 minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0);
93 headerSize = Oop.alignObjectOffset(type.getSize()); 93 headerSize = Oop.alignObjectOffset(type.getSize());
94 94
95 // read field offset constants 95 // read field offset constants
132 private static AddressField transitiveInterfaces; 132 private static AddressField transitiveInterfaces;
133 private static AddressField fields; 133 private static AddressField fields;
134 private static CIntField javaFieldsCount; 134 private static CIntField javaFieldsCount;
135 private static MetadataField constants; 135 private static MetadataField constants;
136 private static AddressField classLoaderData; 136 private static AddressField classLoaderData;
137 private static AddressField sourceFileName;
138 private static AddressField sourceDebugExtension; 137 private static AddressField sourceDebugExtension;
139 private static AddressField innerClasses; 138 private static AddressField innerClasses;
139 private static CIntField sourceFileNameIndex;
140 private static CIntField nonstaticFieldSize; 140 private static CIntField nonstaticFieldSize;
141 private static CIntField staticFieldSize; 141 private static CIntField staticFieldSize;
142 private static CIntField staticOopFieldCount; 142 private static CIntField staticOopFieldCount;
143 private static CIntField nonstaticOopMapSize; 143 private static CIntField nonstaticOopMapSize;
144 private static CIntField isMarkedDependent; 144 private static CIntField isMarkedDependent;
145 private static CIntField initState; 145 private static CIntField initState;
146 private static CIntField vtableLen; 146 private static CIntField vtableLen;
147 private static CIntField itableLen; 147 private static CIntField itableLen;
148 private static AddressField breakpoints; 148 private static AddressField breakpoints;
149 private static AddressField genericSignature; 149 private static CIntField genericSignatureIndex;
150 private static CIntField majorVersion; 150 private static CIntField majorVersion;
151 private static CIntField minorVersion; 151 private static CIntField minorVersion;
152 152
153 // type safe enum for ClassState from instanceKlass.hpp 153 // type safe enum for ClassState from instanceKlass.hpp
154 public static class ClassState { 154 public static class ClassState {
344 return allFieldsCount; 344 return allFieldsCount;
345 } 345 }
346 public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); } 346 public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
347 public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); } 347 public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); }
348 public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); } 348 public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); }
349 public Symbol getSourceFileName() { return getSymbol(sourceFileName); } 349 public Symbol getSourceFileName() { return getConstants().getSymbolAt(sourceFileNameIndex.getValue(this)); }
350 public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); } 350 public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); }
351 public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); } 351 public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
352 public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); } 352 public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); }
353 public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); } 353 public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); }
354 public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; } 354 public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; }
355 public long getVtableLen() { return vtableLen.getValue(this); } 355 public long getVtableLen() { return vtableLen.getValue(this); }
356 public long getItableLen() { return itableLen.getValue(this); } 356 public long getItableLen() { return itableLen.getValue(this); }
357 public Symbol getGenericSignature() { return getSymbol(genericSignature); } 357 public Symbol getGenericSignature() { return getConstants().getSymbolAt(genericSignatureIndex.getValue(this)); }
358 public long majorVersion() { return majorVersion.getValue(this); } 358 public long majorVersion() { return majorVersion.getValue(this); }
359 public long minorVersion() { return minorVersion.getValue(this); } 359 public long minorVersion() { return minorVersion.getValue(this); }
360 360
361 // "size helper" == instance size in words 361 // "size helper" == instance size in words
362 public long getSizeHelper() { 362 public long getSizeHelper() {