RFR (M): 8184334: Generalizing Atomic with templates

Erik Österlund erik.osterlund at oracle.com
Mon Jul 17 15:49:20 UTC 2017


Hi Aleksey,

On 2017-07-17 17:13, Aleksey Shipilev wrote:
> On 07/17/2017 04:21 PM, Andrew Haley wrote:
>> On 14/07/17 17:28, Erik Österlund wrote:
>>> As for oracle-external ports, I would appreciate if port maintainers
>>> could check if it seems to make sense. I have done my best to try to
>>> make the appropriate changes where needed.
>> It seems to, but it looks over-engineered.  We're relying on the C++
>> compiler to get rid of all of the casts and calls, but it's always
>> better not to write code we don't want to execute.
> I have a related question: how are fastdebug builds doing? This is important,
> because we run lots of tests on fastdebug builds, and making them slower would
> be inconvenient.
>
> Something like the Unsafe.{get|put|CAS} -Xint performance test would be nice to
> have.

Sorry, but I do not understand what you mean here.

1) The code only boils down to performing casts that do not change any 
bit pattern, and is by contract forced to be expanded and inlined at 
compile time, so I would be very surprised about any regressions.
2) This code executes when we are about to perform atomic operations, so 
any accidental code generated for the casting (which seems odd in the 
first place), I would be very surprised to see.
3) Even if there was some barely noticeable regression in fastdebug 
atomics for whatever reason, I do not know if I think it makes sense to 
pollute the code with ugly hacks to micro optimize fastdebug execution time.

I hope you agree.

Thanks,
/Erik

> Thanks,
> -Aleksey
>



More information about the hotspot-dev mailing list