< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp

Print this page

135 
136   void do_thread(Thread* t) {
137     if (_thread_cl != NULL) {
138       _thread_cl->do_thread(t);
139     }
140     t->oops_do(_f, _cf);
141   }
142 };
143 
144 // The rationale for selecting the roots to scan is as follows:
145 //   a. With unload_classes = true, we only want to scan the actual strong roots from the
146 //      code cache. This will allow us to identify the dead classes, unload them, *and*
147 //      invalidate the relevant code cache blobs. This could be only done together with
148 //      class unloading.
149 //   b. With unload_classes = false, we have to nominally retain all the references from code
150 //      cache, because there could be the case of embedded class/oop in the generated code,
151 //      which we will never visit during mark. Without code cache invalidation, as in (a),
152 //      we risk executing that code cache blob, and crashing.
153 template <typename T>
154 void ShenandoahSTWRootScanner::roots_do(T* oops, uint worker_id) {
155   MarkingCodeBlobClosure blobs_cl(oops, !CodeBlobToOopClosure::FixRelocations);
156   CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong);
157   ResourceMark rm;
158 
159   if (_unload_classes) {
160     _thread_roots.oops_do(oops, &blobs_cl, worker_id);
161     _cld_roots.always_strong_cld_do(&clds, worker_id);
162   } else {
163     _thread_roots.oops_do(oops, NULL, worker_id);
164     _code_roots.code_blobs_do(&blobs_cl, worker_id);
165     _cld_roots.cld_do(&clds, worker_id);
166   }
167 
168   _vm_roots.oops_do<T>(oops, worker_id);
169 }
170 
171 template <typename IsAlive, typename KeepAlive>
172 void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
173   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
174   ShenandoahCodeBlobAndDisarmClosure blobs_and_disarm_Cl(keep_alive);
175   CodeBlobToOopClosure* codes_cl = (ClassUnloading && ShenandoahNMethodBarrier) ?

135 
136   void do_thread(Thread* t) {
137     if (_thread_cl != NULL) {
138       _thread_cl->do_thread(t);
139     }
140     t->oops_do(_f, _cf);
141   }
142 };
143 
144 // The rationale for selecting the roots to scan is as follows:
145 //   a. With unload_classes = true, we only want to scan the actual strong roots from the
146 //      code cache. This will allow us to identify the dead classes, unload them, *and*
147 //      invalidate the relevant code cache blobs. This could be only done together with
148 //      class unloading.
149 //   b. With unload_classes = false, we have to nominally retain all the references from code
150 //      cache, because there could be the case of embedded class/oop in the generated code,
151 //      which we will never visit during mark. Without code cache invalidation, as in (a),
152 //      we risk executing that code cache blob, and crashing.
153 template <typename T>
154 void ShenandoahSTWRootScanner::roots_do(T* oops, uint worker_id) {
155   MarkingCodeBlobClosure blobs_cl(oops, !CodeBlobToOopClosure::FixRelocations, true /*FIXME*/);
156   CLDToOopClosure clds(oops, ClassLoaderData::_claim_strong);
157   ResourceMark rm;
158 
159   if (_unload_classes) {
160     _thread_roots.oops_do(oops, &blobs_cl, worker_id);
161     _cld_roots.always_strong_cld_do(&clds, worker_id);
162   } else {
163     _thread_roots.oops_do(oops, NULL, worker_id);
164     _code_roots.code_blobs_do(&blobs_cl, worker_id);
165     _cld_roots.cld_do(&clds, worker_id);
166   }
167 
168   _vm_roots.oops_do<T>(oops, worker_id);
169 }
170 
171 template <typename IsAlive, typename KeepAlive>
172 void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
173   CodeBlobToOopClosure update_blobs(keep_alive, CodeBlobToOopClosure::FixRelocations);
174   ShenandoahCodeBlobAndDisarmClosure blobs_and_disarm_Cl(keep_alive);
175   CodeBlobToOopClosure* codes_cl = (ClassUnloading && ShenandoahNMethodBarrier) ?
< prev index next >