< prev index next >

src/share/vm/gc/shared/cardGeneration.cpp

Print this page
rev 8362 : [mq]: hotspot


   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 #include "precompiled.hpp"
  26 
  27 #include "memory/blockOffsetTable.inline.hpp"
  28 #include "memory/cardGeneration.inline.hpp"
  29 #include "memory/gcLocker.hpp"
  30 #include "memory/generationSpec.hpp"
  31 #include "memory/genOopClosures.inline.hpp"
  32 #include "memory/genRemSet.hpp"

  33 #include "memory/iterator.hpp"
  34 #include "memory/memRegion.hpp"
  35 #include "memory/space.inline.hpp"
  36 #include "runtime/java.hpp"
  37 
  38 CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size,
  39                                int level,
  40                                GenRemSet* remset) :
  41   Generation(rs, initial_byte_size, level), _rs(remset),
  42   _shrink_factor(0), _min_heap_delta_bytes(), _capacity_at_prologue(),
  43   _used_at_prologue()
  44 {
  45   HeapWord* start = (HeapWord*)rs.base();
  46   size_t reserved_byte_size = rs.size();
  47   assert((uintptr_t(start) & 3) == 0, "bad alignment");
  48   assert((reserved_byte_size & 3) == 0, "bad alignment");
  49   MemRegion reserved_mr(start, heap_word_size(reserved_byte_size));
  50   _bts = new BlockOffsetSharedArray(reserved_mr,
  51                                     heap_word_size(initial_byte_size));
  52   MemRegion committed_mr(start, heap_word_size(initial_byte_size));
  53   _rs->resize_covered_region(committed_mr);
  54   if (_bts == NULL) {
  55     vm_exit_during_initialization("Could not allocate a BlockOffsetArray");




   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 #include "precompiled.hpp"
  26 
  27 #include "gc/shared/blockOffsetTable.inline.hpp"
  28 #include "gc/shared/cardGeneration.inline.hpp"
  29 #include "gc/shared/gcLocker.hpp"
  30 #include "gc/shared/genOopClosures.inline.hpp"
  31 #include "gc/shared/genRemSet.hpp"
  32 #include "gc/shared/generationSpec.hpp"
  33 #include "gc/shared/space.inline.hpp"
  34 #include "memory/iterator.hpp"
  35 #include "memory/memRegion.hpp"

  36 #include "runtime/java.hpp"
  37 
  38 CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size,
  39                                int level,
  40                                GenRemSet* remset) :
  41   Generation(rs, initial_byte_size, level), _rs(remset),
  42   _shrink_factor(0), _min_heap_delta_bytes(), _capacity_at_prologue(),
  43   _used_at_prologue()
  44 {
  45   HeapWord* start = (HeapWord*)rs.base();
  46   size_t reserved_byte_size = rs.size();
  47   assert((uintptr_t(start) & 3) == 0, "bad alignment");
  48   assert((reserved_byte_size & 3) == 0, "bad alignment");
  49   MemRegion reserved_mr(start, heap_word_size(reserved_byte_size));
  50   _bts = new BlockOffsetSharedArray(reserved_mr,
  51                                     heap_word_size(initial_byte_size));
  52   MemRegion committed_mr(start, heap_word_size(initial_byte_size));
  53   _rs->resize_covered_region(committed_mr);
  54   if (_bts == NULL) {
  55     vm_exit_during_initialization("Could not allocate a BlockOffsetArray");


< prev index next >