1 /*
   2  * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "cds/filemap.hpp"
  26 #include "classfile/classLoaderDataGraph.hpp"
  27 #include "classfile/javaClasses.hpp"
  28 #include "classfile/javaThreadStatus.hpp"
  29 #include "classfile/vmClasses.hpp"
  30 #include "classfile/vmSymbols.hpp"
  31 #include "code/codeBlob.hpp"
  32 #include "code/codeCache.hpp"
  33 #include "code/compiledIC.hpp"
  34 #include "code/compressedStream.hpp"
  35 #include "code/location.hpp"
  36 #include "code/nmethod.hpp"
  37 #include "code/pcDesc.hpp"
  38 #include "code/stubs.hpp"
  39 #include "code/vmreg.hpp"
  40 #include "compiler/compileBroker.hpp"
  41 #include "compiler/oopMap.hpp"
  42 #include "gc/shared/stringdedup/stringDedupThread.hpp"
  43 #include "gc/shared/vmStructs_gc.hpp"
  44 #include "interpreter/bytecodes.hpp"
  45 #include "interpreter/interpreter.hpp"
  46 #include "logging/logAsyncWriter.hpp"
  47 #include "memory/allocation.hpp"
  48 #include "memory/allocation.inline.hpp"
  49 #include "memory/heap.hpp"
  50 #include "memory/padded.hpp"
  51 #include "memory/referenceType.hpp"
  52 #include "memory/universe.hpp"
  53 #include "memory/virtualspace.hpp"
  54 #include "oops/array.hpp"
  55 #include "oops/arrayKlass.hpp"
  56 #include "oops/arrayOop.hpp"
  57 #include "oops/constMethod.hpp"
  58 #include "oops/constantPool.hpp"
  59 #include "oops/cpCache.hpp"
  60 #include "oops/fieldInfo.hpp"
  61 #include "oops/flatArrayKlass.hpp"
  62 #include "oops/inlineKlass.hpp"
  63 #include "oops/instanceClassLoaderKlass.hpp"
  64 #include "oops/instanceKlass.hpp"
  65 #include "oops/instanceMirrorKlass.hpp"
  66 #include "oops/instanceOop.hpp"
  67 #include "oops/instanceStackChunkKlass.hpp"
  68 #include "oops/klass.hpp"
  69 #include "oops/klassVtable.hpp"
  70 #include "oops/markWord.hpp"
  71 #include "oops/method.hpp"
  72 #include "oops/methodCounters.hpp"
  73 #include "oops/methodData.hpp"
  74 #include "oops/objArrayKlass.hpp"
  75 #include "oops/objArrayOop.hpp"
  76 #include "oops/oop.inline.hpp"
  77 #include "oops/oopHandle.hpp"
  78 #include "oops/resolvedFieldEntry.hpp"
  79 #include "oops/resolvedIndyEntry.hpp"
  80 #include "oops/resolvedMethodEntry.hpp"
  81 #include "oops/symbol.hpp"
  82 #include "oops/typeArrayKlass.hpp"
  83 #include "oops/typeArrayOop.hpp"
  84 #include "prims/jvmtiAgentThread.hpp"
  85 #include "runtime/arguments.hpp"
  86 #include "runtime/deoptimization.hpp"
  87 #include "runtime/flags/jvmFlag.hpp"
  88 #include "runtime/globals.hpp"
  89 #include "runtime/java.hpp"
  90 #include "runtime/javaCalls.hpp"
  91 #include "runtime/javaThread.hpp"
  92 #include "runtime/jniHandles.hpp"
  93 #include "runtime/monitorDeflationThread.hpp"
  94 #include "runtime/notificationThread.hpp"
  95 #include "runtime/os.hpp"
  96 #include "runtime/osThread.hpp"
  97 #include "runtime/perfMemory.hpp"
  98 #include "runtime/serviceThread.hpp"
  99 #include "runtime/stubRoutines.hpp"
 100 #include "runtime/synchronizer.hpp"
 101 #include "runtime/vframeArray.hpp"
 102 #include "runtime/vmStructs.hpp"
 103 #include "runtime/vm_version.hpp"
 104 #include "services/attachListener.hpp"
 105 #include "utilities/globalDefinitions.hpp"
 106 #include "utilities/macros.hpp"
 107 #include "utilities/vmError.hpp"
 108 #ifdef COMPILER2
 109 #include "opto/optoreg.hpp"
 110 #endif // COMPILER2
 111 
 112 #include CPU_HEADER(vmStructs)
 113 #include OS_HEADER(vmStructs)
 114 
 115 // Note: the cross-product of (c1, c2, product, nonproduct, ...),
 116 // (nonstatic, static), and (unchecked, checked) has not been taken.
 117 // Only the macros currently needed have been defined.
 118 
 119 // A field whose type is not checked is given a null string as the
 120 // type name, indicating an "opaque" type to the serviceability agent.
 121 
 122 // NOTE: there is an interdependency between this file and
 123 // HotSpotTypeDataBase.java, which parses the type strings.
 124 
 125 #ifndef REG_COUNT
 126   #define REG_COUNT 0
 127 #endif
 128 
 129 #if INCLUDE_JVMTI
 130   #define JVMTI_STRUCTS(static_field) \
 131     static_field(JvmtiExport,                     _can_access_local_variables,                  bool)                                  \
 132     static_field(JvmtiExport,                     _can_hotswap_or_post_breakpoint,              bool)                                  \
 133     static_field(JvmtiExport,                     _can_post_on_exceptions,                      bool)                                  \
 134     static_field(JvmtiExport,                     _can_walk_any_space,                          bool)
 135 #else
 136   #define JVMTI_STRUCTS(static_field)
 137 #endif // INCLUDE_JVMTI
 138 
 139 //--------------------------------------------------------------------------------
 140 // VM_STRUCTS
 141 //
 142 // This list enumerates all of the fields the serviceability agent
 143 // needs to know about. Be sure to see also the type table below this one.
 144 // NOTE that there are platform-specific additions to this table in
 145 // vmStructs_<os>_<cpu>.hpp.
 146 
 147 #define VM_STRUCTS(nonstatic_field,                                                                                                  \
 148                    static_field,                                                                                                     \
 149                    volatile_static_field,                                                                                            \
 150                    unchecked_nonstatic_field,                                                                                        \
 151                    volatile_nonstatic_field,                                                                                         \
 152                    nonproduct_nonstatic_field)                                                                                       \
 153                                                                                                                                      \
 154   /*************/                                                                                                                    \
 155   /* GC fields */                                                                                                                    \
 156   /*************/                                                                                                                    \
 157                                                                                                                                      \
 158   VM_STRUCTS_GC(nonstatic_field,                                                                                                     \
 159                 volatile_static_field,                                                                                               \
 160                 volatile_nonstatic_field,                                                                                            \
 161                 static_field,                                                                                                        \
 162                 unchecked_nonstatic_field)                                                                                           \
 163                                                                                                                                      \
 164   /******************************************************************/                                                               \
 165   /* OopDesc and Klass hierarchies (NOTE: MethodData* incomplete)   */                                                               \
 166   /******************************************************************/                                                               \
 167                                                                                                                                      \
 168   volatile_nonstatic_field(oopDesc,            _mark,                                         markWord)                              \
 169   volatile_nonstatic_field(oopDesc,            _metadata._klass,                              Klass*)                                \
 170   volatile_nonstatic_field(oopDesc,            _metadata._compressed_klass,                   narrowKlass)                           \
 171   static_field(BarrierSet,                     _barrier_set,                                  BarrierSet*)                           \
 172   nonstatic_field(ArrayKlass,                  _dimension,                                    int)                                   \
 173   volatile_nonstatic_field(ArrayKlass,         _higher_dimension,                             ObjArrayKlass*)                        \
 174   volatile_nonstatic_field(ArrayKlass,         _lower_dimension,                              ArrayKlass*)                           \
 175   nonstatic_field(ConstantPool,                _tags,                                         Array<u1>*)                            \
 176   nonstatic_field(ConstantPool,                _cache,                                        ConstantPoolCache*)                    \
 177   nonstatic_field(ConstantPool,                _pool_holder,                                  InstanceKlass*)                        \
 178   nonstatic_field(ConstantPool,                _operands,                                     Array<u2>*)                            \
 179   nonstatic_field(ConstantPool,                _resolved_klasses,                             Array<Klass*>*)                        \
 180   nonstatic_field(ConstantPool,                _length,                                       int)                                   \
 181   nonstatic_field(ConstantPool,                _minor_version,                                u2)                                    \
 182   nonstatic_field(ConstantPool,                _major_version,                                u2)                                    \
 183   nonstatic_field(ConstantPool,                _generic_signature_index,                      u2)                                    \
 184   nonstatic_field(ConstantPool,                _source_file_name_index,                       u2)                                    \
 185   nonstatic_field(ConstantPoolCache,           _resolved_references,                          OopHandle)                             \
 186   nonstatic_field(ConstantPoolCache,           _reference_map,                                Array<u2>*)                            \
 187   nonstatic_field(ConstantPoolCache,           _constant_pool,                                ConstantPool*)                         \
 188   nonstatic_field(ConstantPoolCache,           _resolved_field_entries,                       Array<ResolvedFieldEntry>*)            \
 189   nonstatic_field(ResolvedFieldEntry,          _cpool_index,                                  u2)                                    \
 190   nonstatic_field(ConstantPoolCache,           _resolved_method_entries,                      Array<ResolvedMethodEntry>*)           \
 191   nonstatic_field(ResolvedMethodEntry,         _cpool_index,                                  u2)                                    \
 192   nonstatic_field(ConstantPoolCache,           _resolved_indy_entries,                        Array<ResolvedIndyEntry>*)             \
 193   nonstatic_field(ResolvedIndyEntry,           _cpool_index,                                  u2)                                    \
 194   volatile_nonstatic_field(InstanceKlass,      _array_klasses,                                ArrayKlass*)                        \
 195   nonstatic_field(InstanceKlass,               _methods,                                      Array<Method*>*)                       \
 196   nonstatic_field(InstanceKlass,               _default_methods,                              Array<Method*>*)                       \
 197   nonstatic_field(InstanceKlass,               _local_interfaces,                             Array<InstanceKlass*>*)                \
 198   nonstatic_field(InstanceKlass,               _transitive_interfaces,                        Array<InstanceKlass*>*)                \
 199   nonstatic_field(InstanceKlass,               _fieldinfo_stream,                             Array<u1>*)                            \
 200   nonstatic_field(InstanceKlass,               _constants,                                    ConstantPool*)                         \
 201   nonstatic_field(InstanceKlass,               _source_debug_extension,                       const char*)                           \
 202   nonstatic_field(InstanceKlass,               _inner_classes,                                Array<jushort>*)                       \
 203   nonstatic_field(InstanceKlass,               _nest_members,                                 Array<jushort>*)                       \
 204   nonstatic_field(InstanceKlass,               _nonstatic_field_size,                         int)                                   \
 205   nonstatic_field(InstanceKlass,               _static_field_size,                            int)                                   \
 206   nonstatic_field(InstanceKlass,               _static_oop_field_count,                       u2)                                    \
 207   nonstatic_field(InstanceKlass,               _nonstatic_oop_map_size,                       int)                                   \
 208   volatile_nonstatic_field(InstanceKlass,      _init_state,                                   InstanceKlass::ClassState)             \
 209   volatile_nonstatic_field(InstanceKlass,      _init_thread,                                  JavaThread*)                           \
 210   nonstatic_field(InstanceKlass,               _itable_len,                                   int)                                   \
 211   nonstatic_field(InstanceKlass,               _nest_host_index,                              u2)                                    \
 212   nonstatic_field(InstanceKlass,               _reference_type,                               u1)                                    \
 213   volatile_nonstatic_field(InstanceKlass,      _oop_map_cache,                                OopMapCache*)                          \
 214   nonstatic_field(InstanceKlass,               _jni_ids,                                      JNIid*)                                \
 215   nonstatic_field(InstanceKlass,               _osr_nmethods_head,                            nmethod*)                              \
 216   JVMTI_ONLY(nonstatic_field(InstanceKlass,    _breakpoints,                                  BreakpointInfo*))                      \
 217   volatile_nonstatic_field(InstanceKlass,      _methods_jmethod_ids,                          jmethodID*)                            \
 218   volatile_nonstatic_field(InstanceKlass,      _idnum_allocated_count,                        u2)                                    \
 219   nonstatic_field(InstanceKlass,               _annotations,                                  Annotations*)                          \
 220   nonstatic_field(InstanceKlass,               _method_ordering,                              Array<int>*)                           \
 221   nonstatic_field(InstanceKlass,               _default_vtable_indices,                       Array<int>*)                           \
 222   nonstatic_field(Klass,                       _super_check_offset,                           juint)                                 \
 223   nonstatic_field(Klass,                       _secondary_super_cache,                        Klass*)                                \
 224   nonstatic_field(Klass,                       _secondary_supers,                             Array<Klass*>*)                        \
 225   nonstatic_field(Klass,                       _primary_supers[0],                            Klass*)                                \
 226   nonstatic_field(Klass,                       _java_mirror,                                  OopHandle)                             \
 227   nonstatic_field(Klass,                       _super,                                        Klass*)                                \
 228   volatile_nonstatic_field(Klass,              _subklass,                                     Klass*)                                \
 229   nonstatic_field(Klass,                       _layout_helper,                                jint)                                  \
 230   nonstatic_field(Klass,                       _name,                                         Symbol*)                               \
 231   nonstatic_field(Klass,                       _access_flags,                                 AccessFlags)                           \
 232   volatile_nonstatic_field(Klass,              _next_sibling,                                 Klass*)                                \
 233   nonstatic_field(Klass,                       _next_link,                                    Klass*)                                \
 234   nonstatic_field(Klass,                       _vtable_len,                                   int)                                   \
 235   nonstatic_field(Klass,                       _class_loader_data,                            ClassLoaderData*)                      \
 236   nonstatic_field(vtableEntry,                 _method,                                       Method*)                               \
 237   nonstatic_field(MethodData,                  _size,                                         int)                                   \
 238   nonstatic_field(MethodData,                  _method,                                       Method*)                               \
 239   nonstatic_field(MethodData,                  _data_size,                                    int)                                   \
 240   nonstatic_field(MethodData,                  _data[0],                                      intptr_t)                              \
 241   nonstatic_field(MethodData,                  _parameters_type_data_di,                      int)                                   \
 242   nonstatic_field(MethodData,                  _compiler_counters._nof_decompiles,            uint)                                  \
 243   nonstatic_field(MethodData,                  _compiler_counters._nof_overflow_recompiles,   uint)                                  \
 244   nonstatic_field(MethodData,                  _compiler_counters._nof_overflow_traps,        uint)                                  \
 245   nonstatic_field(MethodData,                  _compiler_counters._trap_hist._array[0],       u1)                                    \
 246   nonstatic_field(MethodData,                  _eflags,                                       intx)                                  \
 247   nonstatic_field(MethodData,                  _arg_local,                                    intx)                                  \
 248   nonstatic_field(MethodData,                  _arg_stack,                                    intx)                                  \
 249   nonstatic_field(MethodData,                  _arg_returned,                                 intx)                                  \
 250   nonstatic_field(MethodData,                  _tenure_traps,                                 uint)                                  \
 251   nonstatic_field(MethodData,                  _invoke_mask,                                  int)                                   \
 252   nonstatic_field(MethodData,                  _backedge_mask,                                int)                                   \
 253   nonstatic_field(DataLayout,                  _header._struct._tag,                          u1)                                    \
 254   nonstatic_field(DataLayout,                  _header._struct._flags,                        u1)                                    \
 255   nonstatic_field(DataLayout,                  _header._struct._bci,                          u2)                                    \
 256   nonstatic_field(DataLayout,                  _header._struct._traps,                        u4)                                    \
 257   nonstatic_field(DataLayout,                  _cells[0],                                     intptr_t)                              \
 258   nonstatic_field(MethodCounters,              _invoke_mask,                                  int)                                   \
 259   nonstatic_field(MethodCounters,              _backedge_mask,                                int)                                   \
 260   COMPILER2_OR_JVMCI_PRESENT(nonstatic_field(MethodCounters, _interpreter_throwout_count,     u2))                                   \
 261   JVMTI_ONLY(nonstatic_field(MethodCounters,   _number_of_breakpoints,                        u2))                                   \
 262   nonstatic_field(MethodCounters,              _invocation_counter,                           InvocationCounter)                     \
 263   nonstatic_field(MethodCounters,              _backedge_counter,                             InvocationCounter)                     \
 264   nonstatic_field(Method,                      _constMethod,                                  ConstMethod*)                          \
 265   nonstatic_field(Method,                      _method_data,                                  MethodData*)                           \
 266   nonstatic_field(Method,                      _method_counters,                              MethodCounters*)                       \
 267   nonstatic_field(Method,                      _access_flags,                                 AccessFlags)                           \
 268   nonstatic_field(Method,                      _vtable_index,                                 int)                                   \
 269   nonstatic_field(Method,                      _intrinsic_id,                                 u2)                                    \
 270   volatile_nonstatic_field(Method,             _code,                                         nmethod*)                              \
 271   nonstatic_field(Method,                      _i2i_entry,                                    address)                               \
 272   volatile_nonstatic_field(Method,             _from_compiled_entry,                          address)                               \
 273   volatile_nonstatic_field(Method,             _from_interpreted_entry,                       address)                               \
 274   volatile_nonstatic_field(ConstMethod,        _fingerprint,                                  uint64_t)                              \
 275   nonstatic_field(ConstMethod,                 _constants,                                    ConstantPool*)                         \
 276   nonstatic_field(ConstMethod,                 _stackmap_data,                                Array<u1>*)                            \
 277   nonstatic_field(ConstMethod,                 _constMethod_size,                             int)                                   \
 278   nonstatic_field(ConstMethod,                 _flags._flags,                                 u4)                                    \
 279   nonstatic_field(ConstMethod,                 _code_size,                                    u2)                                    \
 280   nonstatic_field(ConstMethod,                 _name_index,                                   u2)                                    \
 281   nonstatic_field(ConstMethod,                 _signature_index,                              u2)                                    \
 282   nonstatic_field(ConstMethod,                 _method_idnum,                                 u2)                                    \
 283   nonstatic_field(ConstMethod,                 _max_stack,                                    u2)                                    \
 284   nonstatic_field(ConstMethod,                 _max_locals,                                   u2)                                    \
 285   nonstatic_field(ConstMethod,                 _size_of_parameters,                           u2)                                    \
 286   nonstatic_field(ConstMethod,                 _num_stack_arg_slots,                          u2)                                    \
 287   nonstatic_field(ObjArrayKlass,               _element_klass,                                Klass*)                                \
 288   nonstatic_field(ObjArrayKlass,               _bottom_klass,                                 Klass*)                                \
 289   volatile_nonstatic_field(Symbol,             _hash_and_refcount,                            unsigned int)                          \
 290   nonstatic_field(Symbol,                      _length,                                       u2)                                    \
 291   unchecked_nonstatic_field(Symbol,            _body,                                         sizeof(u1)) /* NOTE: no type */        \
 292   nonstatic_field(Symbol,                      _body[0],                                      u1)                                    \
 293   nonstatic_field(TypeArrayKlass,              _max_length,                                   jint)                                  \
 294   nonstatic_field(OopHandle,                   _obj,                                          oop*)                                  \
 295   nonstatic_field(Annotations,                 _class_annotations,                            Array<u1>*)                            \
 296   nonstatic_field(Annotations,                 _fields_annotations,                           Array<Array<u1>*>*)                    \
 297   nonstatic_field(Annotations,                 _class_type_annotations,                       Array<u1>*)                            \
 298   nonstatic_field(Annotations,                 _fields_type_annotations,                      Array<Array<u1>*>*)                    \
 299                                                                                                                                      \
 300   /*****************************/                                                                                                    \
 301   /* Method related structures */                                                                                                    \
 302   /*****************************/                                                                                                    \
 303                                                                                                                                      \
 304   nonstatic_field(CheckedExceptionElement,     class_cp_index,                                u2)                                    \
 305   nonstatic_field(LocalVariableTableElement,   start_bci,                                     u2)                                    \
 306   nonstatic_field(LocalVariableTableElement,   length,                                        u2)                                    \
 307   nonstatic_field(LocalVariableTableElement,   name_cp_index,                                 u2)                                    \
 308   nonstatic_field(LocalVariableTableElement,   descriptor_cp_index,                           u2)                                    \
 309   nonstatic_field(LocalVariableTableElement,   signature_cp_index,                            u2)                                    \
 310   nonstatic_field(LocalVariableTableElement,   slot,                                          u2)                                    \
 311   nonstatic_field(ExceptionTableElement,       start_pc,                                      u2)                                    \
 312   nonstatic_field(ExceptionTableElement,       end_pc,                                        u2)                                    \
 313   nonstatic_field(ExceptionTableElement,       handler_pc,                                    u2)                                    \
 314   nonstatic_field(ExceptionTableElement,       catch_type_index,                              u2)                                    \
 315   JVMTI_ONLY(nonstatic_field(BreakpointInfo,   _orig_bytecode,                                Bytecodes::Code))                      \
 316   JVMTI_ONLY(nonstatic_field(BreakpointInfo,   _bci,                                          int))                                  \
 317   JVMTI_ONLY(nonstatic_field(BreakpointInfo,   _name_index,                                   u2))                                   \
 318   JVMTI_ONLY(nonstatic_field(BreakpointInfo,   _signature_index,                              u2))                                   \
 319   JVMTI_ONLY(nonstatic_field(BreakpointInfo,   _next,                                         BreakpointInfo*))                      \
 320   /***********/                                                                                                                      \
 321   /* JNI IDs */                                                                                                                      \
 322   /***********/                                                                                                                      \
 323                                                                                                                                      \
 324   nonstatic_field(JNIid,                       _holder,                                       Klass*)                                \
 325   nonstatic_field(JNIid,                       _next,                                         JNIid*)                                \
 326   nonstatic_field(JNIid,                       _offset,                                       int)                                   \
 327                                                                                                                                      \
 328   /************/                                                                                                                     \
 329   /* Universe */                                                                                                                     \
 330   /************/                                                                                                                     \
 331      static_field(Universe,                    _collectedHeap,                                CollectedHeap*)                        \
 332   /******************/                                                                                                               \
 333   /* CompressedOops */                                                                                                               \
 334   /******************/                                                                                                               \
 335                                                                                                                                      \
 336      static_field(CompressedOops,              _base,                                         address)                               \
 337      static_field(CompressedOops,              _shift,                                        int)                                   \
 338      static_field(CompressedOops,              _use_implicit_null_checks,                     bool)                                  \
 339                                                                                                                                      \
 340   /***************************/                                                                                                      \
 341   /* CompressedKlassPointers */                                                                                                      \
 342   /***************************/                                                                                                      \
 343                                                                                                                                      \
 344      static_field(CompressedKlassPointers,     _base,                                         address)                               \
 345      static_field(CompressedKlassPointers,     _shift,                                        int)                                   \
 346                                                                                                                                      \
 347   /**********/                                                                                                                       \
 348   /* Memory */                                                                                                                       \
 349   /**********/                                                                                                                       \
 350                                                                                                                                      \
 351      static_field(MetaspaceObj,                _shared_metaspace_base,                        void*)                                 \
 352      static_field(MetaspaceObj,                _shared_metaspace_top,                         void*)                                 \
 353   nonstatic_field(ThreadLocalAllocBuffer,      _start,                                        HeapWord*)                             \
 354   nonstatic_field(ThreadLocalAllocBuffer,      _top,                                          HeapWord*)                             \
 355   nonstatic_field(ThreadLocalAllocBuffer,      _end,                                          HeapWord*)                             \
 356   nonstatic_field(ThreadLocalAllocBuffer,      _pf_top,                                       HeapWord*)                             \
 357   nonstatic_field(ThreadLocalAllocBuffer,      _desired_size,                                 size_t)                                \
 358   nonstatic_field(ThreadLocalAllocBuffer,      _refill_waste_limit,                           size_t)                                \
 359      static_field(ThreadLocalAllocBuffer,      _reserve_for_allocation_prefetch,              int)                                   \
 360      static_field(ThreadLocalAllocBuffer,      _target_refills,                               unsigned)                              \
 361   nonstatic_field(ThreadLocalAllocBuffer,      _number_of_refills,                            unsigned)                              \
 362   nonstatic_field(ThreadLocalAllocBuffer,      _refill_waste,                                 unsigned)                              \
 363   nonstatic_field(ThreadLocalAllocBuffer,      _gc_waste,                                     unsigned)                              \
 364   nonstatic_field(ThreadLocalAllocBuffer,      _slow_allocations,                             unsigned)                              \
 365   nonstatic_field(VirtualSpace,                _low_boundary,                                 char*)                                 \
 366   nonstatic_field(VirtualSpace,                _high_boundary,                                char*)                                 \
 367   nonstatic_field(VirtualSpace,                _low,                                          char*)                                 \
 368   nonstatic_field(VirtualSpace,                _high,                                         char*)                                 \
 369   nonstatic_field(VirtualSpace,                _lower_high,                                   char*)                                 \
 370   nonstatic_field(VirtualSpace,                _middle_high,                                  char*)                                 \
 371   nonstatic_field(VirtualSpace,                _upper_high,                                   char*)                                 \
 372                                                                                                                                      \
 373   /************************/                                                                                                         \
 374   /* PerfMemory - jvmstat */                                                                                                         \
 375   /************************/                                                                                                         \
 376                                                                                                                                      \
 377   nonstatic_field(PerfDataPrologue,            magic,                                         jint)                                  \
 378   nonstatic_field(PerfDataPrologue,            byte_order,                                    jbyte)                                 \
 379   nonstatic_field(PerfDataPrologue,            major_version,                                 jbyte)                                 \
 380   nonstatic_field(PerfDataPrologue,            minor_version,                                 jbyte)                                 \
 381   nonstatic_field(PerfDataPrologue,            accessible,                                    jbyte)                                 \
 382   nonstatic_field(PerfDataPrologue,            used,                                          jint)                                  \
 383   nonstatic_field(PerfDataPrologue,            overflow,                                      jint)                                  \
 384   nonstatic_field(PerfDataPrologue,            mod_time_stamp,                                jlong)                                 \
 385   nonstatic_field(PerfDataPrologue,            entry_offset,                                  jint)                                  \
 386   nonstatic_field(PerfDataPrologue,            num_entries,                                   jint)                                  \
 387                                                                                                                                      \
 388   nonstatic_field(PerfDataEntry,               entry_length,                                  jint)                                  \
 389   nonstatic_field(PerfDataEntry,               name_offset,                                   jint)                                  \
 390   nonstatic_field(PerfDataEntry,               vector_length,                                 jint)                                  \
 391   nonstatic_field(PerfDataEntry,               data_type,                                     jbyte)                                 \
 392   nonstatic_field(PerfDataEntry,               flags,                                         jbyte)                                 \
 393   nonstatic_field(PerfDataEntry,               data_units,                                    jbyte)                                 \
 394   nonstatic_field(PerfDataEntry,               data_variability,                              jbyte)                                 \
 395   nonstatic_field(PerfDataEntry,               data_offset,                                   jint)                                  \
 396                                                                                                                                      \
 397      static_field(PerfMemory,                  _start,                                        char*)                                 \
 398      static_field(PerfMemory,                  _end,                                          char*)                                 \
 399      static_field(PerfMemory,                  _top,                                          char*)                                 \
 400      static_field(PerfMemory,                  _capacity,                                     size_t)                                \
 401      static_field(PerfMemory,                  _prologue,                                     PerfDataPrologue*)                     \
 402      volatile_static_field(PerfMemory,         _initialized,                                  int)                                   \
 403                                                                                                                                      \
 404   /********************/                                                                                                             \
 405   /* VM Classes       */                                                                                                             \
 406   /********************/                                                                                                             \
 407                                                                                                                                      \
 408      static_field(vmClasses,                   VM_CLASS_AT(Object_klass),                        InstanceKlass*)                     \
 409      static_field(vmClasses,                   VM_CLASS_AT(String_klass),                        InstanceKlass*)                     \
 410      static_field(vmClasses,                   VM_CLASS_AT(Class_klass),                         InstanceKlass*)                     \
 411      static_field(vmClasses,                   VM_CLASS_AT(ClassLoader_klass),                   InstanceKlass*)                     \
 412      static_field(vmClasses,                   VM_CLASS_AT(System_klass),                        InstanceKlass*)                     \
 413      static_field(vmClasses,                   VM_CLASS_AT(Thread_klass),                        InstanceKlass*)                     \
 414      static_field(vmClasses,                   VM_CLASS_AT(Thread_FieldHolder_klass),            InstanceKlass*)                     \
 415      static_field(vmClasses,                   VM_CLASS_AT(ThreadGroup_klass),                   InstanceKlass*)                     \
 416      static_field(vmClasses,                   VM_CLASS_AT(MethodHandle_klass),                  InstanceKlass*)                     \
 417                                                                                                                                      \
 418   /*************/                                                                                                                    \
 419   /* vmSymbols */                                                                                                                    \
 420   /*************/                                                                                                                    \
 421                                                                                                                                      \
 422      static_field(Symbol,                      _vm_symbols[0],                                Symbol*)                               \
 423                                                                                                                                      \
 424   /*******************/                                                                                                              \
 425   /* ClassLoaderData */                                                                                                              \
 426   /*******************/                                                                                                              \
 427   nonstatic_field(ClassLoaderData,             _class_loader,                                 OopHandle)                             \
 428   nonstatic_field(ClassLoaderData,             _next,                                         ClassLoaderData*)                      \
 429   volatile_nonstatic_field(ClassLoaderData,    _klasses,                                      Klass*)                                \
 430   nonstatic_field(ClassLoaderData,             _has_class_mirror_holder,                      bool)                                  \
 431                                                                                                                                      \
 432   volatile_static_field(ClassLoaderDataGraph, _head,                                          ClassLoaderData*)                      \
 433                                                                                                                                      \
 434   /**********/                                                                                                                       \
 435   /* Arrays */                                                                                                                       \
 436   /**********/                                                                                                                       \
 437                                                                                                                                      \
 438   nonstatic_field(Array<Klass*>,               _length,                                       int)                                   \
 439   nonstatic_field(Array<Klass*>,               _data[0],                                      Klass*)                                \
 440   nonstatic_field(Array<ResolvedFieldEntry>,   _length,                                       int)                                   \
 441   nonstatic_field(Array<ResolvedFieldEntry>,   _data[0],                                      ResolvedFieldEntry)                    \
 442   nonstatic_field(Array<ResolvedMethodEntry>,  _length,                                       int)                                   \
 443   nonstatic_field(Array<ResolvedMethodEntry>,  _data[0],                                      ResolvedMethodEntry)                   \
 444   nonstatic_field(Array<ResolvedIndyEntry>,    _length,                                       int)                                   \
 445   nonstatic_field(Array<ResolvedIndyEntry>,    _data[0],                                      ResolvedIndyEntry)                     \
 446                                                                                                                                      \
 447   /*******************/                                                                                                              \
 448   /* GrowableArrays  */                                                                                                              \
 449   /*******************/                                                                                                              \
 450                                                                                                                                      \
 451   nonstatic_field(GrowableArrayBase,           _len,                                          int)                                   \
 452   nonstatic_field(GrowableArrayBase,           _capacity,                                     int)                                   \
 453   nonstatic_field(GrowableArray<int>,          _data,                                         int*)                                  \
 454                                                                                                                                      \
 455   /********************************/                                                                                                 \
 456   /* CodeCache (NOTE: incomplete) */                                                                                                 \
 457   /********************************/                                                                                                 \
 458                                                                                                                                      \
 459      static_field(CodeCache,                   _heaps,                                        GrowableArray<CodeHeap*>*)             \
 460      static_field(CodeCache,                   _low_bound,                                    address)                               \
 461      static_field(CodeCache,                   _high_bound,                                   address)                               \
 462                                                                                                                                      \
 463   /*******************************/                                                                                                  \
 464   /* CodeHeap (NOTE: incomplete) */                                                                                                  \
 465   /*******************************/                                                                                                  \
 466                                                                                                                                      \
 467   nonstatic_field(CodeHeap,                    _memory,                                       VirtualSpace)                          \
 468   nonstatic_field(CodeHeap,                    _segmap,                                       VirtualSpace)                          \
 469   nonstatic_field(CodeHeap,                    _log2_segment_size,                            int)                                   \
 470   nonstatic_field(HeapBlock,                   _header,                                       HeapBlock::Header)                     \
 471   nonstatic_field(HeapBlock::Header,           _length,                                       uint32_t)                              \
 472   nonstatic_field(HeapBlock::Header,           _used,                                         bool)                                  \
 473                                                                                                                                      \
 474   /**********************************/                                                                                               \
 475   /* Interpreter (NOTE: incomplete) */                                                                                               \
 476   /**********************************/                                                                                               \
 477                                                                                                                                      \
 478      static_field(AbstractInterpreter,         _code,                                         StubQueue*)                            \
 479                                                                                                                                      \
 480   /****************************/                                                                                                     \
 481   /* Stubs (NOTE: incomplete) */                                                                                                     \
 482   /****************************/                                                                                                     \
 483                                                                                                                                      \
 484   nonstatic_field(StubQueue,                   _stub_buffer,                                  address)                               \
 485   nonstatic_field(StubQueue,                   _buffer_limit,                                 int)                                   \
 486   nonstatic_field(StubQueue,                   _queue_begin,                                  int)                                   \
 487   nonstatic_field(StubQueue,                   _queue_end,                                    int)                                   \
 488   nonstatic_field(StubQueue,                   _number_of_stubs,                              int)                                   \
 489   nonstatic_field(InterpreterCodelet,          _size,                                         int)                                   \
 490   nonstatic_field(InterpreterCodelet,          _description,                                  const char*)                           \
 491   nonstatic_field(InterpreterCodelet,          _bytecode,                                     Bytecodes::Code)                       \
 492                                                                                                                                      \
 493   /***********************************/                                                                                              \
 494   /* StubRoutine for stack walking.  */                                                                                              \
 495   /***********************************/                                                                                              \
 496                                                                                                                                      \
 497      static_field(StubRoutines,                _call_stub_return_address,                     address)                               \
 498                                                                                                                                      \
 499   /***************************************/                                                                                          \
 500   /* PcDesc and other compiled code info */                                                                                          \
 501   /***************************************/                                                                                          \
 502                                                                                                                                      \
 503   nonstatic_field(PcDesc,                      _pc_offset,                                    int)                                   \
 504   nonstatic_field(PcDesc,                      _scope_decode_offset,                          int)                                   \
 505   nonstatic_field(PcDesc,                      _obj_decode_offset,                            int)                                   \
 506   nonstatic_field(PcDesc,                      _flags,                                        int)                                   \
 507                                                                                                                                      \
 508   /***************************************************/                                                                              \
 509   /* CodeBlobs (NOTE: incomplete, but only a little) */                                                                              \
 510   /***************************************************/                                                                              \
 511                                                                                                                                      \
 512   nonstatic_field(CodeBlob,                    _name,                                         const char*)                           \
 513   nonstatic_field(CodeBlob,                    _size,                                         int)                                   \
 514   nonstatic_field(CodeBlob,                    _kind,                                         CodeBlobKind)                          \
 515   nonstatic_field(CodeBlob,                    _header_size,                                  u2)                                    \
 516   nonstatic_field(CodeBlob,                    _relocation_size,                              int)                                   \
 517   nonstatic_field(CodeBlob,                    _content_offset,                               int)                                   \
 518   nonstatic_field(CodeBlob,                    _code_offset,                                  int)                                   \
 519   nonstatic_field(CodeBlob,                    _frame_complete_offset,                        int16_t)                               \
 520   nonstatic_field(CodeBlob,                    _data_offset,                                  int)                                   \
 521   nonstatic_field(CodeBlob,                    _frame_size,                                   int)                                   \
 522   nonstatic_field(CodeBlob,                    _oop_maps,                                     ImmutableOopMapSet*)                   \
 523   nonstatic_field(CodeBlob,                    _caller_must_gc_arguments,                     bool)                                  \
 524   nonstatic_field(CodeBlob,                    _mutable_data,                                 address)                               \
 525   nonstatic_field(CodeBlob,                    _mutable_data_size,                            int)                                   \
 526                                                                                                                                      \
 527   nonstatic_field(DeoptimizationBlob,          _unpack_offset,                                int)                                   \
 528                                                                                                                                      \
 529   /*****************************************************/                                                                            \
 530   /* UpcallStubs (NOTE: incomplete, but only a little) */                                                                            \
 531   /*****************************************************/                                                                            \
 532                                                                                                                                      \
 533   nonstatic_field(UpcallStub,                  _frame_data_offset,                            ByteSize)                              \
 534                                                                                                                                      \
 535   /**************************************************/                                                                               \
 536   /* NMethods (NOTE: incomplete, but only a little) */                                                                               \
 537   /**************************************************/                                                                               \
 538                                                                                                                                      \
 539   nonstatic_field(nmethod,                     _method,                                       Method*)                               \
 540   nonstatic_field(nmethod,                     _entry_bci,                                    int)                                   \
 541   nonstatic_field(nmethod,                     _osr_link,                                     nmethod*)                              \
 542   nonstatic_field(nmethod,                     _state,                                        volatile signed char)                  \
 543   nonstatic_field(nmethod,                     _exception_offset,                             int)                                   \
 544   nonstatic_field(nmethod,                     _deopt_handler_offset,                         int)                                   \
 545   nonstatic_field(nmethod,                     _deopt_mh_handler_offset,                      int)                                   \
 546   nonstatic_field(nmethod,                     _orig_pc_offset,                               int)                                   \
 547   nonstatic_field(nmethod,                     _stub_offset,                                  int)                                   \
 548   nonstatic_field(nmethod,                     _scopes_pcs_offset,                            int)                                   \
 549   nonstatic_field(nmethod,                     _scopes_data_offset,                           int)                                   \
 550   nonstatic_field(nmethod,                     _handler_table_offset,                         u2)                                    \
 551   nonstatic_field(nmethod,                     _nul_chk_table_offset,                         u2)                                    \
 552   nonstatic_field(nmethod,                     _entry_offset,                                 u2)                                    \
 553   nonstatic_field(nmethod,                     _verified_entry_offset,                        u2)                                    \
 554   nonstatic_field(nmethod,                     _osr_entry_point,                              address)                               \
 555   nonstatic_field(nmethod,                     _immutable_data,                               address)                               \
 556   nonstatic_field(nmethod,                     _immutable_data_size,                          int)                                   \
 557   nonstatic_field(nmethod,                     _compile_id,                                   int)                                   \
 558   nonstatic_field(nmethod,                     _comp_level,                                   CompLevel)                             \
 559   volatile_nonstatic_field(nmethod,            _exception_cache,                              ExceptionCache*)                       \
 560                                                                                                                                      \
 561   nonstatic_field(Deoptimization::UnrollBlock, _size_of_deoptimized_frame,                    int)                                   \
 562   nonstatic_field(Deoptimization::UnrollBlock, _caller_adjustment,                            int)                                   \
 563   nonstatic_field(Deoptimization::UnrollBlock, _number_of_frames,                             int)                                   \
 564   nonstatic_field(Deoptimization::UnrollBlock, _total_frame_sizes,                            int)                                   \
 565   nonstatic_field(Deoptimization::UnrollBlock, _unpack_kind,                                  int)                                   \
 566   nonstatic_field(Deoptimization::UnrollBlock, _frame_sizes,                                  intptr_t*)                             \
 567   nonstatic_field(Deoptimization::UnrollBlock, _frame_pcs,                                    address*)                              \
 568   nonstatic_field(Deoptimization::UnrollBlock, _register_block,                               intptr_t*)                             \
 569   nonstatic_field(Deoptimization::UnrollBlock, _return_type,                                  BasicType)                             \
 570   nonstatic_field(Deoptimization::UnrollBlock, _initial_info,                                 intptr_t)                              \
 571   nonstatic_field(Deoptimization::UnrollBlock, _caller_actual_parameters,                     int)                                   \
 572                                                                                                                                      \
 573   /********************************/                                                                                                 \
 574   /* JavaCalls (NOTE: incomplete) */                                                                                                 \
 575   /********************************/                                                                                                 \
 576                                                                                                                                      \
 577   nonstatic_field(JavaCallWrapper,             _anchor,                                       JavaFrameAnchor)                       \
 578   /********************************/                                                                                                 \
 579   /* JavaFrameAnchor (NOTE: incomplete) */                                                                                           \
 580   /********************************/                                                                                                 \
 581   volatile_nonstatic_field(JavaFrameAnchor,    _last_Java_sp,                                 intptr_t*)                             \
 582   volatile_nonstatic_field(JavaFrameAnchor,    _last_Java_pc,                                 address)                               \
 583                                                                                                                                      \
 584   /******************************/                                                                                                   \
 585   /* Threads (NOTE: incomplete) */                                                                                                   \
 586   /******************************/                                                                                                   \
 587                                                                                                                                      \
 588   static_field(Threads,                     _number_of_threads,                               int)                                   \
 589   static_field(Threads,                     _number_of_non_daemon_threads,                    int)                                   \
 590   static_field(Threads,                     _return_code,                                     int)                                   \
 591                                                                                                                                      \
 592   volatile_static_field(ThreadsSMRSupport, _java_thread_list,                                 ThreadsList*)                          \
 593   nonstatic_field(ThreadsList,                 _length,                                       const uint)                            \
 594   nonstatic_field(ThreadsList,                 _threads,                                      JavaThread *const *const)              \
 595                                                                                                                                      \
 596   nonstatic_field(ThreadShadow,                _pending_exception,                            oop)                                   \
 597   nonstatic_field(ThreadShadow,                _exception_file,                               const char*)                           \
 598   nonstatic_field(ThreadShadow,                _exception_line,                               int)                                   \
 599   nonstatic_field(Thread,                      _tlab,                                         ThreadLocalAllocBuffer)                \
 600   nonstatic_field(Thread,                      _allocated_bytes,                              jlong)                                 \
 601   nonstatic_field(JavaThread,                  _lock_stack,                                   LockStack)                             \
 602   nonstatic_field(LockStack,                   _top,                                          uint32_t)                              \
 603   nonstatic_field(LockStack,                   _base[0],                                      oop)                                   \
 604   nonstatic_field(NamedThread,                 _name,                                         char*)                                 \
 605   nonstatic_field(NamedThread,                 _processed_thread,                             Thread*)                               \
 606   nonstatic_field(JavaThread,                  _threadObj,                                    OopHandle)                             \
 607   nonstatic_field(JavaThread,                  _vthread,                                      OopHandle)                             \
 608   nonstatic_field(JavaThread,                  _jvmti_vthread,                                OopHandle)                             \
 609   nonstatic_field(JavaThread,                  _scopedValueCache,                              OopHandle)                             \
 610   nonstatic_field(JavaThread,                  _anchor,                                       JavaFrameAnchor)                       \
 611   nonstatic_field(JavaThread,                  _vm_result,                                    oop)                                   \
 612   nonstatic_field(JavaThread,                  _vm_result_2,                                  Metadata*)                             \
 613   volatile_nonstatic_field(JavaThread,         _current_pending_monitor,                      ObjectMonitor*)                        \
 614   nonstatic_field(JavaThread,                  _current_pending_monitor_is_from_java,         bool)                                  \
 615   volatile_nonstatic_field(JavaThread,         _current_waiting_monitor,                      ObjectMonitor*)                        \
 616   volatile_nonstatic_field(JavaThread,         _suspend_flags,                                uint32_t)                              \
 617   volatile_nonstatic_field(JavaThread,         _exception_oop,                                oop)                                   \
 618   volatile_nonstatic_field(JavaThread,         _exception_pc,                                 address)                               \
 619   volatile_nonstatic_field(JavaThread,         _is_method_handle_return,                      int)                                   \
 620   nonstatic_field(JavaThread,                  _saved_exception_pc,                           address)                               \
 621   volatile_nonstatic_field(JavaThread,         _thread_state,                                 JavaThreadState)                       \
 622   nonstatic_field(JavaThread,                  _stack_base,                                   address)                               \
 623   nonstatic_field(JavaThread,                  _stack_size,                                   size_t)                                \
 624   nonstatic_field(JavaThread,                  _vframe_array_head,                            vframeArray*)                          \
 625   nonstatic_field(JavaThread,                  _vframe_array_last,                            vframeArray*)                          \
 626   nonstatic_field(JavaThread,                  _active_handles,                               JNIHandleBlock*)                       \
 627   nonstatic_field(JavaThread,                  _monitor_owner_id,                             int64_t)                               \
 628   volatile_nonstatic_field(JavaThread,         _terminated,                                   JavaThread::TerminatedTypes)           \
 629   nonstatic_field(Thread,                      _osthread,                                     OSThread*)                             \
 630                                                                                                                                      \
 631   /************/                                                                                                                     \
 632   /* OSThread */                                                                                                                     \
 633   /************/                                                                                                                     \
 634                                                                                                                                      \
 635   volatile_nonstatic_field(OSThread,           _state,                                        ThreadState)                           \
 636                                                                                                                                      \
 637   /************************/                                                                                                         \
 638   /* ImmutableOopMap      */                                                                                                         \
 639   /************************/                                                                                                         \
 640                                                                                                                                      \
 641   nonstatic_field(ImmutableOopMapSet,          _count,                                        int)                                   \
 642   nonstatic_field(ImmutableOopMapSet,          _size,                                         int)                                   \
 643                                                                                                                                      \
 644   nonstatic_field(ImmutableOopMapPair,         _pc_offset,                                    int)                                   \
 645   nonstatic_field(ImmutableOopMapPair,         _oopmap_offset,                                int)                                   \
 646                                                                                                                                      \
 647   nonstatic_field(ImmutableOopMap,             _count,                                        int)                                   \
 648                                                                                                                                      \
 649   /*********************************/                                                                                                \
 650   /* JNIHandles and JNIHandleBlock */                                                                                                \
 651   /*********************************/                                                                                                \
 652   static_field(JNIHandles,                     _global_handles,                               OopStorage*)                           \
 653   static_field(JNIHandles,                     _weak_global_handles,                          OopStorage*)                           \
 654   unchecked_nonstatic_field(JNIHandleBlock,    _handles,       JNIHandleBlock::block_size_in_oops * sizeof(Oop)) /* Note: no type */ \
 655   nonstatic_field(JNIHandleBlock,              _top,                                          int)                                   \
 656   nonstatic_field(JNIHandleBlock,              _next,                                         JNIHandleBlock*)                       \
 657                                                                                                                                      \
 658   /********************/                                                                                                             \
 659   /* CompressedStream */                                                                                                             \
 660   /********************/                                                                                                             \
 661                                                                                                                                      \
 662   nonstatic_field(CompressedStream,            _buffer,                                       u_char*)                               \
 663   nonstatic_field(CompressedStream,            _position,                                     int)                                   \
 664                                                                                                                                      \
 665   /*********************************/                                                                                                \
 666   /* VMRegImpl (NOTE: incomplete) */                                                                                                 \
 667   /*********************************/                                                                                                \
 668                                                                                                                                      \
 669      static_field(VMRegImpl,                   regName[0],                                    const char*)                           \
 670      static_field(VMRegImpl,                   stack0,                                        VMReg)                                 \
 671                                                                                                                                      \
 672   /************/                                                                                                                     \
 673   /* Monitors */                                                                                                                     \
 674   /************/                                                                                                                     \
 675                                                                                                                                      \
 676   volatile_nonstatic_field(ObjectMonitor,      _metadata,                                     uintptr_t)                             \
 677   unchecked_nonstatic_field(ObjectMonitor,     _object,                                       sizeof(void *)) /* NOTE: no type */    \
 678   volatile_nonstatic_field(ObjectMonitor,      _owner,                                        int64_t)                               \
 679   volatile_nonstatic_field(ObjectMonitor,      _stack_locker,                                 BasicLock*)                            \
 680   volatile_nonstatic_field(ObjectMonitor,      _next_om,                                      ObjectMonitor*)                        \
 681   volatile_nonstatic_field(BasicLock,          _metadata,                                     uintptr_t)                             \
 682   nonstatic_field(ObjectMonitor,               _contentions,                                  int)                                   \
 683   volatile_nonstatic_field(ObjectMonitor,      _waiters,                                      int)                                   \
 684   volatile_nonstatic_field(ObjectMonitor,      _recursions,                                   intx)                                  \
 685   nonstatic_field(BasicObjectLock,             _lock,                                         BasicLock)                             \
 686   nonstatic_field(BasicObjectLock,             _obj,                                          oop)                                   \
 687   static_field(ObjectSynchronizer,             _in_use_list,                                  MonitorList)                           \
 688   volatile_nonstatic_field(MonitorList,        _head,                                         ObjectMonitor*)                        \
 689                                                                                                                                      \
 690   /*********************/                                                                                                            \
 691   /* -XX flags         */                                                                                                            \
 692   /*********************/                                                                                                            \
 693                                                                                                                                      \
 694   nonstatic_field(JVMFlag,                     _type,                                         int)                                   \
 695   nonstatic_field(JVMFlag,                     _name,                                         const char*)                           \
 696   unchecked_nonstatic_field(JVMFlag,           _addr,                                         sizeof(void*)) /* NOTE: no type */     \
 697   nonstatic_field(JVMFlag,                     _flags,                                        JVMFlag::Flags)                        \
 698      static_field(JVMFlag,                     flags,                                         JVMFlag*)                              \
 699      static_field(JVMFlag,                     numFlags,                                      size_t)                                \
 700                                                                                                                                      \
 701   /*************************/                                                                                                        \
 702   /* JDK / VM version info */                                                                                                        \
 703   /*************************/                                                                                                        \
 704                                                                                                                                      \
 705      static_field(Abstract_VM_Version,         _s_vm_release,                                 const char*)                           \
 706      static_field(Abstract_VM_Version,         _s_internal_vm_info_string,                    const char*)                           \
 707      static_field(Abstract_VM_Version,         _features,                                     uint64_t)                              \
 708      static_field(Abstract_VM_Version,         _features_string,                              const char*)                           \
 709      static_field(Abstract_VM_Version,         _vm_major_version,                             int)                                   \
 710      static_field(Abstract_VM_Version,         _vm_minor_version,                             int)                                   \
 711      static_field(Abstract_VM_Version,         _vm_security_version,                          int)                                   \
 712      static_field(Abstract_VM_Version,         _vm_build_number,                              int)                                   \
 713                                                                                                                                      \
 714   /*************************/                                                                                                        \
 715   /* JVMTI */                                                                                                                        \
 716   /*************************/                                                                                                        \
 717                                                                                                                                      \
 718   JVMTI_STRUCTS(static_field)                                                                                                        \
 719                                                                                                                                      \
 720   /*************/                                                                                                                    \
 721   /* Arguments */                                                                                                                    \
 722   /*************/                                                                                                                    \
 723                                                                                                                                      \
 724      static_field(Arguments,                   _jvm_flags_array,                              char**)                                \
 725      static_field(Arguments,                   _num_jvm_flags,                                int)                                   \
 726      static_field(Arguments,                   _jvm_args_array,                               char**)                                \
 727      static_field(Arguments,                   _num_jvm_args,                                 int)                                   \
 728      static_field(Arguments,                   _java_command,                                 char*)                                 \
 729                                                                                                                                      \
 730   /************/                                                                                                                     \
 731   /* Array<T> */                                                                                                                     \
 732   /************/                                                                                                                     \
 733                                                                                                                                      \
 734   nonstatic_field(Array<int>,                          _length,                               int)                                   \
 735   unchecked_nonstatic_field(Array<int>,                _data,                                 sizeof(int))                           \
 736   unchecked_nonstatic_field(Array<u1>,                 _data,                                 sizeof(u1))                            \
 737   unchecked_nonstatic_field(Array<u2>,                 _data,                                 sizeof(u2))                            \
 738   unchecked_nonstatic_field(Array<Method*>,            _data,                                 sizeof(Method*))                       \
 739   unchecked_nonstatic_field(Array<Klass*>,             _data,                                 sizeof(Klass*))                        \
 740   unchecked_nonstatic_field(Array<ResolvedFieldEntry>, _data,                                 sizeof(ResolvedFieldEntry))            \
 741   unchecked_nonstatic_field(Array<ResolvedMethodEntry>,_data,                                 sizeof(ResolvedMethodEntry))           \
 742   unchecked_nonstatic_field(Array<ResolvedIndyEntry>,  _data,                                 sizeof(ResolvedIndyEntry))             \
 743   unchecked_nonstatic_field(Array<Array<u1>*>,         _data,                                 sizeof(Array<u1>*))                    \
 744                                                                                                                                      \
 745   /*********************************/                                                                                                \
 746   /* java_lang_Class fields        */                                                                                                \
 747   /*********************************/                                                                                                \
 748                                                                                                                                      \
 749      static_field(java_lang_Class,             _klass_offset,                                 int)                                   \
 750      static_field(java_lang_Class,             _array_klass_offset,                           int)                                   \
 751      static_field(java_lang_Class,             _oop_size_offset,                              int)                                   \
 752      static_field(java_lang_Class,             _static_oop_field_count_offset,                int)                                   \
 753                                                                                                                                      \
 754   /********************************************/                                                                                     \
 755   /* FileMapInfo fields (CDS archive related) */                                                                                     \
 756   /********************************************/                                                                                     \
 757                                                                                                                                      \
 758   CDS_ONLY(nonstatic_field(FileMapInfo,        _header,                   FileMapHeader*))                                           \
 759   CDS_ONLY(   static_field(FileMapInfo,        _current_info,             FileMapInfo*))                                             \
 760   CDS_ONLY(nonstatic_field(FileMapHeader,      _regions[0],               CDSFileMapRegion))                                         \
 761   CDS_ONLY(nonstatic_field(FileMapHeader,      _cloned_vtables_offset,    size_t))                                                   \
 762   CDS_ONLY(nonstatic_field(FileMapHeader,      _mapped_base_address,      char*))                                                    \
 763   CDS_ONLY(nonstatic_field(CDSFileMapRegion,   _mapped_base,              char*))                                                    \
 764   CDS_ONLY(nonstatic_field(CDSFileMapRegion,   _used,                     size_t))                                                   \
 765                                                                                                                                      \
 766   /******************/                                                                                                               \
 767   /* VMError fields */                                                                                                               \
 768   /******************/                                                                                                               \
 769                                                                                                                                      \
 770      static_field(VMError,                     _thread,                                       Thread*)                               \
 771                                                                                                                                      \
 772   /************************/                                                                                                         \
 773   /* Miscellaneous fields */                                                                                                         \
 774   /************************/                                                                                                         \
 775                                                                                                                                      \
 776   nonstatic_field(CompileTask,                 _method,                                       Method*)                               \
 777   nonstatic_field(CompileTask,                 _osr_bci,                                      int)                                   \
 778   nonstatic_field(CompileTask,                 _comp_level,                                   int)                                   \
 779   nonstatic_field(CompileTask,                 _compile_id,                                   int)                                   \
 780   nonstatic_field(CompileTask,                 _num_inlined_bytecodes,                        int)                                   \
 781   nonstatic_field(CompileTask,                 _next,                                         CompileTask*)                          \
 782   nonstatic_field(CompileTask,                 _prev,                                         CompileTask*)                          \
 783                                                                                                                                      \
 784   nonstatic_field(vframeArray,                 _original,                                     frame)                                 \
 785   nonstatic_field(vframeArray,                 _caller,                                       frame)                                 \
 786   nonstatic_field(vframeArray,                 _frames,                                       int)                                   \
 787                                                                                                                                      \
 788   nonstatic_field(vframeArrayElement,          _frame,                                        frame)                                 \
 789   nonstatic_field(vframeArrayElement,          _bci,                                          int)                                   \
 790   nonstatic_field(vframeArrayElement,          _method,                                       Method*)                               \
 791                                                                                                                                      \
 792   nonstatic_field(AccessFlags,                 _flags,                                        u2)                                    \
 793   nonstatic_field(elapsedTimer,                _counter,                                      jlong)                                 \
 794   nonstatic_field(elapsedTimer,                _active,                                       bool)                                  \
 795   nonstatic_field(InvocationCounter,           _counter,                                      unsigned int)                          \
 796                                                                                                                                      \
 797   nonstatic_field(UpcallStub::FrameData,       jfa,                                           JavaFrameAnchor)                       \
 798                                                                                                                                      \
 799   nonstatic_field(Mutex,                       _name,                                         const char*)                           \
 800   static_field(Mutex,                          _mutex_array,                                  Mutex**)                               \
 801   static_field(Mutex,                          _num_mutex,                                    int)                                   \
 802   volatile_nonstatic_field(Mutex,              _owner,                                        Thread*)
 803 
 804 //--------------------------------------------------------------------------------
 805 // VM_TYPES
 806 //
 807 // This list must enumerate at least all of the types in the above
 808 // list. For the types in the above list, the entry below must have
 809 // exactly the same spacing since string comparisons are done in the
 810 // code which verifies the consistency of these tables (in the debug
 811 // build).
 812 //
 813 // In addition to the above types, this list is required to enumerate
 814 // the JNI's java types, which are used to indicate the size of Java
 815 // fields in this VM to the SA. Further, oop types are currently
 816 // distinguished by name (i.e., ends with "oop") over in the SA.
 817 //
 818 // The declare_toplevel_type macro should be used to declare types
 819 // which do not have a superclass.
 820 //
 821 // The declare_integer_type and declare_unsigned_integer_type macros
 822 // are required in order to properly identify C integer types over in
 823 // the SA. They should be used for any type which is otherwise opaque
 824 // and which it is necessary to coerce into an integer value. This
 825 // includes, for example, the type uintptr_t. Note that while they
 826 // will properly identify the type's size regardless of the platform,
 827 // since it is does not seem possible to deduce or check signedness at
 828 // compile time using the pointer comparison tricks, it is currently
 829 // required that the given types have the same signedness across all
 830 // platforms.
 831 //
 832 // NOTE that there are platform-specific additions to this table in
 833 // vmStructs_<os>_<cpu>.hpp.
 834 
 835 #define VM_TYPES(declare_type,                                            \
 836                  declare_toplevel_type,                                   \
 837                  declare_oop_type,                                        \
 838                  declare_integer_type,                                    \
 839                  declare_unsigned_integer_type)                           \
 840                                                                           \
 841   /*************************************************************/         \
 842   /* Java primitive types -- required by the SA implementation */         \
 843   /* in order to determine the size of Java fields in this VM  */         \
 844   /* (the implementation looks up these names specifically)    */         \
 845   /* NOTE: since we fetch these sizes from the remote VM, we   */         \
 846   /* have a bootstrapping sequence during which it is not      */         \
 847   /* valid to fetch Java values from the remote process, only  */         \
 848   /* C integer values (of known size). NOTE also that we do    */         \
 849   /* NOT include "Java unsigned" types like juint here; since  */         \
 850   /* Java does not have unsigned primitive types, those can    */         \
 851   /* not be mapped directly and are considered to be C integer */         \
 852   /* types in this system (see the "other types" section,      */         \
 853   /* below.)                                                   */         \
 854   /*************************************************************/         \
 855                                                                           \
 856   declare_toplevel_type(jboolean)                                         \
 857   declare_toplevel_type(jbyte)                                            \
 858   declare_toplevel_type(jchar)                                            \
 859   declare_toplevel_type(jdouble)                                          \
 860   declare_toplevel_type(jfloat)                                           \
 861   declare_toplevel_type(jint)                                             \
 862   declare_toplevel_type(jlong)                                            \
 863   declare_toplevel_type(jshort)                                           \
 864                                                                           \
 865   /*********************************************************************/ \
 866   /* C integer types. User-defined typedefs (like "size_t" or          */ \
 867   /* "intptr_t") are guaranteed to be present with the same names over */ \
 868   /* in the SA's type database. Names like "unsigned short" are not    */ \
 869   /* guaranteed to be visible through the SA's type database lookup    */ \
 870   /* mechanism, though they will have a Type object created for them   */ \
 871   /* and are valid types for Fields.                                   */ \
 872   /*********************************************************************/ \
 873   declare_integer_type(bool)                                              \
 874   declare_integer_type(short)                                             \
 875   declare_integer_type(int)                                               \
 876   declare_integer_type(long)                                              \
 877   declare_integer_type(char)                                              \
 878   declare_integer_type(volatile signed char)                              \
 879   declare_unsigned_integer_type(unsigned char)                            \
 880   declare_unsigned_integer_type(u_char)                                   \
 881   declare_unsigned_integer_type(unsigned int)                             \
 882   declare_unsigned_integer_type(uint)                                     \
 883   declare_unsigned_integer_type(volatile uint)                            \
 884   declare_unsigned_integer_type(unsigned short)                           \
 885   declare_unsigned_integer_type(jushort)                                  \
 886   declare_unsigned_integer_type(unsigned long)                            \
 887   /* The compiler thinks this is a different type than */                 \
 888   /* unsigned short on Win32 */                                           \
 889   declare_unsigned_integer_type(u1)                                       \
 890   declare_unsigned_integer_type(u2)                                       \
 891   declare_unsigned_integer_type(u4)                                       \
 892   declare_unsigned_integer_type(u8)                                       \
 893   declare_unsigned_integer_type(unsigned)                                 \
 894                                                                           \
 895   /*****************************/                                         \
 896   /* C primitive pointer types */                                         \
 897   /*****************************/                                         \
 898                                                                           \
 899   declare_toplevel_type(void*)                                            \
 900   declare_toplevel_type(int*)                                             \
 901   declare_toplevel_type(char*)                                            \
 902   declare_toplevel_type(char**)                                           \
 903   declare_toplevel_type(u_char*)                                          \
 904   declare_toplevel_type(unsigned char*)                                   \
 905   declare_toplevel_type(volatile unsigned char*)                          \
 906                                                                           \
 907   /*******************************************************************/   \
 908   /* Types which it will be handy to have available over in the SA   */   \
 909   /* in order to do platform-independent address -> integer coercion */   \
 910   /* (note: these will be looked up by name)                         */   \
 911   /*******************************************************************/   \
 912                                                                           \
 913   declare_unsigned_integer_type(size_t)                                   \
 914   declare_integer_type(ssize_t)                                           \
 915   declare_integer_type(intx)                                              \
 916   declare_integer_type(intptr_t)                                          \
 917   declare_integer_type(int16_t)                                           \
 918   declare_integer_type(int64_t)                                           \
 919   declare_unsigned_integer_type(uintx)                                    \
 920   declare_unsigned_integer_type(uintptr_t)                                \
 921   declare_unsigned_integer_type(uint8_t)                                  \
 922   declare_unsigned_integer_type(uint32_t)                                 \
 923   declare_unsigned_integer_type(uint64_t)                                 \
 924                                                                           \
 925   /******************************************/                            \
 926   /* OopDesc hierarchy (NOTE: some missing) */                            \
 927   /******************************************/                            \
 928                                                                           \
 929   declare_toplevel_type(oopDesc)                                          \
 930     declare_type(arrayOopDesc, oopDesc)                                   \
 931       declare_type(objArrayOopDesc, arrayOopDesc)                         \
 932     declare_type(instanceOopDesc, oopDesc)                                \
 933                                                                           \
 934   /**************************************************/                    \
 935   /* MetadataOopDesc hierarchy (NOTE: some missing) */                    \
 936   /**************************************************/                    \
 937                                                                           \
 938   declare_toplevel_type(MetaspaceObj)                                     \
 939     declare_type(Metadata, MetaspaceObj)                                  \
 940     declare_type(Klass, Metadata)                                         \
 941            declare_type(ArrayKlass, Klass)                                \
 942            declare_type(FlatArrayKlass, ArrayKlass)                       \
 943            declare_type(ObjArrayKlass, ArrayKlass)                        \
 944            declare_type(TypeArrayKlass, ArrayKlass)                       \
 945       declare_type(InstanceKlass, Klass)                                  \
 946         declare_type(InlineKlass, InstanceKlass)                          \
 947         declare_type(InstanceClassLoaderKlass, InstanceKlass)             \
 948         declare_type(InstanceMirrorKlass, InstanceKlass)                  \
 949         declare_type(InstanceRefKlass, InstanceKlass)                     \
 950         declare_type(InstanceStackChunkKlass, InstanceKlass)              \
 951     declare_type(ConstantPool, Metadata)                                  \
 952     declare_type(ConstantPoolCache, MetaspaceObj)                         \
 953     declare_type(MethodData, Metadata)                                    \
 954     declare_type(Method, Metadata)                                        \
 955     declare_type(MethodCounters, MetaspaceObj)                            \
 956     declare_type(ConstMethod, MetaspaceObj)                               \
 957     declare_type(Annotations, MetaspaceObj)                               \
 958                                                                           \
 959   declare_toplevel_type(MethodData::CompilerCounters)                     \
 960                                                                           \
 961   declare_toplevel_type(narrowKlass)                                      \
 962                                                                           \
 963   declare_toplevel_type(vtableEntry)                                      \
 964                                                                           \
 965            declare_toplevel_type(Symbol)                                  \
 966            declare_toplevel_type(Symbol*)                                 \
 967   declare_toplevel_type(volatile Metadata*)                               \
 968                                                                           \
 969   declare_toplevel_type(DataLayout)                                       \
 970                                                                           \
 971   /********/                                                              \
 972   /* Oops */                                                              \
 973   /********/                                                              \
 974                                                                           \
 975   declare_oop_type(objArrayOop)                                           \
 976   declare_oop_type(oop)                                                   \
 977   declare_oop_type(narrowOop)                                             \
 978   declare_oop_type(typeArrayOop)                                          \
 979                                                                           \
 980   declare_toplevel_type(OopHandle)                                        \
 981                                                                           \
 982   /**********************************/                                    \
 983   /* Method related data structures */                                    \
 984   /**********************************/                                    \
 985                                                                           \
 986   declare_toplevel_type(CheckedExceptionElement)                          \
 987   declare_toplevel_type(LocalVariableTableElement)                        \
 988   declare_toplevel_type(ExceptionTableElement)                            \
 989   declare_toplevel_type(MethodParametersElement)                          \
 990                                                                           \
 991   declare_toplevel_type(ClassLoaderData)                                  \
 992   declare_toplevel_type(ClassLoaderDataGraph)                             \
 993                                                                           \
 994   /************************/                                              \
 995   /* PerfMemory - jvmstat */                                              \
 996   /************************/                                              \
 997                                                                           \
 998   declare_toplevel_type(PerfDataPrologue)                                 \
 999   declare_toplevel_type(PerfDataPrologue*)                                \
1000   declare_toplevel_type(PerfDataEntry)                                    \
1001   declare_toplevel_type(PerfMemory)                                       \
1002   declare_type(PerfData, CHeapObj<mtInternal>)                            \
1003                                                                           \
1004   /********************/                                                  \
1005   /* VM Classes       */                                                  \
1006   /********************/                                                  \
1007                                                                           \
1008   declare_toplevel_type(vmClasses)                                        \
1009   declare_toplevel_type(vmSymbols)                                        \
1010                                                                           \
1011   declare_toplevel_type(GrowableArrayBase)                                \
1012   declare_toplevel_type(GrowableArray<int>)                               \
1013                                                                           \
1014   /***********************************************************/           \
1015   /* Thread hierarchy (needed for run-time type information) */           \
1016   /***********************************************************/           \
1017                                                                           \
1018   declare_toplevel_type(Threads)                                          \
1019   declare_toplevel_type(ThreadShadow)                                     \
1020     declare_type(Thread, ThreadShadow)                                    \
1021       declare_type(NonJavaThread, Thread)                                 \
1022         declare_type(NamedThread, NonJavaThread)                          \
1023         declare_type(WatcherThread, NonJavaThread)                        \
1024         declare_type(AsyncLogWriter, NonJavaThread)                       \
1025       declare_type(JavaThread, Thread)                                    \
1026         declare_type(JvmtiAgentThread, JavaThread)                        \
1027         declare_type(MonitorDeflationThread, JavaThread)                  \
1028         declare_type(ServiceThread, JavaThread)                           \
1029         declare_type(NotificationThread, JavaThread)                      \
1030         declare_type(CompilerThread, JavaThread)                          \
1031         declare_type(StringDedupThread, JavaThread)                       \
1032         declare_type(AttachListenerThread, JavaThread)                    \
1033         DEBUG_ONLY(COMPILER2_OR_JVMCI_PRESENT(                            \
1034           declare_type(DeoptimizeObjectsALotThread, JavaThread)))         \
1035   declare_toplevel_type(OSThread)                                         \
1036   declare_toplevel_type(JavaFrameAnchor)                                  \
1037                                                                           \
1038   declare_toplevel_type(ThreadsSMRSupport)                                \
1039   declare_toplevel_type(ThreadsList)                                      \
1040   declare_toplevel_type(LockStack)                                        \
1041                                                                           \
1042   /***************/                                                       \
1043   /* Interpreter */                                                       \
1044   /***************/                                                       \
1045                                                                           \
1046   declare_toplevel_type(AbstractInterpreter)                              \
1047                                                                           \
1048   /*********/                                                             \
1049   /* Stubs */                                                             \
1050   /*********/                                                             \
1051                                                                           \
1052   declare_toplevel_type(StubQueue)                                        \
1053   declare_toplevel_type(StubRoutines)                                     \
1054   declare_toplevel_type(Stub)                                             \
1055            declare_type(InterpreterCodelet, Stub)                         \
1056                                                                           \
1057   /*************/                                                         \
1058   /* JavaCalls */                                                         \
1059   /*************/                                                         \
1060                                                                           \
1061   declare_toplevel_type(JavaCallWrapper)                                  \
1062                                                                           \
1063   /*************/                                                         \
1064   /* CodeCache */                                                         \
1065   /*************/                                                         \
1066                                                                           \
1067   declare_toplevel_type(CodeCache)                                        \
1068                                                                           \
1069   /************/                                                          \
1070   /* CodeHeap */                                                          \
1071   /************/                                                          \
1072                                                                           \
1073   declare_toplevel_type(CodeHeap)                                         \
1074   declare_toplevel_type(CodeHeap*)                                        \
1075   declare_toplevel_type(HeapBlock)                                        \
1076   declare_toplevel_type(HeapBlock::Header)                                \
1077            declare_type(FreeBlock, HeapBlock)                             \
1078                                                                           \
1079   /*************************************************************/         \
1080   /* CodeBlob hierarchy (needed for run-time type information) */         \
1081   /*************************************************************/         \
1082                                                                           \
1083   declare_toplevel_type(CodeBlob)                                         \
1084   declare_type(RuntimeBlob,              CodeBlob)                        \
1085   declare_type(BufferBlob,               RuntimeBlob)                     \
1086   declare_type(AdapterBlob,              BufferBlob)                      \
1087   declare_type(MethodHandlesAdapterBlob, BufferBlob)                      \
1088   declare_type(VtableBlob,               BufferBlob)                      \
1089   declare_type(nmethod,                  CodeBlob)                        \
1090   declare_type(RuntimeStub,              RuntimeBlob)                     \
1091   declare_type(SingletonBlob,            RuntimeBlob)                     \
1092   declare_type(UpcallStub,               RuntimeBlob)                     \
1093   declare_type(SafepointBlob,            SingletonBlob)                   \
1094   declare_type(DeoptimizationBlob,       SingletonBlob)                   \
1095   COMPILER2_PRESENT(declare_type(ExceptionBlob,    SingletonBlob))        \
1096   COMPILER2_PRESENT(declare_type(UncommonTrapBlob, RuntimeBlob))          \
1097                                                                           \
1098   /***************************************/                               \
1099   /* PcDesc and other compiled code info */                               \
1100   /***************************************/                               \
1101                                                                           \
1102   declare_toplevel_type(PcDesc)                                           \
1103   declare_toplevel_type(ExceptionCache)                                   \
1104   declare_toplevel_type(PcDescCache)                                      \
1105   declare_toplevel_type(Dependencies)                                     \
1106   declare_toplevel_type(CompileTask)                                      \
1107   declare_toplevel_type(Deoptimization)                                   \
1108   declare_toplevel_type(Deoptimization::UnrollBlock)                      \
1109                                                                           \
1110   /************************/                                              \
1111   /* ImmutableOopMap      */                                              \
1112   /************************/                                              \
1113                                                                           \
1114   declare_toplevel_type(ImmutableOopMapSet)                               \
1115   declare_toplevel_type(ImmutableOopMapPair)                              \
1116   declare_toplevel_type(ImmutableOopMap)                                  \
1117                                                                           \
1118   /********************/                                                  \
1119   /* CompressedStream */                                                  \
1120   /********************/                                                  \
1121                                                                           \
1122   declare_toplevel_type(CompressedStream)                                 \
1123                                                                           \
1124   /**************/                                                        \
1125   /* VMRegImpl  */                                                        \
1126   /**************/                                                        \
1127                                                                           \
1128   declare_toplevel_type(VMRegImpl)                                        \
1129                                                                           \
1130   /*********************************/                                     \
1131   /* JNIHandles and JNIHandleBlock */                                     \
1132   /*********************************/                                     \
1133                                                                           \
1134   declare_toplevel_type(JNIHandles)                                       \
1135   declare_toplevel_type(JNIHandleBlock)                                   \
1136   declare_toplevel_type(jobject)                                          \
1137                                                                           \
1138   /**************/                                                        \
1139   /* OopStorage */                                                        \
1140   /**************/                                                        \
1141                                                                           \
1142   declare_toplevel_type(OopStorage)                                       \
1143                                                                           \
1144   /************/                                                          \
1145   /* Monitors */                                                          \
1146   /************/                                                          \
1147                                                                           \
1148   declare_toplevel_type(ObjectMonitor)                                    \
1149   declare_toplevel_type(MonitorList)                                      \
1150   declare_toplevel_type(ObjectSynchronizer)                               \
1151   declare_toplevel_type(BasicLock)                                        \
1152   declare_toplevel_type(BasicObjectLock)                                  \
1153                                                                           \
1154   /********************/                                                  \
1155   /* -XX flags        */                                                  \
1156   /********************/                                                  \
1157                                                                           \
1158   declare_toplevel_type(JVMFlag)                                          \
1159   declare_toplevel_type(JVMFlag*)                                         \
1160                                                                           \
1161   /********************/                                                  \
1162   /* JVMTI            */                                                  \
1163   /********************/                                                  \
1164                                                                           \
1165   declare_toplevel_type(JvmtiExport)                                      \
1166                                                                           \
1167   /********************/                                                  \
1168   /* JDK/VM version   */                                                  \
1169   /********************/                                                  \
1170                                                                           \
1171   declare_toplevel_type(Abstract_VM_Version)                              \
1172                                                                           \
1173   /*************/                                                         \
1174   /* Arguments */                                                         \
1175   /*************/                                                         \
1176                                                                           \
1177   declare_toplevel_type(Arguments)                                        \
1178                                                                           \
1179   /***********/                                                           \
1180   /* VMError */                                                           \
1181   /***********/                                                           \
1182                                                                           \
1183   declare_toplevel_type(VMError)                                          \
1184                                                                           \
1185   /***************/                                                       \
1186   /* Other types */                                                       \
1187   /***************/                                                       \
1188                                                                           \
1189   /* all enum types */                                                    \
1190                                                                           \
1191    declare_integer_type(Bytecodes::Code)                                  \
1192    declare_integer_type(InstanceKlass::ClassState)                        \
1193    declare_integer_type(JavaThreadState)                                  \
1194    declare_integer_type(ThreadState)                                      \
1195    declare_integer_type(Location::Type)                                   \
1196    declare_integer_type(Location::Where)                                  \
1197    declare_integer_type(JVMFlag::Flags)                                   \
1198                                                                           \
1199    declare_toplevel_type(CHeapObj<mtInternal>)                            \
1200             declare_type(Array<int>, MetaspaceObj)                        \
1201             declare_type(Array<u1>, MetaspaceObj)                         \
1202             declare_type(Array<u2>, MetaspaceObj)                         \
1203             declare_type(Array<Klass*>, MetaspaceObj)                     \
1204             declare_type(Array<Method*>, MetaspaceObj)                    \
1205             declare_type(Array<ResolvedFieldEntry>, MetaspaceObj)         \
1206             declare_type(Array<ResolvedMethodEntry>, MetaspaceObj)        \
1207             declare_type(Array<ResolvedIndyEntry>, MetaspaceObj)          \
1208             declare_type(Array<Array<u1>*>, MetaspaceObj)                 \
1209                                                                           \
1210    declare_toplevel_type(BitMap)                                          \
1211             declare_type(BitMapView, BitMap)                              \
1212                                                                           \
1213   declare_integer_type(markWord)                                          \
1214   declare_integer_type(AccessFlags)  /* FIXME: wrong type (not integer) */\
1215   declare_toplevel_type(address)      /* FIXME: should this be an integer type? */\
1216   declare_integer_type(BasicType)   /* FIXME: wrong type (not integer) */ \
1217                                                                           \
1218   declare_integer_type(CompLevel)                                         \
1219   declare_integer_type(ByteSize)                                          \
1220   declare_integer_type(CodeBlobKind)                                      \
1221   JVMTI_ONLY(declare_toplevel_type(BreakpointInfo))                       \
1222   JVMTI_ONLY(declare_toplevel_type(BreakpointInfo*))                      \
1223   declare_toplevel_type(CodeBlob*)                                        \
1224   declare_toplevel_type(RuntimeBlob*)                                     \
1225   declare_toplevel_type(CompressedWriteStream*)                           \
1226   declare_toplevel_type(ResolvedFieldEntry)                               \
1227   declare_toplevel_type(ResolvedMethodEntry)                              \
1228   declare_toplevel_type(ResolvedIndyEntry)                                \
1229   declare_toplevel_type(elapsedTimer)                                     \
1230   declare_toplevel_type(frame)                                            \
1231   declare_toplevel_type(intptr_t*)                                        \
1232    declare_unsigned_integer_type(InvocationCounter) /* FIXME: wrong type (not integer) */ \
1233   declare_toplevel_type(JavaThread*)                                      \
1234   declare_toplevel_type(JavaThread *const *const)                         \
1235   declare_toplevel_type(java_lang_Class)                                  \
1236   declare_integer_type(JavaThread::TerminatedTypes)                       \
1237   declare_toplevel_type(jbyte*)                                           \
1238   declare_toplevel_type(jbyte**)                                          \
1239   declare_toplevel_type(jint*)                                            \
1240   declare_unsigned_integer_type(juint)                                    \
1241   declare_unsigned_integer_type(julong)                                   \
1242   declare_toplevel_type(JNIHandleBlock*)                                  \
1243   declare_toplevel_type(JNIid)                                            \
1244   declare_toplevel_type(JNIid*)                                           \
1245   declare_toplevel_type(jmethodID*)                                       \
1246   declare_toplevel_type(Mutex)                                            \
1247   declare_toplevel_type(Mutex*)                                           \
1248   declare_toplevel_type(nmethod*)                                         \
1249   declare_toplevel_type(ObjectMonitor*)                                   \
1250   declare_toplevel_type(oop*)                                             \
1251   declare_toplevel_type(OopMapCache*)                                     \
1252   declare_toplevel_type(VMReg)                                            \
1253   declare_toplevel_type(OSThread*)                                        \
1254    declare_integer_type(ReferenceType)                                    \
1255   declare_toplevel_type(StubQueue*)                                       \
1256   declare_toplevel_type(Thread*)                                          \
1257   declare_toplevel_type(Universe)                                         \
1258   declare_toplevel_type(CompressedOops)                                   \
1259   declare_toplevel_type(CompressedKlassPointers)                          \
1260   declare_toplevel_type(os)                                               \
1261   declare_toplevel_type(vframeArray)                                      \
1262   declare_toplevel_type(vframeArrayElement)                               \
1263   declare_toplevel_type(Annotations*)                                     \
1264   declare_toplevel_type(OopMapValue)                                      \
1265   declare_type(FileMapInfo, CHeapObj<mtInternal>)                         \
1266   declare_toplevel_type(FileMapHeader)                                    \
1267   declare_toplevel_type(CDSFileMapRegion)                                 \
1268   declare_toplevel_type(UpcallStub::FrameData)                            \
1269                                                                           \
1270   /************/                                                          \
1271   /* GC types */                                                          \
1272   /************/                                                          \
1273                                                                           \
1274   VM_TYPES_GC(declare_type,                                               \
1275               declare_toplevel_type,                                      \
1276               declare_integer_type)
1277 
1278 //--------------------------------------------------------------------------------
1279 // VM_INT_CONSTANTS
1280 //
1281 // This table contains integer constants required over in the
1282 // serviceability agent. The "declare_constant" macro is used for all
1283 // enums, etc., while "declare_preprocessor_constant" must be used for
1284 // all #defined constants.
1285 
1286 #define VM_INT_CONSTANTS(declare_constant,                                \
1287                          declare_constant_with_value,                     \
1288                          declare_preprocessor_constant)                   \
1289                                                                           \
1290   /****************/                                                      \
1291   /* GC constants */                                                      \
1292   /****************/                                                      \
1293                                                                           \
1294   VM_INT_CONSTANTS_GC(declare_constant,                                   \
1295                       declare_constant_with_value)                        \
1296                                                                           \
1297   /******************/                                                    \
1298   /* Useful globals */                                                    \
1299   /******************/                                                    \
1300                                                                           \
1301   declare_preprocessor_constant("ASSERT", DEBUG_ONLY(1) NOT_DEBUG(0))     \
1302   declare_preprocessor_constant("COMPILER2", COMPILER2_PRESENT(1) NOT_COMPILER2(0)) \
1303                                                                           \
1304   /****************/                                                      \
1305   /* Object sizes */                                                      \
1306   /****************/                                                      \
1307                                                                           \
1308   declare_constant(oopSize)                                               \
1309   declare_constant(LogBytesPerWord)                                       \
1310   declare_constant(BytesPerWord)                                          \
1311   declare_constant(BytesPerLong)                                          \
1312                                                                           \
1313   declare_constant(HeapWordSize)                                          \
1314   declare_constant(LogHeapWordSize)                                       \
1315                                                                           \
1316                                                                           \
1317   /************************/                                              \
1318   /* PerfMemory - jvmstat */                                              \
1319   /************************/                                              \
1320                                                                           \
1321   declare_preprocessor_constant("PERFDATA_MAJOR_VERSION", PERFDATA_MAJOR_VERSION) \
1322   declare_preprocessor_constant("PERFDATA_MINOR_VERSION", PERFDATA_MINOR_VERSION) \
1323   declare_preprocessor_constant("PERFDATA_BIG_ENDIAN", PERFDATA_BIG_ENDIAN)       \
1324   declare_preprocessor_constant("PERFDATA_LITTLE_ENDIAN", PERFDATA_LITTLE_ENDIAN) \
1325                                                                           \
1326                                                                           \
1327   /************************************************************/          \
1328   /* HotSpot specific JVM_ACC constants from global anon enum */          \
1329   /************************************************************/          \
1330                                                                           \
1331   declare_constant(JVM_CONSTANT_Utf8)                                     \
1332   declare_constant(JVM_CONSTANT_Unicode)                                  \
1333   declare_constant(JVM_CONSTANT_Integer)                                  \
1334   declare_constant(JVM_CONSTANT_Float)                                    \
1335   declare_constant(JVM_CONSTANT_Long)                                     \
1336   declare_constant(JVM_CONSTANT_Double)                                   \
1337   declare_constant(JVM_CONSTANT_Class)                                    \
1338   declare_constant(JVM_CONSTANT_String)                                   \
1339   declare_constant(JVM_CONSTANT_Fieldref)                                 \
1340   declare_constant(JVM_CONSTANT_Methodref)                                \
1341   declare_constant(JVM_CONSTANT_InterfaceMethodref)                       \
1342   declare_constant(JVM_CONSTANT_NameAndType)                              \
1343   declare_constant(JVM_CONSTANT_MethodHandle)                             \
1344   declare_constant(JVM_CONSTANT_MethodType)                               \
1345   declare_constant(JVM_CONSTANT_Dynamic)                                  \
1346   declare_constant(JVM_CONSTANT_InvokeDynamic)                            \
1347   declare_constant(JVM_CONSTANT_Module)                                   \
1348   declare_constant(JVM_CONSTANT_Package)                                  \
1349   declare_constant(JVM_CONSTANT_ExternalMax)                              \
1350                                                                           \
1351   declare_constant(JVM_CONSTANT_Invalid)                                  \
1352   declare_constant(JVM_CONSTANT_InternalMin)                              \
1353   declare_constant(JVM_CONSTANT_UnresolvedClass)                          \
1354   declare_constant(JVM_CONSTANT_ClassIndex)                               \
1355   declare_constant(JVM_CONSTANT_StringIndex)                              \
1356   declare_constant(JVM_CONSTANT_UnresolvedClassInError)                   \
1357   declare_constant(JVM_CONSTANT_MethodHandleInError)                      \
1358   declare_constant(JVM_CONSTANT_MethodTypeInError)                        \
1359   declare_constant(JVM_CONSTANT_DynamicInError)                           \
1360   declare_constant(JVM_CONSTANT_InternalMax)                              \
1361                                                                           \
1362   /*******************/                                                   \
1363   /* JavaThreadState */                                                   \
1364   /*******************/                                                   \
1365                                                                           \
1366   declare_constant(_thread_uninitialized)                                 \
1367   declare_constant(_thread_new)                                           \
1368   declare_constant(_thread_new_trans)                                     \
1369   declare_constant(_thread_in_native)                                     \
1370   declare_constant(_thread_in_native_trans)                               \
1371   declare_constant(_thread_in_vm)                                         \
1372   declare_constant(_thread_in_vm_trans)                                   \
1373   declare_constant(_thread_in_Java)                                       \
1374   declare_constant(_thread_in_Java_trans)                                 \
1375   declare_constant(_thread_blocked)                                       \
1376   declare_constant(_thread_blocked_trans)                                 \
1377   declare_constant(JavaThread::_not_terminated)                           \
1378   declare_constant(JavaThread::_thread_exiting)                           \
1379                                                                           \
1380   /*******************/                                                   \
1381   /* JavaThreadState */                                                   \
1382   /*******************/                                                   \
1383                                                                           \
1384   declare_constant(ALLOCATED)                                             \
1385   declare_constant(INITIALIZED)                                           \
1386   declare_constant(RUNNABLE)                                              \
1387   declare_constant(MONITOR_WAIT)                                          \
1388   declare_constant(CONDVAR_WAIT)                                          \
1389   declare_constant(OBJECT_WAIT)                                           \
1390   declare_constant(BREAKPOINTED)                                          \
1391   declare_constant(SLEEPING)                                              \
1392   declare_constant(ZOMBIE)                                                \
1393                                                                           \
1394   /******************************/                                        \
1395   /* Klass misc. enum constants */                                        \
1396   /******************************/                                        \
1397                                                                           \
1398   declare_constant(Klass::_primary_super_limit)                           \
1399   declare_constant(Klass::_lh_neutral_value)                              \
1400   declare_constant(Klass::_lh_instance_slow_path_bit)                     \
1401   declare_constant(Klass::_lh_log2_element_size_shift)                    \
1402   declare_constant(Klass::_lh_log2_element_size_mask)                     \
1403   declare_constant(Klass::_lh_element_type_shift)                         \
1404   declare_constant(Klass::_lh_element_type_mask)                          \
1405   declare_constant(Klass::_lh_header_size_shift)                          \
1406   declare_constant(Klass::_lh_header_size_mask)                           \
1407   declare_constant(Klass::_lh_array_tag_shift)                            \
1408   declare_constant(Klass::_lh_array_tag_type_value)                       \
1409   declare_constant(Klass::_lh_array_tag_obj_value)                        \
1410                                                                           \
1411   declare_constant(Method::nonvirtual_vtable_index)                       \
1412   declare_constant(Method::extra_stack_entries_for_jsr292)                \
1413                                                                           \
1414   /********************************/                                      \
1415   /* ConstMethod anon-enum */                                             \
1416   /********************************/                                      \
1417                                                                           \
1418   declare_constant(ConstMethodFlags::_misc_has_linenumber_table)          \
1419   declare_constant(ConstMethodFlags::_misc_has_checked_exceptions)        \
1420   declare_constant(ConstMethodFlags::_misc_has_localvariable_table)       \
1421   declare_constant(ConstMethodFlags::_misc_has_exception_table)           \
1422   declare_constant(ConstMethodFlags::_misc_has_generic_signature)         \
1423   declare_constant(ConstMethodFlags::_misc_has_method_parameters)         \
1424   declare_constant(ConstMethodFlags::_misc_has_method_annotations)        \
1425   declare_constant(ConstMethodFlags::_misc_has_parameter_annotations)     \
1426   declare_constant(ConstMethodFlags::_misc_has_default_annotations)       \
1427   declare_constant(ConstMethodFlags::_misc_has_type_annotations)          \
1428                                                                           \
1429   /**************/                                                        \
1430   /* DataLayout */                                                        \
1431   /**************/                                                        \
1432                                                                           \
1433   declare_constant(DataLayout::cell_size)                                 \
1434   declare_constant(DataLayout::no_tag)                                    \
1435   declare_constant(DataLayout::bit_data_tag)                              \
1436   declare_constant(DataLayout::counter_data_tag)                          \
1437   declare_constant(DataLayout::jump_data_tag)                             \
1438   declare_constant(DataLayout::receiver_type_data_tag)                    \
1439   declare_constant(DataLayout::virtual_call_data_tag)                     \
1440   declare_constant(DataLayout::ret_data_tag)                              \
1441   declare_constant(DataLayout::branch_data_tag)                           \
1442   declare_constant(DataLayout::multi_branch_data_tag)                     \
1443   declare_constant(DataLayout::arg_info_data_tag)                         \
1444   declare_constant(DataLayout::call_type_data_tag)                        \
1445   declare_constant(DataLayout::virtual_call_type_data_tag)                \
1446   declare_constant(DataLayout::parameters_type_data_tag)                  \
1447   declare_constant(DataLayout::speculative_trap_data_tag)                 \
1448                                                                           \
1449   /*************************************/                                 \
1450   /* InstanceKlass enum                */                                 \
1451   /*************************************/                                 \
1452                                                                           \
1453                                                                           \
1454                                                                           \
1455   /************************************************/                      \
1456   /* InstanceKlass InnerClassAttributeOffset enum */                      \
1457   /************************************************/                      \
1458                                                                           \
1459   declare_constant(InstanceKlass::inner_class_inner_class_info_offset)    \
1460   declare_constant(InstanceKlass::inner_class_outer_class_info_offset)    \
1461   declare_constant(InstanceKlass::inner_class_inner_name_offset)          \
1462   declare_constant(InstanceKlass::inner_class_access_flags_offset)        \
1463   declare_constant(InstanceKlass::inner_class_next_offset)                \
1464                                                                           \
1465   /*****************************************************/                 \
1466   /* InstanceKlass EnclosingMethodAttributeOffset enum */                 \
1467   /*****************************************************/                 \
1468                                                                           \
1469   declare_constant(InstanceKlass::enclosing_method_attribute_size)        \
1470                                                                           \
1471   /*********************************/                                     \
1472   /* InstanceKlass ClassState enum */                                     \
1473   /*********************************/                                     \
1474                                                                           \
1475   declare_constant(InstanceKlass::allocated)                              \
1476   declare_constant(InstanceKlass::loaded)                                 \
1477   declare_constant(InstanceKlass::linked)                                 \
1478   declare_constant(InstanceKlass::being_initialized)                      \
1479   declare_constant(InstanceKlass::fully_initialized)                      \
1480   declare_constant(InstanceKlass::initialization_error)                   \
1481                                                                           \
1482   /*********************************/                                     \
1483   /* Symbol* - symbol max length */                                       \
1484   /*********************************/                                     \
1485                                                                           \
1486   declare_constant(Symbol::max_symbol_length)                             \
1487                                                                           \
1488   /***********************************************/                       \
1489   /* ConstantPool* layout enum for InvokeDynamic */                       \
1490   /***********************************************/                       \
1491                                                                           \
1492   declare_constant(ConstantPool::_indy_bsm_offset)                        \
1493   declare_constant(ConstantPool::_indy_argc_offset)                       \
1494   declare_constant(ConstantPool::_indy_argv_offset)                       \
1495                                                                           \
1496   /***************************************/                               \
1497   /* JavaThreadStatus enum               */                               \
1498   /***************************************/                               \
1499                                                                           \
1500   declare_constant(JavaThreadStatus::NEW)                                 \
1501   declare_constant(JavaThreadStatus::RUNNABLE)                            \
1502   declare_constant(JavaThreadStatus::SLEEPING)                            \
1503   declare_constant(JavaThreadStatus::IN_OBJECT_WAIT)                      \
1504   declare_constant(JavaThreadStatus::IN_OBJECT_WAIT_TIMED)                \
1505   declare_constant(JavaThreadStatus::PARKED)                              \
1506   declare_constant(JavaThreadStatus::PARKED_TIMED)                        \
1507   declare_constant(JavaThreadStatus::BLOCKED_ON_MONITOR_ENTER)            \
1508   declare_constant(JavaThreadStatus::TERMINATED)                          \
1509                                                                           \
1510                                                                           \
1511   /******************************/                                        \
1512   /* FieldFlags enum            */                                        \
1513   /******************************/                                        \
1514                                                                           \
1515   declare_constant(FieldInfo::FieldFlags::_ff_initialized)                \
1516   declare_constant(FieldInfo::FieldFlags::_ff_injected)                   \
1517   declare_constant(FieldInfo::FieldFlags::_ff_generic)                    \
1518   declare_constant(FieldInfo::FieldFlags::_ff_stable)                     \
1519   declare_constant(FieldInfo::FieldFlags::_ff_contended)                  \
1520                                                                           \
1521   /******************************/                                        \
1522   /* Debug info                 */                                        \
1523   /******************************/                                        \
1524                                                                           \
1525   declare_constant(Location::OFFSET_MASK)                                 \
1526   declare_constant(Location::OFFSET_SHIFT)                                \
1527   declare_constant(Location::TYPE_MASK)                                   \
1528   declare_constant(Location::TYPE_SHIFT)                                  \
1529   declare_constant(Location::WHERE_MASK)                                  \
1530   declare_constant(Location::WHERE_SHIFT)                                 \
1531                                                                           \
1532   /* constants from Location::Type enum  */                               \
1533                                                                           \
1534   declare_constant(Location::normal)                                      \
1535   declare_constant(Location::oop)                                         \
1536   declare_constant(Location::narrowoop)                                   \
1537   declare_constant(Location::int_in_long)                                 \
1538   declare_constant(Location::lng)                                         \
1539   declare_constant(Location::float_in_dbl)                                \
1540   declare_constant(Location::dbl)                                         \
1541   declare_constant(Location::addr)                                        \
1542   declare_constant(Location::invalid)                                     \
1543                                                                           \
1544   /* constants from Location::Where enum */                               \
1545                                                                           \
1546   declare_constant(Location::on_stack)                                    \
1547   declare_constant(Location::in_register)                                 \
1548                                                                           \
1549   declare_constant(Deoptimization::Reason_many)                           \
1550   declare_constant(Deoptimization::Reason_none)                           \
1551   declare_constant(Deoptimization::Reason_null_check)                     \
1552   declare_constant(Deoptimization::Reason_null_assert)                    \
1553   declare_constant(Deoptimization::Reason_range_check)                    \
1554   declare_constant(Deoptimization::Reason_class_check)                    \
1555   declare_constant(Deoptimization::Reason_array_check)                    \
1556   declare_constant(Deoptimization::Reason_intrinsic)                      \
1557   declare_constant(Deoptimization::Reason_bimorphic)                      \
1558   declare_constant(Deoptimization::Reason_profile_predicate)              \
1559   declare_constant(Deoptimization::Reason_unloaded)                       \
1560   declare_constant(Deoptimization::Reason_uninitialized)                  \
1561   declare_constant(Deoptimization::Reason_initialized)                    \
1562   declare_constant(Deoptimization::Reason_unreached)                      \
1563   declare_constant(Deoptimization::Reason_unhandled)                      \
1564   declare_constant(Deoptimization::Reason_constraint)                     \
1565   declare_constant(Deoptimization::Reason_div0_check)                     \
1566   declare_constant(Deoptimization::Reason_age)                            \
1567   declare_constant(Deoptimization::Reason_predicate)                      \
1568   declare_constant(Deoptimization::Reason_loop_limit_check)               \
1569   declare_constant(Deoptimization::Reason_auto_vectorization_check)       \
1570   declare_constant(Deoptimization::Reason_speculate_class_check)          \
1571   declare_constant(Deoptimization::Reason_speculate_null_check)           \
1572   declare_constant(Deoptimization::Reason_speculate_null_assert)          \
1573   declare_constant(Deoptimization::Reason_unstable_if)                    \
1574   declare_constant(Deoptimization::Reason_unstable_fused_if)              \
1575   declare_constant(Deoptimization::Reason_receiver_constraint)            \
1576   NOT_ZERO(JVMCI_ONLY(declare_constant(Deoptimization::Reason_aliasing)))                       \
1577   NOT_ZERO(JVMCI_ONLY(declare_constant(Deoptimization::Reason_transfer_to_interpreter)))        \
1578   NOT_ZERO(JVMCI_ONLY(declare_constant(Deoptimization::Reason_not_compiled_exception_handler))) \
1579   NOT_ZERO(JVMCI_ONLY(declare_constant(Deoptimization::Reason_unresolved)))                     \
1580   NOT_ZERO(JVMCI_ONLY(declare_constant(Deoptimization::Reason_jsr_mismatch)))                   \
1581   declare_constant(Deoptimization::Reason_tenured)                        \
1582   declare_constant(Deoptimization::Reason_LIMIT)                          \
1583   declare_constant(Deoptimization::Reason_RECORDED_LIMIT)                 \
1584                                                                           \
1585   declare_constant(Deoptimization::Action_none)                           \
1586   declare_constant(Deoptimization::Action_maybe_recompile)                \
1587   declare_constant(Deoptimization::Action_reinterpret)                    \
1588   declare_constant(Deoptimization::Action_make_not_entrant)               \
1589   declare_constant(Deoptimization::Action_make_not_compilable)            \
1590   declare_constant(Deoptimization::Action_LIMIT)                          \
1591                                                                           \
1592   declare_constant(Deoptimization::Unpack_deopt)                          \
1593   declare_constant(Deoptimization::Unpack_exception)                      \
1594   declare_constant(Deoptimization::Unpack_uncommon_trap)                  \
1595   declare_constant(Deoptimization::Unpack_reexecute)                      \
1596                                                                           \
1597   declare_constant(Deoptimization::_action_bits)                          \
1598   declare_constant(Deoptimization::_reason_bits)                          \
1599   declare_constant(Deoptimization::_debug_id_bits)                        \
1600   declare_constant(Deoptimization::_action_shift)                         \
1601   declare_constant(Deoptimization::_reason_shift)                         \
1602   declare_constant(Deoptimization::_debug_id_shift)                       \
1603                                                                           \
1604   /******************************************/                            \
1605   /* BasicType enum (globalDefinitions.hpp) */                            \
1606   /******************************************/                            \
1607                                                                           \
1608   declare_constant(T_BOOLEAN)                                             \
1609   declare_constant(T_CHAR)                                                \
1610   declare_constant(T_FLOAT)                                               \
1611   declare_constant(T_DOUBLE)                                              \
1612   declare_constant(T_BYTE)                                                \
1613   declare_constant(T_SHORT)                                               \
1614   declare_constant(T_INT)                                                 \
1615   declare_constant(T_LONG)                                                \
1616   declare_constant(T_OBJECT)                                              \
1617   declare_constant(T_ARRAY)                                               \
1618   declare_constant(T_VOID)                                                \
1619   declare_constant(T_ADDRESS)                                             \
1620   declare_constant(T_NARROWOOP)                                           \
1621   declare_constant(T_METADATA)                                            \
1622   declare_constant(T_NARROWKLASS)                                         \
1623   declare_constant(T_CONFLICT)                                            \
1624   declare_constant(T_ILLEGAL)                                             \
1625                                                                           \
1626   /**********************************************/                        \
1627   /* BasicTypeSize enum (globalDefinitions.hpp) */                        \
1628   /**********************************************/                        \
1629                                                                           \
1630   declare_constant(T_BOOLEAN_size)                                        \
1631   declare_constant(T_CHAR_size)                                           \
1632   declare_constant(T_FLOAT_size)                                          \
1633   declare_constant(T_DOUBLE_size)                                         \
1634   declare_constant(T_BYTE_size)                                           \
1635   declare_constant(T_SHORT_size)                                          \
1636   declare_constant(T_INT_size)                                            \
1637   declare_constant(T_LONG_size)                                           \
1638   declare_constant(T_OBJECT_size)                                         \
1639   declare_constant(T_ARRAY_size)                                          \
1640   declare_constant(T_NARROWOOP_size)                                      \
1641   declare_constant(T_NARROWKLASS_size)                                    \
1642   declare_constant(T_VOID_size)                                           \
1643                                                                           \
1644   /**********************************************/                        \
1645   /* LockingMode enum (globalDefinitions.hpp) */                          \
1646   /**********************************************/                        \
1647                                                                           \
1648   declare_constant(LM_MONITOR)                                            \
1649   declare_constant(LM_LEGACY)                                             \
1650   declare_constant(LM_LIGHTWEIGHT)                                        \
1651                                                                           \
1652   /*********************************************/                         \
1653   /* MethodCompilation (globalDefinitions.hpp) */                         \
1654   /*********************************************/                         \
1655                                                                           \
1656   declare_constant(InvocationEntryBci)                                    \
1657                                                                           \
1658   /*************/                                                         \
1659   /* CompLevel */                                                         \
1660   /*************/                                                         \
1661                                                                           \
1662   declare_constant(CompLevel_any)                                         \
1663   declare_constant(CompLevel_all)                                         \
1664   declare_constant(CompLevel_none)                                        \
1665   declare_constant(CompLevel_simple)                                      \
1666   declare_constant(CompLevel_limited_profile)                             \
1667   declare_constant(CompLevel_full_profile)                                \
1668   declare_constant(CompLevel_full_optimization)                           \
1669                                                                           \
1670   /****************/                                                      \
1671   /* CodeBlobKind */                                                      \
1672   /****************/                                                      \
1673                                                                           \
1674   declare_constant(CodeBlobKind::Nmethod)                                 \
1675   declare_constant(CodeBlobKind::Buffer)                                  \
1676   declare_constant(CodeBlobKind::Adapter)                                 \
1677   declare_constant(CodeBlobKind::Vtable)                                  \
1678   declare_constant(CodeBlobKind::MHAdapter)                               \
1679   declare_constant(CodeBlobKind::RuntimeStub)                             \
1680   declare_constant(CodeBlobKind::Deoptimization)                          \
1681   declare_constant(CodeBlobKind::Safepoint)                               \
1682   COMPILER2_PRESENT(declare_constant(CodeBlobKind::Exception))            \
1683   COMPILER2_PRESENT(declare_constant(CodeBlobKind::UncommonTrap))         \
1684   declare_constant(CodeBlobKind::Upcall)                                  \
1685   declare_constant(CodeBlobKind::Number_Of_Kinds)                         \
1686                                                                           \
1687   /***************/                                                       \
1688   /* OopMapValue */                                                       \
1689   /***************/                                                       \
1690                                                                           \
1691   declare_constant(OopMapValue::type_bits)                                \
1692   declare_constant(OopMapValue::register_bits)                            \
1693   declare_constant(OopMapValue::type_shift)                               \
1694   declare_constant(OopMapValue::register_shift)                           \
1695   declare_constant(OopMapValue::type_mask)                                \
1696   declare_constant(OopMapValue::type_mask_in_place)                       \
1697   declare_constant(OopMapValue::register_mask)                            \
1698   declare_constant(OopMapValue::register_mask_in_place)                   \
1699   declare_constant(OopMapValue::unused_value)                             \
1700   declare_constant(OopMapValue::oop_value)                                \
1701   declare_constant(OopMapValue::narrowoop_value)                          \
1702   declare_constant(OopMapValue::callee_saved_value)                       \
1703   declare_constant(OopMapValue::derived_oop_value)                        \
1704                                                                           \
1705   /******************/                                                    \
1706   /* JNIHandleBlock */                                                    \
1707   /******************/                                                    \
1708                                                                           \
1709   declare_constant(JNIHandleBlock::block_size_in_oops)                    \
1710                                                                           \
1711   /**********************/                                                \
1712   /* PcDesc             */                                                \
1713   /**********************/                                                \
1714                                                                           \
1715   declare_constant(PcDesc::PCDESC_reexecute)                              \
1716   declare_constant(PcDesc::PCDESC_is_method_handle_invoke)                \
1717   declare_constant(PcDesc::PCDESC_return_oop)                             \
1718                                                                           \
1719   /**********************/                                                \
1720   /* frame              */                                                \
1721   /**********************/                                                \
1722   NOT_ZERO(PPC64_ONLY(declare_constant(frame::entry_frame_locals_size)))  \
1723                                                                           \
1724   NOT_ZERO(X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset)))      \
1725   declare_constant(frame::pc_return_offset)                               \
1726                                                                           \
1727   /*************/                                                         \
1728   /* vmSymbols */                                                         \
1729   /*************/                                                         \
1730                                                                           \
1731   declare_constant(vmSymbols::FIRST_SID)                                  \
1732   declare_constant(vmSymbols::SID_LIMIT)                                  \
1733                                                                           \
1734   /****************/                                                      \
1735   /* vmIntrinsics */                                                      \
1736   /****************/                                                      \
1737                                                                           \
1738   declare_constant(vmIntrinsics::_invokeBasic)                            \
1739   declare_constant(vmIntrinsics::_linkToVirtual)                          \
1740   declare_constant(vmIntrinsics::_linkToStatic)                           \
1741   declare_constant(vmIntrinsics::_linkToSpecial)                          \
1742   declare_constant(vmIntrinsics::_linkToInterface)                        \
1743   declare_constant(vmIntrinsics::_linkToNative)                           \
1744                                                                           \
1745   /********************************/                                      \
1746   /* Calling convention constants */                                      \
1747   /********************************/                                      \
1748                                                                           \
1749   declare_constant(ConcreteRegisterImpl::number_of_registers)             \
1750   declare_preprocessor_constant("REG_COUNT", REG_COUNT)                   \
1751   COMPILER2_PRESENT(declare_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT)) \
1752   COMPILER2_PRESENT(declare_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT)) \
1753                                                                           \
1754   /************/                                                          \
1755   /* PerfData */                                                          \
1756   /************/                                                          \
1757                                                                           \
1758   /***********************/                                               \
1759   /* PerfData Units enum */                                               \
1760   /***********************/                                               \
1761                                                                           \
1762   declare_constant(PerfData::U_None)                                      \
1763   declare_constant(PerfData::U_Bytes)                                     \
1764   declare_constant(PerfData::U_Ticks)                                     \
1765   declare_constant(PerfData::U_Events)                                    \
1766   declare_constant(PerfData::U_String)                                    \
1767   declare_constant(PerfData::U_Hertz)                                     \
1768                                                                           \
1769   /****************/                                                      \
1770   /* JVMCI */                                                             \
1771   /****************/                                                      \
1772                                                                           \
1773   declare_preprocessor_constant("INCLUDE_JVMCI", INCLUDE_JVMCI)           \
1774                                                                           \
1775   /****************/                                                      \
1776   /*  VMRegImpl   */                                                      \
1777   /****************/                                                      \
1778   declare_constant(VMRegImpl::stack_slot_size)                            \
1779                                                                           \
1780   /******************************/                                        \
1781   /*  -XX flags (value origin)  */                                        \
1782   /******************************/                                        \
1783   declare_constant(JVMFlagOrigin::DEFAULT)                                \
1784   declare_constant(JVMFlagOrigin::COMMAND_LINE)                           \
1785   declare_constant(JVMFlagOrigin::ENVIRON_VAR)                            \
1786   declare_constant(JVMFlagOrigin::CONFIG_FILE)                            \
1787   declare_constant(JVMFlagOrigin::MANAGEMENT)                             \
1788   declare_constant(JVMFlagOrigin::ERGONOMIC)                              \
1789   declare_constant(JVMFlagOrigin::ATTACH_ON_DEMAND)                       \
1790   declare_constant(JVMFlagOrigin::INTERNAL)                               \
1791   declare_constant(JVMFlagOrigin::JIMAGE_RESOURCE)                        \
1792   declare_constant(JVMFlag::VALUE_ORIGIN_MASK)                            \
1793   declare_constant(JVMFlag::WAS_SET_ON_COMMAND_LINE)
1794 
1795 //--------------------------------------------------------------------------------
1796 // VM_LONG_CONSTANTS
1797 //
1798 // This table contains long constants required over in the
1799 // serviceability agent. The "declare_constant" macro is used for all
1800 // enums, etc., while "declare_preprocessor_constant" must be used for
1801 // all #defined constants.
1802 
1803 #define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant) \
1804                                                                           \
1805   /****************/                                                      \
1806   /* GC constants */                                                      \
1807   /****************/                                                      \
1808                                                                           \
1809   VM_LONG_CONSTANTS_GC(declare_constant)                                  \
1810                                                                           \
1811   /*********************/                                                 \
1812   /* markWord constants */                                                \
1813   /*********************/                                                 \
1814                                                                           \
1815   /* Note: some of these are declared as long constants just for */       \
1816   /* consistency. The mask constants are the only ones requiring */       \
1817   /* 64 bits (on 64-bit platforms). */                                    \
1818                                                                           \
1819   declare_constant(markWord::age_bits)                                    \
1820   declare_constant(markWord::lock_bits)                                   \
1821   declare_constant(markWord::max_hash_bits)                               \
1822   declare_constant(markWord::hash_bits)                                   \
1823                                                                           \
1824   declare_constant(markWord::lock_shift)                                  \
1825   declare_constant(markWord::age_shift)                                   \
1826   declare_constant(markWord::hash_shift)                                  \
1827   LP64_ONLY(declare_constant(markWord::klass_shift))                      \
1828                                                                           \
1829   declare_constant(markWord::lock_mask)                                   \
1830   declare_constant(markWord::lock_mask_in_place)                          \
1831   declare_constant(markWord::age_mask)                                    \
1832   declare_constant(markWord::age_mask_in_place)                           \
1833   declare_constant(markWord::hash_mask)                                   \
1834   declare_constant(markWord::hash_mask_in_place)                          \
1835                                                                           \
1836   declare_constant(markWord::locked_value)                                \
1837   declare_constant(markWord::unlocked_value)                              \
1838   declare_constant(markWord::monitor_value)                               \
1839   declare_constant(markWord::marked_value)                                \
1840                                                                           \
1841   declare_constant(markWord::no_hash)                                     \
1842   declare_constant(markWord::no_hash_in_place)                            \
1843   declare_constant(markWord::no_lock_in_place)                            \
1844   declare_constant(markWord::max_age)                                     \
1845                                                                           \
1846   /* InvocationCounter constants */                                       \
1847   declare_constant(InvocationCounter::count_increment)                    \
1848   declare_constant(InvocationCounter::count_shift)                        \
1849                                                                           \
1850   /* ObjectMonitor constants */                                           \
1851   declare_constant(ObjectMonitor::NO_OWNER)                               \
1852   declare_constant(ObjectMonitor::ANONYMOUS_OWNER)                        \
1853   declare_constant(ObjectMonitor::DEFLATER_MARKER)                        \
1854 
1855 //--------------------------------------------------------------------------------
1856 //
1857 
1858 // Generate and check a nonstatic field in non-product builds
1859 #ifndef PRODUCT
1860 # define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1861 # define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)    CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1862 # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)          ENSURE_FIELD_TYPE_PRESENT(a, b, c)
1863 #else
1864 # define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1865 # define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1866 # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)
1867 #endif /* PRODUCT */
1868 
1869 //
1870 // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries
1871 //
1872 
1873 // These initializers are allowed to access private fields in classes
1874 // as long as class VMStructs is a friend
1875 VMStructEntry VMStructs::localHotSpotVMStructs[] = {
1876 
1877   VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
1878              GENERATE_STATIC_VM_STRUCT_ENTRY,
1879              GENERATE_VOLATILE_STATIC_VM_STRUCT_ENTRY,
1880              GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
1881              GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
1882              GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY)
1883 
1884 
1885   VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
1886                 GENERATE_STATIC_VM_STRUCT_ENTRY,
1887                 GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
1888                 GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
1889                 GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY)
1890 
1891   VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
1892                  GENERATE_STATIC_VM_STRUCT_ENTRY,
1893                  GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY,
1894                  GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
1895                  GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY)
1896 
1897   GENERATE_VM_STRUCT_LAST_ENTRY()
1898 };
1899 
1900 size_t VMStructs::localHotSpotVMStructsLength() {
1901   return sizeof(localHotSpotVMStructs) / sizeof(VMStructEntry);
1902 }
1903 
1904 VMTypeEntry VMStructs::localHotSpotVMTypes[] = {
1905 
1906   VM_TYPES(GENERATE_VM_TYPE_ENTRY,
1907            GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
1908            GENERATE_OOP_VM_TYPE_ENTRY,
1909            GENERATE_INTEGER_VM_TYPE_ENTRY,
1910            GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY)
1911 
1912   VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY,
1913               GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
1914               GENERATE_OOP_VM_TYPE_ENTRY,
1915               GENERATE_INTEGER_VM_TYPE_ENTRY,
1916               GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY)
1917 
1918   VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY,
1919                GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
1920                GENERATE_OOP_VM_TYPE_ENTRY,
1921                GENERATE_INTEGER_VM_TYPE_ENTRY,
1922                GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY)
1923 
1924   GENERATE_VM_TYPE_LAST_ENTRY()
1925 };
1926 
1927 size_t VMStructs::localHotSpotVMTypesLength() {
1928   return sizeof(localHotSpotVMTypes) / sizeof(VMTypeEntry);
1929 }
1930 
1931 VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = {
1932 
1933   VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY,
1934                    GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY,
1935                    GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
1936 
1937   VM_INT_CONSTANTS_OS(GENERATE_VM_INT_CONSTANT_ENTRY,
1938                       GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
1939 
1940   VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY,
1941                        GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
1942 
1943 #ifdef VM_INT_CPU_FEATURE_CONSTANTS
1944   VM_INT_CPU_FEATURE_CONSTANTS
1945 #endif
1946 
1947   GENERATE_VM_INT_CONSTANT_LAST_ENTRY()
1948 };
1949 
1950 size_t VMStructs::localHotSpotVMIntConstantsLength() {
1951   return sizeof(localHotSpotVMIntConstants) / sizeof(VMIntConstantEntry);
1952 }
1953 
1954 VMLongConstantEntry VMStructs::localHotSpotVMLongConstants[] = {
1955 
1956   VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY,
1957                     GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
1958 
1959   VM_LONG_CONSTANTS_OS(GENERATE_VM_LONG_CONSTANT_ENTRY,
1960                        GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
1961 
1962   VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY,
1963                         GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY)
1964 
1965 #ifdef VM_LONG_CPU_FEATURE_CONSTANTS
1966   VM_LONG_CPU_FEATURE_CONSTANTS
1967 #endif
1968 
1969   GENERATE_VM_LONG_CONSTANT_LAST_ENTRY()
1970 };
1971 
1972 size_t VMStructs::localHotSpotVMLongConstantsLength() {
1973   return sizeof(localHotSpotVMLongConstants) / sizeof(VMLongConstantEntry);
1974 }
1975 
1976 extern "C" {
1977 
1978 #define STRIDE(array) ((char*)&array[1] - (char*)&array[0])
1979 
1980 JNIEXPORT VMStructEntry* gHotSpotVMStructs = VMStructs::localHotSpotVMStructs;
1981 JNIEXPORT uint64_t gHotSpotVMStructEntryTypeNameOffset = offset_of(VMStructEntry, typeName);
1982 JNIEXPORT uint64_t gHotSpotVMStructEntryFieldNameOffset = offset_of(VMStructEntry, fieldName);
1983 JNIEXPORT uint64_t gHotSpotVMStructEntryTypeStringOffset = offset_of(VMStructEntry, typeString);
1984 JNIEXPORT uint64_t gHotSpotVMStructEntryIsStaticOffset = offset_of(VMStructEntry, isStatic);
1985 JNIEXPORT uint64_t gHotSpotVMStructEntryOffsetOffset = offset_of(VMStructEntry, offset);
1986 JNIEXPORT uint64_t gHotSpotVMStructEntryAddressOffset = offset_of(VMStructEntry, address);
1987 JNIEXPORT uint64_t gHotSpotVMStructEntryArrayStride = STRIDE(gHotSpotVMStructs);
1988 
1989 JNIEXPORT VMTypeEntry* gHotSpotVMTypes = VMStructs::localHotSpotVMTypes;
1990 JNIEXPORT uint64_t gHotSpotVMTypeEntryTypeNameOffset = offset_of(VMTypeEntry, typeName);
1991 JNIEXPORT uint64_t gHotSpotVMTypeEntrySuperclassNameOffset = offset_of(VMTypeEntry, superclassName);
1992 JNIEXPORT uint64_t gHotSpotVMTypeEntryIsOopTypeOffset = offset_of(VMTypeEntry, isOopType);
1993 JNIEXPORT uint64_t gHotSpotVMTypeEntryIsIntegerTypeOffset = offset_of(VMTypeEntry, isIntegerType);
1994 JNIEXPORT uint64_t gHotSpotVMTypeEntryIsUnsignedOffset = offset_of(VMTypeEntry, isUnsigned);
1995 JNIEXPORT uint64_t gHotSpotVMTypeEntrySizeOffset = offset_of(VMTypeEntry, size);
1996 JNIEXPORT uint64_t gHotSpotVMTypeEntryArrayStride = STRIDE(gHotSpotVMTypes);
1997 
1998 JNIEXPORT VMIntConstantEntry* gHotSpotVMIntConstants = VMStructs::localHotSpotVMIntConstants;
1999 JNIEXPORT uint64_t gHotSpotVMIntConstantEntryNameOffset = offset_of(VMIntConstantEntry, name);
2000 JNIEXPORT uint64_t gHotSpotVMIntConstantEntryValueOffset = offset_of(VMIntConstantEntry, value);
2001 JNIEXPORT uint64_t gHotSpotVMIntConstantEntryArrayStride = STRIDE(gHotSpotVMIntConstants);
2002 
2003 JNIEXPORT VMLongConstantEntry* gHotSpotVMLongConstants = VMStructs::localHotSpotVMLongConstants;
2004 JNIEXPORT uint64_t gHotSpotVMLongConstantEntryNameOffset = offset_of(VMLongConstantEntry, name);
2005 JNIEXPORT uint64_t gHotSpotVMLongConstantEntryValueOffset = offset_of(VMLongConstantEntry, value);
2006 JNIEXPORT uint64_t gHotSpotVMLongConstantEntryArrayStride = STRIDE(gHotSpotVMLongConstants);
2007 } // "C"
2008 
2009 #ifdef ASSERT
2010 // This is used both to check the types of referenced fields and
2011 // to ensure that all of the field types are present.
2012 void VMStructs::init() {
2013   VM_STRUCTS(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2014              CHECK_STATIC_VM_STRUCT_ENTRY,
2015              CHECK_VOLATILE_STATIC_VM_STRUCT_ENTRY,
2016              CHECK_NO_OP,
2017              CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
2018              CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY)
2019 
2020   VM_STRUCTS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2021                  CHECK_STATIC_VM_STRUCT_ENTRY,
2022                  CHECK_NO_OP,
2023                  CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
2024                  CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY)
2025 
2026   VM_TYPES(CHECK_VM_TYPE_ENTRY,
2027            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2028            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2029            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2030            CHECK_SINGLE_ARG_VM_TYPE_NO_OP)
2031 
2032 
2033   VM_TYPES_CPU(CHECK_VM_TYPE_ENTRY,
2034                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2035                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2036                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2037                CHECK_SINGLE_ARG_VM_TYPE_NO_OP)
2038 
2039   //
2040   // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0
2041   // to build with the source mounted over SNC3.2. Symptom was that
2042   // debug build failed with an internal compiler error. Has been seen
2043   // mounting sources from Solaris 2.6 and 2.7 hosts, but so far not
2044   // 2.8 hosts. Appears to occur because line is too long.
2045   //
2046   // If an assertion failure is triggered here it means that an entry
2047   // in VMStructs::localHotSpotVMStructs[] was not found in
2048   // VMStructs::localHotSpotVMTypes[]. (The assertion itself had to be
2049   // made less descriptive because of this above bug -- see the
2050   // definition of ENSURE_FIELD_TYPE_PRESENT.)
2051   //
2052   // NOTE: taken out because this was just not working on everyone's
2053   // Solstice NFS setup. If everyone switches to local workspaces on
2054   // Win32, we can put this back in.
2055 #ifndef _WINDOWS
2056   VM_STRUCTS(ENSURE_FIELD_TYPE_PRESENT,
2057              CHECK_NO_OP,
2058              CHECK_NO_OP,
2059              CHECK_NO_OP,
2060              CHECK_NO_OP,
2061              CHECK_NO_OP)
2062 
2063   VM_STRUCTS(CHECK_NO_OP,
2064              ENSURE_FIELD_TYPE_PRESENT,
2065              ENSURE_FIELD_TYPE_PRESENT,
2066              CHECK_NO_OP,
2067              ENSURE_FIELD_TYPE_PRESENT,
2068              ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT)
2069 
2070   VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT,
2071                  ENSURE_FIELD_TYPE_PRESENT,
2072                  CHECK_NO_OP,
2073                  ENSURE_FIELD_TYPE_PRESENT,
2074                  ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT)
2075 #endif // !_WINDOWS
2076 }
2077 
2078 static int recursiveFindType(VMTypeEntry* origtypes, const char* typeName, bool isRecurse) {
2079   {
2080     VMTypeEntry* types = origtypes;
2081     while (types->typeName != nullptr) {
2082       if (strcmp(typeName, types->typeName) == 0) {
2083         // Found it
2084         return 1;
2085       }
2086       ++types;
2087     }
2088   }
2089   // Search for the base type by peeling off const and *
2090   size_t len = strlen(typeName);
2091   if (typeName[len-1] == '*') {
2092     char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal);
2093     strncpy(s, typeName, len - 1);
2094     s[len-1] = '\0';
2095     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2096     if (recursiveFindType(origtypes, s, true) == 1) {
2097       FREE_C_HEAP_ARRAY(char, s);
2098       return 1;
2099     }
2100     FREE_C_HEAP_ARRAY(char, s);
2101   }
2102   const char* start = nullptr;
2103   if (strstr(typeName, "GrowableArray<") == typeName) {
2104     start = typeName + strlen("GrowableArray<");
2105   } else if (strstr(typeName, "Array<") == typeName) {
2106     start = typeName + strlen("Array<");
2107   }
2108   if (start != nullptr) {
2109     const char * end = strrchr(typeName, '>');
2110     int len = pointer_delta_as_int(end, start) + 1;
2111     char * s = NEW_C_HEAP_ARRAY(char, len, mtInternal);
2112     strncpy(s, start, len - 1);
2113     s[len-1] = '\0';
2114     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2115     if (recursiveFindType(origtypes, s, true) == 1) {
2116       FREE_C_HEAP_ARRAY(char, s);
2117       return 1;
2118     }
2119     FREE_C_HEAP_ARRAY(char, s);
2120   }
2121   if (strstr(typeName, "const ") == typeName) {
2122     const char * s = typeName + strlen("const ");
2123     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2124     if (recursiveFindType(origtypes, s, true) == 1) {
2125       return 1;
2126     }
2127   }
2128   if (strstr(typeName, " const") == typeName + len - 6) {
2129     char * s = os::strdup_check_oom(typeName);
2130     s[len - 6] = '\0';
2131     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2132     if (recursiveFindType(origtypes, s, true) == 1) {
2133       os::free(s);
2134       return 1;
2135     }
2136     os::free(s);
2137   }
2138   if (!isRecurse) {
2139     tty->print_cr("type \"%s\" not found", typeName);
2140   }
2141   return 0;
2142 }
2143 
2144 int VMStructs::findType(const char* typeName) {
2145   VMTypeEntry* types = gHotSpotVMTypes;
2146 
2147   return recursiveFindType(types, typeName, false);
2148 }
2149 
2150 void vmStructs_init() {
2151   VMStructs::init();
2152 }
2153 #endif // ASSERT