Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Michael Kuhlmann
Hi Uwe, you are right! It's confusing because for cases 2-4, *atomic* access is explicitly mentioned but not for case 1. I overlooked the *atomic access* in the sentence before and got confused. Thanks for the clarification! On 1/5/23 13:37, Uwe Schindler wrote: Hi, I answered on the PR on

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Michael Kuhlmann
The more I think about it, the clearer is that the first line of the Javadoc is contrary to the other lines: On 1/5/23 12:59, Michael Kuhlmann wrote: * read write access modes for all T, with the exception of access modes get and set for long and double on 32-bit platforms. So all read write

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Michael Kuhlmann
On 1/5/23 12:40, Uwe Schindler wrote: The copypasted snippet above is misleading, you need to read the whole statement, so an IllegalStateException can only happen for unaligned access on access modes other than get/set (so volatile or opaque reads): "If access is misaligned then access for

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access

2023-01-04 Thread Michael Kuhlmann
On 1/4/23 09:56, Per Minborg wrote: Currently, `java.io.Bits` is using explicit logic to read/write various primitive types to/from byte arrays. Switching to the use of `VarHandle` access would provide better performance and less code. Hmh, Javadoc for MethodHandels::byteArrayViewVarHandle sa