< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.hpp

Print this page
rev 57095 : [mq]: use


  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHCODEROOTS_HPP
  25 #define SHARE_GC_SHENANDOAH_SHENANDOAHCODEROOTS_HPP
  26 
  27 #include "code/codeCache.hpp"
  28 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
  29 #include "gc/shenandoah/shenandoahLock.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "memory/iterator.hpp"

  32 
  33 class ShenandoahHeap;
  34 class ShenandoahHeapRegion;
  35 
  36 class ShenandoahParallelCodeHeapIterator {
  37   friend class CodeCache;
  38 private:
  39   CodeHeap*     _heap;
  40   DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile int));
  41   volatile int  _claimed_idx;
  42   volatile bool _finished;
  43   DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, 0);
  44 public:
  45   ShenandoahParallelCodeHeapIterator(CodeHeap* heap);
  46   void parallel_blobs_do(CodeBlobClosure* f);
  47 };
  48 
  49 class ShenandoahParallelCodeCacheIterator {
  50   friend class CodeCache;
  51 private:
  52   ShenandoahParallelCodeHeapIterator* _iters;
  53   int                       _length;
  54 
  55 private:
  56   // Noncopyable.
  57   ShenandoahParallelCodeCacheIterator(const ShenandoahParallelCodeCacheIterator& o);
  58   ShenandoahParallelCodeCacheIterator& operator=(const ShenandoahParallelCodeCacheIterator& o);
  59 public:
  60   ShenandoahParallelCodeCacheIterator(const GrowableArray<CodeHeap*>* heaps);
  61   ~ShenandoahParallelCodeCacheIterator();
  62   void parallel_blobs_do(CodeBlobClosure* f);
  63 };
  64 
  65 // ShenandoahNMethod tuple records the internal locations of oop slots within the nmethod.
  66 // This allows us to quickly scan the oops without doing the nmethod-internal scans, that
  67 // sometimes involves parsing the machine code. Note it does not record the oops themselves,
  68 // because it would then require handling these tuples as the new class of roots.
  69 class ShenandoahNMethod : public CHeapObj<mtGC> {
  70 private:
  71   nmethod* _nm;
  72   oop**    _oops;
  73   int      _oops_count;
  74 
  75 public:
  76   ShenandoahNMethod(nmethod *nm, GrowableArray<oop*>* oops);
  77   ~ShenandoahNMethod();
  78 




  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHCODEROOTS_HPP
  25 #define SHARE_GC_SHENANDOAH_SHENANDOAHCODEROOTS_HPP
  26 
  27 #include "code/codeCache.hpp"
  28 #include "gc/shenandoah/shenandoahSharedVariables.hpp"
  29 #include "gc/shenandoah/shenandoahLock.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "memory/iterator.hpp"
  32 #include "utilities/macros.hpp"
  33 
  34 class ShenandoahHeap;
  35 class ShenandoahHeapRegion;
  36 
  37 class ShenandoahParallelCodeHeapIterator {
  38   friend class CodeCache;
  39 private:
  40   CodeHeap*     _heap;
  41   DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile int));
  42   volatile int  _claimed_idx;
  43   volatile bool _finished;
  44   DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, 0);
  45 public:
  46   ShenandoahParallelCodeHeapIterator(CodeHeap* heap);
  47   void parallel_blobs_do(CodeBlobClosure* f);
  48 };
  49 
  50 class ShenandoahParallelCodeCacheIterator {
  51   friend class CodeCache;
  52 private:
  53   ShenandoahParallelCodeHeapIterator* _iters;
  54   int                       _length;
  55 
  56   NONCOPYABLE(ShenandoahParallelCodeCacheIterator);
  57 


  58 public:
  59   ShenandoahParallelCodeCacheIterator(const GrowableArray<CodeHeap*>* heaps);
  60   ~ShenandoahParallelCodeCacheIterator();
  61   void parallel_blobs_do(CodeBlobClosure* f);
  62 };
  63 
  64 // ShenandoahNMethod tuple records the internal locations of oop slots within the nmethod.
  65 // This allows us to quickly scan the oops without doing the nmethod-internal scans, that
  66 // sometimes involves parsing the machine code. Note it does not record the oops themselves,
  67 // because it would then require handling these tuples as the new class of roots.
  68 class ShenandoahNMethod : public CHeapObj<mtGC> {
  69 private:
  70   nmethod* _nm;
  71   oop**    _oops;
  72   int      _oops_count;
  73 
  74 public:
  75   ShenandoahNMethod(nmethod *nm, GrowableArray<oop*>* oops);
  76   ~ShenandoahNMethod();
  77 


< prev index next >