< prev index next >

src/share/vm/gc/cms/cmsOopClosures.hpp

Print this page
rev 8362 : [mq]: hotspot
   1 /*
   2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
  27 
  28 #include "memory/genOopClosures.hpp"
  29 #include "memory/iterator.hpp"
  30 
  31 /////////////////////////////////////////////////////////////////
  32 // Closures used by ConcurrentMarkSweepGeneration's collector
  33 /////////////////////////////////////////////////////////////////
  34 class ConcurrentMarkSweepGeneration;
  35 class CMSBitMap;
  36 class CMSMarkStack;
  37 class CMSCollector;
  38 class MarkFromRootsClosure;
  39 class Par_MarkFromRootsClosure;
  40 
  41 // Decode the oop and call do_oop on it.
  42 #define DO_OOP_WORK_DEFN \
  43   void do_oop(oop obj);                                   \
  44   template <class T> inline void do_oop_work(T* p) {      \
  45     T heap_oop = oopDesc::load_heap_oop(p);               \
  46     if (!oopDesc::is_null(heap_oop)) {                    \
  47       oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);       \
  48       do_oop(obj);                                        \


 342 // reference processing is parallel; the only difference
 343 // is in the do_oop method.
 344 class CMSParKeepAliveClosure: public MetadataAwareOopClosure {
 345  private:
 346   MemRegion     _span;
 347   OopTaskQueue* _work_queue;
 348   CMSBitMap*    _bit_map;
 349   CMSInnerParMarkAndPushClosure
 350                 _mark_and_push;
 351   const uint    _low_water_mark;
 352   void trim_queue(uint max);
 353  protected:
 354   DO_OOP_WORK_DEFN
 355  public:
 356   CMSParKeepAliveClosure(CMSCollector* collector, MemRegion span,
 357                          CMSBitMap* bit_map, OopTaskQueue* work_queue);
 358   virtual void do_oop(oop* p);
 359   virtual void do_oop(narrowOop* p);
 360 };
 361 
 362 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CMSOOPCLOSURES_HPP
   1 /*
   2  * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_CMS_CMSOOPCLOSURES_HPP
  26 #define SHARE_VM_GC_CMS_CMSOOPCLOSURES_HPP
  27 
  28 #include "gc/shared/genOopClosures.hpp"
  29 #include "memory/iterator.hpp"
  30 
  31 /////////////////////////////////////////////////////////////////
  32 // Closures used by ConcurrentMarkSweepGeneration's collector
  33 /////////////////////////////////////////////////////////////////
  34 class ConcurrentMarkSweepGeneration;
  35 class CMSBitMap;
  36 class CMSMarkStack;
  37 class CMSCollector;
  38 class MarkFromRootsClosure;
  39 class Par_MarkFromRootsClosure;
  40 
  41 // Decode the oop and call do_oop on it.
  42 #define DO_OOP_WORK_DEFN \
  43   void do_oop(oop obj);                                   \
  44   template <class T> inline void do_oop_work(T* p) {      \
  45     T heap_oop = oopDesc::load_heap_oop(p);               \
  46     if (!oopDesc::is_null(heap_oop)) {                    \
  47       oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);       \
  48       do_oop(obj);                                        \


 342 // reference processing is parallel; the only difference
 343 // is in the do_oop method.
 344 class CMSParKeepAliveClosure: public MetadataAwareOopClosure {
 345  private:
 346   MemRegion     _span;
 347   OopTaskQueue* _work_queue;
 348   CMSBitMap*    _bit_map;
 349   CMSInnerParMarkAndPushClosure
 350                 _mark_and_push;
 351   const uint    _low_water_mark;
 352   void trim_queue(uint max);
 353  protected:
 354   DO_OOP_WORK_DEFN
 355  public:
 356   CMSParKeepAliveClosure(CMSCollector* collector, MemRegion span,
 357                          CMSBitMap* bit_map, OopTaskQueue* work_queue);
 358   virtual void do_oop(oop* p);
 359   virtual void do_oop(narrowOop* p);
 360 };
 361 
 362 #endif // SHARE_VM_GC_CMS_CMSOOPCLOSURES_HPP
< prev index next >