src/hotspot/share/gc/shared/genOopClosures.inline.hpp
changeset 49982 9042ffe5b7fe
parent 49722 a47d1e21b3f1
child 50728 9375184cec98
equal deleted inserted replaced
49981:bd0a95bec96b 49982:9042ffe5b7fe
    23  */
    23  */
    24 
    24 
    25 #ifndef SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
    25 #ifndef SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
    26 #define SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
    26 #define SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
    27 
    27 
    28 #include "gc/serial/defNewGeneration.hpp"
       
    29 #include "gc/shared/cardTableRS.hpp"
    28 #include "gc/shared/cardTableRS.hpp"
    30 #include "gc/shared/genCollectedHeap.hpp"
    29 #include "gc/shared/genCollectedHeap.hpp"
    31 #include "gc/shared/genOopClosures.hpp"
    30 #include "gc/shared/genOopClosures.hpp"
    32 #include "gc/shared/generation.hpp"
    31 #include "gc/shared/generation.hpp"
    33 #include "gc/shared/space.hpp"
    32 #include "gc/shared/space.hpp"
    34 #include "oops/access.inline.hpp"
    33 #include "oops/access.inline.hpp"
    35 #include "oops/compressedOops.inline.hpp"
    34 #include "oops/compressedOops.inline.hpp"
    36 #include "oops/oop.inline.hpp"
    35 #include "oops/oop.inline.hpp"
       
    36 #if INCLUDE_SERIALGC
       
    37 #include "gc/serial/defNewGeneration.inline.hpp"
       
    38 #endif
    37 
    39 
    38 inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
    40 inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
    39   ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
    41   ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
    40   set_generation(gen);
    42   set_generation(gen);
    41 }
    43 }
    75   assert(_scanned_cld != NULL, "Must be");
    77   assert(_scanned_cld != NULL, "Must be");
    76   if (!_scanned_cld->has_modified_oops()) {
    78   if (!_scanned_cld->has_modified_oops()) {
    77     _scanned_cld->record_modified_oops();
    79     _scanned_cld->record_modified_oops();
    78   }
    80   }
    79 }
    81 }
       
    82 
       
    83 #if INCLUDE_SERIALGC
    80 
    84 
    81 // NOTE! Any changes made here should also be made
    85 // NOTE! Any changes made here should also be made
    82 // in FastScanClosure::do_oop_work()
    86 // in FastScanClosure::do_oop_work()
    83 template <class T> inline void ScanClosure::do_oop_work(T* p) {
    87 template <class T> inline void ScanClosure::do_oop_work(T* p) {
    84   T heap_oop = RawAccess<>::oop_load(p);
    88   T heap_oop = RawAccess<>::oop_load(p);
   127 }
   131 }
   128 
   132 
   129 inline void FastScanClosure::do_oop_nv(oop* p)       { FastScanClosure::do_oop_work(p); }
   133 inline void FastScanClosure::do_oop_nv(oop* p)       { FastScanClosure::do_oop_work(p); }
   130 inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); }
   134 inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); }
   131 
   135 
       
   136 #endif // INCLUDE_SERIALGC
       
   137 
   132 template <class T> void FilteringClosure::do_oop_work(T* p) {
   138 template <class T> void FilteringClosure::do_oop_work(T* p) {
   133   T heap_oop = RawAccess<>::oop_load(p);
   139   T heap_oop = RawAccess<>::oop_load(p);
   134   if (!CompressedOops::is_null(heap_oop)) {
   140   if (!CompressedOops::is_null(heap_oop)) {
   135     oop obj = CompressedOops::decode_not_null(heap_oop);
   141     oop obj = CompressedOops::decode_not_null(heap_oop);
   136     if ((HeapWord*)obj < _boundary) {
   142     if ((HeapWord*)obj < _boundary) {
   139   }
   145   }
   140 }
   146 }
   141 
   147 
   142 void FilteringClosure::do_oop_nv(oop* p)       { FilteringClosure::do_oop_work(p); }
   148 void FilteringClosure::do_oop_nv(oop* p)       { FilteringClosure::do_oop_work(p); }
   143 void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); }
   149 void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); }
       
   150 
       
   151 #if INCLUDE_SERIALGC
   144 
   152 
   145 // Note similarity to ScanClosure; the difference is that
   153 // Note similarity to ScanClosure; the difference is that
   146 // the barrier set is taken care of outside this closure.
   154 // the barrier set is taken care of outside this closure.
   147 template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
   155 template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
   148   oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
   156   oop obj = RawAccess<OOP_NOT_NULL>::oop_load(p);
   156 }
   164 }
   157 
   165 
   158 inline void ScanWeakRefClosure::do_oop_nv(oop* p)       { ScanWeakRefClosure::do_oop_work(p); }
   166 inline void ScanWeakRefClosure::do_oop_nv(oop* p)       { ScanWeakRefClosure::do_oop_work(p); }
   159 inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
   167 inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
   160 
   168 
       
   169 #endif // INCLUDE_SERIALGC
       
   170 
   161 #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
   171 #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP