src/hotspot/share/gc/shared/genOopClosures.inline.hpp
changeset 50752 9d62da00bf15
parent 50728 9375184cec98
child 53244 9807daeb47c4
equal deleted inserted replaced
50751:d9132bdf6c30 50752:9d62da00bf15
    36 #if INCLUDE_SERIALGC
    36 #if INCLUDE_SERIALGC
    37 #include "gc/serial/defNewGeneration.inline.hpp"
    37 #include "gc/serial/defNewGeneration.inline.hpp"
    38 #endif
    38 #endif
    39 
    39 
    40 inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
    40 inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
    41   ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
    41   OopIterateClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
    42   set_generation(gen);
    42   set_generation(gen);
    43 }
    43 }
    44 
    44 
    45 inline void OopsInGenClosure::set_generation(Generation* gen) {
    45 inline void OopsInGenClosure::set_generation(Generation* gen) {
    46   _gen = gen;
    46   _gen = gen;
    71   if ((HeapWord*)obj < gen_boundary()) {
    71   if ((HeapWord*)obj < gen_boundary()) {
    72     rs()->write_ref_field_gc_par(p, obj);
    72     rs()->write_ref_field_gc_par(p, obj);
    73   }
    73   }
    74 }
    74 }
    75 
    75 
       
    76 inline BasicOopsInGenClosure::BasicOopsInGenClosure(Generation* gen) : OopsInGenClosure(gen) {
       
    77 }
       
    78 
    76 inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
    79 inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
    77   assert(_scanned_cld != NULL, "Must be");
    80   assert(_scanned_cld != NULL, "Must be");
    78   if (!_scanned_cld->has_modified_oops()) {
    81   if (!_scanned_cld->has_modified_oops()) {
    79     _scanned_cld->record_modified_oops();
    82     _scanned_cld->record_modified_oops();
    80   }
    83   }
   103       do_barrier(p);
   106       do_barrier(p);
   104     }
   107     }
   105   }
   108   }
   106 }
   109 }
   107 
   110 
   108 inline void ScanClosure::do_oop_nv(oop* p)       { ScanClosure::do_oop_work(p); }
   111 inline void ScanClosure::do_oop(oop* p)       { ScanClosure::do_oop_work(p); }
   109 inline void ScanClosure::do_oop_nv(narrowOop* p) { ScanClosure::do_oop_work(p); }
   112 inline void ScanClosure::do_oop(narrowOop* p) { ScanClosure::do_oop_work(p); }
   110 
   113 
   111 // NOTE! Any changes made here should also be made
   114 // NOTE! Any changes made here should also be made
   112 // in ScanClosure::do_oop_work()
   115 // in ScanClosure::do_oop_work()
   113 template <class T> inline void FastScanClosure::do_oop_work(T* p) {
   116 template <class T> inline void FastScanClosure::do_oop_work(T* p) {
   114   T heap_oop = RawAccess<>::oop_load(p);
   117   T heap_oop = RawAccess<>::oop_load(p);
   128       }
   131       }
   129     }
   132     }
   130   }
   133   }
   131 }
   134 }
   132 
   135 
   133 inline void FastScanClosure::do_oop_nv(oop* p)       { FastScanClosure::do_oop_work(p); }
   136 inline void FastScanClosure::do_oop(oop* p)       { FastScanClosure::do_oop_work(p); }
   134 inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); }
   137 inline void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); }
   135 
   138 
   136 #endif // INCLUDE_SERIALGC
   139 #endif // INCLUDE_SERIALGC
   137 
   140 
   138 template <class T> void FilteringClosure::do_oop_work(T* p) {
   141 template <class T> void FilteringClosure::do_oop_work(T* p) {
   139   T heap_oop = RawAccess<>::oop_load(p);
   142   T heap_oop = RawAccess<>::oop_load(p);
   143       _cl->do_oop(p);
   146       _cl->do_oop(p);
   144     }
   147     }
   145   }
   148   }
   146 }
   149 }
   147 
   150 
   148 void FilteringClosure::do_oop_nv(oop* p)       { FilteringClosure::do_oop_work(p); }
   151 inline void FilteringClosure::do_oop(oop* p)       { FilteringClosure::do_oop_work(p); }
   149 void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); }
   152 inline void FilteringClosure::do_oop(narrowOop* p) { FilteringClosure::do_oop_work(p); }
   150 
   153 
   151 #if INCLUDE_SERIALGC
   154 #if INCLUDE_SERIALGC
   152 
   155 
   153 // Note similarity to ScanClosure; the difference is that
   156 // Note similarity to ScanClosure; the difference is that
   154 // the barrier set is taken care of outside this closure.
   157 // the barrier set is taken care of outside this closure.
   161                                       : _g->copy_to_survivor_space(obj);
   164                                       : _g->copy_to_survivor_space(obj);
   162     RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
   165     RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
   163   }
   166   }
   164 }
   167 }
   165 
   168 
   166 inline void ScanWeakRefClosure::do_oop_nv(oop* p)       { ScanWeakRefClosure::do_oop_work(p); }
   169 inline void ScanWeakRefClosure::do_oop(oop* p)       { ScanWeakRefClosure::do_oop_work(p); }
   167 inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
   170 inline void ScanWeakRefClosure::do_oop(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
   168 
   171 
   169 #endif // INCLUDE_SERIALGC
   172 #endif // INCLUDE_SERIALGC
   170 
   173 
   171 #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
   174 #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP