4155N/A * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Note: the cross-product of (c1, c2, product, nonproduct, ...), 0N/A// (nonstatic, static), and (unchecked, checked) has not been taken. 0N/A// Only the macros currently needed have been defined. 0N/A// A field whose type is not checked is given a null string as the 0N/A// type name, indicating an "opaque" type to the serviceability agent. 0N/A// NOTE: there is an interdependency between this file and 0N/A// whole purpose of this function is to work around bug c++/27724 in gcc 4.1.1 0N/A// with optimization turned on it doesn't affect produced code 0N/A//-------------------------------------------------------------------------------- 0N/A// This list enumerates all of the fields the serviceability agent 0N/A// needs to know about. Be sure to see also the type table below this one. 0N/A// NOTE that there are platform-specific additions to this table in 0N/A// vmStructs_<os>_<cpu>.hpp. 0N/A /******************************************************************/ \
0N/A /* OopDesc and Klass hierarchies (NOTE: methodDataOop incomplete) */ \
0N/A /******************************************************************/ \
0N/A /***********************/ \
0N/A /* Constant Pool Cache */ \
0N/A /***********************/ \
0N/A /********************************/ \
0N/A /* MethodOop-related structures */ \
0N/A /********************************/ \
0N/A /**********************************************************************************/ \
0N/A /* Generation and Space hierarchies */ \
0N/A /**********************************************************************************/ \
0N/A /************************/ \
0N/A /* PerfMemory - jvmstat */ \
0N/A /************************/ \
0N/A /********************/ \
0N/A /* SystemDictionary */ \
0N/A /********************/ \
0N/A /*******************/ \
0N/A /* HashtableBucket */ \
0N/A /*******************/ \
0N/A /******************/ \
0N/A /* HashtableEntry */ \
0N/A /******************/ \
0N/A /*******************/ \
0N/A /* DictionaryEntry */ \
0N/A /*******************/ \
0N/A /********************/ \
0N/A /**************************/ \
0N/A /* ProctectionDomainEntry */ \
0N/A /**************************/ \
0N/A /*************************/ \
0N/A /* LoaderConstraintEntry */ \
0N/A /*************************/ \
0N/A /********************************/ \
0N/A /* CodeCache (NOTE: incomplete) */ \
0N/A /********************************/ \
0N/A /*******************************/ \
0N/A /* CodeHeap (NOTE: incomplete) */ \
0N/A /*******************************/ \
0N/A /**********************************/ \
0N/A /* Interpreter (NOTE: incomplete) */ \
0N/A /**********************************/ \
0N/A /****************************/ \
0N/A /* Stubs (NOTE: incomplete) */ \
0N/A /****************************/ \
0N/A /***********************************/ \
0N/A /* StubRoutines (NOTE: incomplete) */ \
0N/A /***********************************/ \
0N/A /***************************************/ \
0N/A /* PcDesc and other compiled code info */ \
0N/A /***************************************/ \
0N/A /***************************************************/ \
0N/A /* CodeBlobs (NOTE: incomplete, but only a little) */ \
0N/A /***************************************************/ \
0N/A /**************************************************/ \
0N/A /* NMethods (NOTE: incomplete, but only a little) */ \
0N/A /**************************************************/ \
0N/A /********************************/ \
0N/A /* JavaCalls (NOTE: incomplete) */ \
0N/A /********************************/ \
0N/A /********************************/ \
0N/A /* JavaFrameAnchor (NOTE: incomplete) */ \
0N/A /********************************/ \
0N/A /******************************/ \
0N/A /* Threads (NOTE: incomplete) */ \
0N/A /******************************/ \
0N/A /************************/ \
0N/A /* OopMap and OopMapSet */ \
0N/A /************************/ \
0N/A /*********************************/ \
0N/A /* JNIHandles and JNIHandleBlock */ \
0N/A /*********************************/ \
0N/A /********************/ \
0N/A /* CompressedStream */ \
0N/A /********************/ \
0N/A /*********************************/ \
0N/A /* VMRegImpl (NOTE: incomplete) */ \
0N/A /*********************************/ \
0N/A /*******************************/ \
0N/A /* Runtime1 (NOTE: incomplete) */ \
0N/A /*******************************/ \
0N/A /*********************/ \
0N/A /* Matcher (C2 only) */ \
0N/A /*********************/ \
0N/A /*********************/ \
0N/A /*********************/ \
0N/A /*************************/ \
0N/A /* JDK / VM version info */ \
0N/A /*************************/ \
2772N/A /*************************/ \
2772N/A /*************************/ \
2223N/A /*********************************/ \
2223N/A /* java_lang_Class fields */ \
2223N/A /*********************************/ \
0N/A /************************/ \
0N/A /* Miscellaneous fields */ \
0N/A /************************/ \
0N/A /* NOTE that we do not use the last_entry() macro here; it is used */ 0N/A /* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must */ 0N/A /* be present there) */ 0N/A//-------------------------------------------------------------------------------- 0N/A// This list must enumerate at least all of the types in the above 0N/A// list. For the types in the above list, the entry below must have 0N/A// exactly the same spacing since string comparisons are done in the 0N/A// code which verifies the consistency of these tables (in the debug 0N/A// In addition to the above types, this list is required to enumerate 0N/A// the JNI's java types, which are used to indicate the size of Java 0N/A// fields in this VM to the SA. Further, oop types are currently 0N/A// distinguished by name (i.e., ends with "oop") over in the SA. 0N/A// The declare_toplevel_type macro should be used to declare types 0N/A// which do not have a superclass. 0N/A// The declare_integer_type and declare_unsigned_integer_type macros 0N/A// are required in order to properly identify C integer types over in 0N/A// the SA. They should be used for any type which is otherwise opaque 0N/A// and which it is necessary to coerce into an integer value. This 0N/A// includes, for example, the type uintptr_t. Note that while they 0N/A// will properly identify the type's size regardless of the platform, 0N/A// since it is does not seem possible to deduce or check signedness at 0N/A// compile time using the pointer comparison tricks, it is currently 0N/A// required that the given types have the same signedness across all 0N/A// NOTE that there are platform-specific additions to this table in 0N/A// vmStructs_<os>_<cpu>.hpp. 0N/A /*************************************************************/ \
0N/A /* Java primitive types -- required by the SA implementation */ \
0N/A /* in order to determine the size of Java fields in this VM */ \
0N/A /* (the implementation looks up these names specifically) */ \
0N/A /* NOTE: since we fetch these sizes from the remote VM, we */ \
0N/A /* have a bootstrapping sequence during which it is not */ \
0N/A /* valid to fetch Java values from the remote process, only */ \
0N/A /* C integer values (of known size). NOTE also that we do */ \
0N/A /* NOT include "Java unsigned" types like juint here; since */ \
0N/A /* Java does not have unsigned primitive types, those can */ \
0N/A /* not be mapped directly and are considered to be C integer */ \
0N/A /* types in this system (see the "other types" section, */ \
0N/A /*************************************************************/ \
0N/A /*********************************************************************/ \
0N/A /* C integer types. User-defined typedefs (like "size_t" or */ \
0N/A /* "intptr_t") are guaranteed to be present with the same names over */ \
0N/A /* in the SA's type database. Names like "unsigned short" are not */ \
0N/A /* guaranteed to be visible through the SA's type database lookup */ \
0N/A /* mechanism, though they will have a Type object created for them */ \
0N/A /* and are valid types for Fields. */ \
0N/A /*********************************************************************/ \
0N/A /* The compiler thinks this is a different type than */ \
0N/A /* unsigned short on Win32 */ \
0N/A /*****************************/ \
0N/A /* C primitive pointer types */ \
0N/A /*****************************/ \
0N/A /*******************************************************************/ \
0N/A /* Types which it will be handy to have available over in the SA */ \
0N/A /* in order to do platform-independent address -> integer coercion */ \
0N/A /* (note: these will be looked up by name) */ \
0N/A /*******************************************************************/ \
0N/A /*******************************************************************************/ \
0N/A /* OopDesc and Klass hierarchies (NOTE: missing methodDataOop-related classes) */ \
0N/A /*******************************************************************************/ \
0N/A /*************************************/ \
0N/A /* MethodOop-related data structures */ \
0N/A /*************************************/ \
0N/A /******************************************/ \
0N/A /* Generation and space hierarchies */ \
0N/A /* (needed for run-time type information) */ \
0N/A /******************************************/ \
0N/A /* Miscellaneous other GC types */ \
0N/A /* Pointers to Garbage Collection types */ \
0N/A /************************/ \
0N/A /* PerfMemory - jvmstat */ \
0N/A /************************/ \
0N/A /*********************************/ \
0N/A /* SymbolTable, SystemDictionary */ \
0N/A /*********************************/ \
0N/A /***********************************************************/ \
0N/A /* Thread hierarchy (needed for run-time type information) */ \
0N/A /***********************************************************/ \
0N/A /*************************************************************/ \
0N/A /* CodeBlob hierarchy (needed for run-time type information) */ \
0N/A /*************************************************************/ \
0N/A /***************************************/ \
0N/A /* PcDesc and other compiled code info */ \
0N/A /***************************************/ \
0N/A /************************/ \
0N/A /* OopMap and OopMapSet */ \
0N/A /************************/ \
0N/A /********************/ \
0N/A /* CompressedStream */ \
0N/A /********************/ \
0N/A /*********************************/ \
0N/A /* JNIHandles and JNIHandleBlock */ \
0N/A /*********************************/ \
0N/A /**********************/ \
0N/A /* Runtime1 (C1 only) */ \
0N/A /**********************/ \
0N/A /*********************/ \
0N/A /* Matcher (C2 only) */ \
0N/A /*********************/ \
0N/A /*********************/ \
0N/A /* Adapter Blob Entries */ \
0N/A /*********************/ \
0N/A /********************/ \
0N/A /********************/ \
0N/A /********************/ \
0N/A /********************/ \
0N/A /* all enum types */ \
0N/A /* NOTE that we do not use the last_entry() macro here; it is used */ 0N/A /* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must be */ 0N/A /* present there) */ 0N/A//-------------------------------------------------------------------------------- 0N/A// This table contains integer constants required over in the 0N/A// serviceability agent. The "declare_constant" macro is used for all 0N/A// enums, etc., while "declare_preprocessor_constant" must be used for 0N/A// all #defined constants. 0N/A /******************/ \
0N/A /* Useful globals */ \
0N/A /******************/ \
0N/A /****************/ \
0N/A /* Object sizes */ \
0N/A /****************/ \
0N/A /********************************************/ \
0N/A /* Generation and Space Hierarchy Constants */ \
0N/A /********************************************/ \
0N/A /* constants from Generation::Name enum */ \
0N/A /* constants from PermGen::Name enum */ \
0N/A /************************/ \
0N/A /* PerfMemory - jvmstat */ \
0N/A /************************/ \
0N/A /***********************************/ \
0N/A /* LoaderConstraintTable constants */ \
0N/A /***********************************/ \
0N/A /************************************************************/ \
0N/A /* HotSpot specific JVM_ACC constants from global anon enum */ \
0N/A /************************************************************/ \
0N/A /*****************************/ \
0N/A /* Thread::SuspendFlags enum */ \
0N/A /*****************************/ \
0N/A /*******************/ \
0N/A /* JavaThreadState */ \
0N/A /*******************/ \
0N/A /******************************/ \
0N/A /* Klass misc. enum constants */ \
0N/A /******************************/ \
0N/A /********************************/ \
0N/A /* constMethodOopDesc anon-enum */ \
0N/A /********************************/ \
0N/A /*************************************/ \
2771N/A /*************************************/ \
2771N/A /*************************************/ \
2771N/A /* FieldInfo FieldOffset enum */ \
0N/A /*************************************/ \
0N/A /************************************************/ \
0N/A /* instanceKlass InnerClassAttributeOffset enum */ \
0N/A /************************************************/ \
0N/A /*********************************/ \
0N/A /* instanceKlass ClassState enum */ \
0N/A /*********************************/ \
0N/A /*********************************/ \
3932N/A /* Symbol* - symbol max length */ \
0N/A /*********************************/ \
1833N/A /*************************************************/ \
1833N/A /* constantPoolOop layout enum for InvokeDynamic */ \
1833N/A /*************************************************/ \
3932N/A /********************************/ \
3932N/A /* ConstantPoolCacheEntry enums */ \
3932N/A /********************************/ \
0N/A /***************************************/ \
0N/A /* java_lang_Thread::ThreadStatus enum */ \
0N/A /***************************************/ \
0N/A /******************************/ \
0N/A /******************************/ \
0N/A /* constants from Location::Type enum */ \
0N/A /* constants from Location::Where enum */ \
0N/A /*********************/ \
0N/A /* Matcher (C2 only) */ \
0N/A /*********************/ \
0N/A /*********************************************/ \
0N/A /*********************************************/ \
0N/A /******************/ \
0N/A /* JNIHandleBlock */ \
0N/A /******************/ \
0N/A /**********************/ \
0N/A /* ObjectSynchronizer */ \
0N/A /**********************/ \
0N/A /********************************/ \
0N/A /* Calling convention constants */ \
0N/A /********************************/ \
0N/A /* NOTE that we do not use the last_entry() macro here; it is used */ 0N/A /* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and */ 0N/A /* must be present there) */ 0N/A//-------------------------------------------------------------------------------- 0N/A// This table contains long constants required over in the 0N/A// serviceability agent. The "declare_constant" macro is used for all 0N/A// enums, etc., while "declare_preprocessor_constant" must be used for 0N/A// all #defined constants. 0N/A /*********************/ \
0N/A /* MarkOop constants */ \
0N/A /*********************/ \
0N/A /* Note: some of these are declared as long constants just for */ \
0N/A /* consistency. The mask constants are the only ones requiring */ \
0N/A /* 64 bits (on 64-bit platforms). */ \
187N/A /* Constants in markOop used by CMS. */ \
0N/A /* NOTE that we do not use the last_entry() macro here; it is used */ 0N/A /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and */ 0N/A /* must be present there) */ 0N/A//-------------------------------------------------------------------------------- 0N/A// Macros operating on the above lists 0N/A//-------------------------------------------------------------------------------- 0N/A// This utility macro quotes the passed string 0N/A//-------------------------------------------------------------------------------- 0N/A// VMStructEntry macros 0N/A// This macro generates a VMStructEntry line for a nonstatic field 0N/A// This macro generates a VMStructEntry line for a static field 0N/A// This macro generates a VMStructEntry line for an unchecked 0N/A// nonstatic field, in which the size of the type is also specified. 0N/A// The type string is given as NULL, indicating an "opaque" type. 0N/A// This macro generates a VMStructEntry line for an unchecked 0N/A// static field, in which the size of the type is also specified. 0N/A// The type string is given as NULL, indicating an "opaque" type. 0N/A// This macro generates the sentinel value indicating the end of the list 0N/A// This macro checks the type of a VMStructEntry by comparing pointer types 0N/A// This macro checks the type of a volatile VMStructEntry by comparing pointer types 0N/A// This macro checks the type of a VMStructEntry by comparing pointer types 0N/A// This macro ensures the type of a field and its containing type are 0N/A// present in the type table. The assertion string is shorter than 0N/A// preferable because (incredibly) of a bug in Solstice NFS client 0N/A// which seems to prevent very long lines from compiling. This assertion 0N/A// means that an entry in VMStructs::localHotSpotVMStructs[] was not 0N/A// found in VMStructs::localHotSpotVMTypes[]. 0N/A// This is a no-op macro for unchecked fields 0N/A// This is a no-op macro for the sentinel value 0N/A// Build-specific macros: 0N/A// Generate and check a nonstatic field in non-product builds 0N/A// Generate and check a nonstatic field in C1 builds 0N/A#
endif /* COMPILER1 */ 0N/A// Generate and check a nonstatic field in C2 builds 0N/A#
endif /* COMPILER2 */ 0N/A// Generate but do not check a static field in C1 builds 0N/A#
endif /* COMPILER1 */ 0N/A// Generate but do not check a static field in C2 builds 0N/A#
endif /* COMPILER2 */ 0N/A//-------------------------------------------------------------------------------- 0N/A// VMTypeEntry macros 0N/A// Build-specific macros: 0N/A#
endif /* COMPILER1 */ 0N/A#
endif /* COMPILER2 */ 0N/A//-------------------------------------------------------------------------------- 0N/A// VMIntConstantEntry macros 0N/A// This macro generates the sentinel value indicating the end of the list 0N/A// Generate an int constant for a C1 build 0N/A#
endif /* COMPILER1 */ 0N/A// Generate an int constant for a C2 build 0N/A#
endif /* COMPILER1 */ 0N/A//-------------------------------------------------------------------------------- 0N/A// VMLongConstantEntry macros 0N/A// This macro generates the sentinel value indicating the end of the list 0N/A// Generate a long constant for a C1 build 0N/A#
endif /* COMPILER1 */ 0N/A// Generate a long constant for a C2 build 0N/A#
endif /* COMPILER1 */ 0N/A// Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries 0N/A// These initializers are allowed to access private fields in classes 0N/A// as long as class VMStructs is a friend 0N/A// This is used both to check the types of referenced fields and, in 0N/A// debug builds, to ensure that all of the field types are present. 0N/A // Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0 0N/A // to build with the source mounted over SNC3.2. Symptom was that 0N/A // debug build failed with an internal compiler error. Has been seen 0N/A // mounting sources from Solaris 2.6 and 2.7 hosts, but so far not 0N/A // 2.8 hosts. Appears to occur because line is too long. 0N/A // If an assertion failure is triggered here it means that an entry 0N/A // in VMStructs::localHotSpotVMStructs[] was not found in 0N/A // VMStructs::localHotSpotVMTypes[]. (The assertion itself had to be 0N/A // made less descriptive because of this above bug -- see the 0N/A // definition of ENSURE_FIELD_TYPE_PRESENT.) 0N/A // NOTE: taken out because this was just not working on everyone's 0N/A // Solstice NFS setup. If everyone switches to local workspaces on 0N/A // Win32, we can put this back in. 0N/A// see comments on cast_uint64_t at the top of this file 2772N/A // Search for the base type by peeling off const and * 2062N/A // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); 2062N/A // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); 2062N/A // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName); 2062N/A // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);