< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 49,58 ****
--- 49,60 ----
baseOffset = type.getSize();
Type elType = db.lookupType("ConstantPoolCacheEntry");
elementSize = elType.getSize();
length = new CIntField(type.getCIntegerField("_length"), 0);
intSize = VM.getVM().getObjectHeap().getIntSize();
+ resolvedReferences = type.getAddressField("_resolved_references");
+ referenceMap = type.getAddressField("_reference_map");
}
public ConstantPoolCache(Address addr) {
super(addr);
}
*** 63,73 ****
private static long baseOffset;
private static long elementSize;
private static CIntField length;
private static long intSize;
!
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
public long getSize() {
return alignSize(baseOffset + getLength() * elementSize);
--- 65,76 ----
private static long baseOffset;
private static long elementSize;
private static CIntField length;
private static long intSize;
! private static AddressField resolvedReferences;
! private static AddressField referenceMap;
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
public long getSize() {
return alignSize(baseOffset + getLength() * elementSize);
*** 98,103 ****
--- 101,120 ----
for (int i = 0; i < getLength(); i++) {
ConstantPoolCacheEntry entry = getEntryAt(i);
entry.iterateFields(visitor);
}
}
+
+ public Oop getResolvedReferences() {
+ Address handle = resolvedReferences.getValue(getAddress());
+ if (handle != null) {
+ // Load through the handle
+ OopHandle refs = handle.getOopHandleAt(0);
+ return VM.getVM().getObjectHeap().newOop(refs);
+ }
+ return null;
+ }
+
+ public U2Array referenceMap() {
+ return new U2Array(referenceMap.getValue(getAddress()));
+ }
};
< prev index next >