equal
deleted
inserted
replaced
927 // Ensure klass read before size. |
927 // Ensure klass read before size. |
928 Klass* k = oop(p)->klass_or_null_acquire(); |
928 Klass* k = oop(p)->klass_or_null_acquire(); |
929 if (k != NULL) { |
929 if (k != NULL) { |
930 assert(k->is_klass(), "Should really be klass oop."); |
930 assert(k->is_klass(), "Should really be klass oop."); |
931 oop o = (oop)p; |
931 oop o = (oop)p; |
932 assert(o->is_oop(true /* ignore mark word */), "Should be an oop."); |
932 assert(oopDesc::is_oop(o, true /* ignore mark word */), "Should be an oop."); |
933 |
933 |
934 size_t res = o->size_given_klass(k); |
934 size_t res = o->size_given_klass(k); |
935 res = adjustObjectSize(res); |
935 res = adjustObjectSize(res); |
936 assert(res != 0, "Block size should not be 0"); |
936 assert(res != 0, "Block size should not be 0"); |
937 return res; |
937 return res; |
977 // Ensure klass read before size. |
977 // Ensure klass read before size. |
978 Klass* k = oop(p)->klass_or_null_acquire(); |
978 Klass* k = oop(p)->klass_or_null_acquire(); |
979 if (k != NULL) { |
979 if (k != NULL) { |
980 assert(k->is_klass(), "Should really be klass oop."); |
980 assert(k->is_klass(), "Should really be klass oop."); |
981 oop o = (oop)p; |
981 oop o = (oop)p; |
982 assert(o->is_oop(), "Should be an oop"); |
982 assert(oopDesc::is_oop(o), "Should be an oop"); |
983 |
983 |
984 size_t res = o->size_given_klass(k); |
984 size_t res = o->size_given_klass(k); |
985 res = adjustObjectSize(res); |
985 res = adjustObjectSize(res); |
986 assert(res != 0, "Block size should not be 0"); |
986 assert(res != 0, "Block size should not be 0"); |
987 return res; |
987 return res; |
1003 return fc->size(); |
1003 return fc->size(); |
1004 } else { |
1004 } else { |
1005 // Ignore mark word because this may be a recently promoted |
1005 // Ignore mark word because this may be a recently promoted |
1006 // object whose mark word is used to chain together grey |
1006 // object whose mark word is used to chain together grey |
1007 // objects (the last one would have a null value). |
1007 // objects (the last one would have a null value). |
1008 assert(oop(p)->is_oop(true), "Should be an oop"); |
1008 assert(oopDesc::is_oop(oop(p), true), "Should be an oop"); |
1009 return adjustObjectSize(oop(p)->size()); |
1009 return adjustObjectSize(oop(p)->size()); |
1010 } |
1010 } |
1011 } |
1011 } |
1012 |
1012 |
1013 // This implementation assumes that the property of "being an object" is |
1013 // This implementation assumes that the property of "being an object" is |
1020 Klass* k = oop(p)->klass_or_null_acquire(); |
1020 Klass* k = oop(p)->klass_or_null_acquire(); |
1021 if (k != NULL) { |
1021 if (k != NULL) { |
1022 // Ignore mark word because it may have been used to |
1022 // Ignore mark word because it may have been used to |
1023 // chain together promoted objects (the last one |
1023 // chain together promoted objects (the last one |
1024 // would have a null value). |
1024 // would have a null value). |
1025 assert(oop(p)->is_oop(true), "Should be an oop"); |
1025 assert(oopDesc::is_oop(oop(p), true), "Should be an oop"); |
1026 return true; |
1026 return true; |
1027 } else { |
1027 } else { |
1028 return false; // Was not an object at the start of collection. |
1028 return false; // Was not an object at the start of collection. |
1029 } |
1029 } |
1030 } |
1030 } |
1064 assert(_bt.block_start(p) == p, "Should be a block boundary"); |
1064 assert(_bt.block_start(p) == p, "Should be a block boundary"); |
1065 if (!fc->is_free()) { |
1065 if (!fc->is_free()) { |
1066 // Ignore mark word because it may have been used to |
1066 // Ignore mark word because it may have been used to |
1067 // chain together promoted objects (the last one |
1067 // chain together promoted objects (the last one |
1068 // would have a null value). |
1068 // would have a null value). |
1069 assert(oop(p)->is_oop(true), "Should be an oop"); |
1069 assert(oopDesc::is_oop(oop(p), true), "Should be an oop"); |
1070 return true; |
1070 return true; |
1071 } |
1071 } |
1072 return false; |
1072 return false; |
1073 } |
1073 } |
1074 |
1074 |
2172 bool was_obj = false; |
2172 bool was_obj = false; |
2173 bool was_live = false; |
2173 bool was_live = false; |
2174 if (_sp->block_is_obj(addr)) { |
2174 if (_sp->block_is_obj(addr)) { |
2175 was_obj = true; |
2175 was_obj = true; |
2176 oop p = oop(addr); |
2176 oop p = oop(addr); |
2177 guarantee(p->is_oop(), "Should be an oop"); |
2177 guarantee(oopDesc::is_oop(p), "Should be an oop"); |
2178 res = _sp->adjustObjectSize(p->size()); |
2178 res = _sp->adjustObjectSize(p->size()); |
2179 if (_sp->obj_is_alive(addr)) { |
2179 if (_sp->obj_is_alive(addr)) { |
2180 was_live = true; |
2180 was_live = true; |
2181 p->verify(); |
2181 p->verify(); |
2182 } |
2182 } |
2224 // that p be in _sp. Note that several generations (and spaces) |
2224 // that p be in _sp. Note that several generations (and spaces) |
2225 // are spanned by _span (CMS heap) above. |
2225 // are spanned by _span (CMS heap) above. |
2226 guarantee(!_sp->is_in_reserved(obj) || |
2226 guarantee(!_sp->is_in_reserved(obj) || |
2227 _sp->block_is_obj((HeapWord*)obj), |
2227 _sp->block_is_obj((HeapWord*)obj), |
2228 "Should be an object"); |
2228 "Should be an object"); |
2229 guarantee(obj->is_oop(), "Should be an oop"); |
2229 guarantee(oopDesc::is_oop(obj), "Should be an oop"); |
2230 obj->verify(); |
2230 obj->verify(); |
2231 if (_past_remark) { |
2231 if (_past_remark) { |
2232 // Remark has been completed, the object should be marked |
2232 // Remark has been completed, the object should be marked |
2233 _bit_map->isMarked((HeapWord*)obj); |
2233 _bit_map->isMarked((HeapWord*)obj); |
2234 } |
2234 } |
2241 } |
2241 } |
2242 } |
2242 } |
2243 } |
2243 } |
2244 } else if (_sp->is_in_reserved(p)) { |
2244 } else if (_sp->is_in_reserved(p)) { |
2245 // the reference is from FLS, and points out of FLS |
2245 // the reference is from FLS, and points out of FLS |
2246 guarantee(obj->is_oop(), "Should be an oop"); |
2246 guarantee(oopDesc::is_oop(obj), "Should be an oop"); |
2247 obj->verify(); |
2247 obj->verify(); |
2248 } |
2248 } |
2249 } |
2249 } |
2250 |
2250 |
2251 template <class T> void do_oop_work(T* p) { |
2251 template <class T> void do_oop_work(T* p) { |