src/share/vm/runtime/vmStructs.cpp

Print this page




  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/stringTable.hpp"
  31 #include "classfile/systemDictionary.hpp"
  32 #include "ci/ciField.hpp"
  33 #include "ci/ciInstance.hpp"
  34 #include "ci/ciObjArrayKlass.hpp"
  35 #include "ci/ciMethodData.hpp"
  36 #include "ci/ciSymbol.hpp"
  37 #include "code/codeBlob.hpp"
  38 #include "code/codeCache.hpp"
  39 #include "code/compressedStream.hpp"
  40 #include "code/location.hpp"
  41 #include "code/nmethod.hpp"
  42 #include "code/pcDesc.hpp"
  43 #include "code/stubs.hpp"
  44 #include "code/vmreg.hpp"
  45 #include "compiler/oopMap.hpp"
  46 #include "compiler/compileBroker.hpp"
  47 #include "gc_implementation/shared/immutableSpace.hpp"
  48 #include "gc_implementation/shared/markSweep.hpp"
  49 #include "gc_implementation/shared/mutableSpace.hpp"


 226 
 227 #if INCLUDE_JVMTI
 228   #define JVMTI_STRUCTS(static_field) \
 229     static_field(JvmtiExport,                     _can_access_local_variables,                  bool)                                  \
 230     static_field(JvmtiExport,                     _can_hotswap_or_post_breakpoint,              bool)                                  \
 231     static_field(JvmtiExport,                     _can_post_on_exceptions,                      bool)                                  \
 232     static_field(JvmtiExport,                     _can_walk_any_space,                          bool)
 233 #else
 234   #define JVMTI_STRUCTS(static_field)
 235 #endif // INCLUDE_JVMTI
 236 
 237 typedef HashtableEntry<intptr_t, mtInternal>  IntptrHashtableEntry;
 238 typedef Hashtable<intptr_t, mtInternal>       IntptrHashtable;
 239 typedef Hashtable<Symbol*, mtSymbol>          SymbolHashtable;
 240 typedef HashtableEntry<Symbol*, mtClass>      SymbolHashtableEntry;
 241 typedef Hashtable<oop, mtSymbol>              StringHashtable;
 242 typedef TwoOopHashtable<Klass*, mtClass>      KlassTwoOopHashtable;
 243 typedef Hashtable<Klass*, mtClass>            KlassHashtable;
 244 typedef HashtableEntry<Klass*, mtClass>       KlassHashtableEntry;
 245 typedef TwoOopHashtable<Symbol*, mtClass>     SymbolTwoOopHashtable;

 246 
 247 //--------------------------------------------------------------------------------
 248 // VM_STRUCTS
 249 //
 250 // This list enumerates all of the fields the serviceability agent
 251 // needs to know about. Be sure to see also the type table below this one.
 252 // NOTE that there are platform-specific additions to this table in
 253 // vmStructs_<os>_<cpu>.hpp.
 254 
 255 #define VM_STRUCTS(nonstatic_field, \
 256                    static_field, \
 257                    unchecked_nonstatic_field, \
 258                    volatile_nonstatic_field, \
 259                    nonproduct_nonstatic_field, \
 260                    c1_nonstatic_field, \
 261                    c2_nonstatic_field, \
 262                    unchecked_c1_static_field, \
 263                    unchecked_c2_static_field) \
 264                                                                                                                                      \
 265   /******************************************************************/                                                               \


 600   nonstatic_field(PerfDataEntry,               name_offset,                                   jint)                                  \
 601   nonstatic_field(PerfDataEntry,               vector_length,                                 jint)                                  \
 602   nonstatic_field(PerfDataEntry,               data_type,                                     jbyte)                                 \
 603   nonstatic_field(PerfDataEntry,               flags,                                         jbyte)                                 \
 604   nonstatic_field(PerfDataEntry,               data_units,                                    jbyte)                                 \
 605   nonstatic_field(PerfDataEntry,               data_variability,                              jbyte)                                 \
 606   nonstatic_field(PerfDataEntry,               data_offset,                                   jint)                                  \
 607                                                                                                                                      \
 608      static_field(PerfMemory,                  _start,                                        char*)                                 \
 609      static_field(PerfMemory,                  _end,                                          char*)                                 \
 610      static_field(PerfMemory,                  _top,                                          char*)                                 \
 611      static_field(PerfMemory,                  _capacity,                                     size_t)                                \
 612      static_field(PerfMemory,                  _prologue,                                     PerfDataPrologue*)                     \
 613      static_field(PerfMemory,                  _initialized,                                  jint)                                  \
 614                                                                                                                                      \
 615   /***************/                                                                                                                  \
 616   /* SymbolTable */                                                                                                                  \
 617   /***************/                                                                                                                  \
 618                                                                                                                                      \
 619      static_field(SymbolTable,                  _the_table,                                   SymbolTable*)                          \

 620                                                                                                                                      \
 621   /***************/                                                                                                                  \
 622   /* StringTable */                                                                                                                  \
 623   /***************/                                                                                                                  \
 624                                                                                                                                      \
 625      static_field(StringTable,                  _the_table,                                   StringTable*)                          \
 626                                                                                                                                      \
 627   /********************/                                                                                                             \










 628   /* SystemDictionary */                                                                                                             \
 629   /********************/                                                                                                             \
 630                                                                                                                                      \
 631       static_field(SystemDictionary,            _dictionary,                                   Dictionary*)                          \
 632       static_field(SystemDictionary,            _placeholders,                                 PlaceholderTable*)                    \
 633       static_field(SystemDictionary,            _shared_dictionary,                            Dictionary*)                          \
 634       static_field(SystemDictionary,            _system_loader_lock_obj,                       oop)                                  \
 635       static_field(SystemDictionary,            _loader_constraints,                           LoaderConstraintTable*)               \
 636       static_field(SystemDictionary,            WK_KLASS(Object_klass),                        Klass*)                               \
 637       static_field(SystemDictionary,            WK_KLASS(String_klass),                        Klass*)                               \
 638       static_field(SystemDictionary,            WK_KLASS(Class_klass),                         Klass*)                               \
 639       static_field(SystemDictionary,            WK_KLASS(Cloneable_klass),                     Klass*)                               \
 640       static_field(SystemDictionary,            WK_KLASS(ClassLoader_klass),                   Klass*)                               \
 641       static_field(SystemDictionary,            WK_KLASS(Serializable_klass),                  Klass*)                               \
 642       static_field(SystemDictionary,            WK_KLASS(System_klass),                        Klass*)                               \
 643       static_field(SystemDictionary,            WK_KLASS(Throwable_klass),                     Klass*)                               \
 644       static_field(SystemDictionary,            WK_KLASS(ThreadDeath_klass),                   Klass*)                               \
 645       static_field(SystemDictionary,            WK_KLASS(Error_klass),                         Klass*)                               \
 646       static_field(SystemDictionary,            WK_KLASS(Exception_klass),                     Klass*)                               \
 647       static_field(SystemDictionary,            WK_KLASS(RuntimeException_klass),              Klass*)                               \


1555     declare_type(KlassTwoOopHashtable, KlassHashtable)                    \
1556     declare_type(Dictionary, KlassTwoOopHashtable)                        \
1557     declare_type(PlaceholderTable, SymbolTwoOopHashtable)                 \
1558   declare_toplevel_type(BasicHashtableEntry<mtInternal>)                  \
1559   declare_type(IntptrHashtableEntry, BasicHashtableEntry<mtInternal>)     \
1560     declare_type(DictionaryEntry, KlassHashtableEntry)                    \
1561     declare_type(PlaceholderEntry, SymbolHashtableEntry)                  \
1562     declare_type(LoaderConstraintEntry, KlassHashtableEntry)              \
1563   declare_toplevel_type(HashtableBucket<mtInternal>)                      \
1564   declare_toplevel_type(SystemDictionary)                                 \
1565   declare_toplevel_type(vmSymbols)                                        \
1566   declare_toplevel_type(ProtectionDomainEntry)                            \
1567   declare_toplevel_type(ProtectionDomainCacheEntry)                       \
1568                                                                           \
1569   declare_toplevel_type(GenericGrowableArray)                             \
1570   declare_toplevel_type(GrowableArray<int>)                               \
1571   declare_toplevel_type(Arena)                                            \
1572     declare_type(ResourceArea, Arena)                                     \
1573   declare_toplevel_type(Chunk)                                            \
1574                                                                           \


1575   /***********************************************************/           \
1576   /* Thread hierarchy (needed for run-time type information) */           \
1577   /***********************************************************/           \
1578                                                                           \
1579   declare_toplevel_type(Threads)                                          \
1580   declare_toplevel_type(ThreadShadow)                                     \
1581            declare_type(Thread, ThreadShadow)                             \
1582            declare_type(NamedThread, Thread)                              \
1583            declare_type(WatcherThread, Thread)                            \
1584            declare_type(JavaThread, Thread)                               \
1585            declare_type(JvmtiAgentThread, JavaThread)                     \
1586            declare_type(ServiceThread, JavaThread)                        \
1587   declare_type(CompilerThread, JavaThread)                                \
1588   declare_type(CodeCacheSweeperThread, JavaThread)                        \
1589   declare_toplevel_type(OSThread)                                         \
1590   declare_toplevel_type(JavaFrameAnchor)                                  \
1591                                                                           \
1592   /***************/                                                       \
1593   /* Interpreter */                                                       \
1594   /***************/                                                       \




  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/compactHashtable.hpp"
  31 #include "classfile/stringTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "ci/ciField.hpp"
  34 #include "ci/ciInstance.hpp"
  35 #include "ci/ciObjArrayKlass.hpp"
  36 #include "ci/ciMethodData.hpp"
  37 #include "ci/ciSymbol.hpp"
  38 #include "code/codeBlob.hpp"
  39 #include "code/codeCache.hpp"
  40 #include "code/compressedStream.hpp"
  41 #include "code/location.hpp"
  42 #include "code/nmethod.hpp"
  43 #include "code/pcDesc.hpp"
  44 #include "code/stubs.hpp"
  45 #include "code/vmreg.hpp"
  46 #include "compiler/oopMap.hpp"
  47 #include "compiler/compileBroker.hpp"
  48 #include "gc_implementation/shared/immutableSpace.hpp"
  49 #include "gc_implementation/shared/markSweep.hpp"
  50 #include "gc_implementation/shared/mutableSpace.hpp"


 227 
 228 #if INCLUDE_JVMTI
 229   #define JVMTI_STRUCTS(static_field) \
 230     static_field(JvmtiExport,                     _can_access_local_variables,                  bool)                                  \
 231     static_field(JvmtiExport,                     _can_hotswap_or_post_breakpoint,              bool)                                  \
 232     static_field(JvmtiExport,                     _can_post_on_exceptions,                      bool)                                  \
 233     static_field(JvmtiExport,                     _can_walk_any_space,                          bool)
 234 #else
 235   #define JVMTI_STRUCTS(static_field)
 236 #endif // INCLUDE_JVMTI
 237 
 238 typedef HashtableEntry<intptr_t, mtInternal>  IntptrHashtableEntry;
 239 typedef Hashtable<intptr_t, mtInternal>       IntptrHashtable;
 240 typedef Hashtable<Symbol*, mtSymbol>          SymbolHashtable;
 241 typedef HashtableEntry<Symbol*, mtClass>      SymbolHashtableEntry;
 242 typedef Hashtable<oop, mtSymbol>              StringHashtable;
 243 typedef TwoOopHashtable<Klass*, mtClass>      KlassTwoOopHashtable;
 244 typedef Hashtable<Klass*, mtClass>            KlassHashtable;
 245 typedef HashtableEntry<Klass*, mtClass>       KlassHashtableEntry;
 246 typedef TwoOopHashtable<Symbol*, mtClass>     SymbolTwoOopHashtable;
 247 typedef CompactHashtable<Symbol*, char>       SymbolCompactHashTable;
 248 
 249 //--------------------------------------------------------------------------------
 250 // VM_STRUCTS
 251 //
 252 // This list enumerates all of the fields the serviceability agent
 253 // needs to know about. Be sure to see also the type table below this one.
 254 // NOTE that there are platform-specific additions to this table in
 255 // vmStructs_<os>_<cpu>.hpp.
 256 
 257 #define VM_STRUCTS(nonstatic_field, \
 258                    static_field, \
 259                    unchecked_nonstatic_field, \
 260                    volatile_nonstatic_field, \
 261                    nonproduct_nonstatic_field, \
 262                    c1_nonstatic_field, \
 263                    c2_nonstatic_field, \
 264                    unchecked_c1_static_field, \
 265                    unchecked_c2_static_field) \
 266                                                                                                                                      \
 267   /******************************************************************/                                                               \


 602   nonstatic_field(PerfDataEntry,               name_offset,                                   jint)                                  \
 603   nonstatic_field(PerfDataEntry,               vector_length,                                 jint)                                  \
 604   nonstatic_field(PerfDataEntry,               data_type,                                     jbyte)                                 \
 605   nonstatic_field(PerfDataEntry,               flags,                                         jbyte)                                 \
 606   nonstatic_field(PerfDataEntry,               data_units,                                    jbyte)                                 \
 607   nonstatic_field(PerfDataEntry,               data_variability,                              jbyte)                                 \
 608   nonstatic_field(PerfDataEntry,               data_offset,                                   jint)                                  \
 609                                                                                                                                      \
 610      static_field(PerfMemory,                  _start,                                        char*)                                 \
 611      static_field(PerfMemory,                  _end,                                          char*)                                 \
 612      static_field(PerfMemory,                  _top,                                          char*)                                 \
 613      static_field(PerfMemory,                  _capacity,                                     size_t)                                \
 614      static_field(PerfMemory,                  _prologue,                                     PerfDataPrologue*)                     \
 615      static_field(PerfMemory,                  _initialized,                                  jint)                                  \
 616                                                                                                                                      \
 617   /***************/                                                                                                                  \
 618   /* SymbolTable */                                                                                                                  \
 619   /***************/                                                                                                                  \
 620                                                                                                                                      \
 621      static_field(SymbolTable,                  _the_table,                                   SymbolTable*)                          \
 622      static_field(SymbolTable,                  _shared_table,                                SymbolCompactHashTable)                \
 623                                                                                                                                      \
 624   /***************/                                                                                                                  \
 625   /* StringTable */                                                                                                                  \
 626   /***************/                                                                                                                  \
 627                                                                                                                                      \
 628      static_field(StringTable,                  _the_table,                                   StringTable*)                          \
 629                                                                                                                                      \
 630   /********************/                                                                                                             \
 631   /* CompactHashTable */                                                                                                             \
 632   /********************/                                                                                                             \
 633                                                                                                                                      \
 634   nonstatic_field(SymbolCompactHashTable, _base_address, uintx)                                                                      \
 635   nonstatic_field(SymbolCompactHashTable, _entry_count, juint)                                                                       \
 636   nonstatic_field(SymbolCompactHashTable, _bucket_count, juint)                                                                      \
 637   nonstatic_field(SymbolCompactHashTable, _table_end_offset, juint)                                                                  \
 638   nonstatic_field(SymbolCompactHashTable, _buckets, juint*)                                                                          \
 639                                                                                                                                      \
 640   /********************/                                                                                                             \
 641   /* SystemDictionary */                                                                                                             \
 642   /********************/                                                                                                             \
 643                                                                                                                                      \
 644       static_field(SystemDictionary,            _dictionary,                                   Dictionary*)                          \
 645       static_field(SystemDictionary,            _placeholders,                                 PlaceholderTable*)                    \
 646       static_field(SystemDictionary,            _shared_dictionary,                            Dictionary*)                          \
 647       static_field(SystemDictionary,            _system_loader_lock_obj,                       oop)                                  \
 648       static_field(SystemDictionary,            _loader_constraints,                           LoaderConstraintTable*)               \
 649       static_field(SystemDictionary,            WK_KLASS(Object_klass),                        Klass*)                               \
 650       static_field(SystemDictionary,            WK_KLASS(String_klass),                        Klass*)                               \
 651       static_field(SystemDictionary,            WK_KLASS(Class_klass),                         Klass*)                               \
 652       static_field(SystemDictionary,            WK_KLASS(Cloneable_klass),                     Klass*)                               \
 653       static_field(SystemDictionary,            WK_KLASS(ClassLoader_klass),                   Klass*)                               \
 654       static_field(SystemDictionary,            WK_KLASS(Serializable_klass),                  Klass*)                               \
 655       static_field(SystemDictionary,            WK_KLASS(System_klass),                        Klass*)                               \
 656       static_field(SystemDictionary,            WK_KLASS(Throwable_klass),                     Klass*)                               \
 657       static_field(SystemDictionary,            WK_KLASS(ThreadDeath_klass),                   Klass*)                               \
 658       static_field(SystemDictionary,            WK_KLASS(Error_klass),                         Klass*)                               \
 659       static_field(SystemDictionary,            WK_KLASS(Exception_klass),                     Klass*)                               \
 660       static_field(SystemDictionary,            WK_KLASS(RuntimeException_klass),              Klass*)                               \


1568     declare_type(KlassTwoOopHashtable, KlassHashtable)                    \
1569     declare_type(Dictionary, KlassTwoOopHashtable)                        \
1570     declare_type(PlaceholderTable, SymbolTwoOopHashtable)                 \
1571   declare_toplevel_type(BasicHashtableEntry<mtInternal>)                  \
1572   declare_type(IntptrHashtableEntry, BasicHashtableEntry<mtInternal>)     \
1573     declare_type(DictionaryEntry, KlassHashtableEntry)                    \
1574     declare_type(PlaceholderEntry, SymbolHashtableEntry)                  \
1575     declare_type(LoaderConstraintEntry, KlassHashtableEntry)              \
1576   declare_toplevel_type(HashtableBucket<mtInternal>)                      \
1577   declare_toplevel_type(SystemDictionary)                                 \
1578   declare_toplevel_type(vmSymbols)                                        \
1579   declare_toplevel_type(ProtectionDomainEntry)                            \
1580   declare_toplevel_type(ProtectionDomainCacheEntry)                       \
1581                                                                           \
1582   declare_toplevel_type(GenericGrowableArray)                             \
1583   declare_toplevel_type(GrowableArray<int>)                               \
1584   declare_toplevel_type(Arena)                                            \
1585     declare_type(ResourceArea, Arena)                                     \
1586   declare_toplevel_type(Chunk)                                            \
1587                                                                           \
1588   declare_toplevel_type(SymbolCompactHashTable)                           \
1589                                                                           \
1590   /***********************************************************/           \
1591   /* Thread hierarchy (needed for run-time type information) */           \
1592   /***********************************************************/           \
1593                                                                           \
1594   declare_toplevel_type(Threads)                                          \
1595   declare_toplevel_type(ThreadShadow)                                     \
1596            declare_type(Thread, ThreadShadow)                             \
1597            declare_type(NamedThread, Thread)                              \
1598            declare_type(WatcherThread, Thread)                            \
1599            declare_type(JavaThread, Thread)                               \
1600            declare_type(JvmtiAgentThread, JavaThread)                     \
1601            declare_type(ServiceThread, JavaThread)                        \
1602   declare_type(CompilerThread, JavaThread)                                \
1603   declare_type(CodeCacheSweeperThread, JavaThread)                        \
1604   declare_toplevel_type(OSThread)                                         \
1605   declare_toplevel_type(JavaFrameAnchor)                                  \
1606                                                                           \
1607   /***************/                                                       \
1608   /* Interpreter */                                                       \
1609   /***************/                                                       \