8218732: SA: Resolves ZPageAllocator::_physical incorrectly
authorstefank
Tue, 19 Feb 2019 10:01:50 +0100
changeset 53809 26a2eded80d9
parent 53808 42a613bcb622
child 53810 d52887bc636f
8218732: SA: Resolves ZPageAllocator::_physical incorrectly Reviewed-by: eosterlund, jgeorge
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java	Tue Feb 19 10:00:51 2019 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/z/ZPageAllocator.java	Tue Feb 19 10:01:50 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -37,7 +37,7 @@
 
 public class ZPageAllocator extends VMObject {
 
-    private static AddressField physicalField;
+    private static long physicalFieldOffset;
     private static CIntegerField usedField;
 
     static {
@@ -47,12 +47,12 @@
     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);
     }