1065 NOT_PRODUCT(verify_objects_initialized()); 1066 assert(MemRegion(bottom(), end()).contains(p), "p not in space"); 1067 FreeChunk* fc = (FreeChunk*)p; 1068 if (fc->is_free()) { 1069 return fc->size(); 1070 } else { 1071 // Ignore mark word because this may be a recently promoted 1072 // object whose mark word is used to chain together grey 1073 // objects (the last one would have a null value). 1074 assert(oop(p)->is_oop(true), "Should be an oop"); 1075 return adjustObjectSize(oop(p)->size()); 1076 } 1077 } 1078 1079 // This implementation assumes that the property of "being an object" is 1080 // stable. But being a free chunk may not be (because of parallel 1081 // promotion.) 1082 bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const { 1083 FreeChunk* fc = (FreeChunk*)p; 1084 assert(is_in_reserved(p), "Should be in space"); 1085 // When doing a mark-sweep-compact of the CMS generation, this 1086 // assertion may fail because prepare_for_compaction() uses 1087 // space that is garbage to maintain information on ranges of 1088 // live objects so that these live ranges can be moved as a whole. 1089 // Comment out this assertion until that problem can be solved 1090 // (i.e., that the block start calculation may look at objects 1091 // at address below "p" in finding the object that contains "p" 1092 // and those objects (if garbage) may have been modified to hold 1093 // live range information. 1094 // assert(CollectedHeap::use_parallel_gc_threads() || _bt.block_start(p) == p, 1095 // "Should be a block boundary"); 1096 if (FreeChunk::indicatesFreeChunk(p)) return false; 1097 Klass* k = oop(p)->klass_or_null(); 1098 if (k != NULL) { 1099 // Ignore mark word because it may have been used to 1100 // chain together promoted objects (the last one 1101 // would have a null value). 1102 assert(oop(p)->is_oop(true), "Should be an oop"); 1103 return true; 1104 } else { 1105 return false; // Was not an object at the start of collection. 1106 } 1107 } 1108 1109 // Check if the object is alive. This fact is checked either by consulting 1110 // the main marking bitmap in the sweeping phase or, if it's a permanent 1111 // generation and we're not in the sweeping phase, by checking the 1112 // perm_gen_verify_bit_map where we store the "deadness" information if 1113 // we did not sweep the perm gen in the most recent previous GC cycle. 1114 bool CompactibleFreeListSpace::obj_is_alive(const HeapWord* p) const { 1115 assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(), | 1065 NOT_PRODUCT(verify_objects_initialized()); 1066 assert(MemRegion(bottom(), end()).contains(p), "p not in space"); 1067 FreeChunk* fc = (FreeChunk*)p; 1068 if (fc->is_free()) { 1069 return fc->size(); 1070 } else { 1071 // Ignore mark word because this may be a recently promoted 1072 // object whose mark word is used to chain together grey 1073 // objects (the last one would have a null value). 1074 assert(oop(p)->is_oop(true), "Should be an oop"); 1075 return adjustObjectSize(oop(p)->size()); 1076 } 1077 } 1078 1079 // This implementation assumes that the property of "being an object" is 1080 // stable. But being a free chunk may not be (because of parallel 1081 // promotion.) 1082 bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const { 1083 FreeChunk* fc = (FreeChunk*)p; 1084 assert(is_in_reserved(p), "Should be in space"); 1085 if (FreeChunk::indicatesFreeChunk(p)) return false; 1086 Klass* k = oop(p)->klass_or_null(); 1087 if (k != NULL) { 1088 // Ignore mark word because it may have been used to 1089 // chain together promoted objects (the last one 1090 // would have a null value). 1091 assert(oop(p)->is_oop(true), "Should be an oop"); 1092 return true; 1093 } else { 1094 return false; // Was not an object at the start of collection. 1095 } 1096 } 1097 1098 // Check if the object is alive. This fact is checked either by consulting 1099 // the main marking bitmap in the sweeping phase or, if it's a permanent 1100 // generation and we're not in the sweeping phase, by checking the 1101 // perm_gen_verify_bit_map where we store the "deadness" information if 1102 // we did not sweep the perm gen in the most recent previous GC cycle. 1103 bool CompactibleFreeListSpace::obj_is_alive(const HeapWord* p) const { 1104 assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(), |