hotspot/src/share/vm/memory/cardTableRS.cpp
changeset 24424 2658d7834c6e
parent 22551 9bf46d16dcc6
child 25351 7c198a690050
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   286   MemRegion ur    = sp->used_region();
   286   MemRegion ur    = sp->used_region();
   287   assert(ur.contains(urasm) || (UseConcMarkSweepGC && UseParNewGC),
   287   assert(ur.contains(urasm) || (UseConcMarkSweepGC && UseParNewGC),
   288          err_msg("Did you forget to call save_marks()? "
   288          err_msg("Did you forget to call save_marks()? "
   289                  "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
   289                  "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
   290                  "[" PTR_FORMAT ", " PTR_FORMAT ")",
   290                  "[" PTR_FORMAT ", " PTR_FORMAT ")",
   291                  urasm.start(), urasm.end(), ur.start(), ur.end()));
   291                  p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end())));
   292   // In the case of CMS+ParNew, issue a warning
   292   // In the case of CMS+ParNew, issue a warning
   293   if (!ur.contains(urasm)) {
   293   if (!ur.contains(urasm)) {
   294     assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above");
   294     assert(UseConcMarkSweepGC && UseParNewGC, "Tautology: see assert above");
   295     warning("CMS+ParNew: Did you forget to call save_marks()? "
   295     warning("CMS+ParNew: Did you forget to call save_marks()? "
   296             "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
   296             "[" PTR_FORMAT ", " PTR_FORMAT ") is not contained in "
   297             "[" PTR_FORMAT ", " PTR_FORMAT ")",
   297             "[" PTR_FORMAT ", " PTR_FORMAT ")",
   298              urasm.start(), urasm.end(), ur.start(), ur.end());
   298              p2i(urasm.start()), p2i(urasm.end()), p2i(ur.start()), p2i(ur.end()));
   299     MemRegion ur2 = sp->used_region();
   299     MemRegion ur2 = sp->used_region();
   300     MemRegion urasm2 = sp->used_region_at_save_marks();
   300     MemRegion urasm2 = sp->used_region_at_save_marks();
   301     if (!ur.equals(ur2)) {
   301     if (!ur.equals(ur2)) {
   302       warning("CMS+ParNew: Flickering used_region()!!");
   302       warning("CMS+ParNew: Flickering used_region()!!");
   303     }
   303     }
   347   template <class T> void do_oop_work(T* p) {
   347   template <class T> void do_oop_work(T* p) {
   348     HeapWord* jp = (HeapWord*)p;
   348     HeapWord* jp = (HeapWord*)p;
   349     assert(jp >= _begin && jp < _end,
   349     assert(jp >= _begin && jp < _end,
   350            err_msg("Error: jp " PTR_FORMAT " should be within "
   350            err_msg("Error: jp " PTR_FORMAT " should be within "
   351                    "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")",
   351                    "[_begin, _end) = [" PTR_FORMAT "," PTR_FORMAT ")",
   352                    jp, _begin, _end));
   352                    p2i(jp), p2i(_begin), p2i(_end)));
   353     oop obj = oopDesc::load_decode_heap_oop(p);
   353     oop obj = oopDesc::load_decode_heap_oop(p);
   354     guarantee(obj == NULL || (HeapWord*)obj >= _boundary,
   354     guarantee(obj == NULL || (HeapWord*)obj >= _boundary,
   355               err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on "
   355               err_msg("pointer " PTR_FORMAT " at " PTR_FORMAT " on "
   356                       "clean card crosses boundary" PTR_FORMAT,
   356                       "clean card crosses boundary" PTR_FORMAT,
   357                       (HeapWord*)obj, jp, _boundary));
   357                       p2i((HeapWord*)obj), p2i(jp), p2i(_boundary)));
   358   }
   358   }
   359 
   359 
   360 public:
   360 public:
   361   VerifyCleanCardClosure(HeapWord* b, HeapWord* begin, HeapWord* end) :
   361   VerifyCleanCardClosure(HeapWord* b, HeapWord* begin, HeapWord* end) :
   362     _boundary(b), _begin(begin), _end(end) {
   362     _boundary(b), _begin(begin), _end(end) {
   363     assert(b <= begin,
   363     assert(b <= begin,
   364            err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT,
   364            err_msg("Error: boundary " PTR_FORMAT " should be at or below begin " PTR_FORMAT,
   365                    b, begin));
   365                    p2i(b), p2i(begin)));
   366     assert(begin <= end,
   366     assert(begin <= end,
   367            err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT,
   367            err_msg("Error: begin " PTR_FORMAT " should be strictly below end " PTR_FORMAT,
   368                    begin, end));
   368                    p2i(begin), p2i(end)));
   369   }
   369   }
   370 
   370 
   371   virtual void do_oop(oop* p)       { VerifyCleanCardClosure::do_oop_work(p); }
   371   virtual void do_oop(oop* p)       { VerifyCleanCardClosure::do_oop_work(p); }
   372   virtual void do_oop(narrowOop* p) { VerifyCleanCardClosure::do_oop_work(p); }
   372   virtual void do_oop(narrowOop* p) { VerifyCleanCardClosure::do_oop_work(p); }
   373 };
   373 };