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