vmStructs.cpp revision 4018
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/loaderConstraints.hpp"
#include "classfile/placeholders.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "ci/ciField.hpp"
#include "ci/ciInstance.hpp"
#include "ci/ciObjArrayKlass.hpp"
#include "ci/ciMethodData.hpp"
#include "ci/ciSymbol.hpp"
#include "code/codeBlob.hpp"
#include "code/codeCache.hpp"
#include "code/compressedStream.hpp"
#include "code/location.hpp"
#include "code/nmethod.hpp"
#include "code/pcDesc.hpp"
#include "compiler/oopMap.hpp"
#include "compiler/compileBroker.hpp"
#include "gc_implementation/shared/immutableSpace.hpp"
#include "gc_implementation/shared/markSweep.hpp"
#include "gc_implementation/shared/mutableSpace.hpp"
#include "gc_interface/collectedHeap.hpp"
#include "interpreter/bytecodeInterpreter.hpp"
#include "interpreter/bytecodes.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/cardTableRS.hpp"
#include "memory/compactPermGen.hpp"
#include "memory/defNewGeneration.hpp"
#include "memory/freeBlockDictionary.hpp"
#include "memory/genCollectedHeap.hpp"
#include "memory/generation.hpp"
#include "memory/generationSpec.hpp"
#include "memory/permGen.hpp"
#include "memory/tenuredGeneration.hpp"
#include "memory/universe.hpp"
#include "memory/watermark.hpp"
#include "oops/arrayKlass.hpp"
#include "oops/arrayKlassKlass.hpp"
#include "oops/arrayOop.hpp"
#include "oops/compiledICHolderKlass.hpp"
#include "oops/compiledICHolderOop.hpp"
#include "oops/constMethodKlass.hpp"
#include "oops/constMethodOop.hpp"
#include "oops/constantPoolKlass.hpp"
#include "oops/constantPoolOop.hpp"
#include "oops/cpCacheKlass.hpp"
#include "oops/cpCacheOop.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/instanceMirrorKlass.hpp"
#include "oops/instanceKlassKlass.hpp"
#include "oops/instanceOop.hpp"
#include "oops/klassOop.hpp"
#include "oops/markOop.hpp"
#include "oops/methodDataKlass.hpp"
#include "oops/methodDataOop.hpp"
#include "oops/methodKlass.hpp"
#include "oops/methodOop.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayKlassKlass.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayKlass.hpp"
#include "oops/typeArrayKlassKlass.hpp"
#include "oops/typeArrayOop.hpp"
#include "prims/jvmtiAgentThread.hpp"
#include "runtime/arguments.hpp"
#include "runtime/deoptimization.hpp"
#include "runtime/vframeArray.hpp"
#include "runtime/globals.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/perfMemory.hpp"
#include "runtime/serviceThread.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/virtualspace.hpp"
#include "runtime/vmStructs.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/hashtable.hpp"
#ifdef TARGET_ARCH_x86
# include "vmStructs_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "vmStructs_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "vmStructs_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "vmStructs_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "vmStructs_ppc.hpp"
#endif
#ifdef TARGET_OS_FAMILY_linux
# include "thread_linux.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_solaris
# include "thread_solaris.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_windows
# include "thread_windows.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "thread_bsd.inline.hpp"
#endif
#ifdef TARGET_OS_ARCH_linux_x86
# include "vmStructs_linux_x86.hpp"
#endif
#ifdef TARGET_OS_ARCH_linux_sparc
# include "vmStructs_linux_sparc.hpp"
#endif
#ifdef TARGET_OS_ARCH_linux_zero
# include "vmStructs_linux_zero.hpp"
#endif
#ifdef TARGET_OS_ARCH_solaris_x86
# include "vmStructs_solaris_x86.hpp"
#endif
#ifdef TARGET_OS_ARCH_solaris_sparc
# include "vmStructs_solaris_sparc.hpp"
#endif
#ifdef TARGET_OS_ARCH_windows_x86
# include "vmStructs_windows_x86.hpp"
#endif
#ifdef TARGET_OS_ARCH_linux_arm
# include "vmStructs_linux_arm.hpp"
#endif
#ifdef TARGET_OS_ARCH_linux_ppc
# include "vmStructs_linux_ppc.hpp"
#endif
#ifdef TARGET_OS_ARCH_bsd_x86
# include "vmStructs_bsd_x86.hpp"
#endif
#ifdef TARGET_OS_ARCH_bsd_zero
# include "vmStructs_bsd_zero.hpp"
#endif
#ifndef SERIALGC
#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
#include "gc_implementation/parNew/parNewGeneration.hpp"
#include "gc_implementation/parNew/vmStructs_parNew.hpp"
#include "gc_implementation/parallelScavenge/asPSOldGen.hpp"
#include "gc_implementation/parallelScavenge/asPSYoungGen.hpp"
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/parallelScavenge/psPermGen.hpp"
#include "gc_implementation/parallelScavenge/psVirtualspace.hpp"
#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
#include "gc_implementation/g1/vmStructs_g1.hpp"
#endif
#ifdef COMPILER2
#include "opto/addnode.hpp"
#include "opto/callnode.hpp"
#include "opto/cfgnode.hpp"
#include "opto/chaitin.hpp"
#include "opto/divnode.hpp"
#include "opto/locknode.hpp"
#include "opto/loopnode.hpp"
#include "opto/machnode.hpp"
#include "opto/matcher.hpp"
#include "opto/mulnode.hpp"
#include "opto/phaseX.hpp"
#include "opto/regalloc.hpp"
#include "opto/rootnode.hpp"
#include "opto/subnode.hpp"
#include "opto/vectornode.hpp"
#ifdef TARGET_ARCH_MODEL_x86_32
# include "adfiles/adGlobals_x86_32.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_x86_64
# include "adfiles/adGlobals_x86_64.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_sparc
# include "adfiles/adGlobals_sparc.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_zero
# include "adfiles/adGlobals_zero.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_arm
# include "adfiles/adGlobals_arm.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_ppc
# include "adfiles/adGlobals_ppc.hpp"
#endif
#endif
// Note: the cross-product of (c1, c2, product, nonproduct, ...),
// (nonstatic, static), and (unchecked, checked) has not been taken.
// Only the macros currently needed have been defined.
// A field whose type is not checked is given a null string as the
// type name, indicating an "opaque" type to the serviceability agent.
// NOTE: there is an interdependency between this file and
// HotSpotTypeDataBase.java, which parses the type strings.
#ifndef REG_COUNT
#define REG_COUNT 0
#endif
// whole purpose of this function is to work around bug c++/27724 in gcc 4.1.1
// with optimization turned on it doesn't affect produced code
{
return x;
}
//--------------------------------------------------------------------------------
// VM_STRUCTS
//
// This list enumerates all of the fields the serviceability agent
// needs to know about. Be sure to see also the type table below this one.
// NOTE that there are platform-specific additions to this table in
// vmStructs_<os>_<cpu>.hpp.
#define VM_STRUCTS(nonstatic_field, \
static_field, \
last_entry) \
\
/******************************************************************/ \
/* OopDesc and Klass hierarchies (NOTE: methodDataOop incomplete) */ \
/******************************************************************/ \
\
\
/***********************/ \
/* Constant Pool Cache */ \
/***********************/ \
\
\
/********************************/ \
/* MethodOop-related structures */ \
/********************************/ \
\
/***********/ \
/* JNI IDs */ \
/***********/ \
\
/************/ \
/* Universe */ \
/************/ \
\
\
/**********************************************************************************/ \
/* Generation and Space hierarchies */ \
/**********************************************************************************/ \
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
unchecked_nonstatic_field(GenCollectedHeap, _gens, sizeof(GenCollectedHeap::_gens)) /* NOTE: no type */ \
\
nonstatic_field(HeapWord, i, char*) \
\
\
\
\
\
\
\
\
\
/************************/ \
/* PerfMemory - jvmstat */ \
/************************/ \
\
\
\
\
/***************/ \
/* SymbolTable */ \
/***************/ \
\
\
/***************/ \
/* StringTable */ \
/***************/ \
\
\
/********************/ \
/* SystemDictionary */ \
/********************/ \
\
\
/*************/ \
/* vmSymbols */ \
/*************/ \
\
\
/*******************/ \
/* HashtableBucket */ \
/*******************/ \
\
\
/******************/ \
/* HashtableEntry */ \
/******************/ \
\
\
/*************/ \
/* Hashtable */ \
/*************/ \
\
\
/*******************/ \
/* DictionaryEntry */ \
/*******************/ \
\
\
/********************/ \
\
\
/**************************/ \
/* ProctectionDomainEntry */ \
/**************************/ \
\
\
/*************************/ \
/* LoaderConstraintEntry */ \
/*************************/ \
\
\
/*******************/ \
/* GrowableArrays */ \
/*******************/ \
\
\
/********************************/ \
/* CodeCache (NOTE: incomplete) */ \
/********************************/ \
\
\
/*******************************/ \
/* CodeHeap (NOTE: incomplete) */ \
/*******************************/ \
\
\
/**********************************/ \
/* Interpreter (NOTE: incomplete) */ \
/**********************************/ \
\
\
/****************************/ \
/* Stubs (NOTE: incomplete) */ \
/****************************/ \
\
\
/***********************************/ \
/* StubRoutines (NOTE: incomplete) */ \
/***********************************/ \
\
\
/***************************************/ \
/* PcDesc and other compiled code info */ \
/***************************************/ \
\
\
/***************************************************/ \
/* CodeBlobs (NOTE: incomplete, but only a little) */ \
/***************************************************/ \
\
\
\
/**************************************************/ \
/* NMethods (NOTE: incomplete, but only a little) */ \
/**************************************************/ \
\
\
\
/********************************/ \
/* JavaCalls (NOTE: incomplete) */ \
/********************************/ \
\
/********************************/ \
/* JavaFrameAnchor (NOTE: incomplete) */ \
/********************************/ \
\
/******************************/ \
/* Threads (NOTE: incomplete) */ \
/******************************/ \
\
\
\
/************/ \
/* OSThread */ \
/************/ \
\
\
/************************/ \
/* OopMap and OopMapSet */ \
/************************/ \
\
\
/*********************************/ \
/* JNIHandles and JNIHandleBlock */ \
/*********************************/ \
\
unchecked_nonstatic_field(JNIHandleBlock, _handles, JNIHandleBlock::block_size_in_oops * sizeof(Oop)) /* Note: no type */ \
\
/********************/ \
/* CompressedStream */ \
/********************/ \
\
\
/*********************************/ \
/* VMRegImpl (NOTE: incomplete) */ \
/*********************************/ \
\
\
/*******************************/ \
/* Runtime1 (NOTE: incomplete) */ \
/*******************************/ \
\
\
/**************/ \
/* allocation */ \
/**************/ \
\
\
\
/************/ \
/* CI */ \
/************/ \
\
\
\
\
\
\
\
\
\
\
\
\
\
\
/************/ \
/* Monitors */ \
/************/ \
\
\
/*********************/ \
/* Matcher (C2 only) */ \
/*********************/ \
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
/*********************/ \
/* -XX flags */ \
/*********************/ \
\
\
/*************************/ \
/* JDK / VM version info */ \
/*************************/ \
\
\
\
/*************************/ \
/* JVMTI */ \
/*************************/ \
\
\
/*************/ \
/* Arguments */ \
/*************/ \
\
\
/*********************************/ \
/* java_lang_Class fields */ \
/*********************************/ \
\
\
/************************/ \
/* Miscellaneous fields */ \
/************************/ \
\
\
\
\
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs_<os>_<cpu>.hpp's VM_STRUCTS_OS_CPU macro (and must */
/* be present there) */
//--------------------------------------------------------------------------------
// VM_TYPES
//
// This list must enumerate at least all of the types in the above
// list. For the types in the above list, the entry below must have
// exactly the same spacing since string comparisons are done in the
// code which verifies the consistency of these tables (in the debug
// build).
//
// In addition to the above types, this list is required to enumerate
// the JNI's java types, which are used to indicate the size of Java
// fields in this VM to the SA. Further, oop types are currently
// distinguished by name (i.e., ends with "oop") over in the SA.
//
// The declare_toplevel_type macro should be used to declare types
// which do not have a superclass.
//
// The declare_integer_type and declare_unsigned_integer_type macros
// are required in order to properly identify C integer types over in
// the SA. They should be used for any type which is otherwise opaque
// and which it is necessary to coerce into an integer value. This
// includes, for example, the type uintptr_t. Note that while they
// will properly identify the type's size regardless of the platform,
// since it is does not seem possible to deduce or check signedness at
// compile time using the pointer comparison tricks, it is currently
// required that the given types have the same signedness across all
// platforms.
//
// NOTE that there are platform-specific additions to this table in
// vmStructs_<os>_<cpu>.hpp.
#define VM_TYPES(declare_type, \
last_entry) \
\
/*************************************************************/ \
/* Java primitive types -- required by the SA implementation */ \
/* in order to determine the size of Java fields in this VM */ \
/* (the implementation looks up these names specifically) */ \
/* NOTE: since we fetch these sizes from the remote VM, we */ \
/* have a bootstrapping sequence during which it is not */ \
/* valid to fetch Java values from the remote process, only */ \
/* C integer values (of known size). NOTE also that we do */ \
/* NOT include "Java unsigned" types like juint here; since */ \
/* Java does not have unsigned primitive types, those can */ \
/* not be mapped directly and are considered to be C integer */ \
/* types in this system (see the "other types" section, */ \
/* below.) */ \
/*************************************************************/ \
\
\
/*********************************************************************/ \
/* C integer types. User-defined typedefs (like "size_t" or */ \
/* "intptr_t") are guaranteed to be present with the same names over */ \
/* in the SA's type database. Names like "unsigned short" are not */ \
/* guaranteed to be visible through the SA's type database lookup */ \
/* mechanism, though they will have a Type object created for them */ \
/* and are valid types for Fields. */ \
/*********************************************************************/ \
declare_integer_type(bool) \
declare_integer_type(short) \
declare_integer_type(int) \
declare_integer_type(long) \
declare_integer_type(char) \
declare_unsigned_integer_type(unsigned char) \
declare_unsigned_integer_type(unsigned int) \
declare_unsigned_integer_type(unsigned short) \
declare_unsigned_integer_type(unsigned long) \
/* The compiler thinks this is a different type than */ \
/* unsigned short on Win32 */ \
declare_unsigned_integer_type(unsigned) \
\
/*****************************/ \
/* C primitive pointer types */ \
/*****************************/ \
\
declare_toplevel_type(int*) \
declare_toplevel_type(char*) \
declare_toplevel_type(char**) \
declare_toplevel_type(unsigned char*) \
\
/*******************************************************************/ \
/* Types which it will be handy to have available over in the SA */ \
/* in order to do platform-independent address -> integer coercion */ \
/* (note: these will be looked up by name) */ \
/*******************************************************************/ \
\
\
/*******************************************************************************/ \
/* OopDesc and Klass hierarchies (NOTE: missing methodDataOop-related classes) */ \
/*******************************************************************************/ \
\
\
\
/********/ \
/* Oops */ \
/********/ \
\
\
/*************************************/ \
/* MethodOop-related data structures */ \
/*************************************/ \
\
\
/******************************************/ \
/* Generation and space hierarchies */ \
/* (needed for run-time type information) */ \
/******************************************/ \
\
\
/* Miscellaneous other GC types */ \
\
\
/* Pointers to Garbage Collection types */ \
\
\
/************************/ \
/* PerfMemory - jvmstat */ \
/************************/ \
\
\
/*********************************/ \
/* SymbolTable, SystemDictionary */ \
/*********************************/ \
\
\
\
/***********************************************************/ \
/* Thread hierarchy (needed for run-time type information) */ \
/***********************************************************/ \
\
\
/***************/ \
/* Interpreter */ \
/***************/ \
\
\
/*********/ \
/* Stubs */ \
/*********/ \
\
\
/*************/ \
/* JavaCalls */ \
/*************/ \
\
\
/*************/ \
/* CodeCache */ \
/*************/ \
\
\
/************/ \
/* CodeHeap */ \
/************/ \
\
\
/*************************************************************/ \
/* CodeBlob hierarchy (needed for run-time type information) */ \
/*************************************************************/ \
\
\
\
/***************************************/ \
/* PcDesc and other compiled code info */ \
/***************************************/ \
\
\
/************************/ \
/* OopMap and OopMapSet */ \
/************************/ \
\
\
/********************/ \
/* CompressedStream */ \
/********************/ \
\
\
/**************/ \
/* VMRegImpl */ \
/**************/ \
\
\
/*********************************/ \
/* JNIHandles and JNIHandleBlock */ \
/*********************************/ \
\
\
/**********************/ \
/* Runtime1 (C1 only) */ \
/**********************/ \
\
\
/************/ \
/* Monitors */ \
/************/ \
\
\
/*********************/ \
/* Matcher (C2 only) */ \
/*********************/ \
\
\
/*********************/ \
/* Adapter Blob Entries */ \
/*********************/ \
\
/*********************/ \
/* CI */ \
/*********************/ \
declare_toplevel_type(void*) \
\
/********************/ \
/* -XX flags */ \
/********************/ \
\
\
/********************/ \
/* JVMTI */ \
/********************/ \
\
\
/********************/ \
/********************/ \
\
\
/*************/ \
/* Arguments */ \
/*************/ \
\
\
/***************/ \
/* Other types */ \
/***************/ \
\
/* all enum types */ \
\
\
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs_<os>_<cpu>.hpp's VM_TYPES_OS_CPU macro (and must be */
/* present there) */
//--------------------------------------------------------------------------------
// VM_INT_CONSTANTS
//
// This table contains integer constants required over in the
// serviceability agent. The "declare_constant" macro is used for all
// enums, etc., while "declare_preprocessor_constant" must be used for
// all #defined constants.
#define VM_INT_CONSTANTS(declare_constant, \
last_entry) \
\
/******************/ \
/* Useful globals */ \
/******************/ \
\
\
/**************/ \
/* Stack bias */ \
/**************/ \
\
\
/****************/ \
/* Object sizes */ \
/****************/ \
\
\
/********************************************/ \
/* Generation and Space Hierarchy Constants */ \
/********************************************/ \
\
\
\
\
\
\
\
\
\
/* constants from Generation::Name enum */ \
\
\
\
\
/* constants from PermGen::Name enum */ \
\
\
/************************/ \
/* PerfMemory - jvmstat */ \
/************************/ \
\
\
/***************/ \
/* SymbolTable */ \
/***************/ \
\
\
/***********************************/ \
/* LoaderConstraintTable constants */ \
/***********************************/ \
\
\
/************************************************************/ \
/* HotSpot specific JVM_ACC constants from global anon enum */ \
/************************************************************/ \
\
\
/*****************************/ \
/* Thread::SuspendFlags enum */ \
/*****************************/ \
\
\
/*******************/ \
/* JavaThreadState */ \
/*******************/ \
\
\
/******************************/ \
/* Klass misc. enum constants */ \
/******************************/ \
\
\
/********************************/ \
/* constMethodOopDesc anon-enum */ \
/********************************/ \
\
\
/*************************************/ \
/* instanceKlass enum */ \
/*************************************/ \
\
\
/*************************************/ \
/* FieldInfo FieldOffset enum */ \
/*************************************/ \
\
\
/************************************************/ \
/* instanceKlass InnerClassAttributeOffset enum */ \
/************************************************/ \
\
\
/*********************************/ \
/* instanceKlass ClassState enum */ \
/*********************************/ \
\
\
/*********************************/ \
/* Symbol* - symbol max length */ \
/*********************************/ \
\
\
/*************************************************/ \
/* constantPoolOop layout enum for InvokeDynamic */ \
/*************************************************/ \
\
\
/********************************/ \
/* ConstantPoolCacheEntry enums */ \
/********************************/ \
\
\
/***************************************/ \
/* java_lang_Thread::ThreadStatus enum */ \
/***************************************/ \
\
\
/******************************/ \
/* Debug info */ \
/******************************/ \
\
\
/* constants from Location::Type enum */ \
\
\
/* constants from Location::Where enum */ \
\
\
\
/*********************/ \
/* Matcher (C2 only) */ \
/*********************/ \
\
declare_c2_preprocessor_constant("Matcher::interpreter_frame_pointer_reg", Matcher::interpreter_frame_pointer_reg()) \
\
/*********************************************/ \
/* MethodCompilation (globalDefinitions.hpp) */ \
/*********************************************/ \
\
\
/***************/ \
/* OopMapValue */ \
/***************/ \
\
\
/******************/ \
/* JNIHandleBlock */ \
/******************/ \
\
\
/**********************/ \
/* ObjectSynchronizer */ \
/**********************/ \
\
\
/**********************/ \
/* PcDesc */ \
/**********************/ \
\
\
/**********************/ \
/* frame */ \
/**********************/ \
\
\
/*************/ \
/* vmSymbols */ \
/*************/ \
\
\
/********************************/ \
/* Calling convention constants */ \
/********************************/ \
\
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs_<os>_<cpu>.hpp's VM_INT_CONSTANTS_OS_CPU macro (and */
/* must be present there) */
//--------------------------------------------------------------------------------
// VM_LONG_CONSTANTS
//
// This table contains long constants required over in the
// serviceability agent. The "declare_constant" macro is used for all
// enums, etc., while "declare_preprocessor_constant" must be used for
// all #defined constants.
#define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant, last_entry) \
\
/*********************/ \
/* MarkOop constants */ \
/*********************/ \
\
/* Note: some of these are declared as long constants just for */ \
/* consistency. The mask constants are the only ones requiring */ \
/* 64 bits (on 64-bit platforms). */ \
\
\
\
\
\
\
/* Constants in markOop used by CMS. */ \
/* NOTE that we do not use the last_entry() macro here; it is used */
/* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and */
/* must be present there) */
//--------------------------------------------------------------------------------
// Macros operating on the above lists
//--------------------------------------------------------------------------------
// This utility macro quotes the passed string
#define QUOTE(x) #x
//--------------------------------------------------------------------------------
// VMStructEntry macros
//
// This macro generates a VMStructEntry line for a nonstatic field
{ QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 0, cast_uint64_t(offset_of(typeName, fieldName)), NULL },
// This macro generates a VMStructEntry line for a static field
// This macro generates a VMStructEntry line for an unchecked
// nonstatic field, in which the size of the type is also specified.
// The type string is given as NULL, indicating an "opaque" type.
{ QUOTE(typeName), QUOTE(fieldName), NULL, 0, cast_uint64_t(offset_of(typeName, fieldName)), NULL },
// This macro generates a VMStructEntry line for an unchecked
// static field, in which the size of the type is also specified.
// The type string is given as NULL, indicating an "opaque" type.
// This macro generates the sentinel value indicating the end of the list
#define GENERATE_VM_STRUCT_LAST_ENTRY() \
// This macro checks the type of a VMStructEntry by comparing pointer types
// This macro checks the type of a volatile VMStructEntry by comparing pointer types
{typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; }
// This macro checks the type of a VMStructEntry by comparing pointer types
// This macro ensures the type of a field and its containing type are
// present in the type table. The assertion string is shorter than
// preferable because (incredibly) of a bug in Solstice NFS client
// which seems to prevent very long lines from compiling. This assertion
// means that an entry in VMStructs::localHotSpotVMStructs[] was not
// found in VMStructs::localHotSpotVMTypes[].
// This is a no-op macro for unchecked fields
#define CHECK_NO_OP(a, b, c)
// This is a no-op macro for the sentinel value
#define CHECK_SENTINEL()
//
// Build-specific macros:
//
// Generate and check a nonstatic field in non-product builds
#ifndef PRODUCT
# define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c) ENSURE_FIELD_TYPE_PRESENT(a, b, c)
# define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c) ENSURE_FIELD_TYPE_PRESENT(a, b, c)
#else
# define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)
# define GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_NONPRODUCT_FIELD_TYPE_PRESENT(a, b, c)
#endif /* PRODUCT */
// Generate and check a nonstatic field in C1 builds
#ifdef COMPILER1
# define GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_C1_FIELD_TYPE_PRESENT(a, b, c) ENSURE_FIELD_TYPE_PRESENT(a, b, c)
#else
# define GENERATE_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_C1_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_C1_FIELD_TYPE_PRESENT(a, b, c)
#endif /* COMPILER1 */
// Generate and check a nonstatic field in C2 builds
#ifdef COMPILER2
# define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c) CHECK_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c) ENSURE_FIELD_TYPE_PRESENT(a, b, c)
#else
# define GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define CHECK_C2_NONSTATIC_VM_STRUCT_ENTRY(a, b, c)
# define ENSURE_C2_FIELD_TYPE_PRESENT(a, b, c)
#endif /* COMPILER2 */
// Generate but do not check a static field in C1 builds
#ifdef COMPILER1
# define GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
#else
# define GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
#endif /* COMPILER1 */
// Generate but do not check a static field in C2 builds
#ifdef COMPILER2
# define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c) GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
#else
# define GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY(a, b, c)
#endif /* COMPILER2 */
//--------------------------------------------------------------------------------
// VMTypeEntry macros
//
#define GENERATE_TOPLEVEL_VM_TYPE_ENTRY(type) \
#define GENERATE_OOP_VM_TYPE_ENTRY(type) \
#define GENERATE_INTEGER_VM_TYPE_ENTRY(type) \
#define GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY(type) \
#define GENERATE_VM_TYPE_LAST_ENTRY() \
#define CHECK_VM_TYPE_NO_OP(a)
#define CHECK_SINGLE_ARG_VM_TYPE_NO_OP(a)
//
// Build-specific macros:
//
#ifdef COMPILER1
# define CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY(a)
#else
# define GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY(a)
# define CHECK_C1_TOPLEVEL_VM_TYPE_ENTRY(a)
#endif /* COMPILER1 */
#ifdef COMPILER2
# define GENERATE_C2_VM_TYPE_ENTRY(a, b) GENERATE_VM_TYPE_ENTRY(a, b)
# define CHECK_C2_VM_TYPE_ENTRY(a, b) CHECK_VM_TYPE_ENTRY(a, b)
# define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a)
#else
# define GENERATE_C2_VM_TYPE_ENTRY(a, b)
# define CHECK_C2_VM_TYPE_ENTRY(a, b)
# define GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY(a)
# define CHECK_C2_TOPLEVEL_VM_TYPE_ENTRY(a)
#endif /* COMPILER2 */
//--------------------------------------------------------------------------------
// VMIntConstantEntry macros
//
#define GENERATE_VM_INT_CONSTANT_ENTRY(name) \
// This macro generates the sentinel value indicating the end of the list
#define GENERATE_VM_INT_CONSTANT_LAST_ENTRY() \
{ NULL, 0 }
// Generate an int constant for a C1 build
#ifdef COMPILER1
#else
# define GENERATE_C1_VM_INT_CONSTANT_ENTRY(name)
#endif /* COMPILER1 */
// Generate an int constant for a C2 build
#ifdef COMPILER2
# define GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value)
#else
# define GENERATE_C2_VM_INT_CONSTANT_ENTRY(name)
#endif /* COMPILER1 */
//--------------------------------------------------------------------------------
// VMLongConstantEntry macros
//
#define GENERATE_VM_LONG_CONSTANT_ENTRY(name) \
// This macro generates the sentinel value indicating the end of the list
#define GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() \
{ NULL, 0 }
// Generate a long constant for a C1 build
#ifdef COMPILER1
#else
# define GENERATE_C1_VM_LONG_CONSTANT_ENTRY(name)
#endif /* COMPILER1 */
// Generate a long constant for a C2 build
#ifdef COMPILER2
# define GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value)
#else
# define GENERATE_C2_VM_LONG_CONSTANT_ENTRY(name)
#endif /* COMPILER1 */
//
// Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries
//
// These initializers are allowed to access private fields in classes
// as long as class VMStructs is a friend
#ifndef SERIALGC
#endif // SERIALGC
};
#ifndef SERIALGC
#endif // SERIALGC
};
#ifndef SERIALGC
#endif // SERIALGC
};
};
// This is used both to check the types of referenced fields and, in
// debug builds, to ensure that all of the field types are present.
void
#ifndef SERIALGC
#endif // SERIALGC
#ifndef SERIALGC
#endif // SERIALGC
//
// Split VM_STRUCTS() invocation into two parts to allow MS VC++ 6.0
// to build with the source mounted over SNC3.2. Symptom was that
// debug build failed with an internal compiler error. Has been seen
// mounting sources from Solaris 2.6 and 2.7 hosts, but so far not
// 2.8 hosts. Appears to occur because line is too long.
//
// If an assertion failure is triggered here it means that an entry
// in VMStructs::localHotSpotVMStructs[] was not found in
// VMStructs::localHotSpotVMTypes[]. (The assertion itself had to be
// made less descriptive because of this above bug -- see the
// definition of ENSURE_FIELD_TYPE_PRESENT.)
//
// NOTE: taken out because this was just not working on everyone's
// Solstice NFS setup. If everyone switches to local workspaces on
// Win32, we can put this back in.
#ifndef _WINDOWS
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
#ifndef SERIALGC
#endif // SERIALGC
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
CHECK_NO_OP, \
#endif
}
extern "C" {
// see comments on cast_uint64_t at the top of this file
}
#ifdef ASSERT
{
// Found it
return 1;
}
++types;
}
}
// Search for the base type by peeling off const and *
char * s = new char[len];
// tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
delete s;
return 1;
}
delete s;
}
char * s = new char[len];
// tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
delete s;
return 1;
}
delete s;
}
// tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
return 1;
}
}
// tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
return 1;
}
}
if (!isRecurse) {
}
return 0;
}
int
}
#endif
void vmStructs_init() {
}