annotate src/hotspot/share/gc/shared/vmStructs_gc.hpp @ 52321:31b159f30fb2

8180193: Make marking bitmap code available to other GCs Reviewed-by: shade, stefank
author rkennke
date Wed, 29 Aug 2018 20:15:09 +0200
parents 7b7c75d87f9b
children 9c18c9d839d3
rev   line source
stefank@50225 1 /*
stefank@50225 2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
stefank@50225 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
stefank@50225 4 *
stefank@50225 5 * This code is free software; you can redistribute it and/or modify it
stefank@50225 6 * under the terms of the GNU General Public License version 2 only, as
stefank@50225 7 * published by the Free Software Foundation.
stefank@50225 8 *
stefank@50225 9 * This code is distributed in the hope that it will be useful, but WITHOUT
stefank@50225 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
stefank@50225 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
stefank@50225 12 * version 2 for more details (a copy is included in the LICENSE file that
stefank@50225 13 * accompanied this code).
stefank@50225 14 *
stefank@50225 15 * You should have received a copy of the GNU General Public License version
stefank@50225 16 * 2 along with this work; if not, write to the Free Software Foundation,
stefank@50225 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
stefank@50225 18 *
stefank@50225 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
stefank@50225 20 * or visit www.oracle.com if you need additional information or have any
stefank@50225 21 * questions.
stefank@50225 22 *
stefank@50225 23 */
stefank@50225 24
stefank@50225 25 #ifndef SHARE_GC_SHARED_VMSTRUCTS_GC_HPP
stefank@50225 26 #define SHARE_GC_SHARED_VMSTRUCTS_GC_HPP
stefank@50225 27
stefank@50518 28 #include "gc/shared/ageTable.hpp"
stefank@50225 29 #include "gc/shared/cardGeneration.hpp"
stefank@50225 30 #include "gc/shared/cardTableRS.hpp"
stefank@50225 31 #include "gc/shared/collectedHeap.hpp"
stefank@50225 32 #include "gc/shared/genCollectedHeap.hpp"
stefank@50225 33 #include "gc/shared/generation.hpp"
stefank@50225 34 #include "gc/shared/generationSpec.hpp"
stefank@50225 35 #include "gc/shared/oopStorage.hpp"
stefank@50225 36 #include "gc/shared/space.hpp"
stefank@50518 37 #if INCLUDE_CMSGC
stefank@50518 38 #include "gc/cms/vmStructs_cms.hpp"
stefank@50518 39 #endif
shade@51136 40 #if INCLUDE_EPSILONGC
shade@51136 41 #include "gc/epsilon/vmStructs_epsilon.hpp"
shade@51136 42 #endif
stefank@50518 43 #if INCLUDE_G1GC
stefank@50518 44 #include "gc/g1/vmStructs_g1.hpp"
stefank@50518 45 #endif
stefank@50518 46 #if INCLUDE_PARALLELGC
stefank@50518 47 #include "gc/parallel/vmStructs_parallelgc.hpp"
stefank@50518 48 #endif
stefank@50518 49 #if INCLUDE_SERIALGC
stefank@50225 50 #include "gc/serial/defNewGeneration.hpp"
stefank@50225 51 #include "gc/serial/vmStructs_serial.hpp"
stefank@50225 52 #endif
pliden@51138 53 #if INCLUDE_ZGC
pliden@51138 54 #include "gc/z/vmStructs_z.hpp"
pliden@51138 55 #endif
stefank@50225 56
stefank@50225 57 #define VM_STRUCTS_GC(nonstatic_field, \
stefank@50225 58 volatile_nonstatic_field, \
stefank@50225 59 static_field, \
stefank@50225 60 unchecked_nonstatic_field) \
stefank@50518 61 CMSGC_ONLY(VM_STRUCTS_CMSGC(nonstatic_field, \
stefank@50518 62 volatile_nonstatic_field, \
stefank@50518 63 static_field)) \
shade@51136 64 EPSILONGC_ONLY(VM_STRUCTS_EPSILONGC(nonstatic_field, \
shade@51136 65 volatile_nonstatic_field, \
shade@51136 66 static_field)) \
stefank@50518 67 G1GC_ONLY(VM_STRUCTS_G1GC(nonstatic_field, \
stefank@50518 68 volatile_nonstatic_field, \
stefank@50518 69 static_field)) \
stefank@50518 70 PARALLELGC_ONLY(VM_STRUCTS_PARALLELGC(nonstatic_field, \
stefank@50518 71 volatile_nonstatic_field, \
stefank@50518 72 static_field)) \
stefank@50518 73 SERIALGC_ONLY(VM_STRUCTS_SERIALGC(nonstatic_field, \
stefank@50518 74 volatile_nonstatic_field, \
stefank@50518 75 static_field)) \
pliden@51138 76 ZGC_ONLY(VM_STRUCTS_ZGC(nonstatic_field, \
pliden@51138 77 volatile_nonstatic_field, \
pliden@51138 78 static_field)) \
pliden@51138 79 \
stefank@50225 80 /**********************************************************************************/ \
stefank@50225 81 /* Generation and Space hierarchies */ \
stefank@50225 82 /**********************************************************************************/ \
stefank@50225 83 \
stefank@50225 84 unchecked_nonstatic_field(AgeTable, sizes, sizeof(AgeTable::sizes)) \
stefank@50225 85 \
stefank@50225 86 nonstatic_field(BarrierSet, _fake_rtti, BarrierSet::FakeRtti) \
stefank@50225 87 \
stefank@50225 88 nonstatic_field(BarrierSet::FakeRtti, _concrete_tag, BarrierSet::Name) \
stefank@50225 89 \
stefank@50225 90 nonstatic_field(BlockOffsetTable, _bottom, HeapWord*) \
stefank@50225 91 nonstatic_field(BlockOffsetTable, _end, HeapWord*) \
stefank@50225 92 \
stefank@50225 93 nonstatic_field(BlockOffsetSharedArray, _reserved, MemRegion) \
stefank@50225 94 nonstatic_field(BlockOffsetSharedArray, _end, HeapWord*) \
stefank@50225 95 nonstatic_field(BlockOffsetSharedArray, _vs, VirtualSpace) \
stefank@50225 96 nonstatic_field(BlockOffsetSharedArray, _offset_array, u_char*) \
stefank@50225 97 \
stefank@50225 98 nonstatic_field(BlockOffsetArray, _array, BlockOffsetSharedArray*) \
stefank@50225 99 nonstatic_field(BlockOffsetArray, _sp, Space*) \
stefank@50225 100 nonstatic_field(BlockOffsetArrayContigSpace, _next_offset_threshold, HeapWord*) \
stefank@50225 101 nonstatic_field(BlockOffsetArrayContigSpace, _next_offset_index, size_t) \
stefank@50225 102 \
stefank@50225 103 nonstatic_field(BlockOffsetArrayNonContigSpace, _unallocated_block, HeapWord*) \
stefank@50225 104 \
stefank@50225 105 nonstatic_field(CardGeneration, _rs, CardTableRS*) \
stefank@50225 106 nonstatic_field(CardGeneration, _bts, BlockOffsetSharedArray*) \
stefank@50225 107 nonstatic_field(CardGeneration, _shrink_factor, size_t) \
stefank@50225 108 nonstatic_field(CardGeneration, _capacity_at_prologue, size_t) \
stefank@50225 109 nonstatic_field(CardGeneration, _used_at_prologue, size_t) \
stefank@50225 110 \
stefank@50225 111 nonstatic_field(CardTable, _whole_heap, const MemRegion) \
stefank@50225 112 nonstatic_field(CardTable, _guard_index, const size_t) \
stefank@50225 113 nonstatic_field(CardTable, _last_valid_index, const size_t) \
stefank@50225 114 nonstatic_field(CardTable, _page_size, const size_t) \
stefank@50225 115 nonstatic_field(CardTable, _byte_map_size, const size_t) \
stefank@50225 116 nonstatic_field(CardTable, _byte_map, jbyte*) \
stefank@50225 117 nonstatic_field(CardTable, _cur_covered_regions, int) \
stefank@50225 118 nonstatic_field(CardTable, _covered, MemRegion*) \
stefank@50225 119 nonstatic_field(CardTable, _committed, MemRegion*) \
stefank@50225 120 nonstatic_field(CardTable, _guard_region, MemRegion) \
stefank@50225 121 nonstatic_field(CardTable, _byte_map_base, jbyte*) \
stefank@50225 122 nonstatic_field(CardTableBarrierSet, _defer_initial_card_mark, bool) \
stefank@50225 123 nonstatic_field(CardTableBarrierSet, _card_table, CardTable*) \
stefank@50225 124 \
stefank@50225 125 nonstatic_field(CollectedHeap, _reserved, MemRegion) \
stefank@50225 126 nonstatic_field(CollectedHeap, _is_gc_active, bool) \
stefank@50225 127 nonstatic_field(CollectedHeap, _total_collections, unsigned int) \
stefank@50225 128 \
stefank@50225 129 nonstatic_field(CompactibleSpace, _compaction_top, HeapWord*) \
stefank@50225 130 nonstatic_field(CompactibleSpace, _first_dead, HeapWord*) \
stefank@50225 131 nonstatic_field(CompactibleSpace, _end_of_live, HeapWord*) \
stefank@50225 132 \
stefank@50225 133 nonstatic_field(ContiguousSpace, _top, HeapWord*) \
stefank@50225 134 nonstatic_field(ContiguousSpace, _concurrent_iteration_safe_limit, HeapWord*) \
stefank@50225 135 nonstatic_field(ContiguousSpace, _saved_mark_word, HeapWord*) \
stefank@50225 136 \
stefank@50225 137 nonstatic_field(Generation, _reserved, MemRegion) \
stefank@50225 138 nonstatic_field(Generation, _virtual_space, VirtualSpace) \
stefank@50225 139 nonstatic_field(Generation, _stat_record, Generation::StatRecord) \
stefank@50225 140 \
stefank@50225 141 nonstatic_field(Generation::StatRecord, invocations, int) \
stefank@50225 142 nonstatic_field(Generation::StatRecord, accumulated_time, elapsedTimer) \
stefank@50225 143 \
stefank@50225 144 nonstatic_field(GenerationSpec, _name, Generation::Name) \
stefank@50225 145 nonstatic_field(GenerationSpec, _init_size, size_t) \
stefank@50225 146 nonstatic_field(GenerationSpec, _max_size, size_t) \
stefank@50225 147 \
stefank@50225 148 nonstatic_field(GenCollectedHeap, _young_gen, Generation*) \
stefank@50225 149 nonstatic_field(GenCollectedHeap, _old_gen, Generation*) \
stefank@50225 150 nonstatic_field(GenCollectedHeap, _young_gen_spec, GenerationSpec*) \
stefank@50225 151 nonstatic_field(GenCollectedHeap, _old_gen_spec, GenerationSpec*) \
stefank@50225 152 \
stefank@50225 153 nonstatic_field(HeapWord, i, char*) \
stefank@50225 154 \
stefank@50225 155 nonstatic_field(MemRegion, _start, HeapWord*) \
stefank@50225 156 nonstatic_field(MemRegion, _word_size, size_t) \
stefank@50225 157 \
stefank@50225 158 nonstatic_field(OffsetTableContigSpace, _offsets, BlockOffsetArray) \
stefank@50225 159 \
stefank@50225 160 nonstatic_field(Space, _bottom, HeapWord*) \
stefank@50225 161 nonstatic_field(Space, _end, HeapWord*)
stefank@50225 162
stefank@50225 163 #define VM_TYPES_GC(declare_type, \
stefank@50225 164 declare_toplevel_type, \
stefank@50225 165 declare_integer_type) \
stefank@50518 166 CMSGC_ONLY(VM_TYPES_CMSGC(declare_type, \
stefank@50518 167 declare_toplevel_type, \
stefank@50518 168 declare_integer_type)) \
shade@51136 169 EPSILONGC_ONLY(VM_TYPES_EPSILONGC(declare_type, \
shade@51136 170 declare_toplevel_type, \
shade@51136 171 declare_integer_type)) \
stefank@50518 172 G1GC_ONLY(VM_TYPES_G1GC(declare_type, \
stefank@50518 173 declare_toplevel_type, \
stefank@50518 174 declare_integer_type)) \
stefank@50518 175 PARALLELGC_ONLY(VM_TYPES_PARALLELGC(declare_type, \
stefank@50518 176 declare_toplevel_type, \
stefank@50518 177 declare_integer_type)) \
stefank@50518 178 SERIALGC_ONLY(VM_TYPES_SERIALGC(declare_type, \
stefank@50518 179 declare_toplevel_type, \
stefank@50518 180 declare_integer_type)) \
pliden@51138 181 ZGC_ONLY(VM_TYPES_ZGC(declare_type, \
pliden@51138 182 declare_toplevel_type, \
pliden@51138 183 declare_integer_type)) \
pliden@51138 184 \
stefank@50225 185 /******************************************/ \
stefank@50225 186 /* Generation and space hierarchies */ \
stefank@50225 187 /* (needed for run-time type information) */ \
stefank@50225 188 /******************************************/ \
stefank@50225 189 \
stefank@50225 190 declare_toplevel_type(CollectedHeap) \
stefank@50225 191 declare_type(GenCollectedHeap, CollectedHeap) \
stefank@50225 192 declare_toplevel_type(Generation) \
stefank@50225 193 declare_type(CardGeneration, Generation) \
stefank@50225 194 declare_toplevel_type(Space) \
stefank@50225 195 declare_type(CompactibleSpace, Space) \
stefank@50225 196 declare_type(ContiguousSpace, CompactibleSpace) \
stefank@50225 197 declare_type(OffsetTableContigSpace, ContiguousSpace) \
stefank@50225 198 declare_toplevel_type(BarrierSet) \
stefank@50225 199 declare_type(ModRefBarrierSet, BarrierSet) \
stefank@50225 200 declare_type(CardTableBarrierSet, ModRefBarrierSet) \
stefank@50225 201 declare_toplevel_type(CardTable) \
stefank@50225 202 declare_type(CardTableRS, CardTable) \
stefank@50225 203 declare_toplevel_type(BarrierSet::Name) \
stefank@50225 204 declare_toplevel_type(BlockOffsetSharedArray) \
stefank@50225 205 declare_toplevel_type(BlockOffsetTable) \
stefank@50225 206 declare_type(BlockOffsetArray, BlockOffsetTable) \
stefank@50225 207 declare_type(BlockOffsetArrayContigSpace, BlockOffsetArray) \
stefank@50225 208 declare_type(BlockOffsetArrayNonContigSpace, BlockOffsetArray) \
stefank@50225 209 \
stefank@50225 210 /* Miscellaneous other GC types */ \
stefank@50225 211 \
stefank@50225 212 declare_toplevel_type(AgeTable) \
stefank@50225 213 declare_toplevel_type(Generation::StatRecord) \
stefank@50225 214 declare_toplevel_type(GenerationSpec) \
stefank@50225 215 declare_toplevel_type(HeapWord) \
stefank@50225 216 declare_toplevel_type(MemRegion) \
stefank@50225 217 declare_toplevel_type(ThreadLocalAllocBuffer) \
stefank@50225 218 declare_toplevel_type(VirtualSpace) \
stefank@50225 219 \
stefank@50225 220 /* Pointers to Garbage Collection types */ \
stefank@50225 221 \
stefank@50225 222 declare_toplevel_type(BarrierSet*) \
stefank@50225 223 declare_toplevel_type(BlockOffsetSharedArray*) \
stefank@50225 224 declare_toplevel_type(CardTable*) \
stefank@50225 225 declare_toplevel_type(CardTable*const) \
stefank@50225 226 declare_toplevel_type(CardTableRS*) \
stefank@50225 227 declare_toplevel_type(CardTableBarrierSet*) \
stefank@50225 228 declare_toplevel_type(CardTableBarrierSet**) \
stefank@50225 229 declare_toplevel_type(CollectedHeap*) \
stefank@50225 230 declare_toplevel_type(ContiguousSpace*) \
stefank@50225 231 declare_toplevel_type(DefNewGeneration*) \
stefank@50225 232 declare_toplevel_type(GenCollectedHeap*) \
stefank@50225 233 declare_toplevel_type(Generation*) \
stefank@50225 234 declare_toplevel_type(GenerationSpec**) \
stefank@50225 235 declare_toplevel_type(HeapWord*) \
stefank@50225 236 declare_toplevel_type(HeapWord* volatile) \
stefank@50225 237 declare_toplevel_type(MemRegion*) \
stefank@50225 238 declare_toplevel_type(OffsetTableContigSpace*) \
stefank@50225 239 declare_toplevel_type(Space*) \
stefank@50225 240 declare_toplevel_type(ThreadLocalAllocBuffer*) \
stefank@50225 241 \
stefank@50225 242 declare_toplevel_type(BarrierSet::FakeRtti)
stefank@50225 243
stefank@50225 244 #define VM_INT_CONSTANTS_GC(declare_constant, \
stefank@50225 245 declare_constant_with_value) \
stefank@50518 246 CMSGC_ONLY(VM_INT_CONSTANTS_CMSGC(declare_constant, \
stefank@50518 247 declare_constant_with_value)) \
shade@51136 248 EPSILONGC_ONLY(VM_INT_CONSTANTS_EPSILONGC(declare_constant, \
shade@51136 249 declare_constant_with_value)) \
stefank@50518 250 G1GC_ONLY(VM_INT_CONSTANTS_G1GC(declare_constant, \
stefank@50518 251 declare_constant_with_value)) \
stefank@50518 252 PARALLELGC_ONLY(VM_INT_CONSTANTS_PARALLELGC(declare_constant, \
stefank@50518 253 declare_constant_with_value)) \
stefank@50518 254 SERIALGC_ONLY(VM_INT_CONSTANTS_SERIALGC(declare_constant, \
stefank@50518 255 declare_constant_with_value)) \
pliden@51138 256 ZGC_ONLY(VM_INT_CONSTANTS_ZGC(declare_constant, \
pliden@51138 257 declare_constant_with_value)) \
stefank@50225 258 \
stefank@50225 259 /********************************************/ \
stefank@50225 260 /* Generation and Space Hierarchy Constants */ \
stefank@50225 261 /********************************************/ \
stefank@50225 262 \
stefank@50225 263 declare_constant(AgeTable::table_size) \
stefank@50225 264 \
stefank@50225 265 declare_constant(BarrierSet::ModRef) \
stefank@50225 266 declare_constant(BarrierSet::CardTableBarrierSet) \
stefank@50225 267 \
stefank@50225 268 declare_constant(BOTConstants::LogN) \
stefank@50225 269 declare_constant(BOTConstants::LogN_words) \
stefank@50225 270 declare_constant(BOTConstants::N_bytes) \
stefank@50225 271 declare_constant(BOTConstants::N_words) \
stefank@50225 272 declare_constant(BOTConstants::LogBase) \
stefank@50225 273 declare_constant(BOTConstants::Base) \
stefank@50225 274 declare_constant(BOTConstants::N_powers) \
stefank@50225 275 \
stefank@50225 276 declare_constant(CardTable::clean_card) \
stefank@50225 277 declare_constant(CardTable::last_card) \
stefank@50225 278 declare_constant(CardTable::dirty_card) \
stefank@50225 279 declare_constant(CardTable::Precise) \
stefank@50225 280 declare_constant(CardTable::ObjHeadPreciseArray) \
stefank@50225 281 declare_constant(CardTable::card_shift) \
stefank@50225 282 declare_constant(CardTable::card_size) \
stefank@50225 283 declare_constant(CardTable::card_size_in_words) \
stefank@50225 284 \
stefank@50225 285 declare_constant(CardTableRS::youngergen_card) \
stefank@50225 286 \
stefank@50225 287 declare_constant(CollectedHeap::Serial) \
stefank@50225 288 declare_constant(CollectedHeap::Parallel) \
stefank@50225 289 declare_constant(CollectedHeap::CMS) \
stefank@50225 290 declare_constant(CollectedHeap::G1) \
stefank@50225 291 \
stefank@50225 292 /* constants from Generation::Name enum */ \
stefank@50225 293 \
stefank@50225 294 declare_constant(Generation::DefNew) \
stefank@50225 295 declare_constant(Generation::MarkSweepCompact) \
stefank@50225 296 declare_constant(Generation::Other) \
stefank@50225 297 \
stefank@50225 298 declare_constant(Generation::LogOfGenGrain) \
stefank@50225 299 declare_constant(Generation::GenGrain) \
stefank@50225 300
pliden@51138 301 #define VM_LONG_CONSTANTS_GC(declare_constant) \
pliden@51138 302 ZGC_ONLY(VM_LONG_CONSTANTS_ZGC(declare_constant))
stefank@50225 303
stefank@50225 304 #endif // SHARE_GC_SHARED_VMSTRUCTS_GC_HPP