RFR: 8155638: Resource allocated BitMaps are often cleared twice
nils.eliasson at oracle.com
Thu Jun 2 08:04:45 UTC 2016
I prefer the reinitialize alternative in c1_linearscan.cpp. Please use
Thanks for fixing this!
On 2016-05-06 12:46, Stefan Karlsson wrote:
> Hi all,
> Please review this patch to remove some redundant clearing of bitmaps.
> It used to be the case that Resource allocated bitmaps were _not_
> cleared in the constructor, and that explicit calls to clear() were
> needed. However, when G1 was open sourced all the Resource allocated
> bitmaps were always cleared in the BitMap constructor:
> It's apparent that the lazy clearing of bitmaps was used to skip
> clearing when it wasn't necessary.
> See, for example:
> where _requires_phi_function is cleared even when all bits are going
> to be set to 1.
> in MethodLiveness::BasicBlock::get_liveness_at
> 1010 ResourceBitMap g(_gen.size()); g.set_from(_gen);
> 1011 ResourceBitMap k(_kill.size()); k.set_from(_kill);
> where we first clear the bitmap, then copy all bits with set_from.
> Before G1 was introduced, the unnecessary clearing was not done.
> I've created a new CR for these kind of issues:
> https://bugs.openjdk.java.net/browse/JDK-8156207 - Resource allocated
> BitMaps are often cleared unnecessarily
> During the review of "8141501: Problems with BitMap buffer
> management", I got the request do the following change:
> I tried it, but felt that the change didn't fit the surrounding code,
> where shallow-copying was used for other bitmaps. It would be great if
> reviewers of this patch could decide if I should change the code as
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev