RFR (S): 8043243: convert SCAN_AND_FORWARD, SCAN_AND_ADJUST_POINTERS, SCAN_AND_COMPACT macros to methods
stefan.karlsson at oracle.com
Thu Aug 28 12:14:07 UTC 2014
On 28/08/14 13:46, Marcus Larsson wrote:
> I would like reviews for the following patch converting the SCAN_AND_*
> macros into (inline) methods.
> Short summary:
> The change is based on the demacroify.patch (bug attachment), using a
> proxy class to enable different functions for obj_size and similar to
> be used for different types of Spaces. Each type of space has a proxy
> defining which methods should be used in the scan_and_* functions.
> Made no changes to the actual code in the macros, except for replacing
> a multi-line debug_only(...) with #ifdef ASSERT ... #endif.
Some background to this change. I wrote it as PoC to see if we could get
rid of these large macros. At that time there werw concerns raised that
some compilers might not be able to inline the template functions. I
checked the code generated by gcc and it was inlined as expected, but I
didn't check the code from the other compilers.
Are the list of benchmarks below performance runs? Was it done on
different platforms? Did you measure the changed phases
(prepare_for_compation, adjust_pointers, etc.) or did you measure the
Looking at the patch now, I wonder if we shouldn't get rid of the
instance variables in the *SpaceProxy classes and instead pass down
'this' from the call sites? And make these classes AllStatic.
> jprt without problems
> SPECjbb2013, SPECjbb2005, SPECjvm2008 - no significant changes
More information about the hotspot-gc-dev