RFR: jsr166 jdk9 integration wave 13
paul.sandoz at oracle.com
Wed Dec 14 16:30:04 UTC 2016
> On 13 Dec 2016, at 19:37, Martin Buchholz <martinrb at google.com> wrote:
> Hotspot appears to have support for the array filling code pattern, but Arrays.fill itself is not intrinsified.
Yes. I suspect in general it should be ok here. FWIW i still would like to make it an explicit intrinsic and improve the code generation.
> There are bounds checks which hotspot may not be able to elide.
Ah, yes, its the range fill that performs explicit checks (also with the IAE vs IOOBE, we are inconsistent in the handling of this in other places).
If this is an issue I think we could probably improve this, since the loop anyway has to check the bounds, so perhaps could branch on >=, then branch on >.
> For almost all software, Arrays.fill is good enough, but core library collections are an exception. Also, we introduce other little abstractions like shiftTailOverGap and circularClear. Another possibility is to introduce our own tiny helper method without checks
> nullOutSlice(Object a, int from, int to)
> On Tue, Dec 13, 2016 at 5:26 PM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
> One general question: why did you replace Arrays.fill with an explicit loop in many cases?
More information about the core-libs-dev