1 /*
   2  * Copyright (c) 2000, 2011, 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 "precompiled.hpp"
  26 #include "classfile/dictionary.hpp"
  27 #include "classfile/javaClasses.hpp"
  28 #include "classfile/loaderConstraints.hpp"
  29 #include "classfile/placeholders.hpp"
  30 #include "classfile/symbolTable.hpp"
  31 #include "classfile/systemDictionary.hpp"
  32 #include "code/codeBlob.hpp"
  33 #include "code/codeCache.hpp"
  34 #include "code/compressedStream.hpp"
  35 #include "code/location.hpp"
  36 #include "code/nmethod.hpp"
  37 #include "code/pcDesc.hpp"
  38 #include "code/stubs.hpp"
  39 #include "code/vmreg.hpp"
  40 #include "compiler/oopMap.hpp"
  41 #include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
  42 #include "gc_implementation/shared/immutableSpace.hpp"
  43 #include "gc_implementation/shared/markSweep.hpp"
  44 #include "gc_implementation/shared/mutableSpace.hpp"
  45 #include "gc_interface/collectedHeap.hpp"
  46 #include "interpreter/bytecodeInterpreter.hpp"
  47 #include "interpreter/bytecodes.hpp"
  48 #include "interpreter/interpreter.hpp"
  49 #include "memory/cardTableRS.hpp"
  50 #include "memory/compactPermGen.hpp"
  51 #include "memory/defNewGeneration.hpp"
  52 #include "memory/genCollectedHeap.hpp"
  53 #include "memory/generation.hpp"
  54 #include "memory/generationSpec.hpp"
  55 #include "memory/heap.hpp"
  56 #include "memory/permGen.hpp"
  57 #include "memory/space.hpp"
  58 #include "memory/tenuredGeneration.hpp"
  59 #include "memory/universe.hpp"
  60 #include "memory/watermark.hpp"
  61 #include "oops/arrayKlass.hpp"
  62 #include "oops/arrayKlassKlass.hpp"
  63 #include "oops/arrayOop.hpp"
  64 #include "oops/compiledICHolderKlass.hpp"
  65 #include "oops/compiledICHolderOop.hpp"
  66 #include "oops/constMethodKlass.hpp"
  67 #include "oops/constMethodOop.hpp"
  68 #include "oops/constantPoolKlass.hpp"
  69 #include "oops/constantPoolOop.hpp"
  70 #include "oops/cpCacheKlass.hpp"
  71 #include "oops/cpCacheOop.hpp"
  72 #include "oops/instanceKlass.hpp"
  73 #include "oops/instanceKlassKlass.hpp"
  74 #include "oops/instanceOop.hpp"
  75 #include "oops/klass.hpp"
  76 #include "oops/klassOop.hpp"
  77 #include "oops/markOop.hpp"
  78 #include "oops/methodDataKlass.hpp"
  79 #include "oops/methodDataOop.hpp"
  80 #include "oops/methodKlass.hpp"
  81 #include "oops/methodOop.hpp"
  82 #include "oops/objArrayKlass.hpp"
  83 #include "oops/objArrayKlassKlass.hpp"
  84 #include "oops/objArrayOop.hpp"
  85 #include "oops/oop.inline.hpp"
  86 #include "oops/symbol.hpp"
  87 #include "oops/typeArrayKlass.hpp"
  88 #include "oops/typeArrayKlassKlass.hpp"
  89 #include "oops/typeArrayOop.hpp"
  90 #include "prims/jvmtiAgentThread.hpp"
  91 #include "runtime/arguments.hpp"
  92 #include "runtime/globals.hpp"
  93 #include "runtime/java.hpp"
  94 #include "runtime/javaCalls.hpp"
  95 #include "runtime/perfMemory.hpp"
  96 #include "runtime/serviceThread.hpp"
  97 #include "runtime/sharedRuntime.hpp"
  98 #include "runtime/stubRoutines.hpp"
  99 #include "runtime/virtualspace.hpp"
 100 #include "runtime/vmStructs.hpp"
 101 #include "utilities/globalDefinitions.hpp"
 102 #include "utilities/hashtable.hpp"
 103 #ifdef TARGET_ARCH_x86
 104 # include "vmStructs_x86.hpp"
 105 #endif
 106 #ifdef TARGET_ARCH_sparc
 107 # include "vmStructs_sparc.hpp"
 108 #endif
 109 #ifdef TARGET_ARCH_zero
 110 # include "vmStructs_zero.hpp"
 111 #endif
 112 #ifdef TARGET_ARCH_arm
 113 # include "vmStructs_arm.hpp"
 114 #endif
 115 #ifdef TARGET_ARCH_ppc
 116 # include "vmStructs_ppc.hpp"
 117 #endif
 118 #ifdef TARGET_OS_FAMILY_linux
 119 # include "thread_linux.inline.hpp"
 120 #endif
 121 #ifdef TARGET_OS_FAMILY_solaris
 122 # include "thread_solaris.inline.hpp"
 123 #endif
 124 #ifdef TARGET_OS_FAMILY_windows
 125 # include "thread_windows.inline.hpp"
 126 #endif
 127 #ifdef TARGET_OS_ARCH_linux_x86
 128 # include "vmStructs_linux_x86.hpp"
 129 #endif
 130 #ifdef TARGET_OS_ARCH_linux_sparc
 131 # include "vmStructs_linux_sparc.hpp"
 132 #endif
 133 #ifdef TARGET_OS_ARCH_linux_zero
 134 # include "vmStructs_linux_zero.hpp"
 135 #endif
 136 #ifdef TARGET_OS_ARCH_solaris_x86
 137 # include "vmStructs_solaris_x86.hpp"
 138 #endif
 139 #ifdef TARGET_OS_ARCH_solaris_sparc
 140 # include "vmStructs_solaris_sparc.hpp"
 141 #endif
 142 #ifdef TARGET_OS_ARCH_windows_x86
 143 # include "vmStructs_windows_x86.hpp"
 144 #endif
 145 #ifdef TARGET_OS_ARCH_linux_arm
 146 # include "vmStructs_linux_arm.hpp"
 147 #endif
 148 #ifdef TARGET_OS_ARCH_linux_ppc
 149 # include "vmStructs_linux_ppc.hpp"
 150 #endif
 151 #ifndef SERIALGC
 152 #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
 153 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
 154 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
 155 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
 156 #include "gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp"
 157 #include "gc_implementation/parNew/parNewGeneration.hpp"
 158 #include "gc_implementation/parNew/vmStructs_parNew.hpp"
 159 #include "gc_implementation/parallelScavenge/asPSOldGen.hpp"
 160 #include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"
 161 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
 162 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
 163 #include "gc_implementation/parallelScavenge/psPermGen.hpp"
 164 #include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
 165 #include "gc_implementation/parallelScavenge/psYoungGen.hpp"
 166 #include "gc_implementation/parallelScavenge/vmStructs_parallelgc.hpp"
 167 #endif
 168 #ifdef COMPILER2
 169 #include "opto/matcher.hpp"
 170 #ifdef TARGET_ARCH_MODEL_x86_32
 171 # include "adfiles/adGlobals_x86_32.hpp"
 172 #endif
 173 #ifdef TARGET_ARCH_MODEL_x86_64
 174 # include "adfiles/adGlobals_x86_64.hpp"
 175 #endif
 176 #ifdef TARGET_ARCH_MODEL_sparc
 177 # include "adfiles/adGlobals_sparc.hpp"
 178 #endif
 179 #ifdef TARGET_ARCH_MODEL_zero
 180 # include "adfiles/adGlobals_zero.hpp"
 181 #endif
 182 #ifdef TARGET_ARCH_MODEL_arm
 183 # include "adfiles/adGlobals_arm.hpp"
 184 #endif
 185 #ifdef TARGET_ARCH_MODEL_ppc
 186 # include "adfiles/adGlobals_ppc.hpp"
 187 #endif
 188 #endif
 189 
 190 // Note: the cross-product of (c1, c2, product, nonproduct, ...),
 191 // (nonstatic, static), and (unchecked, checked) has not been taken.
 192 // Only the macros currently needed have been defined.
 193 
 194 // A field whose type is not checked is given a null string as the
 195 // type name, indicating an "opaque" type to the serviceability agent.
 196 
 197 // NOTE: there is an interdependency between this file and
 198 // HotSpotTypeDataBase.java, which parses the type strings.
 199 
 200 #ifndef REG_COUNT
 201   #define REG_COUNT 0
 202 #endif
 203 
 204 // whole purpose of this function is to work around bug c++/27724 in gcc 4.1.1
 205 // with optimization turned on it doesn't affect produced code
 206 static inline uint64_t cast_uint64_t(size_t x)
 207 {
 208   return x;
 209 }
 210 
 211 
 212 //--------------------------------------------------------------------------------
 213 // VM_STRUCTS
 214 //
 215 // This list enumerates all of the fields the serviceability agent
 216 // needs to know about. Be sure to see also the type table below this one.
 217 // NOTE that there are platform-specific additions to this table in
 218 // vmStructs_<os>_<cpu>.hpp.
 219 
 220 #define VM_STRUCTS(nonstatic_field, \
 221                    static_field, \
 222                    unchecked_nonstatic_field, \
 223                    volatile_nonstatic_field, \
 224                    nonproduct_nonstatic_field, \
 225                    c1_nonstatic_field, \
 226                    c2_nonstatic_field, \
 227                    unchecked_c1_static_field, \
 228                    unchecked_c2_static_field, \
 229                    last_entry) \
 230                                                                                                                                      \
 231   /******************************************************************/                                                               \
 232   /* OopDesc and Klass hierarchies (NOTE: methodDataOop incomplete) */                                                               \
 233   /******************************************************************/                                                               \
 234                                                                                                                                      \
 235   volatile_nonstatic_field(oopDesc,            _mark,                                         markOop)                               \
 236   volatile_nonstatic_field(oopDesc,            _metadata._klass,                              wideKlassOop)                          \
 237   volatile_nonstatic_field(oopDesc,            _metadata._compressed_klass,                   narrowOop)                             \
 238      static_field(oopDesc,                     _bs,                                           BarrierSet*)                           \
 239   nonstatic_field(arrayKlass,                  _dimension,                                    int)                                   \
 240   volatile_nonstatic_field(arrayKlass,         _higher_dimension,                             klassOop)                              \
 241   volatile_nonstatic_field(arrayKlass,         _lower_dimension,                              klassOop)                              \
 242   nonstatic_field(arrayKlass,                  _vtable_len,                                   int)                                   \
 243   nonstatic_field(arrayKlass,                  _alloc_size,                                   juint)                                 \
 244   nonstatic_field(arrayKlass,                  _component_mirror,                             oop)                                   \
 245   nonstatic_field(compiledICHolderKlass,       _alloc_size,                                   juint)                                 \
 246   nonstatic_field(compiledICHolderOopDesc,     _holder_method,                                methodOop)                             \
 247   nonstatic_field(compiledICHolderOopDesc,     _holder_klass,                                 klassOop)                              \
 248   nonstatic_field(constantPoolOopDesc,         _tags,                                         typeArrayOop)                          \
 249   nonstatic_field(constantPoolOopDesc,         _cache,                                        constantPoolCacheOop)                  \
 250   nonstatic_field(constantPoolOopDesc,         _pool_holder,                                  klassOop)                              \
 251   nonstatic_field(constantPoolOopDesc,         _operands,                                     typeArrayOop)                          \
 252   nonstatic_field(constantPoolOopDesc,         _length,                                       int)                                   \
 253   nonstatic_field(constantPoolCacheOopDesc,    _length,                                       int)                                   \
 254   nonstatic_field(constantPoolCacheOopDesc,    _constant_pool,                                constantPoolOop)                       \
 255   nonstatic_field(instanceKlass,               _array_klasses,                                klassOop)                              \
 256   nonstatic_field(instanceKlass,               _methods,                                      objArrayOop)                           \
 257   nonstatic_field(instanceKlass,               _method_ordering,                              typeArrayOop)                          \
 258   nonstatic_field(instanceKlass,               _local_interfaces,                             objArrayOop)                           \
 259   nonstatic_field(instanceKlass,               _transitive_interfaces,                        objArrayOop)                           \
 260   nonstatic_field(instanceKlass,               _nof_implementors,                             int)                                   \
 261   nonstatic_field(instanceKlass,               _implementors[0],                              klassOop)                              \
 262   nonstatic_field(instanceKlass,               _fields,                                       typeArrayOop)                          \
 263   nonstatic_field(instanceKlass,               _constants,                                    constantPoolOop)                       \
 264   nonstatic_field(instanceKlass,               _class_loader,                                 oop)                                   \
 265   nonstatic_field(instanceKlass,               _protection_domain,                            oop)                                   \
 266   nonstatic_field(instanceKlass,               _signers,                                      objArrayOop)                           \
 267   nonstatic_field(instanceKlass,               _source_file_name,                             Symbol*)                               \
 268   nonstatic_field(instanceKlass,               _source_debug_extension,                       Symbol*)                               \
 269   nonstatic_field(instanceKlass,               _inner_classes,                                typeArrayOop)                          \
 270   nonstatic_field(instanceKlass,               _nonstatic_field_size,                         int)                                   \
 271   nonstatic_field(instanceKlass,               _static_field_size,                            int)                                   \
 272   nonstatic_field(instanceKlass,               _static_oop_field_size,                        int)                                   \
 273   nonstatic_field(instanceKlass,               _nonstatic_oop_map_size,                       int)                                   \
 274   nonstatic_field(instanceKlass,               _is_marked_dependent,                          bool)                                  \
 275   nonstatic_field(instanceKlass,               _minor_version,                                u2)                                    \
 276   nonstatic_field(instanceKlass,               _major_version,                                u2)                                    \
 277   nonstatic_field(instanceKlass,               _init_state,                                   instanceKlass::ClassState)             \
 278   nonstatic_field(instanceKlass,               _init_thread,                                  Thread*)                               \
 279   nonstatic_field(instanceKlass,               _vtable_len,                                   int)                                   \
 280   nonstatic_field(instanceKlass,               _itable_len,                                   int)                                   \
 281   nonstatic_field(instanceKlass,               _reference_type,                               ReferenceType)                         \
 282   volatile_nonstatic_field(instanceKlass,      _oop_map_cache,                                OopMapCache*)                          \
 283   nonstatic_field(instanceKlass,               _jni_ids,                                      JNIid*)                                \
 284   nonstatic_field(instanceKlass,               _osr_nmethods_head,                            nmethod*)                              \
 285   nonstatic_field(instanceKlass,               _breakpoints,                                  BreakpointInfo*)                       \
 286   nonstatic_field(instanceKlass,               _generic_signature,                            Symbol*)                               \
 287   nonstatic_field(instanceKlass,               _methods_jmethod_ids,                          jmethodID*)                            \
 288   nonstatic_field(instanceKlass,               _methods_cached_itable_indices,                int*)                                  \
 289   volatile_nonstatic_field(instanceKlass,      _idnum_allocated_count,                        u2)                                    \
 290   nonstatic_field(instanceKlass,               _class_annotations,                            typeArrayOop)                          \
 291   nonstatic_field(instanceKlass,               _fields_annotations,                           objArrayOop)                           \
 292   nonstatic_field(instanceKlass,               _methods_annotations,                          objArrayOop)                           \
 293   nonstatic_field(instanceKlass,               _methods_parameter_annotations,                objArrayOop)                           \
 294   nonstatic_field(instanceKlass,               _methods_default_annotations,                  objArrayOop)                           \
 295   nonstatic_field(Klass,                       _super_check_offset,                           juint)                                 \
 296   nonstatic_field(Klass,                       _secondary_super_cache,                        klassOop)                              \
 297   nonstatic_field(Klass,                       _secondary_supers,                             objArrayOop)                           \
 298   nonstatic_field(Klass,                       _primary_supers[0],                            klassOop)                              \
 299   nonstatic_field(Klass,                       _java_mirror,                                  oop)                                   \
 300   nonstatic_field(Klass,                       _modifier_flags,                               jint)                                  \
 301   nonstatic_field(Klass,                       _super,                                        klassOop)                              \
 302   nonstatic_field(Klass,                       _layout_helper,                                jint)                                  \
 303   nonstatic_field(Klass,                       _name,                                         Symbol*)                               \
 304   nonstatic_field(Klass,                       _access_flags,                                 AccessFlags)                           \
 305   nonstatic_field(Klass,                       _subklass,                                     klassOop)                              \
 306   nonstatic_field(Klass,                       _next_sibling,                                 klassOop)                              \
 307   nonproduct_nonstatic_field(Klass,            _verify_count,                                 int)                                   \
 308   nonstatic_field(Klass,                       _alloc_count,                                  juint)                                 \
 309   nonstatic_field(klassKlass,                  _alloc_size,                                   juint)                                 \
 310   nonstatic_field(methodKlass,                 _alloc_size,                                   juint)                                 \
 311   nonstatic_field(methodDataOopDesc,           _size,                                         int)                                   \
 312   nonstatic_field(methodDataOopDesc,           _method,                                       methodOop)                             \
 313   nonstatic_field(methodOopDesc,               _constMethod,                                  constMethodOop)                        \
 314   nonstatic_field(methodOopDesc,               _constants,                                    constantPoolOop)                       \
 315   c2_nonstatic_field(methodOopDesc,            _method_data,                                  methodDataOop)                         \
 316   c2_nonstatic_field(methodOopDesc,            _interpreter_invocation_count,                 int)                                   \
 317   nonstatic_field(methodOopDesc,               _access_flags,                                 AccessFlags)                           \
 318   nonstatic_field(methodOopDesc,               _vtable_index,                                 int)                                   \
 319   nonstatic_field(methodOopDesc,               _method_size,                                  u2)                                    \
 320   nonstatic_field(methodOopDesc,               _max_stack,                                    u2)                                    \
 321   nonstatic_field(methodOopDesc,               _max_locals,                                   u2)                                    \
 322   nonstatic_field(methodOopDesc,               _size_of_parameters,                           u2)                                    \
 323   c2_nonstatic_field(methodOopDesc,            _interpreter_throwout_count,                   u2)                                    \
 324   nonstatic_field(methodOopDesc,               _number_of_breakpoints,                        u2)                                    \
 325   nonstatic_field(methodOopDesc,               _invocation_counter,                           InvocationCounter)                     \
 326   nonstatic_field(methodOopDesc,               _backedge_counter,                             InvocationCounter)                     \
 327   nonproduct_nonstatic_field(methodOopDesc,    _compiled_invocation_count,                    int)                                   \
 328   volatile_nonstatic_field(methodOopDesc,      _code,                                         nmethod*)                              \
 329   nonstatic_field(methodOopDesc,               _i2i_entry,                                    address)                               \
 330   nonstatic_field(methodOopDesc,               _adapter,                                      AdapterHandlerEntry*)                  \
 331   volatile_nonstatic_field(methodOopDesc,      _from_compiled_entry,                          address)                               \
 332   volatile_nonstatic_field(methodOopDesc,      _from_interpreted_entry,                       address)                               \
 333   volatile_nonstatic_field(constMethodOopDesc, _fingerprint,                                  uint64_t)                              \
 334   nonstatic_field(constMethodOopDesc,          _method,                                       methodOop)                             \
 335   nonstatic_field(constMethodOopDesc,          _stackmap_data,                                typeArrayOop)                          \
 336   nonstatic_field(constMethodOopDesc,          _exception_table,                              typeArrayOop)                          \
 337   nonstatic_field(constMethodOopDesc,          _constMethod_size,                             int)                                   \
 338   nonstatic_field(constMethodOopDesc,          _interpreter_kind,                             jbyte)                                 \
 339   nonstatic_field(constMethodOopDesc,          _flags,                                        jbyte)                                 \
 340   nonstatic_field(constMethodOopDesc,          _code_size,                                    u2)                                    \
 341   nonstatic_field(constMethodOopDesc,          _name_index,                                   u2)                                    \
 342   nonstatic_field(constMethodOopDesc,          _signature_index,                              u2)                                    \
 343   nonstatic_field(constMethodOopDesc,          _method_idnum,                                 u2)                                    \
 344   nonstatic_field(constMethodOopDesc,          _generic_signature_index,                      u2)                                    \
 345   nonstatic_field(objArrayKlass,               _element_klass,                                klassOop)                              \
 346   nonstatic_field(objArrayKlass,               _bottom_klass,                                 klassOop)                              \
 347   volatile_nonstatic_field(Symbol,             _refcount,                                     int)                                   \
 348   nonstatic_field(Symbol,                      _identity_hash,                                int)                                   \
 349   nonstatic_field(Symbol,                      _length,                                       unsigned short)                        \
 350   unchecked_nonstatic_field(Symbol,            _body,                                         sizeof(jbyte)) /* NOTE: no type */     \
 351   nonstatic_field(typeArrayKlass,              _max_length,                                   int)                                   \
 352                                                                                                                                      \
 353   /***********************/                                                                                                          \
 354   /* Constant Pool Cache */                                                                                                          \
 355   /***********************/                                                                                                          \
 356                                                                                                                                      \
 357   volatile_nonstatic_field(ConstantPoolCacheEntry,      _indices,                                      intx)                         \
 358   volatile_nonstatic_field(ConstantPoolCacheEntry,      _f1,                                           oop)                          \
 359   volatile_nonstatic_field(ConstantPoolCacheEntry,      _f2,                                           intx)                         \
 360   volatile_nonstatic_field(ConstantPoolCacheEntry,      _flags,                                        intx)                         \
 361                                                                                                                                      \
 362   /********************************/                                                                                                 \
 363   /* MethodOop-related structures */                                                                                                 \
 364   /********************************/                                                                                                 \
 365                                                                                                                                      \
 366   nonstatic_field(CheckedExceptionElement,     class_cp_index,                                u2)                                    \
 367   nonstatic_field(LocalVariableTableElement,   start_bci,                                     u2)                                    \
 368   nonstatic_field(LocalVariableTableElement,   length,                                        u2)                                    \
 369   nonstatic_field(LocalVariableTableElement,   name_cp_index,                                 u2)                                    \
 370   nonstatic_field(LocalVariableTableElement,   descriptor_cp_index,                           u2)                                    \
 371   nonstatic_field(LocalVariableTableElement,   signature_cp_index,                            u2)                                    \
 372   nonstatic_field(LocalVariableTableElement,   slot,                                          u2)                                    \
 373   nonstatic_field(BreakpointInfo,              _orig_bytecode,                                Bytecodes::Code)                       \
 374   nonstatic_field(BreakpointInfo,              _bci,                                          int)                                   \
 375   nonstatic_field(BreakpointInfo,              _name_index,                                   u2)                                    \
 376   nonstatic_field(BreakpointInfo,              _signature_index,                              u2)                                    \
 377   nonstatic_field(BreakpointInfo,              _next,                                         BreakpointInfo*)                       \
 378   /***********/                                                                                                                      \
 379   /* JNI IDs */                                                                                                                      \
 380   /***********/                                                                                                                      \
 381                                                                                                                                      \
 382   nonstatic_field(JNIid,                       _holder,                                       klassOop)                              \
 383   nonstatic_field(JNIid,                       _next,                                         JNIid*)                                \
 384   nonstatic_field(JNIid,                       _offset,                                       int)                                   \
 385   /************/                                                                                                                     \
 386   /* Universe */                                                                                                                     \
 387   /************/                                                                                                                     \
 388                                                                                                                                      \
 389      static_field(Universe,                    _boolArrayKlassObj,                            klassOop)                              \
 390      static_field(Universe,                    _byteArrayKlassObj,                            klassOop)                              \
 391      static_field(Universe,                    _charArrayKlassObj,                            klassOop)                              \
 392      static_field(Universe,                    _intArrayKlassObj,                             klassOop)                              \
 393      static_field(Universe,                    _shortArrayKlassObj,                           klassOop)                              \
 394      static_field(Universe,                    _longArrayKlassObj,                            klassOop)                              \
 395      static_field(Universe,                    _singleArrayKlassObj,                          klassOop)                              \
 396      static_field(Universe,                    _doubleArrayKlassObj,                          klassOop)                              \
 397      static_field(Universe,                    _methodKlassObj,                               klassOop)                              \
 398      static_field(Universe,                    _constMethodKlassObj,                          klassOop)                              \
 399      static_field(Universe,                    _methodDataKlassObj,                           klassOop)                              \
 400      static_field(Universe,                    _klassKlassObj,                                klassOop)                              \
 401      static_field(Universe,                    _arrayKlassKlassObj,                           klassOop)                              \
 402      static_field(Universe,                    _objArrayKlassKlassObj,                        klassOop)                              \
 403      static_field(Universe,                    _typeArrayKlassKlassObj,                       klassOop)                              \
 404      static_field(Universe,                    _instanceKlassKlassObj,                        klassOop)                              \
 405      static_field(Universe,                    _constantPoolKlassObj,                         klassOop)                              \
 406      static_field(Universe,                    _constantPoolCacheKlassObj,                    klassOop)                              \
 407      static_field(Universe,                    _compiledICHolderKlassObj,                     klassOop)                              \
 408      static_field(Universe,                    _systemObjArrayKlassObj,                       klassOop)                              \
 409      static_field(Universe,                    _mirrors[0],                                   oop)                                  \
 410      static_field(Universe,                    _main_thread_group,                            oop)                                   \
 411      static_field(Universe,                    _system_thread_group,                          oop)                                   \
 412      static_field(Universe,                    _the_empty_byte_array,                         typeArrayOop)                          \
 413      static_field(Universe,                    _the_empty_short_array,                        typeArrayOop)                          \
 414      static_field(Universe,                    _the_empty_int_array,                          typeArrayOop)                          \
 415      static_field(Universe,                    _the_empty_system_obj_array,                   objArrayOop)                           \
 416      static_field(Universe,                    _the_empty_class_klass_array,                  objArrayOop)                           \
 417      static_field(Universe,                    _out_of_memory_error_java_heap,                oop)                                   \
 418      static_field(Universe,                    _out_of_memory_error_perm_gen,                 oop)                                   \
 419      static_field(Universe,                    _out_of_memory_error_array_size,               oop)                                   \
 420      static_field(Universe,                    _out_of_memory_error_gc_overhead_limit,        oop)                                   \
 421      static_field(Universe,                    _null_ptr_exception_instance,                  oop)                                   \
 422      static_field(Universe,                    _arithmetic_exception_instance,                oop)                                   \
 423      static_field(Universe,                    _vm_exception,                                 oop)                                   \
 424      static_field(Universe,                    _collectedHeap,                                CollectedHeap*)                        \
 425      static_field(Universe,                    _base_vtable_size,                             int)                                   \
 426      static_field(Universe,                    _bootstrapping,                                bool)                                  \
 427      static_field(Universe,                    _fully_initialized,                            bool)                                  \
 428      static_field(Universe,                    _verify_count,                                 int)                                   \
 429      static_field(Universe,                    _narrow_oop._base,                             address)                               \
 430      static_field(Universe,                    _narrow_oop._shift,                            int)                                   \
 431      static_field(Universe,                    _narrow_oop._use_implicit_null_checks,         bool)                                  \
 432                                                                                                                                      \
 433   /**********************************************************************************/                                               \
 434   /* Generation and Space hierarchies                                               */                                               \
 435   /**********************************************************************************/                                               \
 436                                                                                                                                      \
 437   unchecked_nonstatic_field(ageTable,          sizes,                                         sizeof(ageTable::sizes))               \
 438                                                                                                                                      \
 439   nonstatic_field(BarrierSet,                  _max_covered_regions,                          int)                                   \
 440   nonstatic_field(BlockOffsetTable,            _bottom,                                       HeapWord*)                             \
 441   nonstatic_field(BlockOffsetTable,            _end,                                          HeapWord*)                             \
 442                                                                                                                                      \
 443   nonstatic_field(BlockOffsetSharedArray,      _reserved,                                     MemRegion)                             \
 444   nonstatic_field(BlockOffsetSharedArray,      _end,                                          HeapWord*)                             \
 445   nonstatic_field(BlockOffsetSharedArray,      _vs,                                           VirtualSpace)                          \
 446   nonstatic_field(BlockOffsetSharedArray,      _offset_array,                                 u_char*)                               \
 447                                                                                                                                      \
 448   nonstatic_field(BlockOffsetArray,            _array,                                        BlockOffsetSharedArray*)               \
 449   nonstatic_field(BlockOffsetArray,            _sp,                                           Space*)                                \
 450   nonstatic_field(BlockOffsetArrayContigSpace, _next_offset_threshold,                        HeapWord*)                             \
 451   nonstatic_field(BlockOffsetArrayContigSpace, _next_offset_index,                            size_t)                                \
 452                                                                                                                                      \
 453   nonstatic_field(BlockOffsetArrayNonContigSpace, _unallocated_block,                         HeapWord*)                             \
 454                                                                                                                                      \
 455   nonstatic_field(CardGeneration,              _rs,                                           GenRemSet*)                            \
 456   nonstatic_field(CardGeneration,              _bts,                                          BlockOffsetSharedArray*)               \
 457                                                                                                                                      \
 458   nonstatic_field(CardTableModRefBS,           _whole_heap,                                   const MemRegion)                       \
 459   nonstatic_field(CardTableModRefBS,           _guard_index,                                  const size_t)                          \
 460   nonstatic_field(CardTableModRefBS,           _last_valid_index,                             const size_t)                          \
 461   nonstatic_field(CardTableModRefBS,           _page_size,                                    const size_t)                          \
 462   nonstatic_field(CardTableModRefBS,           _byte_map_size,                                const size_t)                          \
 463   nonstatic_field(CardTableModRefBS,           _byte_map,                                     jbyte*)                                \
 464   nonstatic_field(CardTableModRefBS,           _cur_covered_regions,                          int)                                   \
 465   nonstatic_field(CardTableModRefBS,           _covered,                                      MemRegion*)                            \
 466   nonstatic_field(CardTableModRefBS,           _committed,                                    MemRegion*)                            \
 467   nonstatic_field(CardTableModRefBS,           _guard_region,                                 MemRegion)                             \
 468   nonstatic_field(CardTableModRefBS,           byte_map_base,                                 jbyte*)                                \
 469                                                                                                                                      \
 470   nonstatic_field(CardTableRS,                 _ct_bs,                                        CardTableModRefBSForCTRS*)             \
 471                                                                                                                                      \
 472   nonstatic_field(CollectedHeap,               _reserved,                                     MemRegion)                             \
 473   nonstatic_field(SharedHeap,                  _perm_gen,                                     PermGen*)                              \
 474   nonstatic_field(CollectedHeap,               _barrier_set,                                  BarrierSet*)                           \
 475   nonstatic_field(CollectedHeap,               _defer_initial_card_mark,                      bool)                                  \
 476   nonstatic_field(CollectedHeap,               _is_gc_active,                                 bool)                                  \
 477   nonstatic_field(CompactibleSpace,            _compaction_top,                               HeapWord*)                             \
 478   nonstatic_field(CompactibleSpace,            _first_dead,                                   HeapWord*)                             \
 479   nonstatic_field(CompactibleSpace,            _end_of_live,                                  HeapWord*)                             \
 480                                                                                                                                      \
 481   nonstatic_field(CompactingPermGen,           _gen,                                          OneContigSpaceCardGeneration*)         \
 482                                                                                                                                      \
 483   nonstatic_field(ContiguousSpace,             _top,                                          HeapWord*)                             \
 484   nonstatic_field(ContiguousSpace,             _concurrent_iteration_safe_limit,              HeapWord*)                             \
 485   nonstatic_field(ContiguousSpace,             _saved_mark_word,                              HeapWord*)                             \
 486                                                                                                                                      \
 487   nonstatic_field(DefNewGeneration,            _next_gen,                                     Generation*)                           \
 488   nonstatic_field(DefNewGeneration,            _tenuring_threshold,                           int)                                   \
 489   nonstatic_field(DefNewGeneration,            _age_table,                                    ageTable)                              \
 490   nonstatic_field(DefNewGeneration,            _eden_space,                                   EdenSpace*)                            \
 491   nonstatic_field(DefNewGeneration,            _from_space,                                   ContiguousSpace*)                      \
 492   nonstatic_field(DefNewGeneration,            _to_space,                                     ContiguousSpace*)                      \
 493                                                                                                                                      \
 494   nonstatic_field(EdenSpace,                   _gen,                                          DefNewGeneration*)                     \
 495                                                                                                                                      \
 496   nonstatic_field(Generation,                  _reserved,                                     MemRegion)                             \
 497   nonstatic_field(Generation,                  _virtual_space,                                VirtualSpace)                          \
 498   nonstatic_field(Generation,                  _level,                                        int)                                   \
 499   nonstatic_field(Generation,                  _stat_record,                                  Generation::StatRecord)                \
 500                                                                                                                                      \
 501   nonstatic_field(Generation::StatRecord,      invocations,                                   int)                                   \
 502   nonstatic_field(Generation::StatRecord,      accumulated_time,                              elapsedTimer)                          \
 503                                                                                                                                      \
 504   nonstatic_field(GenerationSpec,              _name,                                         Generation::Name)                      \
 505   nonstatic_field(GenerationSpec,              _init_size,                                    size_t)                                \
 506   nonstatic_field(GenerationSpec,              _max_size,                                     size_t)                                \
 507                                                                                                                                      \
 508     static_field(GenCollectedHeap,             _gch,                                          GenCollectedHeap*)                     \
 509  nonstatic_field(GenCollectedHeap,             _n_gens,                                       int)                                   \
 510  unchecked_nonstatic_field(GenCollectedHeap,   _gens,                                         sizeof(GenCollectedHeap::_gens)) /* NOTE: no type */ \
 511   nonstatic_field(GenCollectedHeap,            _gen_specs,                                    GenerationSpec**)                      \
 512                                                                                                                                      \
 513   nonstatic_field(HeapWord,                    i,                                             char*)                                 \
 514                                                                                                                                      \
 515   nonstatic_field(MemRegion,                   _start,                                        HeapWord*)                             \
 516   nonstatic_field(MemRegion,                   _word_size,                                    size_t)                                \
 517                                                                                                                                      \
 518   nonstatic_field(OffsetTableContigSpace,      _offsets,                                      BlockOffsetArray)                      \
 519                                                                                                                                      \
 520   nonstatic_field(OneContigSpaceCardGeneration, _min_heap_delta_bytes,                        size_t)                                \
 521   nonstatic_field(OneContigSpaceCardGeneration, _the_space,                                   ContiguousSpace*)                      \
 522   nonstatic_field(OneContigSpaceCardGeneration, _last_gc,                                     WaterMark)                             \
 523                                                                                                                                      \
 524   nonstatic_field(CompactingPermGenGen,        _ro_vs,                                        VirtualSpace)                          \
 525   nonstatic_field(CompactingPermGenGen,        _rw_vs,                                        VirtualSpace)                          \
 526   nonstatic_field(CompactingPermGenGen,        _md_vs,                                        VirtualSpace)                          \
 527   nonstatic_field(CompactingPermGenGen,        _mc_vs,                                        VirtualSpace)                          \
 528   nonstatic_field(CompactingPermGenGen,        _ro_space,                                     OffsetTableContigSpace*)               \
 529   nonstatic_field(CompactingPermGenGen,        _rw_space,                                     OffsetTableContigSpace*)               \
 530      static_field(CompactingPermGenGen,        unshared_bottom,                               HeapWord*)                             \
 531      static_field(CompactingPermGenGen,        unshared_end,                                  HeapWord*)                             \
 532      static_field(CompactingPermGenGen,        shared_bottom,                                 HeapWord*)                             \
 533      static_field(CompactingPermGenGen,        readonly_bottom,                               HeapWord*)                             \
 534      static_field(CompactingPermGenGen,        readonly_end,                                  HeapWord*)                             \
 535      static_field(CompactingPermGenGen,        readwrite_bottom,                              HeapWord*)                             \
 536      static_field(CompactingPermGenGen,        readwrite_end,                                 HeapWord*)                             \
 537      static_field(CompactingPermGenGen,        miscdata_bottom,                               HeapWord*)                             \
 538      static_field(CompactingPermGenGen,        miscdata_end,                                  HeapWord*)                             \
 539      static_field(CompactingPermGenGen,        misccode_bottom,                               HeapWord*)                             \
 540      static_field(CompactingPermGenGen,        misccode_end,                                  HeapWord*)                             \
 541      static_field(CompactingPermGenGen,        shared_end,                                    HeapWord*)                             \
 542                                                                                                                                      \
 543   nonstatic_field(PermGen,                     _capacity_expansion_limit,                     size_t)                                \
 544                                                                                                                                      \
 545   nonstatic_field(PermanentGenerationSpec,     _name,                                         PermGen::Name)                         \
 546   nonstatic_field(PermanentGenerationSpec,     _init_size,                                    size_t)                                \
 547   nonstatic_field(PermanentGenerationSpec,     _max_size,                                     size_t)                                \
 548                                                                                                                                      \
 549   nonstatic_field(Space,                       _bottom,                                       HeapWord*)                             \
 550   nonstatic_field(Space,                       _end,                                          HeapWord*)                             \
 551                                                                                                                                      \
 552   nonstatic_field(TenuredGeneration,           _shrink_factor,                                size_t)                                \
 553   nonstatic_field(TenuredGeneration,           _capacity_at_prologue,                         size_t)                                \
 554   nonstatic_field(ThreadLocalAllocBuffer,      _start,                                        HeapWord*)                             \
 555   nonstatic_field(ThreadLocalAllocBuffer,      _top,                                          HeapWord*)                             \
 556   nonstatic_field(ThreadLocalAllocBuffer,      _end,                                          HeapWord*)                             \
 557   nonstatic_field(ThreadLocalAllocBuffer,      _desired_size,                                 size_t)                                \
 558   nonstatic_field(ThreadLocalAllocBuffer,      _refill_waste_limit,                           size_t)                                \
 559      static_field(ThreadLocalAllocBuffer,      _target_refills,                               unsigned)                              \
 560   nonstatic_field(VirtualSpace,                _low_boundary,                                 char*)                                 \
 561   nonstatic_field(VirtualSpace,                _high_boundary,                                char*)                                 \
 562   nonstatic_field(VirtualSpace,                _low,                                          char*)                                 \
 563   nonstatic_field(VirtualSpace,                _high,                                         char*)                                 \
 564   nonstatic_field(VirtualSpace,                _lower_high,                                   char*)                                 \
 565   nonstatic_field(VirtualSpace,                _middle_high,                                  char*)                                 \
 566   nonstatic_field(VirtualSpace,                _upper_high,                                   char*)                                 \
 567   nonstatic_field(WaterMark,                   _point,                                        HeapWord*)                             \
 568   nonstatic_field(WaterMark,                   _space,                                        Space*)                                \
 569                                                                                                                                      \
 570   /************************/                                                                                                         \
 571   /* PerfMemory - jvmstat */                                                                                                         \
 572   /************************/                                                                                                         \
 573                                                                                                                                      \
 574   nonstatic_field(PerfDataPrologue,            magic,                                         jint)                                  \
 575   nonstatic_field(PerfDataPrologue,            byte_order,                                    jbyte)                                 \
 576   nonstatic_field(PerfDataPrologue,            major_version,                                 jbyte)                                 \
 577   nonstatic_field(PerfDataPrologue,            minor_version,                                 jbyte)                                 \
 578   nonstatic_field(PerfDataPrologue,            accessible,                                    jbyte)                                 \
 579   nonstatic_field(PerfDataPrologue,            used,                                          jint)                                  \
 580   nonstatic_field(PerfDataPrologue,            overflow,                                      jint)                                  \
 581   nonstatic_field(PerfDataPrologue,            mod_time_stamp,                                jlong)                                 \
 582   nonstatic_field(PerfDataPrologue,            entry_offset,                                  jint)                                  \
 583   nonstatic_field(PerfDataPrologue,            num_entries,                                   jint)                                  \
 584                                                                                                                                      \
 585   nonstatic_field(PerfDataEntry,               entry_length,                                  jint)                                  \
 586   nonstatic_field(PerfDataEntry,               name_offset,                                   jint)                                  \
 587   nonstatic_field(PerfDataEntry,               vector_length,                                 jint)                                  \
 588   nonstatic_field(PerfDataEntry,               data_type,                                     jbyte)                                 \
 589   nonstatic_field(PerfDataEntry,               flags,                                         jbyte)                                 \
 590   nonstatic_field(PerfDataEntry,               data_units,                                    jbyte)                                 \
 591   nonstatic_field(PerfDataEntry,               data_variability,                              jbyte)                                 \
 592   nonstatic_field(PerfDataEntry,               data_offset,                                   jint)                                  \
 593                                                                                                                                      \
 594      static_field(PerfMemory,                  _start,                                        char*)                                 \
 595      static_field(PerfMemory,                  _end,                                          char*)                                 \
 596      static_field(PerfMemory,                  _top,                                          char*)                                 \
 597      static_field(PerfMemory,                  _capacity,                                     size_t)                                \
 598      static_field(PerfMemory,                  _prologue,                                     PerfDataPrologue*)                     \
 599      static_field(PerfMemory,                  _initialized,                                  jint)                                  \
 600                                                                                                                                      \
 601   /***************/                                                                                                                  \
 602   /* SymbolTable */                                                                                                                  \
 603   /***************/                                                                                                                  \
 604                                                                                                                                      \
 605      static_field(SymbolTable,                  _the_table,                                   SymbolTable*)                          \
 606                                                                                                                                      \
 607   /***************/                                                                                                                  \
 608   /* StringTable */                                                                                                                  \
 609   /***************/                                                                                                                  \
 610                                                                                                                                      \
 611      static_field(StringTable,                  _the_table,                                   StringTable*)                          \
 612                                                                                                                                      \
 613   /********************/                                                                                                             \
 614   /* SystemDictionary */                                                                                                             \
 615   /********************/                                                                                                             \
 616                                                                                                                                      \
 617       static_field(SystemDictionary,            _dictionary,                                   Dictionary*)                          \
 618       static_field(SystemDictionary,            _placeholders,                                 PlaceholderTable*)                    \
 619       static_field(SystemDictionary,            _shared_dictionary,                            Dictionary*)                          \
 620       static_field(SystemDictionary,            _system_loader_lock_obj,                       oop)                                  \
 621       static_field(SystemDictionary,            _loader_constraints,                           LoaderConstraintTable*)               \
 622       static_field(SystemDictionary,            WK_KLASS(Object_klass),                        klassOop)                             \
 623       static_field(SystemDictionary,            WK_KLASS(String_klass),                        klassOop)                             \
 624       static_field(SystemDictionary,            WK_KLASS(Class_klass),                         klassOop)                             \
 625       static_field(SystemDictionary,            WK_KLASS(Cloneable_klass),                     klassOop)                             \
 626       static_field(SystemDictionary,            WK_KLASS(ClassLoader_klass),                   klassOop)                             \
 627       static_field(SystemDictionary,            WK_KLASS(Serializable_klass),                  klassOop)                             \
 628       static_field(SystemDictionary,            WK_KLASS(System_klass),                        klassOop)                             \
 629       static_field(SystemDictionary,            WK_KLASS(Throwable_klass),                     klassOop)                             \
 630       static_field(SystemDictionary,            WK_KLASS(ThreadDeath_klass),                   klassOop)                             \
 631       static_field(SystemDictionary,            WK_KLASS(Error_klass),                         klassOop)                             \
 632       static_field(SystemDictionary,            WK_KLASS(Exception_klass),                     klassOop)                             \
 633       static_field(SystemDictionary,            WK_KLASS(RuntimeException_klass),              klassOop)                             \
 634       static_field(SystemDictionary,            WK_KLASS(ClassNotFoundException_klass),        klassOop)                             \
 635       static_field(SystemDictionary,            WK_KLASS(NoClassDefFoundError_klass),          klassOop)                             \
 636       static_field(SystemDictionary,            WK_KLASS(LinkageError_klass),                  klassOop)                             \
 637       static_field(SystemDictionary,            WK_KLASS(ClassCastException_klass),            klassOop)                             \
 638       static_field(SystemDictionary,            WK_KLASS(ArrayStoreException_klass),           klassOop)                             \
 639       static_field(SystemDictionary,            WK_KLASS(VirtualMachineError_klass),           klassOop)                             \
 640       static_field(SystemDictionary,            WK_KLASS(OutOfMemoryError_klass),              klassOop)                             \
 641       static_field(SystemDictionary,            WK_KLASS(StackOverflowError_klass),            klassOop)                             \
 642       static_field(SystemDictionary,            WK_KLASS(ProtectionDomain_klass),              klassOop)                             \
 643       static_field(SystemDictionary,            WK_KLASS(AccessControlContext_klass),          klassOop)                             \
 644       static_field(SystemDictionary,            WK_KLASS(Reference_klass),                     klassOop)                             \
 645       static_field(SystemDictionary,            WK_KLASS(SoftReference_klass),                 klassOop)                             \
 646       static_field(SystemDictionary,            WK_KLASS(WeakReference_klass),                 klassOop)                             \
 647       static_field(SystemDictionary,            WK_KLASS(FinalReference_klass),                klassOop)                             \
 648       static_field(SystemDictionary,            WK_KLASS(PhantomReference_klass),              klassOop)                             \
 649       static_field(SystemDictionary,            WK_KLASS(Finalizer_klass),                     klassOop)                             \
 650       static_field(SystemDictionary,            WK_KLASS(Thread_klass),                        klassOop)                             \
 651       static_field(SystemDictionary,            WK_KLASS(ThreadGroup_klass),                   klassOop)                             \
 652       static_field(SystemDictionary,            WK_KLASS(Properties_klass),                    klassOop)                             \
 653       static_field(SystemDictionary,            WK_KLASS(StringBuffer_klass),                  klassOop)                             \
 654       static_field(SystemDictionary,            _box_klasses[0],                               klassOop)                             \
 655       static_field(SystemDictionary,            _java_system_loader,                           oop)                                  \
 656                                                                                                                                      \
 657   /*******************/                                                                                                              \
 658   /* HashtableBucket */                                                                                                              \
 659   /*******************/                                                                                                              \
 660                                                                                                                                      \
 661   nonstatic_field(HashtableBucket,             _entry,                                        BasicHashtableEntry*)                  \
 662                                                                                                                                      \
 663   /******************/                                                                                                               \
 664   /* HashtableEntry */                                                                                                               \
 665   /******************/                                                                                                               \
 666                                                                                                                                      \
 667   nonstatic_field(BasicHashtableEntry,         _next,                                         BasicHashtableEntry*)                  \
 668   nonstatic_field(BasicHashtableEntry,         _hash,                                         unsigned int)                          \
 669   nonstatic_field(HashtableEntry<intptr_t>,    _literal,                                      intptr_t) \
 670                                                                                                                                      \
 671   /*************/                                                                                                                    \
 672   /* Hashtable */                                                                                                                    \
 673   /*************/                                                                                                                    \
 674                                                                                                                                      \
 675   nonstatic_field(BasicHashtable,              _table_size,                                   int)                                   \
 676   nonstatic_field(BasicHashtable,              _buckets,                                      HashtableBucket*)                      \
 677   nonstatic_field(BasicHashtable,              _free_list,                                    BasicHashtableEntry*)                  \
 678   nonstatic_field(BasicHashtable,              _first_free_entry,                             char*)                                 \
 679   nonstatic_field(BasicHashtable,              _end_block,                                    char*)                                 \
 680   nonstatic_field(BasicHashtable,              _entry_size,                                   int)                                   \
 681                                                                                                                                      \
 682   /*******************/                                                                                                              \
 683   /* DictionaryEntry */                                                                                                              \
 684   /*******************/                                                                                                              \
 685                                                                                                                                      \
 686   nonstatic_field(DictionaryEntry,             _loader,                                       oop)                                   \
 687   nonstatic_field(DictionaryEntry,             _pd_set,                                       ProtectionDomainEntry*)                \
 688                                                                                                                                      \
 689   /********************/                                                                                                             \
 690                                                                                                                                      \
 691   nonstatic_field(PlaceholderEntry,            _loader,                                       oop)                                   \
 692                                                                                                                                      \
 693   /**************************/                                                                                                       \
 694   /* ProctectionDomainEntry */                                                                                                       \
 695   /**************************/                                                                                                       \
 696                                                                                                                                      \
 697   nonstatic_field(ProtectionDomainEntry,       _next,                                         ProtectionDomainEntry*)                \
 698   nonstatic_field(ProtectionDomainEntry,       _protection_domain,                            oop)                                   \
 699                                                                                                                                      \
 700   /*************************/                                                                                                        \
 701   /* LoaderConstraintEntry */                                                                                                        \
 702   /*************************/                                                                                                        \
 703                                                                                                                                      \
 704   nonstatic_field(LoaderConstraintEntry,       _name,                                         Symbol*)                               \
 705   nonstatic_field(LoaderConstraintEntry,       _num_loaders,                                  int)                                   \
 706   nonstatic_field(LoaderConstraintEntry,       _max_loaders,                                  int)                                   \
 707   nonstatic_field(LoaderConstraintEntry,       _loaders,                                      oop*)                                  \
 708                                                                                                                                      \
 709   /********************************/                                                                                                 \
 710   /* CodeCache (NOTE: incomplete) */                                                                                                 \
 711   /********************************/                                                                                                 \
 712                                                                                                                                      \
 713      static_field(CodeCache,                   _heap,                                         CodeHeap*)                             \
 714      static_field(CodeCache,                   _scavenge_root_nmethods,                       nmethod*)                              \
 715                                                                                                                                      \
 716   /*******************************/                                                                                                  \
 717   /* CodeHeap (NOTE: incomplete) */                                                                                                  \
 718   /*******************************/                                                                                                  \
 719                                                                                                                                      \
 720   nonstatic_field(CodeHeap,                    _memory,                                       VirtualSpace)                          \
 721   nonstatic_field(CodeHeap,                    _segmap,                                       VirtualSpace)                          \
 722   nonstatic_field(CodeHeap,                    _log2_segment_size,                            int)                                   \
 723   nonstatic_field(HeapBlock,                   _header,                                       HeapBlock::Header)                     \
 724   nonstatic_field(HeapBlock::Header,           _length,                                       size_t)                                \
 725   nonstatic_field(HeapBlock::Header,           _used,                                         bool)                                  \
 726                                                                                                                                      \
 727   /**********************************/                                                                                               \
 728   /* Interpreter (NOTE: incomplete) */                                                                                               \
 729   /**********************************/                                                                                               \
 730                                                                                                                                      \
 731      static_field(AbstractInterpreter,         _code,                                         StubQueue*)                            \
 732                                                                                                                                      \
 733   /****************************/                                                                                                     \
 734   /* Stubs (NOTE: incomplete) */                                                                                                     \
 735   /****************************/                                                                                                     \
 736                                                                                                                                      \
 737   nonstatic_field(StubQueue,                   _stub_buffer,                                  address)                               \
 738   nonstatic_field(StubQueue,                   _buffer_limit,                                 int)                                   \
 739   nonstatic_field(StubQueue,                   _queue_begin,                                  int)                                   \
 740   nonstatic_field(StubQueue,                   _queue_end,                                    int)                                   \
 741   nonstatic_field(StubQueue,                   _number_of_stubs,                              int)                                   \
 742   nonstatic_field(InterpreterCodelet,          _size,                                         int)                                   \
 743   nonstatic_field(InterpreterCodelet,          _description,                                  const char*)                           \
 744   nonstatic_field(InterpreterCodelet,          _bytecode,                                     Bytecodes::Code)                       \
 745                                                                                                                                      \
 746   /***********************************/                                                                                              \
 747   /* StubRoutines (NOTE: incomplete) */                                                                                              \
 748   /***********************************/                                                                                              \
 749                                                                                                                                      \
 750      static_field(StubRoutines,                _call_stub_return_address,                     address)                               \
 751                                                                                                                                      \
 752   /***************************************/                                                                                          \
 753   /* PcDesc and other compiled code info */                                                                                          \
 754   /***************************************/                                                                                          \
 755                                                                                                                                      \
 756   nonstatic_field(PcDesc,                      _pc_offset,                                    int)                                   \
 757   nonstatic_field(PcDesc,                      _scope_decode_offset,                          int)                                   \
 758   nonstatic_field(PcDesc,                      _obj_decode_offset,                            int)                                   \
 759   nonstatic_field(PcDesc,                      _flags,                        PcDesc::PcDescFlags)                                   \
 760                                                                                                                                      \
 761   /***************************************************/                                                                              \
 762   /* CodeBlobs (NOTE: incomplete, but only a little) */                                                                              \
 763   /***************************************************/                                                                              \
 764                                                                                                                                      \
 765   nonstatic_field(CodeBlob,                    _name,                                         const char*)                           \
 766   nonstatic_field(CodeBlob,                    _size,                                         int)                                   \
 767   nonstatic_field(CodeBlob,                    _header_size,                                  int)                                   \
 768   nonstatic_field(CodeBlob,                    _relocation_size,                              int)                                   \
 769   nonstatic_field(CodeBlob,                    _content_offset,                               int)                                   \
 770   nonstatic_field(CodeBlob,                    _code_offset,                                  int)                                   \
 771   nonstatic_field(CodeBlob,                    _frame_complete_offset,                        int)                                   \
 772   nonstatic_field(CodeBlob,                    _data_offset,                                  int)                                   \
 773   nonstatic_field(CodeBlob,                    _frame_size,                                   int)                                   \
 774   nonstatic_field(CodeBlob,                    _oop_maps,                                     OopMapSet*)                            \
 775                                                                                                                                      \
 776   /**************************************************/                                                                               \
 777   /* NMethods (NOTE: incomplete, but only a little) */                                                                               \
 778   /**************************************************/                                                                               \
 779                                                                                                                                      \
 780   nonstatic_field(nmethod,             _method,                                       methodOop)                             \
 781   nonstatic_field(nmethod,             _entry_bci,                                    int)                                   \
 782   nonstatic_field(nmethod,             _osr_link,                                     nmethod*)                              \
 783   nonstatic_field(nmethod,             _scavenge_root_link,                           nmethod*)                              \
 784   nonstatic_field(nmethod,             _scavenge_root_state,                          jbyte)                                 \
 785   nonstatic_field(nmethod,             _exception_offset,                             int)                                   \
 786   nonstatic_field(nmethod,             _deoptimize_offset,                            int)                                   \
 787   nonstatic_field(nmethod,             _orig_pc_offset,                               int)                                   \
 788   nonstatic_field(nmethod,             _stub_offset,                                  int)                                   \
 789   nonstatic_field(nmethod,             _consts_offset,                                int)                                   \
 790   nonstatic_field(nmethod,             _oops_offset,                                  int)                                   \
 791   nonstatic_field(nmethod,             _scopes_data_offset,                           int)                                   \
 792   nonstatic_field(nmethod,             _scopes_pcs_offset,                            int)                                   \
 793   nonstatic_field(nmethod,             _dependencies_offset,                          int)                                   \
 794   nonstatic_field(nmethod,             _handler_table_offset,                         int)                                   \
 795   nonstatic_field(nmethod,             _nul_chk_table_offset,                         int)                                   \
 796   nonstatic_field(nmethod,             _nmethod_end_offset,                           int)                                   \
 797   nonstatic_field(nmethod,             _entry_point,                                  address)                               \
 798   nonstatic_field(nmethod,             _verified_entry_point,                         address)                               \
 799   nonstatic_field(nmethod,             _osr_entry_point,                              address)                               \
 800   nonstatic_field(nmethod,             _lock_count,                                   jint)                                  \
 801   nonstatic_field(nmethod,             _stack_traversal_mark,                         long)                                  \
 802                                                                                                                                      \
 803   /********************************/                                                                                                 \
 804   /* JavaCalls (NOTE: incomplete) */                                                                                                 \
 805   /********************************/                                                                                                 \
 806                                                                                                                                      \
 807   nonstatic_field(JavaCallWrapper,             _anchor,                                       JavaFrameAnchor)                       \
 808   /********************************/                                                                                                 \
 809   /* JavaFrameAnchor (NOTE: incomplete) */                                                                                           \
 810   /********************************/                                                                                                 \
 811   volatile_nonstatic_field(JavaFrameAnchor,    _last_Java_sp,                                 intptr_t*)                             \
 812   volatile_nonstatic_field(JavaFrameAnchor,    _last_Java_pc,                                 address)                               \
 813                                                                                                                                      \
 814   /******************************/                                                                                                   \
 815   /* Threads (NOTE: incomplete) */                                                                                                   \
 816   /******************************/                                                                                                   \
 817                                                                                                                                      \
 818      static_field(Threads,                     _thread_list,                                  JavaThread*)                           \
 819      static_field(Threads,                     _number_of_threads,                            int)                                   \
 820      static_field(Threads,                     _number_of_non_daemon_threads,                 int)                                   \
 821      static_field(Threads,                     _return_code,                                  int)                                   \
 822                                                                                                                                      \
 823    volatile_nonstatic_field(Thread,            _suspend_flags,                                uint32_t)                              \
 824   nonstatic_field(Thread,                      _active_handles,                               JNIHandleBlock*)                       \
 825   nonstatic_field(Thread,                      _tlab,                                         ThreadLocalAllocBuffer)                \
 826   nonstatic_field(Thread,                      _current_pending_monitor,                      ObjectMonitor*)                        \
 827   nonstatic_field(Thread,                      _current_pending_monitor_is_from_java,         bool)                                  \
 828   nonstatic_field(Thread,                      _current_waiting_monitor,                      ObjectMonitor*)                        \
 829   nonstatic_field(NamedThread,                 _name,                                         char*)                                 \
 830   nonstatic_field(NamedThread,                 _processed_thread,                             JavaThread*)                           \
 831   nonstatic_field(JavaThread,                  _next,                                         JavaThread*)                           \
 832   nonstatic_field(JavaThread,                  _threadObj,                                    oop)                                   \
 833   nonstatic_field(JavaThread,                  _anchor,                                       JavaFrameAnchor)                       \
 834    volatile_nonstatic_field(JavaThread,        _thread_state,                                 JavaThreadState)                       \
 835   nonstatic_field(JavaThread,                  _osthread,                                     OSThread*)                             \
 836   nonstatic_field(JavaThread,                  _stack_base,                                   address)                               \
 837   nonstatic_field(JavaThread,                  _stack_size,                                   size_t)                                \
 838                                                                                                                                      \
 839   /************/                                                                                                                     \
 840   /* OSThread */                                                                                                                     \
 841   /************/                                                                                                                     \
 842                                                                                                                                      \
 843   nonstatic_field(OSThread,                    _interrupted,                                  jint)                                  \
 844                                                                                                                                      \
 845   /************************/                                                                                                         \
 846   /* OopMap and OopMapSet */                                                                                                         \
 847   /************************/                                                                                                         \
 848                                                                                                                                      \
 849   nonstatic_field(OopMap,                      _pc_offset,                                    int)                                   \
 850   nonstatic_field(OopMap,                      _omv_count,                                    int)                                   \
 851   nonstatic_field(OopMap,                      _omv_data_size,                                int)                                   \
 852   nonstatic_field(OopMap,                      _omv_data,                                     unsigned char*)                        \
 853   nonstatic_field(OopMap,                      _write_stream,                                 CompressedWriteStream*)                \
 854   nonstatic_field(OopMapSet,                   _om_count,                                     int)                                   \
 855   nonstatic_field(OopMapSet,                   _om_size,                                      int)                                   \
 856   nonstatic_field(OopMapSet,                   _om_data,                                      OopMap**)                              \
 857                                                                                                                                      \
 858   /*********************************/                                                                                                \
 859   /* JNIHandles and JNIHandleBlock */                                                                                                \
 860   /*********************************/                                                                                                \
 861      static_field(JNIHandles,                  _global_handles,                               JNIHandleBlock*)                       \
 862      static_field(JNIHandles,                  _weak_global_handles,                          JNIHandleBlock*)                       \
 863      static_field(JNIHandles,                  _deleted_handle,                               oop)                                   \
 864                                                                                                                                      \
 865   unchecked_nonstatic_field(JNIHandleBlock,    _handles,                                      JNIHandleBlock::block_size_in_oops * sizeof(Oop)) /* Note: no type */ \
 866   nonstatic_field(JNIHandleBlock,              _top,                                          int)                                   \
 867   nonstatic_field(JNIHandleBlock,              _next,                                         JNIHandleBlock*)                       \
 868                                                                                                                                      \
 869   /********************/                                                                                                             \
 870   /* CompressedStream */                                                                                                             \
 871   /********************/                                                                                                             \
 872                                                                                                                                      \
 873   nonstatic_field(CompressedStream,            _buffer,                                       u_char*)                               \
 874   nonstatic_field(CompressedStream,            _position,                                     int)                                   \
 875                                                                                                                                      \
 876   /*********************************/                                                                                                \
 877   /* VMRegImpl (NOTE: incomplete) */                                                                                                 \
 878   /*********************************/                                                                                                \
 879                                                                                                                                      \
 880      static_field(VMRegImpl,                   regName[0],                                    const char*)                           \
 881      static_field(VMRegImpl,                   stack0,                                        VMReg)                                 \
 882                                                                                                                                      \
 883   /*******************************/                                                                                                  \
 884   /* Runtime1 (NOTE: incomplete) */                                                                                                  \
 885   /*******************************/                                                                                                  \
 886                                                                                                                                      \
 887   unchecked_c1_static_field(Runtime1,          _blobs,                                        sizeof(Runtime1::_blobs)) /* NOTE: no type */ \
 888                                                                                                                                      \
 889   /************/                                                                                                                     \
 890   /* Monitors */                                                                                                                     \
 891   /************/                                                                                                                     \
 892                                                                                                                                      \
 893   volatile_nonstatic_field(ObjectMonitor,      _header,                                       markOop)                               \
 894   unchecked_nonstatic_field(ObjectMonitor,     _object,                                       sizeof(void *)) /* NOTE: no type */    \
 895   unchecked_nonstatic_field(ObjectMonitor,     _owner,                                        sizeof(void *)) /* NOTE: no type */    \
 896   volatile_nonstatic_field(ObjectMonitor,      _count,                                        intptr_t)                              \
 897   volatile_nonstatic_field(ObjectMonitor,      _waiters,                                      intptr_t)                              \
 898   volatile_nonstatic_field(ObjectMonitor,      _recursions,                                   intptr_t)                              \
 899   nonstatic_field(ObjectMonitor,               FreeNext,                                      ObjectMonitor*)                        \
 900   volatile_nonstatic_field(BasicLock,          _displaced_header,                             markOop)                               \
 901   nonstatic_field(BasicObjectLock,             _lock,                                         BasicLock)                             \
 902   nonstatic_field(BasicObjectLock,             _obj,                                          oop)                                   \
 903   static_field(ObjectSynchronizer,             gBlockList,                                    ObjectMonitor*)                        \
 904                                                                                                                                      \
 905   /*********************/                                                                                                            \
 906   /* Matcher (C2 only) */                                                                                                            \
 907   /*********************/                                                                                                            \
 908                                                                                                                                      \
 909   unchecked_c2_static_field(Matcher,           _regEncode,                                    sizeof(Matcher::_regEncode)) /* NOTE: no type */ \
 910                                                                                                                                      \
 911   /*********************/                                                                                                            \
 912   /* -XX flags         */                                                                                                            \
 913   /*********************/                                                                                                            \
 914                                                                                                                                      \
 915   nonstatic_field(Flag,                        type,                                          const char*)                           \
 916   nonstatic_field(Flag,                        name,                                          const char*)                           \
 917   unchecked_nonstatic_field(Flag,              addr,                                          sizeof(void*)) /* NOTE: no type */     \
 918   nonstatic_field(Flag,                        kind,                                          const char*)                           \
 919   static_field(Flag,                           flags,                                         Flag*)                                 \
 920   static_field(Flag,                           numFlags,                                      size_t)                                \
 921                                                                                                                                      \
 922   /*************************/                                                                                                        \
 923   /* JDK / VM version info */                                                                                                        \
 924   /*************************/                                                                                                        \
 925                                                                                                                                      \
 926   static_field(Abstract_VM_Version,            _s_vm_release,                                 const char*)                           \
 927   static_field(Abstract_VM_Version,            _s_internal_vm_info_string,                    const char*)                           \
 928   static_field(Abstract_VM_Version,            _vm_major_version,                             int)                                   \
 929   static_field(Abstract_VM_Version,            _vm_minor_version,                             int)                                   \
 930   static_field(Abstract_VM_Version,            _vm_build_number,                              int)                                   \
 931                                                                                                                                      \
 932   static_field(JDK_Version,                    _current,                                      JDK_Version)                           \
 933   nonstatic_field(JDK_Version,                 _partially_initialized,                        bool)                                  \
 934   nonstatic_field(JDK_Version,                 _major,                                        unsigned char)                         \
 935                                                                                                                                      \
 936                                                                                                                                      \
 937                                                                                                                                      \
 938   /*************/                                                                                                                    \
 939   /* Arguments */                                                                                                                    \
 940   /*************/                                                                                                                    \
 941                                                                                                                                      \
 942   static_field(Arguments,                      _jvm_flags_array,                              char**)                                \
 943   static_field(Arguments,                      _num_jvm_flags,                                int)                                   \
 944   static_field(Arguments,                      _jvm_args_array,                               char**)                                \
 945   static_field(Arguments,                      _num_jvm_args,                                 int)                                   \
 946   static_field(Arguments,                      _java_command,                                 char*)                                 \
 947                                                                                                                                      \
 948                                                                                                                                      \
 949   /************************/                                                                                                         \
 950   /* Miscellaneous fields */                                                                                                         \
 951   /************************/                                                                                                         \
 952                                                                                                                                      \
 953   nonstatic_field(AccessFlags,                 _flags,                                        jint)                                  \
 954   nonstatic_field(elapsedTimer,                _counter,                                      jlong)                                 \
 955   nonstatic_field(elapsedTimer,                _active,                                       bool)                                  \
 956   nonstatic_field(InvocationCounter,           _counter,                                      unsigned int)
 957 
 958   /* NOTE that we do not use the last_entry() macro here; it is used  */
 959   /* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must  */
 960   /* be present there)                                                */
 961 
 962 //--------------------------------------------------------------------------------
 963 // VM_TYPES
 964 //
 965 // This list must enumerate at least all of the types in the above
 966 // list. For the types in the above list, the entry below must have
 967 // exactly the same spacing since string comparisons are done in the
 968 // code which verifies the consistency of these tables (in the debug
 969 // build).
 970 //
 971 // In addition to the above types, this list is required to enumerate
 972 // the JNI's java types, which are used to indicate the size of Java
 973 // fields in this VM to the SA. Further, oop types are currently
 974 // distinguished by name (i.e., ends with "oop") over in the SA.
 975 //
 976 // The declare_toplevel_type macro should be used to declare types
 977 // which do not have a superclass.
 978 //
 979 // The declare_integer_type and declare_unsigned_integer_type macros
 980 // are required in order to properly identify C integer types over in
 981 // the SA. They should be used for any type which is otherwise opaque
 982 // and which it is necessary to coerce into an integer value. This
 983 // includes, for example, the type uintptr_t. Note that while they
 984 // will properly identify the type's size regardless of the platform,
 985 // since it is does not seem possible to deduce or check signedness at
 986 // compile time using the pointer comparison tricks, it is currently
 987 // required that the given types have the same signedness across all
 988 // platforms.
 989 //
 990 // NOTE that there are platform-specific additions to this table in
 991 // vmStructs_<os>_<cpu>.hpp.
 992 
 993 #define VM_TYPES(declare_type,                                            \
 994                  declare_toplevel_type,                                   \
 995                  declare_oop_type,                                        \
 996                  declare_integer_type,                                    \
 997                  declare_unsigned_integer_type,                           \
 998                  declare_c1_toplevel_type,                                \
 999                  declare_c2_type,                                         \
1000                  declare_c2_toplevel_type,                                \
1001                  last_entry)                                              \
1002                                                                           \
1003   /*************************************************************/         \
1004   /* Java primitive types -- required by the SA implementation */         \
1005   /* in order to determine the size of Java fields in this VM  */         \
1006   /* (the implementation looks up these names specifically)    */         \
1007   /* NOTE: since we fetch these sizes from the remote VM, we   */         \
1008   /* have a bootstrapping sequence during which it is not      */         \
1009   /* valid to fetch Java values from the remote process, only  */         \
1010   /* C integer values (of known size). NOTE also that we do    */         \
1011   /* NOT include "Java unsigned" types like juint here; since  */         \
1012   /* Java does not have unsigned primitive types, those can    */         \
1013   /* not be mapped directly and are considered to be C integer */         \
1014   /* types in this system (see the "other types" section,      */         \
1015   /* below.)                                                   */         \
1016   /*************************************************************/         \
1017                                                                           \
1018   declare_toplevel_type(jboolean)                                         \
1019   declare_toplevel_type(jbyte)                                            \
1020   declare_toplevel_type(jchar)                                            \
1021   declare_toplevel_type(jdouble)                                          \
1022   declare_toplevel_type(jfloat)                                           \
1023   declare_toplevel_type(jint)                                             \
1024   declare_toplevel_type(jlong)                                            \
1025   declare_toplevel_type(jshort)                                           \
1026                                                                           \
1027   /*********************************************************************/ \
1028   /* C integer types. User-defined typedefs (like "size_t" or          */ \
1029   /* "intptr_t") are guaranteed to be present with the same names over */ \
1030   /* in the SA's type database. Names like "unsigned short" are not    */ \
1031   /* guaranteed to be visible through the SA's type database lookup    */ \
1032   /* mechanism, though they will have a Type object created for them   */ \
1033   /* and are valid types for Fields.                                   */ \
1034   /*********************************************************************/ \
1035   declare_integer_type(bool)                                              \
1036   declare_integer_type(int)                                               \
1037   declare_integer_type(long)                                              \
1038   declare_integer_type(char)                                              \
1039   declare_unsigned_integer_type(unsigned char)                            \
1040   declare_unsigned_integer_type(unsigned int)                             \
1041   declare_unsigned_integer_type(unsigned short)                           \
1042   declare_unsigned_integer_type(unsigned long)                            \
1043   /* The compiler thinks this is a different type than */                 \
1044   /* unsigned short on Win32 */                                           \
1045   declare_unsigned_integer_type(u2)                                       \
1046   declare_unsigned_integer_type(unsigned)                                 \
1047                                                                           \
1048   /*****************************/                                         \
1049   /* C primitive pointer types */                                         \
1050   /*****************************/                                         \
1051                                                                           \
1052   declare_toplevel_type(int*)                                             \
1053   declare_toplevel_type(char*)                                            \
1054   declare_toplevel_type(char**)                                           \
1055   declare_toplevel_type(const char*)                                      \
1056   declare_toplevel_type(u_char*)                                          \
1057   declare_toplevel_type(unsigned char*)                                   \
1058                                                                           \
1059   /*******************************************************************/   \
1060   /* Types which it will be handy to have available over in the SA   */   \
1061   /* in order to do platform-independent address -> integer coercion */   \
1062   /* (note: these will be looked up by name)                         */   \
1063   /*******************************************************************/   \
1064                                                                           \
1065   declare_unsigned_integer_type(size_t)                                   \
1066   declare_integer_type(ssize_t)                                           \
1067   declare_unsigned_integer_type(const size_t)                             \
1068   declare_integer_type(intx)                                              \
1069   declare_integer_type(intptr_t)                                          \
1070   declare_unsigned_integer_type(uintx)                                    \
1071   declare_unsigned_integer_type(uintptr_t)                                \
1072   declare_unsigned_integer_type(uint32_t)                                 \
1073   declare_unsigned_integer_type(uint64_t)                                 \
1074   declare_integer_type(const int)                                         \
1075                                                                           \
1076   /*******************************************************************************/ \
1077   /* OopDesc and Klass hierarchies (NOTE: missing methodDataOop-related classes) */ \
1078   /*******************************************************************************/ \
1079                                                                           \
1080   declare_toplevel_type(oopDesc)                                          \
1081   declare_toplevel_type(Klass_vtbl)                                       \
1082            declare_type(Klass, Klass_vtbl)                                \
1083            declare_type(arrayKlass, Klass)                                \
1084            declare_type(arrayKlassKlass, klassKlass)                      \
1085            declare_type(arrayOopDesc, oopDesc)                            \
1086    declare_type(compiledICHolderKlass, Klass)                             \
1087    declare_type(compiledICHolderOopDesc, oopDesc)                         \
1088            declare_type(constantPoolKlass, Klass)                         \
1089            declare_type(constantPoolOopDesc, oopDesc)                     \
1090            declare_type(constantPoolCacheKlass, Klass)                    \
1091            declare_type(constantPoolCacheOopDesc, oopDesc)                \
1092            declare_type(instanceKlass, Klass)                             \
1093            declare_type(instanceKlassKlass, klassKlass)                   \
1094            declare_type(instanceOopDesc, oopDesc)                         \
1095            declare_type(instanceRefKlass, instanceKlass)                  \
1096            declare_type(klassKlass, Klass)                                \
1097            declare_type(klassOopDesc, oopDesc)                            \
1098            declare_type(markOopDesc, oopDesc)                             \
1099    declare_type(methodDataKlass, Klass)                           \
1100    declare_type(methodDataOopDesc, oopDesc)                       \
1101            declare_type(methodKlass, Klass)                               \
1102            declare_type(constMethodKlass, Klass)                          \
1103            declare_type(methodOopDesc, oopDesc)                           \
1104            declare_type(objArrayKlass, arrayKlass)                        \
1105            declare_type(objArrayKlassKlass, arrayKlassKlass)              \
1106            declare_type(objArrayOopDesc, arrayOopDesc)                    \
1107            declare_type(constMethodOopDesc, oopDesc)                      \
1108            declare_type(typeArrayKlass, arrayKlass)                       \
1109            declare_type(typeArrayKlassKlass, arrayKlassKlass)             \
1110            declare_type(typeArrayOopDesc, arrayOopDesc)                   \
1111            declare_toplevel_type(Symbol)                                  \
1112            declare_toplevel_type(Symbol*)                                 \
1113                                                                           \
1114   /********/                                                              \
1115   /* Oops */                                                              \
1116   /********/                                                              \
1117                                                                           \
1118   declare_oop_type(constantPoolOop)                                       \
1119   declare_oop_type(constantPoolCacheOop)                                  \
1120   declare_oop_type(klassOop)                                              \
1121   declare_oop_type(markOop)                                               \
1122   declare_oop_type(methodOop)                                             \
1123   declare_oop_type(methodDataOop)                                         \
1124   declare_oop_type(objArrayOop)                                           \
1125   declare_oop_type(oop)                                                   \
1126   declare_oop_type(narrowOop)                                             \
1127   declare_oop_type(wideKlassOop)                                          \
1128   declare_oop_type(constMethodOop)                                        \
1129   declare_oop_type(typeArrayOop)                                          \
1130                                                                           \
1131   /*************************************/                                 \
1132   /* MethodOop-related data structures */                                 \
1133   /*************************************/                                 \
1134                                                                           \
1135   declare_toplevel_type(CheckedExceptionElement)                          \
1136   declare_toplevel_type(LocalVariableTableElement)                        \
1137                                                                           \
1138   /******************************************/                            \
1139   /* Generation and space hierarchies       */                            \
1140   /* (needed for run-time type information) */                            \
1141   /******************************************/                            \
1142                                                                           \
1143   declare_toplevel_type(CollectedHeap)                                    \
1144            declare_type(SharedHeap,                   CollectedHeap)      \
1145            declare_type(GenCollectedHeap,             SharedHeap)         \
1146   declare_toplevel_type(Generation)                                       \
1147            declare_type(DefNewGeneration,             Generation)         \
1148            declare_type(CardGeneration,               Generation)         \
1149            declare_type(OneContigSpaceCardGeneration, CardGeneration)     \
1150            declare_type(TenuredGeneration,            OneContigSpaceCardGeneration) \
1151            declare_type(CompactingPermGenGen,         OneContigSpaceCardGeneration) \
1152   declare_toplevel_type(Space)                                            \
1153   declare_toplevel_type(BitMap)                                           \
1154            declare_type(CompactibleSpace,             Space)              \
1155            declare_type(ContiguousSpace,              CompactibleSpace)   \
1156            declare_type(EdenSpace,                    ContiguousSpace)    \
1157            declare_type(OffsetTableContigSpace,       ContiguousSpace)    \
1158            declare_type(TenuredSpace,                 OffsetTableContigSpace) \
1159            declare_type(ContigPermSpace,              OffsetTableContigSpace) \
1160   declare_toplevel_type(PermGen)                                          \
1161            declare_type(CompactingPermGen,            PermGen)            \
1162   declare_toplevel_type(BarrierSet)                                       \
1163            declare_type(ModRefBarrierSet,             BarrierSet)         \
1164            declare_type(CardTableModRefBS,            ModRefBarrierSet)   \
1165            declare_type(CardTableModRefBSForCTRS,     CardTableModRefBS)  \
1166   declare_toplevel_type(GenRemSet)                                        \
1167            declare_type(CardTableRS,                  GenRemSet)          \
1168   declare_toplevel_type(BlockOffsetSharedArray)                           \
1169   declare_toplevel_type(BlockOffsetTable)                                 \
1170            declare_type(BlockOffsetArray,             BlockOffsetTable)   \
1171            declare_type(BlockOffsetArrayContigSpace,  BlockOffsetArray)   \
1172            declare_type(BlockOffsetArrayNonContigSpace, BlockOffsetArray) \
1173                                                                           \
1174   /* Miscellaneous other GC types */                                      \
1175                                                                           \
1176   declare_toplevel_type(ageTable)                                         \
1177   declare_toplevel_type(Generation::StatRecord)                           \
1178   declare_toplevel_type(GenerationSpec)                                   \
1179   declare_toplevel_type(HeapWord)                                         \
1180   declare_toplevel_type(MemRegion)                                        \
1181   declare_toplevel_type(const MemRegion)                                  \
1182   declare_toplevel_type(PermanentGenerationSpec)                          \
1183   declare_toplevel_type(ThreadLocalAllocBuffer)                           \
1184   declare_toplevel_type(VirtualSpace)                                     \
1185   declare_toplevel_type(WaterMark)                                        \
1186                                                                           \
1187   /* Pointers to Garbage Collection types */                              \
1188                                                                           \
1189   declare_toplevel_type(BarrierSet*)                                      \
1190   declare_toplevel_type(BlockOffsetSharedArray*)                          \
1191   declare_toplevel_type(GenRemSet*)                                       \
1192   declare_toplevel_type(CardTableRS*)                                     \
1193   declare_toplevel_type(CardTableModRefBS*)                               \
1194   declare_toplevel_type(CardTableModRefBS**)                              \
1195   declare_toplevel_type(CardTableModRefBSForCTRS*)                        \
1196   declare_toplevel_type(CardTableModRefBSForCTRS**)                       \
1197   declare_toplevel_type(CollectedHeap*)                                   \
1198   declare_toplevel_type(ContiguousSpace*)                                 \
1199   declare_toplevel_type(DefNewGeneration*)                                \
1200   declare_toplevel_type(EdenSpace*)                                       \
1201   declare_toplevel_type(GenCollectedHeap*)                                \
1202   declare_toplevel_type(Generation*)                                      \
1203   declare_toplevel_type(GenerationSpec**)                                 \
1204   declare_toplevel_type(HeapWord*)                                        \
1205   declare_toplevel_type(MemRegion*)                                       \
1206   declare_toplevel_type(OffsetTableContigSpace*)                          \
1207   declare_toplevel_type(OneContigSpaceCardGeneration*)                    \
1208   declare_toplevel_type(PermGen*)                                         \
1209   declare_toplevel_type(Space*)                                           \
1210   declare_toplevel_type(ThreadLocalAllocBuffer*)                          \
1211                                                                           \
1212   /************************/                                              \
1213   /* PerfMemory - jvmstat */                                              \
1214   /************************/                                              \
1215                                                                           \
1216   declare_toplevel_type(PerfDataPrologue)                                 \
1217   declare_toplevel_type(PerfDataPrologue*)                                \
1218   declare_toplevel_type(PerfDataEntry)                                    \
1219   declare_toplevel_type(PerfMemory)                                       \
1220                                                                           \
1221   /*********************************/                                     \
1222   /* SymbolTable, SystemDictionary */                                     \
1223   /*********************************/                                     \
1224                                                                           \
1225   declare_toplevel_type(BasicHashtable)                                   \
1226     declare_type(Hashtable<intptr_t>, BasicHashtable)                     \
1227   declare_type(SymbolTable, Hashtable<Symbol*>)                           \
1228   declare_type(StringTable, Hashtable<oop>)                               \
1229     declare_type(LoaderConstraintTable, Hashtable<klassOop>)              \
1230     declare_type(TwoOopHashtable<klassOop>, Hashtable<klassOop>)          \
1231     declare_type(Dictionary, TwoOopHashtable<klassOop>)                   \
1232     declare_type(PlaceholderTable, TwoOopHashtable<Symbol*>)              \
1233   declare_toplevel_type(BasicHashtableEntry)                              \
1234   declare_type(HashtableEntry<intptr_t>, BasicHashtableEntry)             \
1235     declare_type(DictionaryEntry, HashtableEntry<klassOop>)               \
1236     declare_type(PlaceholderEntry, HashtableEntry<Symbol*>)               \
1237     declare_type(LoaderConstraintEntry, HashtableEntry<klassOop>)         \
1238   declare_toplevel_type(HashtableBucket)                                  \
1239   declare_toplevel_type(SystemDictionary)                                 \
1240   declare_toplevel_type(ProtectionDomainEntry)                            \
1241                                                                           \
1242   /***********************************************************/           \
1243   /* Thread hierarchy (needed for run-time type information) */           \
1244   /***********************************************************/           \
1245                                                                           \
1246   declare_toplevel_type(Threads)                                          \
1247   declare_toplevel_type(ThreadShadow)                                     \
1248            declare_type(Thread, ThreadShadow)                             \
1249            declare_type(NamedThread, Thread)                              \
1250            declare_type(WatcherThread, Thread)                            \
1251            declare_type(JavaThread, Thread)                               \
1252            declare_type(JvmtiAgentThread, JavaThread)                     \
1253            declare_type(ServiceThread, JavaThread)                        \
1254   declare_type(CompilerThread, JavaThread)                        \
1255   declare_toplevel_type(OSThread)                                         \
1256   declare_toplevel_type(JavaFrameAnchor)                                  \
1257                                                                           \
1258   /***************/                                                       \
1259   /* Interpreter */                                                       \
1260   /***************/                                                       \
1261                                                                           \
1262   declare_toplevel_type(AbstractInterpreter)                              \
1263                                                                           \
1264   /*********/                                                             \
1265   /* Stubs */                                                             \
1266   /*********/                                                             \
1267                                                                           \
1268   declare_toplevel_type(StubQueue)                                        \
1269   declare_toplevel_type(StubRoutines)                                     \
1270   IA32_ONLY(declare_toplevel_type(StubRoutines::x86))                     \
1271   declare_toplevel_type(Stub)                                             \
1272            declare_type(InterpreterCodelet, Stub)                         \
1273                                                                           \
1274   /*************/                                                         \
1275   /* JavaCalls */                                                         \
1276   /*************/                                                         \
1277                                                                           \
1278   declare_toplevel_type(JavaCallWrapper)                                  \
1279                                                                           \
1280   /*************/                                                         \
1281   /* CodeCache */                                                         \
1282   /*************/                                                         \
1283                                                                           \
1284   declare_toplevel_type(CodeCache)                                        \
1285                                                                           \
1286   /************/                                                          \
1287   /* CodeHeap */                                                          \
1288   /************/                                                          \
1289                                                                           \
1290   declare_toplevel_type(CodeHeap)                                         \
1291   declare_toplevel_type(CodeHeap*)                                        \
1292   declare_toplevel_type(HeapBlock)                                        \
1293   declare_toplevel_type(HeapBlock::Header)                                \
1294            declare_type(FreeBlock, HeapBlock)                             \
1295                                                                           \
1296   /*************************************************************/         \
1297   /* CodeBlob hierarchy (needed for run-time type information) */         \
1298   /*************************************************************/         \
1299                                                                           \
1300   declare_toplevel_type(CodeBlob)                                         \
1301   declare_type(BufferBlob,            CodeBlob)                           \
1302   declare_type(nmethod,       CodeBlob)                           \
1303   declare_type(RuntimeStub,           CodeBlob)                           \
1304   declare_type(SingletonBlob,         CodeBlob)                           \
1305   declare_type(SafepointBlob,         SingletonBlob)                      \
1306   declare_type(DeoptimizationBlob,    SingletonBlob)                      \
1307   declare_c2_type(ExceptionBlob,      SingletonBlob)                      \
1308   declare_c2_type(UncommonTrapBlob,   CodeBlob)                           \
1309                                                                           \
1310   /***************************************/                               \
1311   /* PcDesc and other compiled code info */                               \
1312   /***************************************/                               \
1313                                                                           \
1314   declare_toplevel_type(PcDesc)                                           \
1315   declare_integer_type(PcDesc::PcDescFlags)                               \
1316                                                                           \
1317   /************************/                                              \
1318   /* OopMap and OopMapSet */                                              \
1319   /************************/                                              \
1320                                                                           \
1321   declare_toplevel_type(OopMap)                                           \
1322   declare_toplevel_type(OopMapSet)                                        \
1323                                                                           \
1324   /********************/                                                  \
1325   /* CompressedStream */                                                  \
1326   /********************/                                                  \
1327                                                                           \
1328   declare_toplevel_type(CompressedStream)                                 \
1329                                                                           \
1330   /**************/                                                        \
1331   /* VMRegImpl  */                                                        \
1332   /**************/                                                        \
1333                                                                           \
1334   declare_toplevel_type(VMRegImpl)                                        \
1335                                                                           \
1336   /*********************************/                                     \
1337   /* JNIHandles and JNIHandleBlock */                                     \
1338   /*********************************/                                     \
1339                                                                           \
1340   declare_toplevel_type(JNIHandles)                                       \
1341   declare_toplevel_type(JNIHandleBlock)                                   \
1342                                                                           \
1343   /**********************/                                                \
1344   /* Runtime1 (C1 only) */                                                \
1345   /**********************/                                                \
1346                                                                           \
1347   declare_c1_toplevel_type(Runtime1)                                      \
1348                                                                           \
1349   /************/                                                          \
1350   /* Monitors */                                                          \
1351   /************/                                                          \
1352                                                                           \
1353   declare_toplevel_type(ObjectMonitor)                                    \
1354   declare_toplevel_type(ObjectSynchronizer)                               \
1355   declare_toplevel_type(BasicLock)                                        \
1356   declare_toplevel_type(BasicObjectLock)                                  \
1357                                                                           \
1358   /*********************/                                                 \
1359   /* Matcher (C2 only) */                                                 \
1360   /*********************/                                                 \
1361                                                                           \
1362   /* NOTE: this is not really a toplevel type, but we only need */        \
1363   /* this one -- FIXME later if necessary */                              \
1364   declare_c2_toplevel_type(Matcher)                                       \
1365                                                                           \
1366   /*********************/                                                 \
1367   /* Adapter Blob Entries */                                              \
1368   /*********************/                                                 \
1369   declare_toplevel_type(AdapterHandlerEntry)                              \
1370   declare_toplevel_type(AdapterHandlerEntry*)                             \
1371                                                                           \
1372   /********************/                                                  \
1373   /* -XX flags        */                                                  \
1374   /********************/                                                  \
1375                                                                           \
1376   declare_toplevel_type(Flag)                                             \
1377   declare_toplevel_type(Flag*)                                            \
1378                                                                           \
1379   /********************/                                                  \
1380   /* JDK/VM version   */                                                  \
1381   /********************/                                                  \
1382                                                                           \
1383   declare_toplevel_type(Abstract_VM_Version)                              \
1384   declare_toplevel_type(JDK_Version)                                      \
1385                                                                           \
1386   /*************/                                                         \
1387   /* Arguments */                                                         \
1388   /*************/                                                         \
1389                                                                           \
1390   declare_toplevel_type(Arguments)                                        \
1391                                                                           \
1392   /***************/                                                       \
1393   /* Other types */                                                       \
1394   /***************/                                                       \
1395                                                                           \
1396   /* all enum types */                                                    \
1397                                                                           \
1398    declare_integer_type(Bytecodes::Code)                                  \
1399    declare_integer_type(Generation::Name)                                 \
1400    declare_integer_type(instanceKlass::ClassState)                        \
1401    declare_integer_type(JavaThreadState)                                  \
1402    declare_integer_type(Location::Type)                                   \
1403    declare_integer_type(Location::Where)                                  \
1404    declare_integer_type(PermGen::Name)                                    \
1405                                                                           \
1406    declare_integer_type(AccessFlags)  /* FIXME: wrong type (not integer) */\
1407   declare_toplevel_type(address)      /* FIXME: should this be an integer type? */\
1408   declare_toplevel_type(BreakpointInfo)                                   \
1409   declare_toplevel_type(BreakpointInfo*)                                  \
1410   declare_toplevel_type(CodeBlob*)                                        \
1411   declare_toplevel_type(CompressedWriteStream*)                           \
1412   declare_toplevel_type(ConstantPoolCacheEntry)                           \
1413   declare_toplevel_type(elapsedTimer)                                     \
1414   declare_toplevel_type(intptr_t*)                                        \
1415    declare_unsigned_integer_type(InvocationCounter) /* FIXME: wrong type (not integer) */ \
1416   declare_toplevel_type(JavaThread*)                                      \
1417   declare_toplevel_type(jbyte*)                                           \
1418   declare_toplevel_type(jbyte**)                                          \
1419   declare_toplevel_type(jint*)                                            \
1420   declare_toplevel_type(jniIdMapBase*)                                    \
1421   declare_unsigned_integer_type(juint)                                    \
1422   declare_unsigned_integer_type(julong)                                   \
1423   declare_toplevel_type(JNIHandleBlock*)                                  \
1424   declare_toplevel_type(JNIid)                                            \
1425   declare_toplevel_type(JNIid*)                                           \
1426   declare_toplevel_type(jmethodID*)                                       \
1427   declare_toplevel_type(Mutex*)                                           \
1428   declare_toplevel_type(nmethod*)                                         \
1429   declare_toplevel_type(ObjectMonitor*)                                   \
1430   declare_toplevel_type(oop*)                                             \
1431   declare_toplevel_type(OopMap**)                                         \
1432   declare_toplevel_type(OopMapCache*)                                     \
1433   declare_toplevel_type(OopMapSet*)                                       \
1434   declare_toplevel_type(VMReg)                                            \
1435   declare_toplevel_type(OSThread*)                                        \
1436    declare_integer_type(ReferenceType)                                    \
1437   declare_toplevel_type(StubQueue*)                                       \
1438   declare_toplevel_type(Thread*)                                          \
1439   declare_toplevel_type(Universe)
1440 
1441   /* NOTE that we do not use the last_entry() macro here; it is used  */
1442   /* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must be */
1443   /* present there)                                                   */
1444 
1445 //--------------------------------------------------------------------------------
1446 // VM_INT_CONSTANTS
1447 //
1448 // This table contains integer constants required over in the
1449 // serviceability agent. The "declare_constant" macro is used for all
1450 // enums, etc., while "declare_preprocessor_constant" must be used for
1451 // all #defined constants.
1452 
1453 #define VM_INT_CONSTANTS(declare_constant,                                \
1454                          declare_preprocessor_constant,                   \
1455                          declare_c1_constant,                             \
1456                          declare_c2_constant,                             \
1457                          declare_c2_preprocessor_constant,                \
1458                          last_entry)                                      \
1459                                                                           \
1460   /******************/                                                    \
1461   /* Useful globals */                                                    \
1462   /******************/                                                    \
1463                                                                           \
1464   declare_constant(UseTLAB)                                               \
1465                                                                           \
1466   /**************/                                                        \
1467   /* Stack bias */                                                        \
1468   /**************/                                                        \
1469                                                                           \
1470   declare_preprocessor_constant("STACK_BIAS", STACK_BIAS)                 \
1471                                                                           \
1472   /****************/                                                      \
1473   /* Object sizes */                                                      \
1474   /****************/                                                      \
1475                                                                           \
1476   declare_constant(oopSize)                                               \
1477   declare_constant(LogBytesPerWord)                                       \
1478   declare_constant(BytesPerLong)                                          \
1479                                                                           \
1480   /********************************************/                          \
1481   /* Generation and Space Hierarchy Constants */                          \
1482   /********************************************/                          \
1483                                                                           \
1484   declare_constant(ageTable::table_size)                                  \
1485                                                                           \
1486   declare_constant(BarrierSet::ModRef)                                    \
1487   declare_constant(BarrierSet::CardTableModRef)                           \
1488   declare_constant(BarrierSet::Other)                                     \
1489                                                                           \
1490   declare_constant(BlockOffsetSharedArray::LogN)                          \
1491   declare_constant(BlockOffsetSharedArray::LogN_words)                    \
1492   declare_constant(BlockOffsetSharedArray::N_bytes)                       \
1493   declare_constant(BlockOffsetSharedArray::N_words)                       \
1494                                                                           \
1495   declare_constant(BlockOffsetArray::N_words)                             \
1496                                                                           \
1497   declare_constant(CardTableModRefBS::clean_card)                         \
1498   declare_constant(CardTableModRefBS::last_card)                          \
1499   declare_constant(CardTableModRefBS::dirty_card)                         \
1500   declare_constant(CardTableModRefBS::Precise)                            \
1501   declare_constant(CardTableModRefBS::ObjHeadPreciseArray)                \
1502   declare_constant(CardTableModRefBS::card_shift)                         \
1503   declare_constant(CardTableModRefBS::card_size)                          \
1504   declare_constant(CardTableModRefBS::card_size_in_words)                 \
1505                                                                           \
1506   declare_constant(CardTableRS::youngergen_card)                          \
1507                                                                           \
1508   declare_constant(CollectedHeap::Abstract)                               \
1509   declare_constant(CollectedHeap::SharedHeap)                             \
1510   declare_constant(CollectedHeap::GenCollectedHeap)                       \
1511                                                                           \
1512   declare_constant(GenCollectedHeap::max_gens)                            \
1513                                                                           \
1514   /* constants from Generation::Name enum */                              \
1515                                                                           \
1516   declare_constant(Generation::DefNew)                                    \
1517   declare_constant(Generation::MarkSweepCompact)                          \
1518   declare_constant(Generation::Other)                                     \
1519                                                                           \
1520   declare_constant(Generation::LogOfGenGrain)                             \
1521   declare_constant(Generation::GenGrain)                                  \
1522                                                                           \
1523   declare_constant(HeapWordSize)                                          \
1524   declare_constant(LogHeapWordSize)                                       \
1525                                                                           \
1526   /* constants from PermGen::Name enum */                                 \
1527                                                                           \
1528   declare_constant(PermGen::MarkSweepCompact)                             \
1529   declare_constant(PermGen::MarkSweep)                                    \
1530                                                                           \
1531   /************************/                                              \
1532   /* PerfMemory - jvmstat */                                              \
1533   /************************/                                              \
1534                                                                           \
1535   declare_preprocessor_constant("PERFDATA_MAJOR_VERSION", PERFDATA_MAJOR_VERSION) \
1536   declare_preprocessor_constant("PERFDATA_MINOR_VERSION", PERFDATA_MINOR_VERSION) \
1537   declare_preprocessor_constant("PERFDATA_BIG_ENDIAN", PERFDATA_BIG_ENDIAN)       \
1538   declare_preprocessor_constant("PERFDATA_LITTLE_ENDIAN", PERFDATA_LITTLE_ENDIAN) \
1539                                                                           \
1540   /***************/                                                       \
1541   /* SymbolTable */                                                       \
1542   /***************/                                                       \
1543                                                                           \
1544   declare_constant(SymbolTable::symbol_table_size)                        \
1545                                                                           \
1546   /***************/                                                       \
1547   /* StringTable */                                                       \
1548   /***************/                                                       \
1549                                                                           \
1550   declare_constant(StringTable::string_table_size)                        \
1551                                                                           \
1552   /********************/                                                  \
1553   /* SystemDictionary */                                                  \
1554   /********************/                                                  \
1555                                                                           \
1556   declare_constant(SystemDictionary::_loader_constraint_size)             \
1557   declare_constant(SystemDictionary::_nof_buckets)                        \
1558                                                                           \
1559   /***********************************/                                   \
1560   /* LoaderConstraintTable constants */                                   \
1561   /***********************************/                                   \
1562                                                                           \
1563   declare_constant(LoaderConstraintTable::_loader_constraint_size)        \
1564   declare_constant(LoaderConstraintTable::_nof_buckets)                   \
1565                                                                           \
1566   /************************************************************/          \
1567   /* HotSpot specific JVM_ACC constants from global anon enum */          \
1568   /************************************************************/          \
1569                                                                           \
1570   declare_constant(JVM_ACC_WRITTEN_FLAGS)                                 \
1571   declare_constant(JVM_ACC_MONITOR_MATCH)                                 \
1572   declare_constant(JVM_ACC_HAS_MONITOR_BYTECODES)                         \
1573   declare_constant(JVM_ACC_HAS_LOOPS)                                     \
1574   declare_constant(JVM_ACC_LOOPS_FLAG_INIT)                               \
1575   declare_constant(JVM_ACC_QUEUED)                                        \
1576   declare_constant(JVM_ACC_NOT_OSR_COMPILABLE)                            \
1577   declare_constant(JVM_ACC_HAS_LINE_NUMBER_TABLE)                         \
1578   declare_constant(JVM_ACC_HAS_CHECKED_EXCEPTIONS)                        \
1579   declare_constant(JVM_ACC_HAS_JSRS)                                      \
1580   declare_constant(JVM_ACC_IS_OLD)                                        \
1581   declare_constant(JVM_ACC_IS_OBSOLETE)                                   \
1582   declare_constant(JVM_ACC_IS_PREFIXED_NATIVE)                            \
1583   declare_constant(JVM_ACC_HAS_MIRANDA_METHODS)                           \
1584   declare_constant(JVM_ACC_HAS_VANILLA_CONSTRUCTOR)                       \
1585   declare_constant(JVM_ACC_HAS_FINALIZER)                                 \
1586   declare_constant(JVM_ACC_IS_CLONEABLE)                                  \
1587   declare_constant(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE)                      \
1588   declare_constant(JVM_ACC_PROMOTED_FLAGS)                                \
1589   declare_constant(JVM_ACC_FIELD_ACCESS_WATCHED)                          \
1590   declare_constant(JVM_ACC_FIELD_MODIFICATION_WATCHED)                    \
1591                                                                           \
1592   /*****************************/                                         \
1593   /* Thread::SuspendFlags enum */                                         \
1594   /*****************************/                                         \
1595                                                                           \
1596   declare_constant(Thread::_external_suspend)                             \
1597   declare_constant(Thread::_ext_suspended)                                \
1598   declare_constant(Thread::_has_async_exception)                          \
1599                                                                           \
1600   /*******************/                                                   \
1601   /* JavaThreadState */                                                   \
1602   /*******************/                                                   \
1603                                                                           \
1604   declare_constant(_thread_uninitialized)                                 \
1605   declare_constant(_thread_new)                                           \
1606   declare_constant(_thread_new_trans)                                     \
1607   declare_constant(_thread_in_native)                                     \
1608   declare_constant(_thread_in_native_trans)                               \
1609   declare_constant(_thread_in_vm)                                         \
1610   declare_constant(_thread_in_vm_trans)                                   \
1611   declare_constant(_thread_in_Java)                                       \
1612   declare_constant(_thread_in_Java_trans)                                 \
1613   declare_constant(_thread_blocked)                                       \
1614   declare_constant(_thread_blocked_trans)                                 \
1615                                                                           \
1616   /******************************/                                        \
1617   /* Klass misc. enum constants */                                        \
1618   /******************************/                                        \
1619                                                                           \
1620   declare_constant(Klass::_primary_super_limit)                           \
1621   declare_constant(Klass::_lh_instance_slow_path_bit)                     \
1622   declare_constant(Klass::_lh_log2_element_size_shift)                    \
1623   declare_constant(Klass::_lh_element_type_shift)                         \
1624   declare_constant(Klass::_lh_header_size_shift)                          \
1625   declare_constant(Klass::_lh_array_tag_shift)                            \
1626   declare_constant(Klass::_lh_array_tag_type_value)                       \
1627   declare_constant(Klass::_lh_array_tag_obj_value)                        \
1628                                                                           \
1629   /********************************/                                      \
1630   /* constMethodOopDesc anon-enum */                                      \
1631   /********************************/                                      \
1632                                                                           \
1633   declare_constant(constMethodOopDesc::_has_linenumber_table)             \
1634   declare_constant(constMethodOopDesc::_has_checked_exceptions)           \
1635   declare_constant(constMethodOopDesc::_has_localvariable_table)          \
1636                                                                           \
1637   /*************************************/                                 \
1638   /* instanceKlass FieldOffset enum    */                                 \
1639   /*************************************/                                 \
1640                                                                           \
1641   declare_constant(instanceKlass::access_flags_offset)                    \
1642   declare_constant(instanceKlass::name_index_offset)                      \
1643   declare_constant(instanceKlass::signature_index_offset)                 \
1644   declare_constant(instanceKlass::initval_index_offset)                   \
1645   declare_constant(instanceKlass::low_offset)                             \
1646   declare_constant(instanceKlass::high_offset)                            \
1647   declare_constant(instanceKlass::generic_signature_offset)               \
1648   declare_constant(instanceKlass::next_offset)                            \
1649   declare_constant(instanceKlass::implementors_limit)                     \
1650                                                                           \
1651   /************************************************/                      \
1652   /* instanceKlass InnerClassAttributeOffset enum */                      \
1653   /************************************************/                      \
1654                                                                           \
1655   declare_constant(instanceKlass::inner_class_inner_class_info_offset)    \
1656   declare_constant(instanceKlass::inner_class_outer_class_info_offset)    \
1657   declare_constant(instanceKlass::inner_class_inner_name_offset)          \
1658   declare_constant(instanceKlass::inner_class_access_flags_offset)        \
1659   declare_constant(instanceKlass::inner_class_next_offset)                \
1660                                                                           \
1661   /*********************************/                                     \
1662   /* instanceKlass ClassState enum */                                     \
1663   /*********************************/                                     \
1664                                                                           \
1665   declare_constant(instanceKlass::unparsable_by_gc)                       \
1666   declare_constant(instanceKlass::allocated)                              \
1667   declare_constant(instanceKlass::loaded)                                 \
1668   declare_constant(instanceKlass::linked)                                 \
1669   declare_constant(instanceKlass::being_initialized)                      \
1670   declare_constant(instanceKlass::fully_initialized)                      \
1671   declare_constant(instanceKlass::initialization_error)                   \
1672                                                                           \
1673   /*********************************/                                     \
1674   /* Symbol* - symbol max length */                                     \
1675   /*********************************/                                     \
1676                                                                           \
1677   declare_constant(Symbol::max_symbol_length)                             \
1678                                                                           \
1679   /*************************************************/                     \
1680   /* constantPoolOop layout enum for InvokeDynamic */                     \
1681   /*************************************************/                     \
1682                                                                           \
1683   declare_constant(constantPoolOopDesc::_indy_bsm_offset)                 \
1684   declare_constant(constantPoolOopDesc::_indy_argc_offset)                \
1685   declare_constant(constantPoolOopDesc::_indy_argv_offset)                \
1686                                                                           \
1687   /*********************************************/                         \
1688   /* ConstantPoolCacheEntry FlagBitValues enum */                         \
1689   /*********************************************/                         \
1690                                                                           \
1691   declare_constant(ConstantPoolCacheEntry::hotSwapBit)                    \
1692   declare_constant(ConstantPoolCacheEntry::methodInterface)               \
1693   declare_constant(ConstantPoolCacheEntry::volatileField)                 \
1694   declare_constant(ConstantPoolCacheEntry::vfinalMethod)                  \
1695   declare_constant(ConstantPoolCacheEntry::finalField)                    \
1696                                                                           \
1697   /******************************************/                            \
1698   /* ConstantPoolCacheEntry FlagValues enum */                            \
1699   /******************************************/                            \
1700                                                                           \
1701   declare_constant(ConstantPoolCacheEntry::tosBits)                       \
1702                                                                           \
1703   /*********************************/                                     \
1704   /* java_lang_Class field offsets */                                     \
1705   /*********************************/                                     \
1706                                                                           \
1707   declare_constant(java_lang_Class::hc_klass_offset)                      \
1708   declare_constant(java_lang_Class::hc_array_klass_offset)                \
1709   declare_constant(java_lang_Class::hc_resolved_constructor_offset)       \
1710   declare_constant(java_lang_Class::hc_number_of_fake_oop_fields)         \
1711                                                                           \
1712   /***************************************/                               \
1713   /* java_lang_Thread::ThreadStatus enum */                               \
1714   /***************************************/                               \
1715                                                                           \
1716   declare_constant(java_lang_Thread::NEW)                                 \
1717   declare_constant(java_lang_Thread::RUNNABLE)                            \
1718   declare_constant(java_lang_Thread::SLEEPING)                            \
1719   declare_constant(java_lang_Thread::IN_OBJECT_WAIT)                      \
1720   declare_constant(java_lang_Thread::IN_OBJECT_WAIT_TIMED)                \
1721   declare_constant(java_lang_Thread::PARKED)                              \
1722   declare_constant(java_lang_Thread::PARKED_TIMED)                        \
1723   declare_constant(java_lang_Thread::BLOCKED_ON_MONITOR_ENTER)            \
1724   declare_constant(java_lang_Thread::TERMINATED)                          \
1725                                                                           \
1726   /******************************/                                        \
1727   /* Debug info                 */                                        \
1728   /******************************/                                        \
1729                                                                           \
1730   declare_constant(Location::OFFSET_MASK)                                 \
1731   declare_constant(Location::OFFSET_SHIFT)                                \
1732   declare_constant(Location::TYPE_MASK)                                   \
1733   declare_constant(Location::TYPE_SHIFT)                                  \
1734   declare_constant(Location::WHERE_MASK)                                  \
1735   declare_constant(Location::WHERE_SHIFT)                                 \
1736                                                                           \
1737   /* constants from Location::Type enum  */                               \
1738                                                                           \
1739   declare_constant(Location::normal)                                      \
1740   declare_constant(Location::oop)                                         \
1741   declare_constant(Location::narrowoop)                                   \
1742   declare_constant(Location::int_in_long)                                 \
1743   declare_constant(Location::lng)                                         \
1744   declare_constant(Location::float_in_dbl)                                \
1745   declare_constant(Location::dbl)                                         \
1746   declare_constant(Location::addr)                                        \
1747   declare_constant(Location::invalid)                                     \
1748                                                                           \
1749   /* constants from Location::Where enum */                               \
1750                                                                           \
1751   declare_constant(Location::on_stack)                                    \
1752   declare_constant(Location::in_register)                                 \
1753                                                                           \
1754   /*********************/                                                 \
1755   /* Matcher (C2 only) */                                                 \
1756   /*********************/                                                 \
1757                                                                           \
1758   declare_c2_preprocessor_constant("Matcher::interpreter_frame_pointer_reg", Matcher::interpreter_frame_pointer_reg()) \
1759                                                                           \
1760   /*********************************************/                         \
1761   /* MethodCompilation (globalDefinitions.hpp) */                         \
1762   /*********************************************/                         \
1763                                                                           \
1764   declare_constant(InvocationEntryBci)                                    \
1765   declare_constant(InvalidOSREntryBci)                                    \
1766                                                                           \
1767   /***************/                                                       \
1768   /* OopMapValue */                                                       \
1769   /***************/                                                       \
1770                                                                           \
1771   declare_constant(OopMapValue::type_bits)                                \
1772   declare_constant(OopMapValue::register_bits)                            \
1773   declare_constant(OopMapValue::type_shift)                               \
1774   declare_constant(OopMapValue::register_shift)                           \
1775   declare_constant(OopMapValue::type_mask)                                \
1776   declare_constant(OopMapValue::type_mask_in_place)                       \
1777   declare_constant(OopMapValue::register_mask)                            \
1778   declare_constant(OopMapValue::register_mask_in_place)                   \
1779   declare_constant(OopMapValue::unused_value)                             \
1780   declare_constant(OopMapValue::oop_value)                                \
1781   declare_constant(OopMapValue::value_value)                              \
1782   declare_constant(OopMapValue::narrowoop_value)                          \
1783   declare_constant(OopMapValue::callee_saved_value)                       \
1784   declare_constant(OopMapValue::derived_oop_value)                        \
1785                                                                           \
1786   /******************/                                                    \
1787   /* JNIHandleBlock */                                                    \
1788   /******************/                                                    \
1789                                                                           \
1790   declare_constant(JNIHandleBlock::block_size_in_oops)                    \
1791                                                                           \
1792   /**********************/                                                \
1793   /* ObjectSynchronizer */                                                \
1794   /**********************/                                                \
1795                                                                           \
1796   declare_constant(ObjectSynchronizer::_BLOCKSIZE)                        \
1797                                                                           \
1798   /********************************/                                      \
1799   /* Calling convention constants */                                      \
1800   /********************************/                                      \
1801                                                                           \
1802   declare_constant(RegisterImpl::number_of_registers)                     \
1803   declare_constant(ConcreteRegisterImpl::number_of_registers)             \
1804   declare_preprocessor_constant("REG_COUNT", REG_COUNT)                \
1805   declare_c2_preprocessor_constant("SAVED_ON_ENTRY_REG_COUNT", SAVED_ON_ENTRY_REG_COUNT) \
1806   declare_c2_preprocessor_constant("C_SAVED_ON_ENTRY_REG_COUNT", C_SAVED_ON_ENTRY_REG_COUNT)
1807 
1808   /* NOTE that we do not use the last_entry() macro here; it is used  */
1809   /* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and */
1810   /* must be present there)                                           */
1811 
1812 //--------------------------------------------------------------------------------
1813 // VM_LONG_CONSTANTS
1814 //
1815 // This table contains long constants required over in the
1816 // serviceability agent. The "declare_constant" macro is used for all
1817 // enums, etc., while "declare_preprocessor_constant" must be used for
1818 // all #defined constants.
1819 
1820 #define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
1821                                                                           \
1822   /*********************/                                                 \
1823   /* MarkOop constants */                                                 \
1824   /*********************/                                                 \
1825                                                                           \
1826   /* Note: some of these are declared as long constants just for */       \
1827   /* consistency. The mask constants are the only ones requiring */       \
1828   /* 64 bits (on 64-bit platforms). */                                    \
1829                                                                           \
1830   declare_constant(markOopDesc::age_bits)                                 \
1831   declare_constant(markOopDesc::lock_bits)                                \
1832   declare_constant(markOopDesc::biased_lock_bits)                         \
1833   declare_constant(markOopDesc::max_hash_bits)                            \
1834   declare_constant(markOopDesc::hash_bits)                                \
1835                                                                           \
1836   declare_constant(markOopDesc::lock_shift)                               \
1837   declare_constant(markOopDesc::biased_lock_shift)                        \
1838   declare_constant(markOopDesc::age_shift)                                \
1839   declare_constant(markOopDesc::hash_shift)                               \
1840                                                                           \
1841   declare_constant(markOopDesc::lock_mask)                                \
1842   declare_constant(markOopDesc::lock_mask_in_place)                       \
1843   declare_constant(markOopDesc::biased_lock_mask)                         \
1844   declare_constant(markOopDesc::biased_lock_mask_in_place)                \
1845   declare_constant(markOopDesc::biased_lock_bit_in_place)                 \
1846   declare_constant(markOopDesc::age_mask)                                 \
1847   declare_constant(markOopDesc::age_mask_in_place)                        \
1848   declare_constant(markOopDesc::hash_mask)                                \
1849   declare_constant(markOopDesc::hash_mask_in_place)                       \
1850   declare_constant(markOopDesc::biased_lock_alignment)                    \
1851                                                                           \
1852   declare_constant(markOopDesc::locked_value)                             \
1853   declare_constant(markOopDesc::unlocked_value)                           \
1854   declare_constant(markOopDesc::monitor_value)                            \
1855   declare_constant(markOopDesc::marked_value)                             \
1856   declare_constant(markOopDesc::biased_lock_pattern)                      \
1857                                                                           \
1858   declare_constant(markOopDesc::no_hash)                                  \
1859   declare_constant(markOopDesc::no_hash_in_place)                         \
1860   declare_constant(markOopDesc::no_lock_in_place)                         \
1861   declare_constant(markOopDesc::max_age)                                  \
1862                                                                           \
1863   /* Constants in markOop used by CMS. */                                 \
1864   declare_constant(markOopDesc::cms_shift)                                \
1865   declare_constant(markOopDesc::cms_mask)                                 \
1866   declare_constant(markOopDesc::size_shift)                               \
1867 
1868   /* NOTE that we do not use the last_entry() macro here; it is used   */
1869   /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and */
1870   /* must be present there)                                            */
1871 
1872 
1873 //--------------------------------------------------------------------------------
1874 // Macros operating on the above lists
1875 //--------------------------------------------------------------------------------
1876 
1877 // This utility macro quotes the passed string
1878 #define QUOTE(x) #x
1879 
1880 //--------------------------------------------------------------------------------
1881 // VMStructEntry macros
1882 //
1883 
1884 // This macro generates a VMStructEntry line for a nonstatic field
1885 #define GENERATE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type)              \
1886  { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 0, cast_uint64_t(offset_of(typeName, fieldName)), NULL },
1887 
1888 // This macro generates a VMStructEntry line for a static field
1889 #define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type)                 \
1890  { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName },
1891 
1892 // This macro generates a VMStructEntry line for an unchecked
1893 // nonstatic field, in which the size of the type is also specified.
1894 // The type string is given as NULL, indicating an "opaque" type.
1895 #define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size)    \
1896   { QUOTE(typeName), QUOTE(fieldName), NULL, 0, cast_uint64_t(offset_of(typeName, fieldName)), NULL },
1897 
1898 // This macro generates a VMStructEntry line for an unchecked
1899 // static field, in which the size of the type is also specified.
1900 // The type string is given as NULL, indicating an "opaque" type.
1901 #define GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, size)       \
1902  { QUOTE(typeName), QUOTE(fieldName), NULL, 1, 0, (void*) &typeName::fieldName },
1903 
1904 // This macro generates the sentinel value indicating the end of the list
1905 #define GENERATE_VM_STRUCT_LAST_ENTRY() \
1906  { NULL, NULL, NULL, 0, 0, NULL }
1907 
1908 // This macro checks the type of a VMStructEntry by comparing pointer types
1909 #define CHECK_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type)                 \
1910  {typeName *dummyObj = NULL; type* dummy = &dummyObj->fieldName; }
1911 
1912 // This macro checks the type of a volatile VMStructEntry by comparing pointer types
1913 #define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type)        \
1914  {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; }
1915 
1916 // This macro checks the type of a VMStructEntry by comparing pointer types
1917 #define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type)                    \
1918  {type* dummy = &typeName::fieldName; }
1919 
1920 // This macro ensures the type of a field and its containing type are
1921 // present in the type table. The assertion string is shorter than
1922 // preferable because (incredibly) of a bug in Solstice NFS client
1923 // which seems to prevent very long lines from compiling. This assertion
1924 // means that an entry in VMStructs::localHotSpotVMStructs[] was not
1925 // found in VMStructs::localHotSpotVMTypes[].
1926 #define ENSURE_FIELD_TYPE_PRESENT(typeName, fieldName, type)                       \
1927  { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \
1928    assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); }
1929 
1930 // This is a no-op macro for unchecked fields
1931 #define CHECK_NO_OP(a, b, c)
1932 
1933 // This is a no-op macro for the sentinel value
1934 #define CHECK_SENTINEL()
1935 
1936 //
1937 // Build-specific macros:
1938 //
1939 
1940 // Generate and check a nonstatic field in non-product builds
1941 #ifndef PRODUCT
1942 # define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1943 # define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)    CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1944 # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)          ENSURE_FIELD_TYPE_PRESENT(a, b, c)
1945 # define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1946 # define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)    CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1947 # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)          ENSURE_FIELD_TYPE_PRESENT(a, b, c)
1948 #else
1949 # define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1950 # define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1951 # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)
1952 # define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1953 # define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1954 # define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)
1955 #endif /* PRODUCT */
1956 
1957 // Generate and check a nonstatic field in C1 builds
1958 #ifdef COMPILER1
1959 # define GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1960 # define CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)    CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1961 # define ENSURE_C1_FIELD_TYPE_PRESENT(a, b, c)          ENSURE_FIELD_TYPE_PRESENT(a, b, c)
1962 #else
1963 # define GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1964 # define CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1965 # define ENSURE_C1_FIELD_TYPE_PRESENT(a, b, c)
1966 #endif /* COMPILER1 */
1967 // Generate and check a nonstatic field in C2 builds
1968 #ifdef COMPILER2
1969 # define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1970 # define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)    CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1971 # define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c)          ENSURE_FIELD_TYPE_PRESENT(a, b, c)
1972 #else
1973 # define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1974 # define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
1975 # define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c)
1976 #endif /* COMPILER2 */
1977 
1978 // Generate but do not check a static field in C1 builds
1979 #ifdef COMPILER1
1980 # define GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
1981 #else
1982 # define GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
1983 #endif /* COMPILER1 */
1984 
1985 // Generate but do not check a static field in C2 builds
1986 #ifdef COMPILER2
1987 # define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
1988 #else
1989 # define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
1990 #endif /* COMPILER2 */
1991 
1992 //--------------------------------------------------------------------------------
1993 // VMTypeEntry macros
1994 //
1995 
1996 #define GENERATE_VM_TYPE_ENTRY(type, superclass) \
1997  { QUOTE(type), QUOTE(superclass), 0, 0, 0, sizeof(type) },
1998 
1999 #define GENERATE_TOPLEVEL_VM_TYPE_ENTRY(type) \
2000  { QUOTE(type), NULL,              0, 0, 0, sizeof(type) },
2001 
2002 #define GENERATE_OOP_VM_TYPE_ENTRY(type) \
2003  { QUOTE(type), NULL,              1, 0, 0, sizeof(type) },
2004 
2005 #define GENERATE_INTEGER_VM_TYPE_ENTRY(type) \
2006  { QUOTE(type), NULL,              0, 1, 0, sizeof(type) },
2007 
2008 #define GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY(type) \
2009  { QUOTE(type), NULL,              0, 1, 1, sizeof(type) },
2010 
2011 #define GENERATE_VM_TYPE_LAST_ENTRY() \
2012  { NULL, NULL, 0, 0, 0, 0 }
2013 
2014 #define CHECK_VM_TYPE_ENTRY(type, superclass) \
2015  { type* dummyObj = NULL; superclass* dummySuperObj = dummyObj; }
2016 
2017 #define CHECK_VM_TYPE_NO_OP(a)
2018 #define CHECK_SINGLE_ARG_VM_TYPE_NO_OP(a)
2019 
2020 //
2021 // Build-specific macros:
2022 //
2023 
2024 #ifdef COMPILER1
2025 # define GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY(a)               GENERATE_TOPLEVEL_VM_TYPE_ENTRY(a)
2026 # define CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY(a)
2027 #else
2028 # define GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY(a)
2029 # define CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY(a)
2030 #endif /* COMPILER1 */
2031 
2032 #ifdef COMPILER2
2033 # define GENERATE_C2_VM_TYPE_ENTRY(a, b)                     GENERATE_VM_TYPE_ENTRY(a, b)
2034 # define CHECK_C2_VM_TYPE_ENTRY(a, b)                        CHECK_VM_TYPE_ENTRY(a, b)
2035 # define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a)               GENERATE_TOPLEVEL_VM_TYPE_ENTRY(a)
2036 # define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a)
2037 #else
2038 # define GENERATE_C2_VM_TYPE_ENTRY(a, b)
2039 # define CHECK_C2_VM_TYPE_ENTRY(a, b)
2040 # define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a)
2041 # define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a)
2042 #endif /* COMPILER2 */
2043 
2044 
2045 //--------------------------------------------------------------------------------
2046 // VMIntConstantEntry macros
2047 //
2048 
2049 #define GENERATE_VM_INT_CONSTANT_ENTRY(name) \
2050  { QUOTE(name), (int32_t) name },
2051 
2052 #define GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) \
2053  { name, (int32_t) value },
2054 
2055 // This macro generates the sentinel value indicating the end of the list
2056 #define GENERATE_VM_INT_CONSTANT_LAST_ENTRY() \
2057  { NULL, 0 }
2058 
2059 
2060 // Generate an int constant for a C1 build
2061 #ifdef COMPILER1
2062 # define GENERATE_C1_VM_INT_CONSTANT_ENTRY(name)  GENERATE_VM_INT_CONSTANT_ENTRY(name)
2063 #else
2064 # define GENERATE_C1_VM_INT_CONSTANT_ENTRY(name)
2065 #endif /* COMPILER1 */
2066 
2067 // Generate an int constant for a C2 build
2068 #ifdef COMPILER2
2069 # define GENERATE_C2_VM_INT_CONSTANT_ENTRY(name)                      GENERATE_VM_INT_CONSTANT_ENTRY(name)
2070 # define GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value)  GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value)
2071 #else
2072 # define GENERATE_C2_VM_INT_CONSTANT_ENTRY(name)
2073 # define GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value)
2074 #endif /* COMPILER1 */
2075 
2076 //--------------------------------------------------------------------------------
2077 // VMLongConstantEntry macros
2078 //
2079 
2080 #define GENERATE_VM_LONG_CONSTANT_ENTRY(name) \
2081   { QUOTE(name), cast_uint64_t(name) },
2082 
2083 #define GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) \
2084   { name, cast_uint64_t(value) },
2085 
2086 // This macro generates the sentinel value indicating the end of the list
2087 #define GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() \
2088  { NULL, 0 }
2089 
2090 // Generate a long constant for a C1 build
2091 #ifdef COMPILER1
2092 # define GENERATE_C1_VM_LONG_CONSTANT_ENTRY(name)  GENERATE_VM_LONG_CONSTANT_ENTRY(name)
2093 #else
2094 # define GENERATE_C1_VM_LONG_CONSTANT_ENTRY(name)
2095 #endif /* COMPILER1 */
2096 
2097 // Generate a long constant for a C2 build
2098 #ifdef COMPILER2
2099 # define GENERATE_C2_VM_LONG_CONSTANT_ENTRY(name)                     GENERATE_VM_LONG_CONSTANT_ENTRY(name)
2100 # define GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value)
2101 #else
2102 # define GENERATE_C2_VM_LONG_CONSTANT_ENTRY(name)
2103 # define GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value)
2104 #endif /* COMPILER1 */
2105 
2106 //
2107 // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries
2108 //
2109 
2110 // These initializers are allowed to access private fields in classes
2111 // as long as class VMStructs is a friend
2112 VMStructEntry VMStructs::localHotSpotVMStructs[] = {
2113 
2114   VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2115              GENERATE_STATIC_VM_STRUCT_ENTRY, \
2116              GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, \
2117              GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2118              GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, \
2119              GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY, \
2120              GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, \
2121              GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \
2122              GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \
2123              GENERATE_VM_STRUCT_LAST_ENTRY)
2124 
2125 #ifndef SERIALGC
2126   VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2127                         GENERATE_STATIC_VM_STRUCT_ENTRY)
2128 
2129   VM_STRUCTS_CMS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2130                  GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2131                  GENERATE_STATIC_VM_STRUCT_ENTRY)
2132 #endif // SERIALGC
2133 
2134   VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2135                  GENERATE_STATIC_VM_STRUCT_ENTRY, \
2136                  GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, \
2137                  GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2138                  GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, \
2139                  GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, \
2140                  GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \
2141                  GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \
2142                  GENERATE_VM_STRUCT_LAST_ENTRY)
2143 
2144   VM_STRUCTS_OS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2145                     GENERATE_STATIC_VM_STRUCT_ENTRY, \
2146                     GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, \
2147                     GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
2148                     GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, \
2149                     GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, \
2150                     GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \
2151                     GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY, \
2152                     GENERATE_VM_STRUCT_LAST_ENTRY)
2153 };
2154 
2155 VMTypeEntry VMStructs::localHotSpotVMTypes[] = {
2156 
2157   VM_TYPES(GENERATE_VM_TYPE_ENTRY,
2158            GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
2159            GENERATE_OOP_VM_TYPE_ENTRY,
2160            GENERATE_INTEGER_VM_TYPE_ENTRY,
2161            GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY,
2162            GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY,
2163            GENERATE_C2_VM_TYPE_ENTRY,
2164            GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY,
2165            GENERATE_VM_TYPE_LAST_ENTRY)
2166 
2167 #ifndef SERIALGC
2168   VM_TYPES_PARALLELGC(GENERATE_VM_TYPE_ENTRY,
2169                       GENERATE_TOPLEVEL_VM_TYPE_ENTRY)
2170 
2171   VM_TYPES_CMS(GENERATE_VM_TYPE_ENTRY,
2172                GENERATE_TOPLEVEL_VM_TYPE_ENTRY)
2173 
2174   VM_TYPES_PARNEW(GENERATE_VM_TYPE_ENTRY)
2175 #endif // SERIALGC
2176 
2177   VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY,
2178                GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
2179                GENERATE_OOP_VM_TYPE_ENTRY,
2180                GENERATE_INTEGER_VM_TYPE_ENTRY,
2181                GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY,
2182                GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY,
2183                GENERATE_C2_VM_TYPE_ENTRY,
2184                GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY,
2185                GENERATE_VM_TYPE_LAST_ENTRY)
2186 
2187   VM_TYPES_OS_CPU(GENERATE_VM_TYPE_ENTRY,
2188                   GENERATE_TOPLEVEL_VM_TYPE_ENTRY,
2189                   GENERATE_OOP_VM_TYPE_ENTRY,
2190                   GENERATE_INTEGER_VM_TYPE_ENTRY,
2191                   GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY,
2192                   GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY,
2193                   GENERATE_C2_VM_TYPE_ENTRY,
2194                   GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY,
2195                   GENERATE_VM_TYPE_LAST_ENTRY)
2196 };
2197 
2198 VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = {
2199 
2200   VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY,
2201                    GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
2202                    GENERATE_C1_VM_INT_CONSTANT_ENTRY,
2203                    GENERATE_C2_VM_INT_CONSTANT_ENTRY,
2204                    GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
2205                    GENERATE_VM_INT_CONSTANT_LAST_ENTRY)
2206 
2207 #ifndef SERIALGC
2208   VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY)
2209 
2210   VM_INT_CONSTANTS_PARNEW(GENERATE_VM_INT_CONSTANT_ENTRY)
2211 #endif // SERIALGC
2212 
2213   VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY,
2214                        GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
2215                        GENERATE_C1_VM_INT_CONSTANT_ENTRY,
2216                        GENERATE_C2_VM_INT_CONSTANT_ENTRY,
2217                        GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
2218                        GENERATE_VM_INT_CONSTANT_LAST_ENTRY)
2219 
2220   VM_INT_CONSTANTS_OS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY,
2221                           GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
2222                           GENERATE_C1_VM_INT_CONSTANT_ENTRY,
2223                           GENERATE_C2_VM_INT_CONSTANT_ENTRY,
2224                           GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY,
2225                           GENERATE_VM_INT_CONSTANT_LAST_ENTRY)
2226 };
2227 
2228 VMLongConstantEntry VMStructs::localHotSpotVMLongConstants[] = {
2229 
2230   VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY,
2231                     GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
2232                     GENERATE_C1_VM_LONG_CONSTANT_ENTRY,
2233                     GENERATE_C2_VM_LONG_CONSTANT_ENTRY,
2234                     GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
2235                     GENERATE_VM_LONG_CONSTANT_LAST_ENTRY)
2236 
2237   VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY,
2238                         GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
2239                         GENERATE_C1_VM_LONG_CONSTANT_ENTRY,
2240                         GENERATE_C2_VM_LONG_CONSTANT_ENTRY,
2241                         GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
2242                         GENERATE_VM_LONG_CONSTANT_LAST_ENTRY)
2243 
2244   VM_LONG_CONSTANTS_OS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY,
2245                            GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
2246                            GENERATE_C1_VM_LONG_CONSTANT_ENTRY,
2247                            GENERATE_C2_VM_LONG_CONSTANT_ENTRY,
2248                            GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY,
2249                            GENERATE_VM_LONG_CONSTANT_LAST_ENTRY)
2250 };
2251 
2252 // This is used both to check the types of referenced fields and, in
2253 // debug builds, to ensure that all of the field types are present.
2254 void
2255 VMStructs::init() {
2256   VM_STRUCTS(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2257              CHECK_STATIC_VM_STRUCT_ENTRY,
2258              CHECK_NO_OP,
2259              CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
2260              CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
2261              CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY,
2262              CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY,
2263              CHECK_NO_OP,
2264              CHECK_NO_OP,
2265              CHECK_SENTINEL);
2266 
2267 #ifndef SERIALGC
2268   VM_STRUCTS_PARALLELGC(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2269              CHECK_STATIC_VM_STRUCT_ENTRY);
2270 
2271   VM_STRUCTS_CMS(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2272              CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
2273              CHECK_STATIC_VM_STRUCT_ENTRY);
2274 #endif // SERIALGC
2275 
2276   VM_STRUCTS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2277                  CHECK_STATIC_VM_STRUCT_ENTRY,
2278                  CHECK_NO_OP,
2279                  CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
2280                  CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
2281                  CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY,
2282                  CHECK_NO_OP,
2283                  CHECK_NO_OP,
2284                  CHECK_SENTINEL);
2285 
2286   VM_STRUCTS_OS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
2287                     CHECK_STATIC_VM_STRUCT_ENTRY,
2288                     CHECK_NO_OP,
2289                     CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
2290                     CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY,
2291                     CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY,
2292                     CHECK_NO_OP,
2293                     CHECK_NO_OP,
2294                     CHECK_SENTINEL);
2295 
2296   VM_TYPES(CHECK_VM_TYPE_ENTRY,
2297            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2298            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2299            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2300            CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2301            CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY,
2302            CHECK_C2_VM_TYPE_ENTRY,
2303            CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY,
2304            CHECK_SENTINEL);
2305 
2306 #ifndef SERIALGC
2307   VM_TYPES_PARALLELGC(CHECK_VM_TYPE_ENTRY,
2308                       CHECK_SINGLE_ARG_VM_TYPE_NO_OP);
2309 
2310   VM_TYPES_CMS(CHECK_VM_TYPE_ENTRY,
2311                CHECK_SINGLE_ARG_VM_TYPE_NO_OP);
2312 
2313   VM_TYPES_PARNEW(CHECK_VM_TYPE_ENTRY)
2314 #endif // SERIALGC
2315 
2316   VM_TYPES_CPU(CHECK_VM_TYPE_ENTRY,
2317                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2318                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2319                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2320                CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2321                CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY,
2322                CHECK_C2_VM_TYPE_ENTRY,
2323                CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY,
2324                CHECK_SENTINEL);
2325 
2326   VM_TYPES_OS_CPU(CHECK_VM_TYPE_ENTRY,
2327                   CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2328                   CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2329                   CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2330                   CHECK_SINGLE_ARG_VM_TYPE_NO_OP,
2331                   CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY,
2332                   CHECK_C2_VM_TYPE_ENTRY,
2333                   CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY,
2334                   CHECK_SENTINEL);
2335 
2336   //
2337   // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0
2338   // to build with the source mounted over SNC3.2. Symptom was that
2339   // debug build failed with an internal compiler error. Has been seen
2340   // mounting sources from Solaris 2.6 and 2.7 hosts, but so far not
2341   // 2.8 hosts. Appears to occur because line is too long.
2342   //
2343   // If an assertion failure is triggered here it means that an entry
2344   // in VMStructs::localHotSpotVMStructs[] was not found in
2345   // VMStructs::localHotSpotVMTypes[]. (The assertion itself had to be
2346   // made less descriptive because of this above bug -- see the
2347   // definition of ENSURE_FIELD_TYPE_PRESENT.)
2348   //
2349   // NOTE: taken out because this was just not working on everyone's
2350   // Solstice NFS setup. If everyone switches to local workspaces on
2351   // Win32, we can put this back in.
2352 #ifndef _WINDOWS
2353   debug_only(VM_STRUCTS(ENSURE_FIELD_TYPE_PRESENT, \
2354                         CHECK_NO_OP, \
2355                         CHECK_NO_OP, \
2356                         CHECK_NO_OP, \
2357                         CHECK_NO_OP, \
2358                         CHECK_NO_OP, \
2359                         CHECK_NO_OP, \
2360                         CHECK_NO_OP, \
2361                         CHECK_NO_OP, \
2362                         CHECK_SENTINEL));
2363   debug_only(VM_STRUCTS(CHECK_NO_OP, \
2364                         ENSURE_FIELD_TYPE_PRESENT, \
2365                         CHECK_NO_OP, \
2366                         ENSURE_FIELD_TYPE_PRESENT, \
2367                         ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, \
2368                         ENSURE_C1_FIELD_TYPE_PRESENT, \
2369                         ENSURE_C2_FIELD_TYPE_PRESENT, \
2370                         CHECK_NO_OP, \
2371                         CHECK_NO_OP, \
2372                         CHECK_SENTINEL));
2373 #ifndef SERIALGC
2374   debug_only(VM_STRUCTS_PARALLELGC(ENSURE_FIELD_TYPE_PRESENT, \
2375                                    ENSURE_FIELD_TYPE_PRESENT));
2376   debug_only(VM_STRUCTS_CMS(ENSURE_FIELD_TYPE_PRESENT, \
2377                             ENSURE_FIELD_TYPE_PRESENT, \
2378                             ENSURE_FIELD_TYPE_PRESENT));
2379 #endif // SERIALGC
2380   debug_only(VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, \
2381                             ENSURE_FIELD_TYPE_PRESENT, \
2382                             CHECK_NO_OP, \
2383                             ENSURE_FIELD_TYPE_PRESENT, \
2384                             ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, \
2385                             ENSURE_C2_FIELD_TYPE_PRESENT, \
2386                             CHECK_NO_OP, \
2387                             CHECK_NO_OP, \
2388                             CHECK_SENTINEL));
2389   debug_only(VM_STRUCTS_OS_CPU(ENSURE_FIELD_TYPE_PRESENT, \
2390                                ENSURE_FIELD_TYPE_PRESENT, \
2391                                CHECK_NO_OP, \
2392                                ENSURE_FIELD_TYPE_PRESENT, \
2393                                ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT, \
2394                                ENSURE_C2_FIELD_TYPE_PRESENT, \
2395                                CHECK_NO_OP, \
2396                                CHECK_NO_OP, \
2397                                CHECK_SENTINEL));
2398 #endif
2399 }
2400 
2401 extern "C" {
2402 
2403 // see comments on cast_uint64_t at the top of this file
2404 #define ASSIGN_CONST_TO_64BIT_VAR(var, expr) \
2405     JNIEXPORT uint64_t var = cast_uint64_t(expr);
2406 #define ASSIGN_OFFSET_TO_64BIT_VAR(var, type, field)   \
2407   ASSIGN_CONST_TO_64BIT_VAR(var, offset_of(type, field))
2408 #define ASSIGN_STRIDE_TO_64BIT_VAR(var, array) \
2409   ASSIGN_CONST_TO_64BIT_VAR(var, (char*)&array[1] - (char*)&array[0])
2410 
2411 JNIEXPORT VMStructEntry* gHotSpotVMStructs                 = VMStructs::localHotSpotVMStructs;
2412 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMStructEntryTypeNameOffset,  VMStructEntry, typeName);
2413 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMStructEntryFieldNameOffset, VMStructEntry, fieldName);
2414 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMStructEntryTypeStringOffset, VMStructEntry, typeString);
2415 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMStructEntryIsStaticOffset, VMStructEntry, isStatic);
2416 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMStructEntryOffsetOffset, VMStructEntry, offset);
2417 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMStructEntryAddressOffset, VMStructEntry, address);
2418 ASSIGN_STRIDE_TO_64BIT_VAR(gHotSpotVMStructEntryArrayStride, gHotSpotVMStructs);
2419 JNIEXPORT VMTypeEntry*   gHotSpotVMTypes                   = VMStructs::localHotSpotVMTypes;
2420 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMTypeEntryTypeNameOffset, VMTypeEntry, typeName);
2421 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMTypeEntrySuperclassNameOffset, VMTypeEntry, superclassName);
2422 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMTypeEntryIsOopTypeOffset, VMTypeEntry, isOopType);
2423 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMTypeEntryIsIntegerTypeOffset, VMTypeEntry, isIntegerType);
2424 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMTypeEntryIsUnsignedOffset, VMTypeEntry, isUnsigned);
2425 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMTypeEntrySizeOffset, VMTypeEntry, size);
2426 ASSIGN_STRIDE_TO_64BIT_VAR(gHotSpotVMTypeEntryArrayStride,gHotSpotVMTypes);
2427 JNIEXPORT VMIntConstantEntry* gHotSpotVMIntConstants       = VMStructs::localHotSpotVMIntConstants;
2428 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMIntConstantEntryNameOffset, VMIntConstantEntry, name);
2429 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMIntConstantEntryValueOffset, VMIntConstantEntry, value);
2430 ASSIGN_STRIDE_TO_64BIT_VAR(gHotSpotVMIntConstantEntryArrayStride, gHotSpotVMIntConstants);
2431 JNIEXPORT VMLongConstantEntry* gHotSpotVMLongConstants     = VMStructs::localHotSpotVMLongConstants;
2432 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMLongConstantEntryNameOffset, VMLongConstantEntry, name);
2433 ASSIGN_OFFSET_TO_64BIT_VAR(gHotSpotVMLongConstantEntryValueOffset, VMLongConstantEntry, value);
2434 ASSIGN_STRIDE_TO_64BIT_VAR(gHotSpotVMLongConstantEntryArrayStride, gHotSpotVMLongConstants);
2435 }
2436 
2437 #ifdef ASSERT
2438 static int recursiveFindType(VMTypeEntry* origtypes, const char* typeName, bool isRecurse) {
2439   {
2440     VMTypeEntry* types = origtypes;
2441     while (types->typeName != NULL) {
2442       if (!strcmp(typeName, types->typeName)) {
2443         return 1;
2444       }
2445       ++types;
2446     }
2447   }
2448   size_t len = strlen(typeName);
2449   if (typeName[len-1] == '*') {
2450     char * s = new char[len];
2451     strncpy(s, typeName, len - 1);
2452     s[len-1] = '\0';
2453     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2454     if (recursiveFindType(origtypes, s, true) == 1) {
2455       delete s;
2456       return 1;
2457     }
2458     delete s;
2459   }
2460   if (strstr(typeName, "GrowableArray<") == typeName) {
2461     const char * start = typeName + strlen("GrowableArray<");
2462     const char * end = strrchr(typeName, '>');
2463     int len = end - start + 1;
2464     char * s = new char[len];
2465     strncpy(s, start, len - 1);
2466     s[len-1] = '\0';
2467     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2468     if (recursiveFindType(origtypes, s, true) == 1) {
2469       delete s;
2470       return 1;
2471     }
2472     delete s;
2473   }
2474   if (strstr(typeName, "const ") == typeName) {
2475     const char * s = typeName + strlen("const ");
2476     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2477     if (recursiveFindType(origtypes, s, true) == 1) {
2478       return 1;
2479     }
2480   }
2481   if (strstr(typeName, " const") == typeName + len - 6) {
2482     char * s = strdup(typeName);
2483     s[len - 6] = '\0';
2484     // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
2485     if (recursiveFindType(origtypes, s, true) == 1) {
2486       return 1;
2487     }
2488   }
2489   if (!isRecurse) {
2490     tty->print_cr("type \"%s\" not found", typeName);
2491   }
2492   return 2;
2493 }
2494 
2495 
2496 int
2497 VMStructs::findType(const char* typeName) {
2498   VMTypeEntry* types = gHotSpotVMTypes;
2499 
2500   return recursiveFindType(types, typeName, false);
2501 }
2502 #endif
2503 
2504 void vmStructs_init() {
2505   debug_only(VMStructs::init());
2506 }