1 /*
   2  * Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 #ifndef SHARE_GC_PARALLEL_VMSTRUCTS_PARALLELGC_HPP
  26 #define SHARE_GC_PARALLEL_VMSTRUCTS_PARALLELGC_HPP
  27 
  28 #include "gc/parallel/immutableSpace.hpp"
  29 #include "gc/parallel/mutableSpace.hpp"
  30 #include "gc/parallel/parallelScavengeHeap.hpp"
  31 #include "gc/parallel/psOldGen.hpp"
  32 #include "gc/parallel/psVirtualspace.hpp"
  33 #include "gc/parallel/psYoungGen.hpp"
  34 #include "gc/parallel/vmStructs_parallelgc.hpp"
  35 
  36 #define VM_STRUCTS_PARALLELGC(nonstatic_field, \
  37                               volatile_nonstatic_field, \
  38                               static_field) \
  39                                                                                                                                      \
  40   /**********************/                                                                                                           \
  41   /* Parallel GC fields */                                                                                                           \
  42   /**********************/                                                                                                           \
  43   nonstatic_field(PSVirtualSpace,              _alignment,                                    const size_t)                          \
  44   nonstatic_field(PSVirtualSpace,              _reserved_low_addr,                            char*)                                 \
  45   nonstatic_field(PSVirtualSpace,              _reserved_high_addr,                           char*)                                 \
  46   nonstatic_field(PSVirtualSpace,              _committed_low_addr,                           char*)                                 \
  47   nonstatic_field(PSVirtualSpace,              _committed_high_addr,                          char*)                                 \
  48                                                                                                                                      \
  49   nonstatic_field(ImmutableSpace,              _bottom,                                       HeapWord*)                             \
  50   nonstatic_field(ImmutableSpace,              _end,                                          HeapWord*)                             \
  51                                                                                                                                      \
  52   volatile_nonstatic_field(MutableSpace,       _top,                                          HeapWord*)                             \
  53                                                                                                                                      \
  54   nonstatic_field(PSYoungGen,                  _reserved,                                     MemRegion)                             \
  55   nonstatic_field(PSYoungGen,                  _virtual_space,                                PSVirtualSpace*)                       \
  56   nonstatic_field(PSYoungGen,                  _eden_space,                                   MutableSpace*)                         \
  57   nonstatic_field(PSYoungGen,                  _from_space,                                   MutableSpace*)                         \
  58   nonstatic_field(PSYoungGen,                  _to_space,                                     MutableSpace*)                         \
  59   nonstatic_field(PSYoungGen,                  _init_gen_size,                                const size_t)                          \
  60   nonstatic_field(PSYoungGen,                  _min_gen_size,                                 const size_t)                          \
  61   nonstatic_field(PSYoungGen,                  _max_gen_size,                                 const size_t)                          \
  62                                                                                                                                      \
  63   nonstatic_field(PSOldGen,                    _reserved,                                     MemRegion)                             \
  64   nonstatic_field(PSOldGen,                    _virtual_space,                                PSVirtualSpace*)                       \
  65   nonstatic_field(PSOldGen,                    _object_space,                                 MutableSpace*)                         \
  66   nonstatic_field(PSOldGen,                    _init_gen_size,                                const size_t)                          \
  67   nonstatic_field(PSOldGen,                    _min_gen_size,                                 const size_t)                          \
  68   nonstatic_field(PSOldGen,                    _max_gen_size,                                 const size_t)                          \
  69                                                                                                                                      \
  70                                                                                                                                      \
  71      static_field(ParallelScavengeHeap,        _young_gen,                                    PSYoungGen*)                           \
  72      static_field(ParallelScavengeHeap,        _old_gen,                                      PSOldGen*)                             \
  73                                                                                                                                      \
  74 
  75 #define VM_TYPES_PARALLELGC(declare_type,                                 \
  76                             declare_toplevel_type,                        \
  77                             declare_integer_type)                         \
  78                                                                           \
  79                                                                           \
  80   /*****************************************/                             \
  81   /* Parallel GC - space, gen abstractions */                             \
  82   /*****************************************/                             \
  83            declare_type(ParallelScavengeHeap,         CollectedHeap)      \
  84                                                                           \
  85   declare_toplevel_type(PSVirtualSpace)                                   \
  86   declare_toplevel_type(ImmutableSpace)                                   \
  87            declare_type(MutableSpace, ImmutableSpace)                     \
  88   declare_toplevel_type(PSYoungGen)                                       \
  89   declare_toplevel_type(PSOldGen)                                         \
  90                                                                           \
  91   /*****************************/                                         \
  92   /* Parallel GC pointer types */                                         \
  93   /*****************************/                                         \
  94                                                                           \
  95   declare_toplevel_type(PSVirtualSpace*)                                  \
  96   declare_toplevel_type(ImmutableSpace*)                                  \
  97   declare_toplevel_type(MutableSpace*)                                    \
  98   declare_toplevel_type(PSYoungGen*)                                      \
  99   declare_toplevel_type(PSOldGen*)                                        \
 100   declare_toplevel_type(ParallelScavengeHeap*)
 101 
 102 #define VM_INT_CONSTANTS_PARALLELGC(declare_constant,                     \
 103                                     declare_constant_with_value)
 104 
 105 #endif // SHARE_GC_PARALLEL_VMSTRUCTS_PARALLELGC_HPP