annotate src/hotspot/share/gc/shared/genOopClosures.inline.hpp @ 54304:9807daeb47c4

8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
author coleenp
date Thu, 10 Jan 2019 15:13:51 -0500
parents 9d62da00bf15
children
rev   line source
duke@1 1 /*
coleenp@54304 2 * Copyright (c) 2001, 2019, 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
coleenp@54304 25 #ifndef SHARE_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
coleenp@54304 26 #define SHARE_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
stefank@7397 27
pliden@30764 28 #include "gc/shared/cardTableRS.hpp"
pliden@30764 29 #include "gc/shared/genCollectedHeap.hpp"
pliden@30764 30 #include "gc/shared/genOopClosures.hpp"
pliden@30764 31 #include "gc/shared/generation.hpp"
pliden@30764 32 #include "gc/shared/space.hpp"
stefank@50087 33 #include "oops/access.inline.hpp"
stefank@50087 34 #include "oops/compressedOops.inline.hpp"
rkennke@50217 35 #include "oops/oop.inline.hpp"
stefank@50518 36 #if INCLUDE_SERIALGC
stefank@50518 37 #include "gc/serial/defNewGeneration.inline.hpp"
stefank@50518 38 #endif
stefank@7397 39
duke@1 40 inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
stefank@51386 41 OopIterateClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
duke@1 42 set_generation(gen);
duke@1 43 }
duke@1 44
duke@1 45 inline void OopsInGenClosure::set_generation(Generation* gen) {
duke@1 46 _gen = gen;
duke@1 47 _gen_boundary = _gen->reserved().start();
duke@1 48 // Barrier set for the heap, must be set after heap is initialized
duke@1 49 if (_rs == NULL) {
david@33212 50 _rs = GenCollectedHeap::heap()->rem_set();
duke@1 51 }
duke@1 52 }
duke@1 53
coleenp@360 54 template <class T> inline void OopsInGenClosure::do_barrier(T* p) {
duke@1 55 assert(generation()->is_in_reserved(p), "expected ref in generation");
stefank@50087 56 T heap_oop = RawAccess<>::oop_load(p);
stefank@50087 57 assert(!CompressedOops::is_null(heap_oop), "expected non-null oop");
stefank@50087 58 oop obj = CompressedOops::decode_not_null(heap_oop);
duke@1 59 // If p points to a younger generation, mark the card.
duke@1 60 if ((HeapWord*)obj < _gen_boundary) {
duke@1 61 _rs->inline_write_ref_field_gc(p, obj);
duke@1 62 }
duke@1 63 }
duke@1 64
ysr@3262 65 template <class T> inline void OopsInGenClosure::par_do_barrier(T* p) {
ysr@1374 66 assert(generation()->is_in_reserved(p), "expected ref in generation");
stefank@50087 67 T heap_oop = RawAccess<>::oop_load(p);
stefank@50087 68 assert(!CompressedOops::is_null(heap_oop), "expected non-null oop");
stefank@50087 69 oop obj = CompressedOops::decode_not_null(heap_oop);
ysr@1374 70 // If p points to a younger generation, mark the card.
ysr@1374 71 if ((HeapWord*)obj < gen_boundary()) {
ysr@1374 72 rs()->write_ref_field_gc_par(p, obj);
ysr@1374 73 }
ysr@1374 74 }
ysr@1374 75
stefank@51386 76 inline BasicOopsInGenClosure::BasicOopsInGenClosure(Generation* gen) : OopsInGenClosure(gen) {
stefank@51386 77 }
stefank@51386 78
coleenp@47735 79 inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
coleenp@47735 80 assert(_scanned_cld != NULL, "Must be");
coleenp@47735 81 if (!_scanned_cld->has_modified_oops()) {
coleenp@47735 82 _scanned_cld->record_modified_oops();
coleenp@47735 83 }
coleenp@13728 84 }
coleenp@13728 85
stefank@50518 86 #if INCLUDE_SERIALGC
stefank@50518 87
duke@1 88 // NOTE! Any changes made here should also be made
coleenp@360 89 // in FastScanClosure::do_oop_work()
coleenp@360 90 template <class T> inline void ScanClosure::do_oop_work(T* p) {
stefank@50087 91 T heap_oop = RawAccess<>::oop_load(p);
duke@1 92 // Should we copy the obj?
stefank@50087 93 if (!CompressedOops::is_null(heap_oop)) {
stefank@50087 94 oop obj = CompressedOops::decode_not_null(heap_oop);
duke@1 95 if ((HeapWord*)obj < _boundary) {
duke@1 96 assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?");
coleenp@360 97 oop new_obj = obj->is_forwarded() ? obj->forwardee()
coleenp@360 98 : _g->copy_to_survivor_space(obj);
kbarrett@51362 99 RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
duke@1 100 }
coleenp@13728 101
coleenp@47735 102 if (is_scanning_a_cld()) {
coleenp@47735 103 do_cld_barrier();
coleenp@13728 104 } else if (_gc_barrier) {
duke@1 105 // Now call parent closure
duke@1 106 do_barrier(p);
duke@1 107 }
duke@1 108 }
duke@1 109 }
duke@1 110
stefank@51386 111 inline void ScanClosure::do_oop(oop* p) { ScanClosure::do_oop_work(p); }
stefank@51386 112 inline void ScanClosure::do_oop(narrowOop* p) { ScanClosure::do_oop_work(p); }
duke@1 113
duke@1 114 // NOTE! Any changes made here should also be made
coleenp@360 115 // in ScanClosure::do_oop_work()
coleenp@360 116 template <class T> inline void FastScanClosure::do_oop_work(T* p) {
stefank@50087 117 T heap_oop = RawAccess<>::oop_load(p);
duke@1 118 // Should we copy the obj?
stefank@50087 119 if (!CompressedOops::is_null(heap_oop)) {
stefank@50087 120 oop obj = CompressedOops::decode_not_null(heap_oop);
duke@1 121 if ((HeapWord*)obj < _boundary) {
duke@1 122 assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?");
coleenp@360 123 oop new_obj = obj->is_forwarded() ? obj->forwardee()
coleenp@360 124 : _g->copy_to_survivor_space(obj);
kbarrett@51362 125 RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
coleenp@47735 126 if (is_scanning_a_cld()) {
coleenp@47735 127 do_cld_barrier();
coleenp@13728 128 } else if (_gc_barrier) {
duke@1 129 // Now call parent closure
duke@1 130 do_barrier(p);
duke@1 131 }
duke@1 132 }
duke@1 133 }
duke@1 134 }
duke@1 135
stefank@51386 136 inline void FastScanClosure::do_oop(oop* p) { FastScanClosure::do_oop_work(p); }
stefank@51386 137 inline void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); }
duke@1 138
stefank@50518 139 #endif // INCLUDE_SERIALGC
stefank@50518 140
goetz@35862 141 template <class T> void FilteringClosure::do_oop_work(T* p) {
stefank@50087 142 T heap_oop = RawAccess<>::oop_load(p);
stefank@50087 143 if (!CompressedOops::is_null(heap_oop)) {
stefank@50087 144 oop obj = CompressedOops::decode_not_null(heap_oop);
goetz@35862 145 if ((HeapWord*)obj < _boundary) {
goetz@35862 146 _cl->do_oop(p);
goetz@35862 147 }
goetz@35862 148 }
goetz@35862 149 }
goetz@35862 150
stefank@51386 151 inline void FilteringClosure::do_oop(oop* p) { FilteringClosure::do_oop_work(p); }
stefank@51386 152 inline void FilteringClosure::do_oop(narrowOop* p) { FilteringClosure::do_oop_work(p); }
goetz@35862 153
stefank@50518 154 #if INCLUDE_SERIALGC
stefank@50518 155
duke@1 156 // Note similarity to ScanClosure; the difference is that
duke@1 157 // the barrier set is taken care of outside this closure.
coleenp@360 158 template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
kbarrett@51362 159 oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
duke@1 160 // weak references are sometimes scanned twice; must check
duke@1 161 // that to-space doesn't already contain this object
duke@1 162 if ((HeapWord*)obj < _boundary && !_g->to()->is_in_reserved(obj)) {
coleenp@360 163 oop new_obj = obj->is_forwarded() ? obj->forwardee()
coleenp@360 164 : _g->copy_to_survivor_space(obj);
kbarrett@51362 165 RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
duke@1 166 }
duke@1 167 }
duke@1 168
stefank@51386 169 inline void ScanWeakRefClosure::do_oop(oop* p) { ScanWeakRefClosure::do_oop_work(p); }
stefank@51386 170 inline void ScanWeakRefClosure::do_oop(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
stefank@7397 171
stefank@50518 172 #endif // INCLUDE_SERIALGC
stefank@50518 173
coleenp@54304 174 #endif // SHARE_GC_SHARED_GENOOPCLOSURES_INLINE_HPP