RFR: 8209120: Archive the Integer.IntegerCache
Claes Redestad
claes.redestad at oracle.com
Mon Aug 13 14:16:14 UTC 2018
Hi Jiangli,
On 2018-08-10 19:15, Jiangli Zhou wrote:
> Hi Claes,
>
> The updated Integer.java looks good. The test also looks good to me.
> I'd suggest adding some checks in CheckIntegerCacheApp test for the
> cached Integers using WhiteBox API, WhiteBox.isShared(object) to make
> sure that they are archived. Checking all cached Integers is probably
> too excessive and unnecessary. Select a few values within [-128, 127]
> range would be good enough, I think.
>
> As archived java heap data mapping may fail in some cases at runtime,
> and there is no need to continue the test execution when that happens
> as it would not exercise any of the archived java objects. The
> following can be done at the beginning of CheckIntegerCacheApp:
>
> WhiteBox wb = WhiteBox.getWhiteBox();
>
> if (!wb.areOpenArchiveHeapObjectsMapped()) {
> return;
> }
thanks for reviewing!
I've added WhiteBox testing as suggested:
http://cr.openjdk.java.net/~redestad/8209120/open.03/
/Claes
More information about the core-libs-dev
mailing list