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