hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
changeset 25490 59f226da8d81
parent 25481 1427aa24638c
child 25491 70fb742e40aa
equal deleted inserted replaced
25489:feb54edc509d 25490:59f226da8d81
   398 void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
   398 void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
   399                                                     bool during_conc_mark) {
   399                                                     bool during_conc_mark) {
   400   // We always recreate the prev marking info and we'll explicitly
   400   // We always recreate the prev marking info and we'll explicitly
   401   // mark all objects we find to be self-forwarded on the prev
   401   // mark all objects we find to be self-forwarded on the prev
   402   // bitmap. So all objects need to be below PTAMS.
   402   // bitmap. So all objects need to be below PTAMS.
   403   _prev_top_at_mark_start = top();
       
   404   _prev_marked_bytes = 0;
   403   _prev_marked_bytes = 0;
   405 
   404 
   406   if (during_initial_mark) {
   405   if (during_initial_mark) {
   407     // During initial-mark, we'll also explicitly mark all objects
   406     // During initial-mark, we'll also explicitly mark all objects
   408     // we find to be self-forwarded on the next bitmap. So all
   407     // we find to be self-forwarded on the next bitmap. So all
   422                                                   bool during_conc_mark,
   421                                                   bool during_conc_mark,
   423                                                   size_t marked_bytes) {
   422                                                   size_t marked_bytes) {
   424   assert(0 <= marked_bytes && marked_bytes <= used(),
   423   assert(0 <= marked_bytes && marked_bytes <= used(),
   425          err_msg("marked: "SIZE_FORMAT" used: "SIZE_FORMAT,
   424          err_msg("marked: "SIZE_FORMAT" used: "SIZE_FORMAT,
   426                  marked_bytes, used()));
   425                  marked_bytes, used()));
       
   426   _prev_top_at_mark_start = top();
   427   _prev_marked_bytes = marked_bytes;
   427   _prev_marked_bytes = marked_bytes;
   428 }
   428 }
   429 
   429 
   430 HeapWord*
   430 HeapWord*
   431 HeapRegion::object_iterate_mem_careful(MemRegion mr,
   431 HeapRegion::object_iterate_mem_careful(MemRegion mr,
   903   while (p < top()) {
   903   while (p < top()) {
   904     oop obj = oop(p);
   904     oop obj = oop(p);
   905     size_t obj_size = block_size(p);
   905     size_t obj_size = block_size(p);
   906     object_num += 1;
   906     object_num += 1;
   907 
   907 
   908     if (is_humongous != g1->isHumongous(obj_size)) {
   908     if (is_humongous != g1->isHumongous(obj_size) &&
       
   909         !g1->is_obj_dead(obj, this)) { // Dead objects may have bigger block_size since they span several objects.
   909       gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size ("
   910       gclog_or_tty->print_cr("obj "PTR_FORMAT" is of %shumongous size ("
   910                              SIZE_FORMAT" words) in a %shumongous region",
   911                              SIZE_FORMAT" words) in a %shumongous region",
   911                              p, g1->isHumongous(obj_size) ? "" : "non-",
   912                              p, g1->isHumongous(obj_size) ? "" : "non-",
   912                              obj_size, is_humongous ? "" : "non-");
   913                              obj_size, is_humongous ? "" : "non-");
   913        *failures = true;
   914        *failures = true;
   914        return;
   915        return;
   915     }
   916     }
   916 
   917 
   917     // If it returns false, verify_for_object() will output the
   918     // If it returns false, verify_for_object() will output the
   918     // appropriate messasge.
   919     // appropriate messasge.
   919     if (do_bot_verify && !_offsets.verify_for_object(p, obj_size)) {
   920     if (do_bot_verify &&
       
   921         !g1->is_obj_dead(obj, this) &&
       
   922         !_offsets.verify_for_object(p, obj_size)) {
   920       *failures = true;
   923       *failures = true;
   921       return;
   924       return;
   922     }
   925     }
   923 
   926 
   924     if (!g1->is_obj_dead_cond(obj, this, vo)) {
   927     if (!g1->is_obj_dead_cond(obj, this, vo)) {
   925       if (obj->is_oop()) {
   928       if (obj->is_oop()) {
   926         Klass* klass = obj->klass();
   929         Klass* klass = obj->klass();
   927         if (!klass->is_metaspace_object()) {
   930         bool is_metaspace_object = Metaspace::contains(klass) ||
       
   931                                    (vo == VerifyOption_G1UsePrevMarking &&
       
   932                                    ClassLoaderDataGraph::unload_list_contains(klass));
       
   933         if (!is_metaspace_object) {
   928           gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
   934           gclog_or_tty->print_cr("klass "PTR_FORMAT" of object "PTR_FORMAT" "
   929                                  "not metadata", klass, (void *)obj);
   935                                  "not metadata", klass, (void *)obj);
   930           *failures = true;
   936           *failures = true;
   931           return;
   937           return;
   932         } else if (!klass->is_klass()) {
   938         } else if (!klass->is_klass()) {