src/share/vm/gc_implementation/g1/heapRegion.cpp

Print this page
rev 7084 : [mq]: demacro


 966       return;
 967     }
 968   }
 969 
 970   if (is_humongous && object_num > 1) {
 971     gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is humongous "
 972                            "but has "SIZE_FORMAT", objects",
 973                            bottom(), end(), object_num);
 974     *failures = true;
 975     return;
 976   }
 977 
 978   verify_strong_code_roots(vo, failures);
 979 }
 980 
 981 void HeapRegion::verify() const {
 982   bool dummy = false;
 983   verify(VerifyOption_G1UsePrevMarking, /* failures */ &dummy);
 984 }
 985 




 986 // G1OffsetTableContigSpace code; copied from space.cpp.  Hope this can go
 987 // away eventually.
 988 
 989 void G1OffsetTableContigSpace::clear(bool mangle_space) {
 990   set_top(bottom());
 991   set_saved_mark_word(bottom());
 992   CompactibleSpace::clear(mangle_space);
 993   reset_bot();
 994 }
 995 
 996 void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) {
 997   Space::set_bottom(new_bottom);
 998   _offsets.set_bottom(new_bottom);
 999 }
1000 
1001 void G1OffsetTableContigSpace::set_end(HeapWord* new_end) {
1002   Space::set_end(new_end);
1003   _offsets.resize(new_end - bottom());
1004 }
1005 


1048     // this is called in parallel with other threads trying to
1049     // allocate into the region, the caller should call this while
1050     // holding a lock and when the lock is released the writes will be
1051     // flushed.
1052   }
1053 }
1054 
1055 void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) {
1056   object_iterate(blk);
1057 }
1058 
1059 void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) {
1060   HeapWord* p = bottom();
1061   while (p < top()) {
1062     if (block_is_obj(p)) {
1063       blk->do_object(oop(p));
1064     }
1065     p += block_size(p);
1066   }
1067 }
1068 
1069 #define block_is_always_obj(q) true
1070 void G1OffsetTableContigSpace::prepare_for_compaction(CompactPoint* cp) {
1071   SCAN_AND_FORWARD(cp, top, block_is_always_obj, block_size);
1072 }
1073 #undef block_is_always_obj
1074 
1075 G1OffsetTableContigSpace::
1076 G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
1077                          MemRegion mr) :
1078   _offsets(sharedOffsetArray, mr),
1079   _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
1080   _gc_time_stamp(0)
1081 {
1082   _offsets.set_space(this);
1083 }
1084 
1085 void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
1086   CompactibleSpace::initialize(mr, clear_space, mangle_space);
1087   _top = bottom();
1088   reset_bot();
1089 }
1090 


 966       return;
 967     }
 968   }
 969 
 970   if (is_humongous && object_num > 1) {
 971     gclog_or_tty->print_cr("region ["PTR_FORMAT","PTR_FORMAT"] is humongous "
 972                            "but has "SIZE_FORMAT", objects",
 973                            bottom(), end(), object_num);
 974     *failures = true;
 975     return;
 976   }
 977 
 978   verify_strong_code_roots(vo, failures);
 979 }
 980 
 981 void HeapRegion::verify() const {
 982   bool dummy = false;
 983   verify(VerifyOption_G1UsePrevMarking, /* failures */ &dummy);
 984 }
 985 
 986 void HeapRegion::prepare_for_compaction(CompactPoint* cp) {
 987   scan_and_forward(this, cp);
 988 }
 989 
 990 // G1OffsetTableContigSpace code; copied from space.cpp.  Hope this can go
 991 // away eventually.
 992 
 993 void G1OffsetTableContigSpace::clear(bool mangle_space) {
 994   set_top(bottom());
 995   set_saved_mark_word(bottom());
 996   CompactibleSpace::clear(mangle_space);
 997   reset_bot();
 998 }
 999 
1000 void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) {
1001   Space::set_bottom(new_bottom);
1002   _offsets.set_bottom(new_bottom);
1003 }
1004 
1005 void G1OffsetTableContigSpace::set_end(HeapWord* new_end) {
1006   Space::set_end(new_end);
1007   _offsets.resize(new_end - bottom());
1008 }
1009 


1052     // this is called in parallel with other threads trying to
1053     // allocate into the region, the caller should call this while
1054     // holding a lock and when the lock is released the writes will be
1055     // flushed.
1056   }
1057 }
1058 
1059 void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) {
1060   object_iterate(blk);
1061 }
1062 
1063 void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) {
1064   HeapWord* p = bottom();
1065   while (p < top()) {
1066     if (block_is_obj(p)) {
1067       blk->do_object(oop(p));
1068     }
1069     p += block_size(p);
1070   }
1071 }






1072 
1073 G1OffsetTableContigSpace::
1074 G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
1075                          MemRegion mr) :
1076   _offsets(sharedOffsetArray, mr),
1077   _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
1078   _gc_time_stamp(0)
1079 {
1080   _offsets.set_space(this);
1081 }
1082 
1083 void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
1084   CompactibleSpace::initialize(mr, clear_space, mangle_space);
1085   _top = bottom();
1086   reset_bot();
1087 }
1088