src/share/vm/memory/space.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, 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 # include "incls/_precompiled.incl"
  26 # include "incls/_space.cpp.incl"
















  27 
  28 void SpaceMemRegionOopsIterClosure::do_oop(oop* p)       { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
  29 void SpaceMemRegionOopsIterClosure::do_oop(narrowOop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
  30 
  31 HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
  32                                                 HeapWord* top_obj) {
  33   if (top_obj != NULL) {
  34     if (_sp->block_is_obj(top_obj)) {
  35       if (_precision == CardTableModRefBS::ObjHeadPreciseArray) {
  36         if (oop(top_obj)->is_objArray() || oop(top_obj)->is_typeArray()) {
  37           // An arrayOop is starting on the dirty card - since we do exact
  38           // store checks for objArrays we are done.
  39         } else {
  40           // Otherwise, it is possible that the object starting on the dirty
  41           // card spans the entire card, and that the store happened on a
  42           // later card.  Figure out where the object ends.
  43           // Use the block_size() method of the space over which
  44           // the iteration is being done.  That space (e.g. CMS) may have
  45           // specific requirements on object sizes which will
  46           // be reflected in the block_size() method.


   1 /*
   2  * Copyright (c) 1997, 2010, 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 #include "precompiled.hpp"
  26 #include "classfile/systemDictionary.hpp"
  27 #include "classfile/vmSymbols.hpp"
  28 #include "gc_implementation/shared/liveRange.hpp"
  29 #include "gc_implementation/shared/markSweep.hpp"
  30 #include "gc_implementation/shared/spaceDecorator.hpp"
  31 #include "memory/blockOffsetTable.inline.hpp"
  32 #include "memory/defNewGeneration.hpp"
  33 #include "memory/genCollectedHeap.hpp"
  34 #include "memory/space.hpp"
  35 #include "memory/space.inline.hpp"
  36 #include "memory/universe.inline.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "oops/oop.inline2.hpp"
  39 #include "runtime/java.hpp"
  40 #include "runtime/safepoint.hpp"
  41 #include "utilities/copy.hpp"
  42 #include "utilities/globalDefinitions.hpp"
  43 
  44 void SpaceMemRegionOopsIterClosure::do_oop(oop* p)       { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
  45 void SpaceMemRegionOopsIterClosure::do_oop(narrowOop* p) { SpaceMemRegionOopsIterClosure::do_oop_work(p); }
  46 
  47 HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
  48                                                 HeapWord* top_obj) {
  49   if (top_obj != NULL) {
  50     if (_sp->block_is_obj(top_obj)) {
  51       if (_precision == CardTableModRefBS::ObjHeadPreciseArray) {
  52         if (oop(top_obj)->is_objArray() || oop(top_obj)->is_typeArray()) {
  53           // An arrayOop is starting on the dirty card - since we do exact
  54           // store checks for objArrays we are done.
  55         } else {
  56           // Otherwise, it is possible that the object starting on the dirty
  57           // card spans the entire card, and that the store happened on a
  58           // later card.  Figure out where the object ends.
  59           // Use the block_size() method of the space over which
  60           // the iteration is being done.  That space (e.g. CMS) may have
  61           // specific requirements on object sizes which will
  62           // be reflected in the block_size() method.