annotate src/hotspot/share/gc/shared/specialized_oop_closures.hpp @ 48073:5caa1d5f74c1

8186571: Implementation: JEP 307: Parallel Full GC for G1 Summary: Improve G1 worst-case latencies by making the full GC parallel. Reviewed-by: tschatzl, sangheki, ehelin
author sjohanss
date Tue, 14 Nov 2017 11:33:23 +0100
parents 71c04702a3d5
children b3c09ab95c1a
rev   line source
duke@1 1 /*
sjohanss@46415 2 * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
pliden@30764 25 #ifndef SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP
pliden@30764 26 #define SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP
stefank@7397 27
jprovino@15482 28 #include "utilities/macros.hpp"
jprovino@15482 29 #if INCLUDE_ALL_GCS
pliden@30764 30 #include "gc/g1/g1_specialized_oop_closures.hpp"
jprovino@15482 31 #endif // INCLUDE_ALL_GCS
stefank@7397 32
duke@1 33 // The following OopClosure types get specialized versions of
duke@1 34 // "oop_oop_iterate" that invoke the closures' do_oop methods
duke@1 35 // non-virtually, using a mechanism defined in this file. Extend these
duke@1 36 // macros in the obvious way to add specializations for new closures.
duke@1 37
duke@1 38 // Forward declarations.
duke@1 39 class OopClosure;
duke@1 40 class OopsInGenClosure;
duke@1 41 // DefNew
duke@1 42 class ScanClosure;
duke@1 43 class FastScanClosure;
duke@1 44 class FilteringClosure;
sjohanss@32606 45 // MarkSweep
sjohanss@32606 46 class MarkAndPushClosure;
sjohanss@46415 47 class AdjustPointerClosure;
duke@1 48 // ParNew
duke@1 49 class ParScanWithBarrierClosure;
duke@1 50 class ParScanWithoutBarrierClosure;
duke@1 51 // CMS
duke@1 52 class MarkRefsIntoAndScanClosure;
david@35492 53 class ParMarkRefsIntoAndScanClosure;
duke@1 54 class PushAndMarkClosure;
david@35492 55 class ParPushAndMarkClosure;
duke@1 56 class PushOrMarkClosure;
david@35492 57 class ParPushOrMarkClosure;
duke@1 58 class CMSKeepAliveClosure;
duke@1 59 class CMSInnerParMarkAndPushClosure;
coleenp@13728 60 // Misc
coleenp@13728 61 class NoHeaderExtendedOopClosure;
duke@1 62
duke@1 63 // This macro applies an argument macro to all OopClosures for which we
duke@1 64 // want specialized bodies of "oop_oop_iterate". The arguments to "f" are:
duke@1 65 // "f(closureType, non_virtual)"
stefank@29687 66 // where "closureType" is the name of the particular subclass of ExtendedOopClosure,
duke@1 67 // and "non_virtual" will be the string "_nv" if the closure type should
duke@1 68 // have its "do_oop" method invoked non-virtually, or else the
stefank@29687 69 // string "_v". ("ExtendedOopClosure" itself will be the only class in the latter
duke@1 70 // category.)
duke@1 71
duke@1 72 // This is split into several because of a Visual C++ 6.0 compiler bug
duke@1 73 // where very long macros cause the compiler to crash
duke@1 74
duke@1 75 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f) \
duke@1 76 f(ScanClosure,_nv) \
duke@1 77 f(FastScanClosure,_nv) \
duke@1 78 f(FilteringClosure,_nv)
duke@1 79
jprovino@15482 80 #if INCLUDE_ALL_GCS
duke@1 81 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f) \
duke@1 82 f(ParScanWithBarrierClosure,_nv) \
duke@1 83 f(ParScanWithoutBarrierClosure,_nv)
jprovino@15482 84 #else // INCLUDE_ALL_GCS
duke@1 85 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
jprovino@15482 86 #endif // INCLUDE_ALL_GCS
duke@1 87
duke@1 88 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f) \
coleenp@13728 89 f(NoHeaderExtendedOopClosure,_nv) \
duke@1 90 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f) \
duke@1 91 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)
duke@1 92
sjohanss@32606 93 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f) \
sjohanss@46415 94 f(MarkAndPushClosure,_nv) \
sjohanss@46415 95 f(AdjustPointerClosure,_nv)
sjohanss@32606 96
jprovino@15482 97 #if INCLUDE_ALL_GCS
stefank@29688 98 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f) \
duke@1 99 f(MarkRefsIntoAndScanClosure,_nv) \
david@35492 100 f(ParMarkRefsIntoAndScanClosure,_nv) \
duke@1 101 f(PushAndMarkClosure,_nv) \
david@35492 102 f(ParPushAndMarkClosure,_nv) \
duke@1 103 f(PushOrMarkClosure,_nv) \
david@35492 104 f(ParPushOrMarkClosure,_nv) \
duke@1 105 f(CMSKeepAliveClosure,_nv) \
stefank@29688 106 f(CMSInnerParMarkAndPushClosure,_nv)
stefank@29688 107 #endif
stefank@29688 108
stefank@29688 109 #if INCLUDE_ALL_GCS
stefank@29688 110 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f) \
sjohanss@32606 111 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f) \
stefank@29688 112 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f) \
sjohanss@48073 113 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \
sjohanss@48073 114 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(f)
jprovino@15482 115 #else // INCLUDE_ALL_GCS
sjohanss@32606 116 #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f) \
sjohanss@32606 117 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f)
jprovino@15482 118 #endif // INCLUDE_ALL_GCS
duke@1 119
ysr@1374 120
duke@1 121 // We separate these out, because sometime the general one has
duke@1 122 // a different definition from the specialized ones, and sometimes it
duke@1 123 // doesn't.
duke@1 124
duke@1 125 #define ALL_OOP_OOP_ITERATE_CLOSURES_1(f) \
coleenp@13728 126 f(ExtendedOopClosure,_v) \
duke@1 127 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f)
duke@1 128
ysr@1374 129 #define ALL_OOP_OOP_ITERATE_CLOSURES_2(f) \
ysr@1374 130 SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f)
duke@1 131
jprovino@15482 132 #if INCLUDE_ALL_GCS
duke@1 133 // This macro applies an argument macro to all OopClosures for which we
duke@1 134 // want specialized bodies of a family of methods related to
duke@1 135 // "par_oop_iterate". The arguments to f are the same as above.
duke@1 136 // The "root_class" is the most general class to define; this may be
duke@1 137 // "OopClosure" in some applications and "OopsInGenClosure" in others.
duke@1 138
duke@1 139 #define SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f) \
duke@1 140 f(MarkRefsIntoAndScanClosure,_nv) \
duke@1 141 f(PushAndMarkClosure,_nv) \
david@35492 142 f(ParMarkRefsIntoAndScanClosure,_nv) \
david@35492 143 f(ParPushAndMarkClosure,_nv)
duke@1 144
duke@1 145 #define ALL_PAR_OOP_ITERATE_CLOSURES(f) \
coleenp@13728 146 f(ExtendedOopClosure,_v) \
duke@1 147 SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f)
jprovino@15482 148 #endif // INCLUDE_ALL_GCS
duke@1 149
duke@1 150 // This macro applies an argument macro to all OopClosures for which we
duke@1 151 // want specialized bodies of a family of methods related to
duke@1 152 // "oops_since_save_marks_do". The arguments to f are the same as above.
duke@1 153 // The "root_class" is the most general class to define; this may be
duke@1 154 // "OopClosure" in some applications and "OopsInGenClosure" in others.
duke@1 155
duke@1 156 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \
duke@1 157 f(ScanClosure,_nv) \
duke@1 158 f(FastScanClosure,_nv)
duke@1 159
jprovino@15482 160 #if INCLUDE_ALL_GCS
duke@1 161 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f) \
duke@1 162 f(ParScanWithBarrierClosure,_nv) \
stefank@29688 163 f(ParScanWithoutBarrierClosure,_nv)
jprovino@15482 164 #else // INCLUDE_ALL_GCS
duke@1 165 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
jprovino@15482 166 #endif // INCLUDE_ALL_GCS
duke@1 167
duke@1 168 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f) \
duke@1 169 SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \
duke@1 170 SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)
duke@1 171
duke@1 172 #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) \
duke@1 173 SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f)
duke@1 174
duke@1 175 // We separate these out, because sometime the general one has
duke@1 176 // a different definition from the specialized ones, and sometimes it
duke@1 177 // doesn't.
duke@1 178
duke@1 179 #define ALL_SINCE_SAVE_MARKS_CLOSURES(f) \
duke@1 180 f(OopsInGenClosure,_v) \
duke@1 181 SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f)
duke@1 182
pliden@30764 183 #endif // SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP