8191324: SA cleanup -- part 2
authorjgeorge
Thu, 30 Nov 2017 21:24:52 +0530
changeset 48166 2659c4fe8ea7
parent 48165 4c25d37d8557
child 48167 f04a848c6f00
8191324: SA cleanup -- part 2 Summary: Avoid redefinition of hotspot constants and ia64 code vestiges removal Reviewed-by: sspitsyn, dholmes, coleenp
src/hotspot/share/runtime/perfData.hpp
src/hotspot/share/runtime/vmStructs.cpp
src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java
src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h
--- a/src/hotspot/share/runtime/perfData.hpp	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/hotspot/share/runtime/perfData.hpp	Thu Nov 30 21:24:52 2017 +0530
@@ -245,6 +245,7 @@
 
   friend class StatSampler;      // for access to protected void sample()
   friend class PerfDataManager;  // for access to protected destructor
+  friend class VMStructs;
 
   public:
 
--- a/src/hotspot/share/runtime/vmStructs.cpp	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/hotspot/share/runtime/vmStructs.cpp	Thu Nov 30 21:24:52 2017 +0530
@@ -1534,6 +1534,7 @@
   declare_toplevel_type(PerfDataPrologue*)                                \
   declare_toplevel_type(PerfDataEntry)                                    \
   declare_toplevel_type(PerfMemory)                                       \
+  declare_type(PerfData, CHeapObj<mtInternal>)                            \
                                                                           \
   /*********************************/                                     \
   /* SymbolTable, SystemDictionary */                                     \
@@ -2481,6 +2482,12 @@
   declare_constant(InstanceKlass::inner_class_access_flags_offset)        \
   declare_constant(InstanceKlass::inner_class_next_offset)                \
                                                                           \
+  /*****************************************************/                 \
+  /* InstanceKlass EnclosingMethodAttributeOffset enum */                 \
+  /*****************************************************/                 \
+                                                                          \
+  declare_constant(InstanceKlass::enclosing_method_attribute_size)        \
+                                                                          \
   /*********************************/                                     \
   /* InstanceKlass ClassState enum */                                     \
   /*********************************/                                     \
@@ -2734,6 +2741,21 @@
   declare_c2_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT) \
   declare_c2_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT) \
                                                                           \
+  /************/                                                          \
+  /* PerfData */                                                          \
+  /************/                                                          \
+                                                                          \
+  /***********************/                                               \
+  /* PerfData Units enum */                                               \
+  /***********************/                                               \
+                                                                          \
+  declare_constant(PerfData::U_None)                                      \
+  declare_constant(PerfData::U_Bytes)                                     \
+  declare_constant(PerfData::U_Ticks)                                     \
+  declare_constant(PerfData::U_Events)                                    \
+  declare_constant(PerfData::U_String)                                    \
+  declare_constant(PerfData::U_Hertz)                                     \
+                                                                          \
   /****************/                                                      \
   /* JVMCI */                                                             \
   /****************/                                                      \
--- a/src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -298,9 +298,6 @@
 #ifdef i386
 #define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
 #endif
-#ifdef ia64
-#define NPRGREG IA64_REG_COUNT
-#endif
 #ifdef amd64
 #define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
 #endif
@@ -335,14 +332,6 @@
 
 #endif /* i386 */
 
-#if ia64
-  regs = (*env)->GetLongArrayElements(env, array, &isCopy);
-  int i;
-  for (i = 0; i < NPRGREG; i++ ) {
-    regs[i] = 0xDEADDEAD;
-  }
-#endif /* ia64 */
-
 #ifdef amd64
 #define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
 
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -35,7 +35,6 @@
 import sun.jvm.hotspot.debugger.MachineDescriptionAMD64;
 import sun.jvm.hotspot.debugger.MachineDescriptionPPC64;
 import sun.jvm.hotspot.debugger.MachineDescriptionAArch64;
-import sun.jvm.hotspot.debugger.MachineDescriptionIA64;
 import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86;
 import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit;
 import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit;
@@ -556,10 +555,8 @@
             machDesc = new MachineDescriptionIntelX86();
         } else if (cpu.equals("amd64")) {
             machDesc = new MachineDescriptionAMD64();
-        } else if (cpu.equals("ia64")) {
-            machDesc = new MachineDescriptionIA64();
         } else {
-            throw new DebuggerException("Win32 supported under x86, amd64 and ia64 only");
+            throw new DebuggerException("Win32 supported under x86 and amd64 only");
         }
 
         // Note we do not use a cache for the local debugger in server
@@ -586,8 +583,6 @@
 
         if (cpu.equals("x86")) {
             machDesc = new MachineDescriptionIntelX86();
-        } else if (cpu.equals("ia64")) {
-            machDesc = new MachineDescriptionIA64();
         } else if (cpu.equals("amd64")) {
             machDesc = new MachineDescriptionAMD64();
         } else if (cpu.equals("ppc64")) {
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java	Thu Nov 30 16:08:13 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2003, 2008, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.debugger;
-
-public class MachineDescriptionIA64 extends MachineDescriptionTwosComplement implements MachineDescription {
-  public long getAddressSize() {
-    return 8;
-  }
-
-  public boolean isLP64() {
-    return true;
-  }
-
-  public boolean isBigEndian() {
-    return false;
-  }
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -216,11 +216,7 @@
             // the UI. This is a cache of 4096 4K pages, or 16 MB. The page
             // size must be adjusted to be the hardware's page size.
             // (FIXME: should pick this up from the debugger.)
-            if (getCPU().equals("ia64")) {
-              initCache(16384, parseCacheNumPagesProperty(1024));
-            } else {
-              initCache(4096, parseCacheNumPagesProperty(4096));
-            }
+            initCache(4096, parseCacheNumPagesProperty(4096));
         }
 
         isDarwin = getOS().equals("darwin");
@@ -575,11 +571,6 @@
 
     public CDebugger getCDebugger() {
       if (cdbg == null) {
-         String cpu = getCPU();
-         if (cpu.equals("ia64") ) {
-            // IA-64 is not supported because of stack-walking issues
-            return null;
-         }
          cdbg = new BsdCDebugger(this);
       }
       return cdbg;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java	Thu Nov 30 16:08:13 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2003, 2012, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.debugger.ia64;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.cdbg.*;
-
-/** Specifies the thread context on ia64 platform; only a sub-portion
-    of the context is guaranteed to be present on all operating
-    systems. */
-
-public abstract class IA64ThreadContext implements ThreadContext {
-  // Refer to winnt.h CONTEXT structure - Nov 2001 edition Platform SDK
-  // only a relevant subset of CONTEXT structure is used here.
-  // For eg. floating point registers are ignored.
-
-  // NOTE: the indices for the various registers must be maintained as
-  // listed across various operating systems. However, only a
-  // subset of the registers' values are guaranteed to be present
-
-  // global registers r0-r31
-  public static final int GR0  = 0;
-  public static final int GR1  = 1;
-  public static final int GR2  = 2;
-  public static final int GR3  = 3;
-  public static final int GR4  = 4;
-  public static final int GR5  = 5;
-  public static final int GR6  = 6;
-  public static final int GR7  = 7;
-  public static final int GR8  = 8;
-  public static final int GR9  = 9;
-  public static final int GR10 = 10;
-  public static final int GR11 = 11;
-  public static final int GR12 = 12;
-  public static final int SP = GR12;
-  public static final int GR13 = 13;
-  public static final int GR14 = 14;
-  public static final int GR15 = 15;
-  public static final int GR16 = 16;
-  public static final int GR17 = 17;
-  public static final int GR18 = 18;
-  public static final int GR19 = 19;
-  public static final int GR20 = 20;
-  public static final int GR21 = 21;
-  public static final int GR22 = 22;
-  public static final int GR23 = 23;
-  public static final int GR24 = 24;
-  public static final int GR25 = 25;
-  public static final int GR26 = 26;
-  public static final int GR27 = 27;
-  public static final int GR28 = 28;
-  public static final int GR29 = 29;
-  public static final int GR30 = 30;
-  public static final int GR31 = 31;
-
-  // Nat bits for r1-r31
-  public static final int INT_NATS = 32;
-
-  // predicates
-  public static final int PREDS    = 33;
-
-  // branch registers
-  public static final int BR0      = 34;
-  public static final int BR_RP    = BR0;
-  public static final int BR1      = 35;
-  public static final int BR2      = 36;
-  public static final int BR3      = 37;
-  public static final int BR4      = 38;
-  public static final int BR5      = 39;
-  public static final int BR6      = 40;
-  public static final int BR7      = 41;
-
-  // application registers
-  public static final int AP_UNAT  = 42; // User Nat Collection register
-  public static final int AP_LC    = 43; // Loop counter register
-  public static final int AP_EC    = 43; // Epilog counter register
-  public static final int AP_CCV   = 45; // CMPXCHG value register
-  public static final int AP_DCR   = 46; // Default control register
-
-  // register stack info
-  public static final int RS_PFS   = 47; // Previous function state
-  public static final int AP_PFS   = RS_PFS;
-  public static final int RS_BSP   = 48; // Backing store pointer
-  public static final int AR_BSP   = RS_BSP;
-  public static final int RS_BSPSTORE = 49;
-  public static final int AP_BSPSTORE = RS_BSPSTORE;
-  public static final int RS_RSC   = 50;     // RSE configuration
-  public static final int AP_RSC   = RS_RSC;
-  public static final int RS_RNAT  = 51; // RSE Nat collection register
-  public static final int AP_RNAT  = RS_RNAT;
-
-  // trap status register
-  public static final int ST_IPSR  = 52; // Interuption Processor Status
-  public static final int ST_IIP   = 53; // Interruption IP
-  public static final int ST_IFS   = 54; // Interruption Function State
-
-  // debug registers
-  public static final int DB_I0    = 55;
-  public static final int DB_I1    = 56;
-  public static final int DB_I2    = 57;
-  public static final int DB_I3    = 58;
-  public static final int DB_I4    = 59;
-  public static final int DB_I5    = 60;
-  public static final int DB_I6    = 61;
-  public static final int DB_I7    = 62;
-
-  public static final int DB_D0    = 63;
-  public static final int DB_D1    = 64;
-  public static final int DB_D2    = 65;
-  public static final int DB_D3    = 66;
-  public static final int DB_D4    = 67;
-  public static final int DB_D5    = 68;
-  public static final int DB_D6    = 69;
-  public static final int DB_D7    = 70;
-
-  public static final int NPRGREG  = 71;
-
-  private static final String[] regNames = {
-     "GR0", "GR1", "GR2", "GR3", "GR4", "GR5", "GR6", "GR7", "GR8",
-     "GR9", "GR10", "GR11", "GR12", "GR13", "GR14", "GR15", "GR16",
-     "GR17","GR18", "GR19", "GR20", "GR21", "GR22", "GR23", "GR24",
-     "GR25","GR26", "GR27", "GR28", "GR29", "GR30", "GR31",
-     "INT_NATS", "PREDS",
-     "BR0", "BR1", "BR2", "BR3", "BR4", "BR5", "BR6", "BR7",
-     "AP_UNAT", "AP_LC", "AP_EC", "AP_CCV", "AP_DCR",
-     "RS_FPS", "RS_BSP", "RS_BSPSTORE", "RS_RSC", "RS_RNAT",
-     "ST_IPSR", "ST_IIP", "ST_IFS",
-     "DB_I0", "DB_I1", "DB_I2", "DB_I3", "DB_I4", "DB_I5", "DB_I6", "DB_I7",
-     "DB_D0", "DB_D1", "DB_D2", "DB_D3", "DB_D4", "DB_D5", "DB_D6", "DB_D7"
-  };
-
-  private long[] data;
-
-  public IA64ThreadContext() {
-    data = new long[NPRGREG];
-  }
-
-  public int getNumRegisters() {
-    return NPRGREG;
-  }
-
-  public String getRegisterName(int index) {
-    return regNames[index];
-  }
-
-  public void setRegister(int index, long value) {
-    data[index] = value;
-  }
-
-  public long getRegister(int index) {
-    return data[index];
-  }
-
-  public CFrame getTopFrame(Debugger dbg) {
-    return null;
-  }
-
-  /** This can't be implemented in this class since we would have to
-      tie the implementation to, for example, the debugging system */
-  public abstract void setRegisterAsAddress(int index, Address value);
-
-  /** This can't be implemented in this class since we would have to
-      tie the implementation to, for example, the debugging system */
-  public abstract Address getRegisterAsAddress(int index);
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -210,11 +210,7 @@
             // the UI. This is a cache of 4096 4K pages, or 16 MB. The page
             // size must be adjusted to be the hardware's page size.
             // (FIXME: should pick this up from the debugger.)
-            if (getCPU().equals("ia64")) {
-              initCache(16384, parseCacheNumPagesProperty(1024));
-            } else {
-              initCache(4096, parseCacheNumPagesProperty(4096));
-            }
+            initCache(4096, parseCacheNumPagesProperty(4096));
         }
 
         workerThread = new LinuxDebuggerLocalWorkerThread(this);
@@ -560,11 +556,6 @@
 
     public CDebugger getCDebugger() {
       if (cdbg == null) {
-         String cpu = getCPU();
-         if (cpu.equals("ia64") ) {
-            // IA-64 is not supported because of stack-walking issues
-            return null;
-         }
          cdbg = new LinuxCDebugger(this);
       }
       return cdbg;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -27,7 +27,6 @@
 import java.lang.reflect.*;
 import sun.jvm.hotspot.debugger.*;
 import sun.jvm.hotspot.debugger.linux.amd64.*;
-import sun.jvm.hotspot.debugger.linux.ia64.*;
 import sun.jvm.hotspot.debugger.linux.x86.*;
 import sun.jvm.hotspot.debugger.linux.ppc64.*;
 import sun.jvm.hotspot.debugger.linux.sparc.*;
@@ -39,8 +38,6 @@
          return new LinuxX86ThreadContext(dbg);
       } else if (cpu.equals("amd64")) {
          return new LinuxAMD64ThreadContext(dbg);
-      } else if (cpu.equals("ia64")) {
-         return new LinuxIA64ThreadContext(dbg);
       } else if (cpu.equals("sparc")) {
          return new LinuxSPARCThreadContext(dbg);
       }  else if (cpu.equals("ppc64")) {
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java	Thu Nov 30 16:08:13 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.debugger.linux.ia64;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.ia64.*;
-import sun.jvm.hotspot.debugger.linux.*;
-
-public class LinuxIA64ThreadContext extends IA64ThreadContext {
-  private LinuxDebugger debugger;
-
-  public LinuxIA64ThreadContext(LinuxDebugger debugger) {
-    super();
-    this.debugger = debugger;
-  }
-
-  public void setRegisterAsAddress(int index, Address value) {
-    setRegister(index, debugger.getAddressValue(value));
-  }
-
-  public Address getRegisterAsAddress(int index) {
-    return debugger.newAddress(getRegister(index));
-  }
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -30,10 +30,8 @@
 import sun.jvm.hotspot.debugger.*;
 import sun.jvm.hotspot.debugger.amd64.*;
 import sun.jvm.hotspot.debugger.x86.*;
-import sun.jvm.hotspot.debugger.ia64.*;
 import sun.jvm.hotspot.debugger.windbg.amd64.*;
 import sun.jvm.hotspot.debugger.windbg.x86.*;
-import sun.jvm.hotspot.debugger.windbg.ia64.*;
 import sun.jvm.hotspot.debugger.win32.coff.*;
 import sun.jvm.hotspot.debugger.cdbg.*;
 import sun.jvm.hotspot.debugger.cdbg.basic.BasicDebugEvent;
@@ -115,8 +113,6 @@
        threadFactory = new WindbgX86ThreadFactory(this);
     } else if (cpu.equals("amd64")) {
        threadFactory = new WindbgAMD64ThreadFactory(this);
-    } else if (cpu.equals("ia64")) {
-       threadFactory = new WindbgIA64ThreadFactory(this);
     }
 
     if (useCache) {
@@ -231,11 +227,7 @@
 
   public CDebugger getCDebugger() throws DebuggerException {
     if (cdbg == null) {
-      // FIXME: CDebugger is not yet supported for IA64 because
-      // of native stack walking issues.
-      if (! getCPU().equals("ia64")) {
-         cdbg = new WindbgCDebugger(this);
-      }
+      cdbg = new WindbgCDebugger(this);
     }
     return cdbg;
   }
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java	Thu Nov 30 16:08:13 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.debugger.windbg.ia64;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.ia64.*;
-import sun.jvm.hotspot.debugger.windbg.*;
-
-class WindbgIA64Thread implements ThreadProxy {
-  private WindbgDebugger debugger;
-  private long           sysId;
-  private boolean        gotID;
-  private long           id;
-
-  /** The address argument must be the address of the HANDLE of the
-      desired thread in the target process. */
-  WindbgIA64Thread(WindbgDebugger debugger, Address addr) {
-    this.debugger = debugger;
-    // FIXME: size of data fetched here should be configurable.
-    // However, making it so would produce a dependency on the "types"
-    // package from the debugger package, which is not desired.
-
-    // another hack here is that we use sys thread id instead of handle.
-    // windbg can't get details based on handles it seems.
-    // I assume that osThread_win32 thread struct has _thread_id (which
-    // sys thread id) just after handle field.
-
-    this.sysId   = (int) addr.addOffsetTo(debugger.getAddressSize()).getCIntegerAt(0, 4, true);
-    gotID = false;
-  }
-
-  WindbgIA64Thread(WindbgDebugger debugger, long sysId) {
-    this.debugger = debugger;
-    this.sysId    = sysId;
-    gotID         = false;
-  }
-
-  public ThreadContext getContext() throws IllegalThreadStateException {
-    long[] data = debugger.getThreadIntegerRegisterSet(getThreadID());
-    WindbgIA64ThreadContext context = new WindbgIA64ThreadContext(debugger);
-    for (int i = 0; i < data.length; i++) {
-      context.setRegister(i, data[i]);
-    }
-    return context;
-  }
-
-  public boolean canSetContext() throws DebuggerException {
-    return false;
-  }
-
-  public void setContext(ThreadContext thrCtx)
-    throws IllegalThreadStateException, DebuggerException {
-    throw new DebuggerException("Unimplemented");
-  }
-
-  public boolean equals(Object obj) {
-    if ((obj == null) || !(obj instanceof WindbgIA64Thread)) {
-      return false;
-    }
-
-    return (((WindbgIA64Thread) obj).getThreadID() == getThreadID());
-  }
-
-  public int hashCode() {
-    return (int) getThreadID();
-  }
-
-  public String toString() {
-    return Long.toString(getThreadID());
-  }
-
-  /** Retrieves the thread ID of this thread by examining the Thread
-      Information Block. */
-  private long getThreadID() {
-    if (!gotID) {
-       id = debugger.getThreadIdFromSysId(sysId);
-    }
-
-    return id;
-  }
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java	Thu Nov 30 16:08:13 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.debugger.windbg.ia64;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.ia64.*;
-import sun.jvm.hotspot.debugger.windbg.*;
-
-class WindbgIA64ThreadContext extends IA64ThreadContext {
-  private WindbgDebugger debugger;
-
-  public WindbgIA64ThreadContext(WindbgDebugger debugger) {
-    super();
-    this.debugger = debugger;
-  }
-
-  public void setRegisterAsAddress(int index, Address value) {
-    setRegister(index, debugger.getAddressValue(value));
-  }
-
-  public Address getRegisterAsAddress(int index) {
-    return debugger.newAddress(getRegister(index));
-  }
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java	Thu Nov 30 16:08:13 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.debugger.windbg.ia64;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.windbg.*;
-
-public class WindbgIA64ThreadFactory implements WindbgThreadFactory {
-  private WindbgDebugger debugger;
-
-  public WindbgIA64ThreadFactory(WindbgDebugger debugger) {
-    this.debugger = debugger;
-  }
-
-  public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) {
-    return new WindbgIA64Thread(debugger, threadIdentifierAddr);
-  }
-
-  public ThreadProxy createThreadWrapper(long id) {
-    return new WindbgIA64Thread(debugger, id);
-  }
-}
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java	Thu Nov 30 21:24:52 2017 +0530
@@ -474,20 +474,48 @@
   }
 
   // same as enum InnerClassAttributeOffset in VM code.
-  public static interface InnerClassAttributeOffset {
+  private static class InnerClassAttributeOffset {
     // from JVM spec. "InnerClasses" attribute
-    public static final int innerClassInnerClassInfoOffset = 0;
-    public static final int innerClassOuterClassInfoOffset = 1;
-    public static final int innerClassInnerNameOffset = 2;
-    public static final int innerClassAccessFlagsOffset = 3;
-    public static final int innerClassNextOffset = 4;
-  };
+    public static int innerClassInnerClassInfoOffset;
+    public static int innerClassOuterClassInfoOffset;
+    public static int innerClassInnerNameOffset;
+    public static int innerClassAccessFlagsOffset;
+    public static int innerClassNextOffset;
+    static {
+      VM.registerVMInitializedObserver(new Observer() {
+          public void update(Observable o, Object data) {
+              initialize(VM.getVM().getTypeDataBase());
+          }
+      });
+    }
 
-  public static interface EnclosingMethodAttributeOffset {
-    public static final int enclosing_method_class_index_offset = 0;
-    public static final int enclosing_method_method_index_offset = 1;
-    public static final int enclosing_method_attribute_size = 2;
-  };
+    private static synchronized void initialize(TypeDataBase db) {
+      innerClassInnerClassInfoOffset = db.lookupIntConstant(
+          "InstanceKlass::inner_class_inner_class_info_offset").intValue();
+      innerClassOuterClassInfoOffset = db.lookupIntConstant(
+          "InstanceKlass::inner_class_outer_class_info_offset").intValue();
+      innerClassInnerNameOffset = db.lookupIntConstant(
+          "InstanceKlass::inner_class_inner_name_offset").intValue();
+      innerClassAccessFlagsOffset = db.lookupIntConstant(
+          "InstanceKlass::inner_class_access_flags_offset").intValue();
+      innerClassNextOffset = db.lookupIntConstant(
+          "InstanceKlass::inner_class_next_offset").intValue();
+    }
+  }
+
+  private static class EnclosingMethodAttributeOffset {
+    public static int enclosingMethodAttributeSize;
+    static {
+      VM.registerVMInitializedObserver(new Observer() {
+          public void update(Observable o, Object data) {
+              initialize(VM.getVM().getTypeDataBase());
+          }
+      });
+    }
+    private static synchronized void initialize(TypeDataBase db) {
+      enclosingMethodAttributeSize = db.lookupIntConstant("InstanceKlass::enclosing_method_attribute_size").intValue();
+    }
+  }
 
   // refer to compute_modifier_flags in VM code.
   public long computeModifierFlags() {
@@ -498,11 +526,11 @@
     if (length > 0) {
        if (Assert.ASSERTS_ENABLED) {
           Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
-                      length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosing_method_attribute_size,
+                      length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosingMethodAttributeSize,
                       "just checking");
        }
        for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
-          if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
+          if (i == length - EnclosingMethodAttributeOffset.enclosingMethodAttributeSize) {
               break;
           }
           int ioff = innerClassList.at(i +
@@ -547,11 +575,11 @@
     if (length > 0) {
        if (Assert.ASSERTS_ENABLED) {
          Assert.that(length % InnerClassAttributeOffset.innerClassNextOffset == 0 ||
-                     length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosing_method_attribute_size,
+                     length % InnerClassAttributeOffset.innerClassNextOffset == EnclosingMethodAttributeOffset.enclosingMethodAttributeSize,
                      "just checking");
        }
        for (int i = 0; i < length; i += InnerClassAttributeOffset.innerClassNextOffset) {
-         if (i == length - EnclosingMethodAttributeOffset.enclosing_method_attribute_size) {
+         if (i == length - EnclosingMethodAttributeOffset.enclosingMethodAttributeSize) {
              break;
          }
          int ioff = innerClassList.at(i +
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java	Thu Nov 30 21:24:52 2017 +0530
@@ -44,9 +44,7 @@
     Type type;
     try {
       type = db.lookupType("ObjectSynchronizer");
-      AddressField blockListField;
-      blockListField = type.getAddressField("gBlockList");
-      gBlockListAddr = blockListField.getValue();
+      gBlockList = type.getAddressField("gBlockList").getValue();
       blockSize = db.lookupIntConstant("ObjectSynchronizer::_BLOCKSIZE").intValue();
       defaultCacheLineSize = db.lookupIntConstant("DEFAULT_CACHE_LINE_SIZE").intValue();
     } catch (RuntimeException e) { }
@@ -84,7 +82,7 @@
   }
 
   public static Iterator objectMonitorIterator() {
-    if (gBlockListAddr != null) {
+    if (gBlockList != null) {
       return new ObjectMonitorIterator();
     } else {
       return null;
@@ -97,7 +95,7 @@
     // and are not included by this Iterator. May add them later.
 
     ObjectMonitorIterator() {
-      blockAddr = gBlockListAddr;
+      blockAddr = gBlockList;
       index = blockSize - 1;
       block = new ObjectMonitor(blockAddr);
     }
@@ -131,7 +129,7 @@
     private Address blockAddr;
   }
 
-  private static Address gBlockListAddr;
+  private static Address gBlockList;
   private static int blockSize;
   private static int defaultCacheLineSize;
   private static long objectMonitorTypeSize;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -92,14 +92,29 @@
         return (flags() & 0x1) != 0;
     }
 
-    // NOTE: Keep this in sync with PerfData::Units enum in VM code
-    public interface PerfDataUnits {
-        public static final int U_None   = 1;
-        public static final int U_Bytes  = 2;
-        public static final int U_Ticks  = 3;
-        public static final int U_Events = 4;
-        public static final int U_String = 5;
-        public static final int U_Hertz  = 6;
+    private static class PerfDataUnits {
+        public static int U_None;
+        public static int U_Bytes;
+        public static int U_Ticks;
+        public static int U_Events;
+        public static int U_String;
+        public static int U_Hertz;
+
+        static {
+            VM.registerVMInitializedObserver(new Observer() {
+                public void update(Observable o, Object data) {
+                    initialize(VM.getVM().getTypeDataBase());
+                }
+            });
+        }
+        private static synchronized void initialize(TypeDataBase db) {
+            U_None = db.lookupIntConstant("PerfData::U_None");
+            U_Bytes = db.lookupIntConstant("PerfData::U_Bytes");
+            U_Ticks = db.lookupIntConstant("PerfData::U_Ticks");
+            U_Events = db.lookupIntConstant("PerfData::U_Events");
+            U_String = db.lookupIntConstant("PerfData::U_String");
+            U_Hertz = db.lookupIntConstant("PerfData::U_Hertz");
+        }
     }
 
     // returns one of the constants in PerfDataUnits
@@ -107,13 +122,6 @@
         return (int) dataUnitsField.getValue(addr);
     }
 
-    // NOTE: Keep this in sync with PerfData::Variability enum in VM code
-    public interface PerfDataVariability {
-        public static final int V_Constant  = 1;
-        public static final int V_Monotonic = 2;
-        public static final int V_Variable  = 3;
-    }
-
     // returns one of the constants in PerfDataVariability
     public int dataVariability() {
         return (int) dataVariabilityField.getValue(addr);
@@ -451,23 +459,16 @@
         }
 
         // add units
-        switch (dataUnits()) {
-        case PerfDataUnits.U_None:
-            break;
-        case PerfDataUnits.U_Bytes:
+        int dataUnitsValue = dataUnits();
+
+        if (dataUnitsValue == PerfDataUnits.U_Bytes) {
             str += " byte(s)";
-            break;
-        case PerfDataUnits.U_Ticks:
+        } else if (dataUnitsValue == PerfDataUnits.U_Ticks) {
             str += " tick(s)";
-            break;
-        case PerfDataUnits.U_Events:
+        } else if (dataUnitsValue == PerfDataUnits.U_Events) {
             str += " event(s)";
-            break;
-        case PerfDataUnits.U_String:
-            break;
-        case PerfDataUnits.U_Hertz:
+        } else if (dataUnitsValue == PerfDataUnits.U_Hertz) {
             str += " Hz";
-            break;
         }
 
         return str;
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -117,10 +117,7 @@
       return null;
     }
     Frame s = fr.realSender(tempMap);
-    // ia64 in 1.4.1 only has java frames and no entryFrame
-    // so "s" can be null here for the first frame.
     if (s == null) {
-      Assert.that(VM.getVM().getCPU().equals("ia64"), "Only ia64 should have null here");
       return null;
     }
     if (s.isFirstFrame()) {
--- a/src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h	Thu Nov 30 16:08:13 2017 +0100
+++ b/src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h	Thu Nov 30 21:24:52 2017 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -77,14 +77,14 @@
 typedef uint32_t syscall_t;     /* holds a syscall instruction */
 #endif  /* sparc */
 
-#if defined(__i386) || defined(__ia64)
+#if defined(__i386)
 #define R_PC    EIP
 #define R_SP    UESP
 #define R_RVAL1 EAX             /* register holding a function return value */
 #define R_RVAL2 EDX             /* 32 more bits for a 64-bit return value */
 #define SYSCALL 0x9a            /* syscall (lcall) instruction opcode */
 typedef uchar_t syscall_t[7];   /* holds a syscall instruction */
-#endif  /* __i386 || __ia64 */
+#endif  /* __i386 */
 
 #define R_RVAL  R_RVAL1         /* simple function return value register */