< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.hpp

Print this page

 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_GC_SERIAL_DEFNEWGENERATION_HPP
 26 #define SHARE_GC_SERIAL_DEFNEWGENERATION_HPP
 27 
 28 #include "gc/serial/cSpaceCounters.hpp"
 29 #include "gc/serial/generation.hpp"
 30 #include "gc/serial/tenuredGeneration.hpp"
 31 #include "gc/shared/ageTable.hpp"
 32 #include "gc/shared/copyFailedInfo.hpp"
 33 #include "gc/shared/gc_globals.hpp"
 34 #include "gc/shared/generationCounters.hpp"
 35 #include "gc/shared/preservedMarks.hpp"
 36 #include "gc/shared/stringdedup/stringDedup.hpp"
 37 #include "gc/shared/tlab_globals.hpp"
 38 #include "utilities/align.hpp"
 39 #include "utilities/stack.hpp"
 40 
 41 class ContiguousSpace;
 42 class CSpaceCounters;
 43 class OldGenScanClosure;
 44 class YoungGenScanClosure;
 45 class DefNewTracer;
 46 class ScanWeakRefClosure;
 47 class SerialHeap;
 48 class STWGCTimer;
 49 
 50 // DefNewGeneration is a young generation containing eden, from- and
 51 // to-space.
 52 
 53 class DefNewGeneration: public Generation {
 54   friend class VMStructs;
 55 

 83   //   Before the collection
 84   //     Objects are in eden or from-space
 85   //     All roots into the young generation point into eden or from-space.
 86   //
 87   //   After a failed collection
 88   //     Objects may be in eden, from-space, or to-space
 89   //     An object A in eden or from-space may have a copy B
 90   //       in to-space.  If B exists, all roots that once pointed
 91   //       to A must now point to B.
 92   //     All objects in the young generation are unmarked.
 93   //     Eden, from-space, and to-space will all be collected by
 94   //       the full collection.
 95   void handle_promotion_failure(oop);
 96 
 97   // In the absence of promotion failure, we wouldn't look at "from-space"
 98   // objects after a young-gen collection.  When promotion fails, however,
 99   // the subsequent full collection will look at from-space objects:
100   // therefore we must remove their forwarding pointers.
101   void remove_forwarding_pointers();
102 
103   virtual void restore_preserved_marks();
104 
105   // Preserved marks
106   PreservedMarksSet _preserved_marks_set;
107 
108   Stack<oop, mtGC> _promo_failure_scan_stack;
109   void drain_promo_failure_scan_stack(void);
110   bool _promo_failure_drain_in_progress;
111 
112   // Performance Counters
113   GenerationCounters*  _gen_counters;
114   CSpaceCounters*      _eden_counters;
115   CSpaceCounters*      _from_counters;
116   CSpaceCounters*      _to_counters;
117 
118   // sizing information
119   size_t               _max_eden_size;
120   size_t               _max_survivor_size;
121 
122   // Allocation support
123   bool _should_allocate_from_space;
124   bool should_allocate_from_space() const {
125     return _should_allocate_from_space;
126   }
127   void clear_should_allocate_from_space() {

 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_GC_SERIAL_DEFNEWGENERATION_HPP
 26 #define SHARE_GC_SERIAL_DEFNEWGENERATION_HPP
 27 
 28 #include "gc/serial/cSpaceCounters.hpp"
 29 #include "gc/serial/generation.hpp"
 30 #include "gc/serial/tenuredGeneration.hpp"
 31 #include "gc/shared/ageTable.hpp"
 32 #include "gc/shared/copyFailedInfo.hpp"
 33 #include "gc/shared/gc_globals.hpp"
 34 #include "gc/shared/generationCounters.hpp"

 35 #include "gc/shared/stringdedup/stringDedup.hpp"
 36 #include "gc/shared/tlab_globals.hpp"
 37 #include "utilities/align.hpp"
 38 #include "utilities/stack.hpp"
 39 
 40 class ContiguousSpace;
 41 class CSpaceCounters;
 42 class OldGenScanClosure;
 43 class YoungGenScanClosure;
 44 class DefNewTracer;
 45 class ScanWeakRefClosure;
 46 class SerialHeap;
 47 class STWGCTimer;
 48 
 49 // DefNewGeneration is a young generation containing eden, from- and
 50 // to-space.
 51 
 52 class DefNewGeneration: public Generation {
 53   friend class VMStructs;
 54 

 82   //   Before the collection
 83   //     Objects are in eden or from-space
 84   //     All roots into the young generation point into eden or from-space.
 85   //
 86   //   After a failed collection
 87   //     Objects may be in eden, from-space, or to-space
 88   //     An object A in eden or from-space may have a copy B
 89   //       in to-space.  If B exists, all roots that once pointed
 90   //       to A must now point to B.
 91   //     All objects in the young generation are unmarked.
 92   //     Eden, from-space, and to-space will all be collected by
 93   //       the full collection.
 94   void handle_promotion_failure(oop);
 95 
 96   // In the absence of promotion failure, we wouldn't look at "from-space"
 97   // objects after a young-gen collection.  When promotion fails, however,
 98   // the subsequent full collection will look at from-space objects:
 99   // therefore we must remove their forwarding pointers.
100   void remove_forwarding_pointers();
101 





102   Stack<oop, mtGC> _promo_failure_scan_stack;
103   void drain_promo_failure_scan_stack(void);
104   bool _promo_failure_drain_in_progress;
105 
106   // Performance Counters
107   GenerationCounters*  _gen_counters;
108   CSpaceCounters*      _eden_counters;
109   CSpaceCounters*      _from_counters;
110   CSpaceCounters*      _to_counters;
111 
112   // sizing information
113   size_t               _max_eden_size;
114   size_t               _max_survivor_size;
115 
116   // Allocation support
117   bool _should_allocate_from_space;
118   bool should_allocate_from_space() const {
119     return _should_allocate_from_space;
120   }
121   void clear_should_allocate_from_space() {
< prev index next >