< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, 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.

@@ -35,26 +35,26 @@
 
 // Mirror class for ZPageAllocator
 
 public class ZPageAllocator extends VMObject {
 
-    private static AddressField physicalField;
+    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");
 
-        physicalField = type.getAddressField("_physical");
+        physicalFieldOffset = type.getAddressField("_physical").getOffset();
         usedField = type.getCIntegerField("_used");
     }
 
     private ZPhysicalMemoryManager physical() {
-      Address physicalAddr = physicalField.getValue(addr);
+      Address physicalAddr = addr.addOffsetTo(physicalFieldOffset);
       return (ZPhysicalMemoryManager)VMObjectFactory.newObject(ZPhysicalMemoryManager.class, physicalAddr);
     }
 
     public long maxCapacity() {
         return physical().maxCapacity();
< prev index next >