Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v3]

2022-05-27 Thread Claes Redestad
On Wed, 25 May 2022 14:13:52 GMT, Claes Redestad wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >> wi

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v4]

2022-05-27 Thread Claes Redestad
> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a kind value above 15 will be forced to allocate and use ar

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v3]

2022-05-26 Thread Mandy Chung
On Wed, 25 May 2022 14:13:52 GMT, Claes Redestad wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >> wi

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v2]

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 14:03:41 GMT, Claes Redestad wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >> wi

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v3]

2022-05-25 Thread Claes Redestad
> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a kind value above 15 will be forced to allocate and use ar

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v2]

2022-05-25 Thread Claes Redestad
> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a kind value above 15 will be forced to allocate and use ar

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:37:14 GMT, Claes Redestad wrote: >> Maybe an `assert b == b23456[i]` would be nice here. > > All usage implies the int is an argument position, which by spec is > constrained to be in the 0-255 range. But surely checking or asserting > shouldn't hurt. Yes, please. IMHO i

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Claes Redestad
On Wed, 25 May 2022 13:30:23 GMT, Jorn Vernee wrote: >> Maybe not... argument positions should fit in a byte as well. But, maybe >> there are other problematic cases? Or are the ints guaranteed to fit in a >> byte? > > Maybe an `assert b == b23456[i]` would be nice here. All usage implies the

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:27:17 GMT, Jorn Vernee wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >> with

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:28:52 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java line 239: >> >>> 237: for (int i = 0; i < b23456.length; i++) { >>> 238: int b = b23456[i] & 0xFF; >>> 239: bitset |= b; >> >> L

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 09:38:08 GMT, Claes Redestad wrote: > The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jim Laskey
On Wed, 25 May 2022 09:38:08 GMT, Claes Redestad wrote: > The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a

RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Claes Redestad
The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` allows keys to be compacted when all byte values of the key fit in 4 bits, otherwise a byte array is allocated and used. This means that all transforms with a kind value above 15 will be forced to allocate and use array comp