< prev index next >

src/hotspot/share/gc/serial/markSweep.inline.hpp

Print this page
rev 51152 : [mq]: gcbuildoptionspatch


   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_SERIAL_MARKSWEEP_INLINE_HPP
  26 #define SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP
  27 

  28 #include "classfile/classLoaderData.inline.hpp"
  29 #include "gc/serial/markSweep.hpp"
  30 #include "memory/metaspaceShared.hpp"
  31 #include "memory/universe.hpp"
  32 #include "oops/markOop.inline.hpp"
  33 #include "oops/access.inline.hpp"
  34 #include "oops/compressedOops.inline.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "utilities/stack.inline.hpp"
  37 
  38 inline void MarkSweep::mark_object(oop obj) {
  39   // some marks may contain information we need to preserve so we store them away
  40   // and overwrite the mark.  We'll restore it at the end of markSweep.
  41   markOop mark = obj->mark_raw();
  42   obj->set_mark_raw(markOopDesc::prototype()->set_marked());
  43 
  44   if (mark->must_be_preserved(obj)) {
  45     preserve_mark(obj, mark);
  46   }
  47 }


  88            "should be forwarded");
  89 
  90     if (new_obj != NULL) {
  91       assert(Universe::heap()->is_in_reserved(new_obj),
  92              "should be in object space");
  93       RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
  94     }
  95   }
  96 }
  97 
  98 template <typename T>
  99 void AdjustPointerClosure::do_oop_work(T* p)           { MarkSweep::adjust_pointer(p); }
 100 inline void AdjustPointerClosure::do_oop(oop* p)       { do_oop_work(p); }
 101 inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 102 
 103 
 104 inline int MarkSweep::adjust_pointers(oop obj) {
 105   return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
 106 }
 107 

 108 #endif // SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP


   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_SERIAL_MARKSWEEP_INLINE_HPP
  26 #define SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP
  27 
  28 #if INCLUDE_SERIALGC
  29 #include "classfile/classLoaderData.inline.hpp"
  30 #include "gc/serial/markSweep.hpp"
  31 #include "memory/metaspaceShared.hpp"
  32 #include "memory/universe.hpp"
  33 #include "oops/markOop.inline.hpp"
  34 #include "oops/access.inline.hpp"
  35 #include "oops/compressedOops.inline.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "utilities/stack.inline.hpp"
  38 
  39 inline void MarkSweep::mark_object(oop obj) {
  40   // some marks may contain information we need to preserve so we store them away
  41   // and overwrite the mark.  We'll restore it at the end of markSweep.
  42   markOop mark = obj->mark_raw();
  43   obj->set_mark_raw(markOopDesc::prototype()->set_marked());
  44 
  45   if (mark->must_be_preserved(obj)) {
  46     preserve_mark(obj, mark);
  47   }
  48 }


  89            "should be forwarded");
  90 
  91     if (new_obj != NULL) {
  92       assert(Universe::heap()->is_in_reserved(new_obj),
  93              "should be in object space");
  94       RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
  95     }
  96   }
  97 }
  98 
  99 template <typename T>
 100 void AdjustPointerClosure::do_oop_work(T* p)           { MarkSweep::adjust_pointer(p); }
 101 inline void AdjustPointerClosure::do_oop(oop* p)       { do_oop_work(p); }
 102 inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 103 
 104 
 105 inline int MarkSweep::adjust_pointers(oop obj) {
 106   return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
 107 }
 108 
 109 #endif // INCLUDE_SERIALGC
 110 #endif // SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP
< prev index next >