Path: blob/master/runtime/gc_include/j9modron.h
5986 views
/*******************************************************************************1* Copyright (c) 1991, 2021 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122#if !defined(J9MODRON_H__)23#define J9MODRON_H__2425/* @ddr_namespace: map_to_type=J9ModronConstants */2627#include "j9.h"28#include "j9consts.h"29#include "omrgcconsts.h"3031#ifdef __cplusplus32extern "C" {33#endif /* __cplusplus */3435/**36* Write barrier type definitions.37* @ingroup GC_Include38* @{39*/40typedef enum {41j9gc_modron_wrtbar_illegal = gc_modron_wrtbar_illegal,42j9gc_modron_wrtbar_none = gc_modron_wrtbar_none,43j9gc_modron_wrtbar_always = gc_modron_wrtbar_always,44j9gc_modron_wrtbar_oldcheck = gc_modron_wrtbar_oldcheck,45j9gc_modron_wrtbar_cardmark = gc_modron_wrtbar_cardmark,46j9gc_modron_wrtbar_cardmark_incremental = gc_modron_wrtbar_cardmark_incremental,47j9gc_modron_wrtbar_cardmark_and_oldcheck = gc_modron_wrtbar_cardmark_and_oldcheck,48j9gc_modron_wrtbar_satb = gc_modron_wrtbar_satb,49j9gc_modron_wrtbar_satb_and_oldcheck = gc_modron_wrtbar_satb_and_oldcheck,50j9gc_modron_wrtbar_count = gc_modron_wrtbar_count51} J9WriteBarrierType;5253/**54* Read barrier type definitions.55* @ingroup GC_Include56* @{57*/58typedef enum {59j9gc_modron_readbar_illegal = gc_modron_readbar_illegal,60j9gc_modron_readbar_none = gc_modron_readbar_none,61j9gc_modron_readbar_always = gc_modron_readbar_always,62j9gc_modron_readbar_range_check = gc_modron_readbar_range_check,63j9gc_modron_readbar_region_check = gc_modron_readbar_region_check,64j9gc_modron_readbar_count = gc_modron_readbar_count65} J9ReadBarrierType;6667typedef enum {68j9gc_modron_allocation_type_illegal = OMR_GC_ALLOCATION_TYPE_ILLEGAL,69j9gc_modron_allocation_type_tlh = OMR_GC_ALLOCATION_TYPE_TLH,70j9gc_modron_allocation_type_segregated = OMR_GC_ALLOCATION_TYPE_SEGREGATED,71j9gc_modron_allocation_type_count /* Total number of write barriers */72} J9GCAllocationType;7374/**75* GC Feature type definitions (used by "j9gc_modron_isFeatureSupported")76*/77typedef enum {78j9gc_modron_feature_none = 0,79j9gc_modron_feature_inline_reference_get,80j9gc_modron_feature_count /* Total number of known features */81} J9GCFeatureType;8283/**84* GC Configuration type definitions (used by "j9gc_modron_getConfigurationValueForKey")85*/86typedef enum {87j9gc_modron_configuration_none = 0,88j9gc_modron_configuration_heapAddressToCardAddressShift, /* a UDATA representing the shift amount to convert from heap granularity to card table granularity */89j9gc_modron_configuration_heapBaseForBarrierRange0_isVariable, /* a UDATA (TRUE or FALSE) representing whether or not the J9VMThread->heapBaseForBarrierRange0 can change during the run (FALSE implies constant) */90j9gc_modron_configuration_activeCardTableBase_isVariable, /* a UDATA (TRUE or FALSE) representing whether or not the J9VMThread->activeCardTableBase can change during the run (FALSE implies constant) */91j9gc_modron_configuration_heapSizeForBarrierRange0_isVariable, /* a UDATA (TRUE or FALSE) representing whether or not the J9VMThread->heapSizeForBarrierRange0 can change during the run (FALSE implies constant) */92j9gc_modron_configuration_minimumObjectSize, /* a UDATA representing the minimum object size */93j9gc_modron_configuration_allocationType, /* a UDATA representing the allocation type see J9GCAllocationType enum for possible types */94j9gc_modron_configuration_discontiguousArraylets, /* a UDATA (TRUE or FALSE) representing whether or not discontiguousArraylets are enabled */95j9gc_modron_configuration_gcThreadCount, /* a UDATA representing the MAX number of GC threads being used */96j9gc_modron_configuration_objectAlignment, /* a UDATA representing the alignment of the object in heap */97j9gc_modron_configuration_compressObjectReferences, /* a UDATA (TRUE or FALSE) representing whether or not object references are compressed */98j9gc_modron_configuration_heapRegionShift, /* a UDATA representing the shift amount to convert an object pointer to the address of the region */99j9gc_modron_configuration_heapRegionStateTable, /* a pointer to the base of the region state table */100/* Add new values before this comment */101j9gc_modron_configuration_count /* Total number of known configuration keys */102} J9GCConfigurationKey;103104105/**106* Signature for the callback function passed to <code>MM_ReferenceChainWalker</code>107*/108typedef jvmtiIterationControl J9MODRON_REFERENCE_CHAIN_WALKER_CALLBACK(J9Object **slotPtr, J9Object *sourcePtr, void *userData, IDATA type, IDATA index, IDATA wasReportedBefore);109110#define J9GC_ROOT_TYPE_UNKNOWN 1 /**< root that fell through a default state in an iterator, or called via non abstracted doSlot() */111#define J9GC_ROOT_TYPE_CLASS 2112#define J9GC_ROOT_TYPE_JNI_LOCAL 3113#define J9GC_ROOT_TYPE_JNI_GLOBAL 4114#define J9GC_ROOT_TYPE_JNI_WEAK_GLOBAL 5115#define J9GC_ROOT_TYPE_THREAD_SLOT 6116#define J9GC_ROOT_TYPE_MONITOR 7117#define J9GC_ROOT_TYPE_STRING_TABLE 8118#define J9GC_ROOT_TYPE_DEBUG_REFERENCE 9119#define J9GC_ROOT_TYPE_DEBUG_CLASS_REFERENCE 10120#define J9GC_ROOT_TYPE_FINALIZABLE_OBJECT 11121#define J9GC_ROOT_TYPE_UNFINALIZED_OBJECT 12122#define J9GC_ROOT_TYPE_WEAK_REFERENCE 13123#define J9GC_ROOT_TYPE_SOFT_REFERENCE 14124#define J9GC_ROOT_TYPE_PHANTOM_REFERENCE 15125#define J9GC_ROOT_TYPE_THREAD_MONITOR 16126#define J9GC_ROOT_TYPE_REMEMBERED_SET 17127#define J9GC_ROOT_TYPE_CLASSLOADER 18128#define J9GC_ROOT_TYPE_VM_CLASS_SLOT 19129#define J9GC_ROOT_TYPE_STACK_SLOT 20130#define J9GC_ROOT_TYPE_JVMTI_TAG_REF 21131#define J9GC_ROOT_TYPE_OWNABLE_SYNCHRONIZER_OBJECT 22132133#define J9GC_REFERENCE_TYPE_UNKNOWN -1 /**< reference to an object that fell through a default state in an iterator */134#define J9GC_REFERENCE_TYPE_FIELD -2 /**< field reference to an object */135#define J9GC_REFERENCE_TYPE_STATIC -3 /**< static field reference to an object */136#define J9GC_REFERENCE_TYPE_CLASS -4 /**< reference to an object's class */137#define J9GC_REFERENCE_TYPE_ARRAY -5 /**< reference to an object from an array */138#define J9GC_REFERENCE_TYPE_WEAK_REFERENCE -6 /**< field reference to an object from a weak reference */139#define J9GC_REFERENCE_TYPE_CONSTANT_POOL -7 /**< reference to an object in a constant pool */140#define J9GC_REFERENCE_TYPE_PROTECTION_DOMAIN -8 /**< reference to a class' protection domain */141#define J9GC_REFERENCE_TYPE_SUPERCLASS -9 /**< reference to a class' superclass */142#define J9GC_REFERENCE_TYPE_INTERFACE -10 /**< reference to an interface implemented by a class */143#define J9GC_REFERENCE_TYPE_CLASSLOADER -11 /**< reference to the classloader of the class */144#define J9GC_REFERENCE_TYPE_CLASS_ARRAY_CLASS -12 /**< reference to an array class' component type class */145#define J9GC_REFERENCE_TYPE_CLASS_NAME_STRING -13 /**< reference to a class' name string */146#define J9GC_REFERENCE_TYPE_CALL_SITE -14 /**< call site reference to an object */147#define J9GC_REFERENCE_TYPE_CLASS_FCC -15 /**< reference to a class in flattened class cache */148149/**150* #defines representing the results from j9gc_ext_check_is_valid_heap_object.151* @ingroup GC_Include152* @{153*/154#define J9OBJECTCHECK_OBJECT 0155#define J9OBJECTCHECK_CLASS 1156#define J9OBJECTCHECK_FORWARDED 2157#define J9OBJECTCHECK_INVALID 3158/**159* @}160*/161162/**163* @ingroup GC_Include164* @name Class loader flags165* Borrowed from builder - should be made collector specific166* @{167*/168/* TODO Should these be deleted? or changed? */169#define J9_GC_CLASS_LOADER_SCANNED 0x1170#define J9_GC_CLASS_LOADER_DEAD 0x2171#define J9_GC_CLASS_LOADER_UNLOADING 0x4172#define J9_GC_CLASS_LOADER_ENQ_UNLOAD 0x8173#define J9_GC_CLASS_LOADER_REMEMBERED 0x10174175/** @} */176177/**178* @ingroup GC_Include179* @name Metronome CPU utilization component type flags.180* Any JVM component that hooks to GC events and consumes significant CPU cycles181* should be assigned a new component type so that GC can keep track of its utilization.182* @{183*/184#define J9_GC_METRONOME_UTILIZATION_COMPONENT_MUTATOR 0185#define J9_GC_METRONOME_UTILIZATION_COMPONENT_GC 1186#define J9_GC_METRONOME_UTILIZATION_COMPONENT_JIT 2187/** @} */188189190#define J9GC_HASH_SALT_COUNT_STANDARD 1191#define J9GC_HASH_SALT_NURSERY_INDEX 0192193#define J9_GC_MANAGEMENT_POOL_JAVAHEAP 0x1194#define J9_GC_MANAGEMENT_POOL_TENURED 0x2195#define J9_GC_MANAGEMENT_POOL_TENURED_SOA 0x4196#define J9_GC_MANAGEMENT_POOL_TENURED_LOA 0x8197#define J9_GC_MANAGEMENT_POOL_NURSERY_ALLOCATE 0x10198#define J9_GC_MANAGEMENT_POOL_NURSERY_SURVIVOR 0x20199#define J9_GC_MANAGEMENT_POOL_REGION_OLD 0x40200#define J9_GC_MANAGEMENT_POOL_REGION_EDEN 0x80201#define J9_GC_MANAGEMENT_POOL_REGION_SURVIVOR 0x100202#define J9_GC_MANAGEMENT_POOL_REGION_RESERVED 0x200203#define J9_GC_MANAGEMENT_MAX_POOL 10204205#define J9_GC_MANAGEMENT_COLLECTOR_SCAVENGE 0x1206#define J9_GC_MANAGEMENT_COLLECTOR_GLOBAL 0x2207#define J9_GC_MANAGEMENT_COLLECTOR_PGC 0x4208#define J9_GC_MANAGEMENT_COLLECTOR_GGC 0x8209#define J9_GC_MANAGEMENT_COLLECTOR_EPSILON 0x10210#define J9_GC_MANAGEMENT_MAX_COLLECTOR 5211212#ifdef __cplusplus213} /* extern "C" { */214#endif /* __cplusplus */215216#endif /* J9MODRON_H__ */217218219220