RFR(S) 8038412: Move object_iterate_careful down from Space to ContigousSpace and CFLSpace

Mikael Gerdin mikael.gerdin at oracle.com
Thu Mar 27 08:56:17 UTC 2014


Hi Thomas,

On Thursday 27 March 2014 09.24.07 Thomas Schatzl wrote:
> Hi Mikael,
> 
> On Wed, 2014-03-26 at 17:21 +0100, Mikael Gerdin wrote:
> > Hi,
> > 
> > I'm doing some cleanups in the "Space" classes to simplify the code for
> > the G1 class unloading work[1].
> > Here's a change to move code only used for CMS from virtuals on Space to
> > only be declared and defined where needed.
> 
>  some comments:
> 
>  - in ContiguousSpace, after moving object_iterate_careful(), the
> comment "// iterates on objects up to the safe limit" seems to be
> obsolete now since the new comment seems better.

Yes, I'll remove the obsolete comment.

> 
>  - object_iterate_careful() seems to be only used by CFLSpace: why not
> move it to compactibleFreeListSpace?
> 
> Actually everything that has to do with it
> (concurrent_iteration_safe_limit(), oop_since_save_marks_iterate*, and a
> lot of other code) seems to be specific to CMS.

CMS code is the only caller of object_iterate_careful, however it is invoked 
on the spaces of the {Def,Par}NewGeneration, these are ContiguousSpaces and 
need to provide this API for CMS.

> 
> Are you going to merge this code with similar G1 code like
> HeapRegion::object_iterate_*mem_*careful() later, so you kept this code
> for now in ContiguousSpace?

object_iterate_careful needs to be in ContiguousSpace for the reasons I stated 
above.

HeapRegion::object_iterate_mem_careful seems to only ever be used with 
[bottom, top) but it actually also takes care to only look at objects which 
are "live" according to G1's is_obj_dead. I have some ideas about how to solve 
this but I'd like to leave this as is for now.

> 
> Otherwise seems okay.

Thanks.

/Mikael
> 
> Thanks,
>   Thomas




More information about the hotspot-gc-dev mailing list