Re: RFR: 8319761: Simplify fields of Array VarHandles

2023-11-09 Thread Magnus Ihse Bursie
On Sun, 24 Sep 2023 13:17:05 GMT, Chen Liang  wrote:

> 1. Primitive array VHs are now singletons and no longer need to record their 
> array base and offset in their object themselves.
> 2. Moved Unsafe offset calculation to a utility method, like `index` in 
> VarHandleByteArrayView.

Build changes look good.

-

Marked as reviewed by ihse (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15894#pullrequestreview-1723191512


Re: RFR: 8319761: Simplify fields of Array VarHandles

2023-11-09 Thread Chen Liang
On Thu, 9 Nov 2023 07:48:04 GMT, Per Minborg  wrote:

> Sharing code might sometimes have performance issues because the shared code 
> is used differently from different call sites. See 
> https://bugs.openjdk.org/browse/JDK-8015417.   Is this something we should 
> check here?

This patch mainly simplifies primitive array var handles by reusing the same 
object instance. There's no shared bytecode in this patch. Some exist in #15854 
though.

-

PR Comment: https://git.openjdk.org/jdk/pull/15894#issuecomment-1803387174


Re: RFR: 8319761: Simplify fields of Array VarHandles

2023-11-08 Thread Per Minborg
On Sun, 24 Sep 2023 13:17:05 GMT, Chen Liang  wrote:

> 1. Primitive array VHs are now singletons and no longer need to record their 
> array base and offset in their object themselves.
> 2. Moved Unsafe offset calculation to a utility method, like `index` in 
> VarHandleByteArrayView.

Sharing code might sometimes have performance issues because the shared code is 
used differently from different call sites. See 
https://bugs.openjdk.org/browse/JDK-8015417.   Is this something we should 
check here?

-

PR Comment: https://git.openjdk.org/jdk/pull/15894#issuecomment-1803312528


Re: RFR: 8319761: Simplify fields of Array VarHandles

2023-11-08 Thread Magnus Ihse Bursie
On Sun, 24 Sep 2023 13:17:05 GMT, Chen Liang  wrote:

> 1. Primitive array VHs are now singletons and no longer need to record their 
> array base and offset in their object themselves.
> 2. Moved Unsafe offset calculation to a utility method, like `index` in 
> VarHandleByteArrayView.

@liach You need to create an issue in JBS, and update the PR title to include 
the bug number. Otherwise, this PR will not be flagged as ready for review, and 
will not really appear on anyone's radar.

-

PR Comment: https://git.openjdk.org/jdk/pull/15894#issuecomment-1802301793


Re: RFR: 8319761: Simplify fields of Array VarHandles

2023-11-08 Thread ExE Boss
On Sun, 24 Sep 2023 13:17:05 GMT, Chen Liang  wrote:

> 1. Primitive array VHs are now singletons and no longer need to record their 
> array base and offset in their object themselves.
> 2. Moved Unsafe offset calculation to a utility method, like `index` in 
> VarHandleByteArrayView.

Note that the first change might need a **CSR** in case there’s user code out 
there which currently assumes it gets ownership over the identity of the result 
of calling `MethodHandles::arrayElementVarHandle(Class)` with a primitive array 
type.

-

PR Comment: https://git.openjdk.org/jdk/pull/15894#issuecomment-1735062158