< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java
Print this page
*** 25,69 ****
package sun.jvm.hotspot.gc.z;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
- import sun.jvm.hotspot.runtime.VMObjectFactory;
- import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for ZPageAllocator
public class ZPageAllocator extends VMObject {
! private static long physicalFieldOffset;
private static CIntegerField usedField;
static {
VM.registerVMInitializedObserver((o, d) -> initialize(VM.getVM().getTypeDataBase()));
}
static private synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("ZPageAllocator");
! physicalFieldOffset = type.getAddressField("_physical").getOffset();
usedField = type.getCIntegerField("_used");
}
- private ZPhysicalMemoryManager physical() {
- Address physicalAddr = addr.addOffsetTo(physicalFieldOffset);
- return (ZPhysicalMemoryManager)VMObjectFactory.newObject(ZPhysicalMemoryManager.class, physicalAddr);
- }
-
public long maxCapacity() {
! return physical().maxCapacity();
}
public long capacity() {
! return physical().capacity();
}
public long used() {
return usedField.getValue(addr);
}
--- 25,64 ----
package sun.jvm.hotspot.gc.z;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for ZPageAllocator
public class ZPageAllocator extends VMObject {
! private static CIntegerField maxCapacityField;
! private static CIntegerField capacityField;
private static CIntegerField usedField;
static {
VM.registerVMInitializedObserver((o, d) -> initialize(VM.getVM().getTypeDataBase()));
}
static private synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("ZPageAllocator");
! maxCapacityField = type.getCIntegerField("_max_capacity");
! capacityField = type.getCIntegerField("_capacity");
usedField = type.getCIntegerField("_used");
}
public long maxCapacity() {
! return maxCapacityField.getValue(addr);
}
public long capacity() {
! return capacityField.getValue(addr);
}
public long used() {
return usedField.getValue(addr);
}
< prev index next >