< prev index next >

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

Print this page
rev 47957 : 8191564: Refactor GC related servicability code into GC specific subclasses
   1 /*
   2  * Copyright (c) 2001, 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  *


  41   // Abstractly, this is a subtype that gets access to protected fields.
  42   friend class VM_PopulateDumpSharedSpace;
  43 
  44  protected:
  45   ContiguousSpace*    _the_space;       // Actual space holding objects
  46 
  47   GenerationCounters* _gen_counters;
  48   CSpaceCounters*     _space_counters;
  49 
  50   // Allocation failure
  51   virtual bool expand(size_t bytes, size_t expand_bytes);
  52 
  53   // Accessing spaces
  54   ContiguousSpace* space() const { return _the_space; }
  55 
  56   void assert_correct_size_change_locking();
  57 
  58  public:
  59   TenuredGeneration(ReservedSpace rs,
  60                     size_t initial_byte_size,

  61                     CardTableRS* remset);
  62 
  63   Generation::Name kind() { return Generation::MarkSweepCompact; }
  64 
  65   // Printing
  66   const char* name() const { return "tenured generation"; }
  67   const char* short_name() const { return "Tenured"; }
  68 
  69   size_t unsafe_max_alloc_nogc() const;
  70   size_t contiguous_available() const;
  71 
  72   // Iteration
  73   void object_iterate(ObjectClosure* blk);
  74 
  75   virtual inline HeapWord* allocate(size_t word_size, bool is_tlab);
  76   virtual inline HeapWord* par_allocate(size_t word_size, bool is_tlab);
  77 
  78 #define TenuredGen_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix)     \
  79   void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl);
  80   TenuredGen_SINCE_SAVE_MARKS_DECL(OopsInGenClosure,_v)


   1 /*
   2  * Copyright (c) 2001, 2017, 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  *


  41   // Abstractly, this is a subtype that gets access to protected fields.
  42   friend class VM_PopulateDumpSharedSpace;
  43 
  44  protected:
  45   ContiguousSpace*    _the_space;       // Actual space holding objects
  46 
  47   GenerationCounters* _gen_counters;
  48   CSpaceCounters*     _space_counters;
  49 
  50   // Allocation failure
  51   virtual bool expand(size_t bytes, size_t expand_bytes);
  52 
  53   // Accessing spaces
  54   ContiguousSpace* space() const { return _the_space; }
  55 
  56   void assert_correct_size_change_locking();
  57 
  58  public:
  59   TenuredGeneration(ReservedSpace rs,
  60                     size_t initial_byte_size,
  61                     GCMemoryManager* mem_mgr,
  62                     CardTableRS* remset);
  63 
  64   Generation::Name kind() { return Generation::MarkSweepCompact; }
  65 
  66   // Printing
  67   const char* name() const { return "tenured generation"; }
  68   const char* short_name() const { return "Tenured"; }
  69 
  70   size_t unsafe_max_alloc_nogc() const;
  71   size_t contiguous_available() const;
  72 
  73   // Iteration
  74   void object_iterate(ObjectClosure* blk);
  75 
  76   virtual inline HeapWord* allocate(size_t word_size, bool is_tlab);
  77   virtual inline HeapWord* par_allocate(size_t word_size, bool is_tlab);
  78 
  79 #define TenuredGen_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix)     \
  80   void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl);
  81   TenuredGen_SINCE_SAVE_MARKS_DECL(OopsInGenClosure,_v)


< prev index next >