< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java

Print this page

 96     // char* mapped_base_address = header->_mapped_base_address
 97     // size_t cloned_vtable_offset = header->_cloned_vtable_offset
 98     // CppVtableInfo** vtablesIndex = mapped_base_address + cloned_vtable_offset;
 99     Address mapped_base_address = get_AddressField(FileMapHeader_type, header, "_mapped_base_address");
100     long cloned_vtable_offset = get_CIntegerField(FileMapHeader_type, header, "_cloned_vtables_offset");
101     vtablesIndex = mapped_base_address.addOffsetTo(cloned_vtable_offset);
102 
103     // CDSFileMapRegion* rw_space = &header->_space[rw];
104     // char* rwRegionBaseAddress = rw_space->_mapped_base;
105     // size_t used = rw_space->_used;
106     // char* rwRegionEndAddress = rwRegionBaseAddress + used;
107     Address rw_space = get_CDSFileMapRegion(FileMapHeader_type, header, 0);
108     rwRegionBaseAddress = get_AddressField(CDSFileMapRegion_type, rw_space, "_mapped_base");
109     long used = get_CIntegerField(CDSFileMapRegion_type, rw_space, "_used");
110     rwRegionEndAddress = rwRegionBaseAddress.addOffsetTo(used);
111 
112     populateMetadataTypeArray(db);
113   }
114 
115   private static void populateMetadataTypeArray(TypeDataBase db) {
116     metadataTypeArray = new Type[8];
117 
118     metadataTypeArray[0] = db.lookupType("ConstantPool");
119     metadataTypeArray[1] = db.lookupType("InstanceKlass");
120     metadataTypeArray[2] = db.lookupType("InstanceClassLoaderKlass");
121     metadataTypeArray[3] = db.lookupType("InstanceMirrorKlass");
122     metadataTypeArray[4] = db.lookupType("InstanceRefKlass");
123     metadataTypeArray[5] = db.lookupType("Method");
124     metadataTypeArray[6] = db.lookupType("ObjArrayKlass");
125     metadataTypeArray[7] = db.lookupType("TypeArrayKlass");

126   }
127 
128   public FileMapHeader getHeader() {
129     return headerObj;
130   }
131 
132   public boolean inCopiedVtableSpace(Address vptrAddress) {
133     FileMapHeader fmHeader = getHeader();
134     return fmHeader.inCopiedVtableSpace(vptrAddress);
135   }
136 
137   public Type getTypeForVptrAddress(Address vptrAddress) {
138     if (vTableTypeMap == null) {
139       getHeader().createVtableTypeMapping();
140     }
141     return vTableTypeMap.get(vptrAddress);
142   }
143 
144 
145   //------------------------------------------------------------------------------------------

 96     // char* mapped_base_address = header->_mapped_base_address
 97     // size_t cloned_vtable_offset = header->_cloned_vtable_offset
 98     // CppVtableInfo** vtablesIndex = mapped_base_address + cloned_vtable_offset;
 99     Address mapped_base_address = get_AddressField(FileMapHeader_type, header, "_mapped_base_address");
100     long cloned_vtable_offset = get_CIntegerField(FileMapHeader_type, header, "_cloned_vtables_offset");
101     vtablesIndex = mapped_base_address.addOffsetTo(cloned_vtable_offset);
102 
103     // CDSFileMapRegion* rw_space = &header->_space[rw];
104     // char* rwRegionBaseAddress = rw_space->_mapped_base;
105     // size_t used = rw_space->_used;
106     // char* rwRegionEndAddress = rwRegionBaseAddress + used;
107     Address rw_space = get_CDSFileMapRegion(FileMapHeader_type, header, 0);
108     rwRegionBaseAddress = get_AddressField(CDSFileMapRegion_type, rw_space, "_mapped_base");
109     long used = get_CIntegerField(CDSFileMapRegion_type, rw_space, "_used");
110     rwRegionEndAddress = rwRegionBaseAddress.addOffsetTo(used);
111 
112     populateMetadataTypeArray(db);
113   }
114 
115   private static void populateMetadataTypeArray(TypeDataBase db) {
116     metadataTypeArray = new Type[9];
117 
118     metadataTypeArray[0] = db.lookupType("ConstantPool");
119     metadataTypeArray[1] = db.lookupType("InstanceKlass");
120     metadataTypeArray[2] = db.lookupType("InstanceClassLoaderKlass");
121     metadataTypeArray[3] = db.lookupType("InstanceMirrorKlass");
122     metadataTypeArray[4] = db.lookupType("InstanceRefKlass");
123     metadataTypeArray[5] = db.lookupType("InstanceStackChunkKlass");
124     metadataTypeArray[6] = db.lookupType("Method");
125     metadataTypeArray[7] = db.lookupType("ObjArrayKlass");
126     metadataTypeArray[8] = db.lookupType("TypeArrayKlass");
127   }
128 
129   public FileMapHeader getHeader() {
130     return headerObj;
131   }
132 
133   public boolean inCopiedVtableSpace(Address vptrAddress) {
134     FileMapHeader fmHeader = getHeader();
135     return fmHeader.inCopiedVtableSpace(vptrAddress);
136   }
137 
138   public Type getTypeForVptrAddress(Address vptrAddress) {
139     if (vTableTypeMap == null) {
140       getHeader().createVtableTypeMapping();
141     }
142     return vTableTypeMap.get(vptrAddress);
143   }
144 
145 
146   //------------------------------------------------------------------------------------------
< prev index next >