On Thu, 29 Jun 2023 01:55:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Thu, 29 Jun 2023 01:55:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Thu, 29 Jun 2023 01:55:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Thu, 29 Jun 2023 01:55:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Thu, 29 Jun 2023 01:55:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Wed, 28 Jun 2023 19:15:02 GMT, Paul Sandoz wrote:
>> I use this block to remove the overhead around MethodHandle and VarHandle
>> infrastructure initialization (such as LF spinning) that is not related to
>> any particular class; so that I measure only the impact of encountering a
>> new cl
On Wed, 28 Jun 2023 23:08:28 GMT, Mandy Chung wrote:
> I suggest to create a CSR to document the behavioral change to match the
> specification.
CSR filed for this behavior change; no spec updates but there's minor
class-loading compatibility risk. I would be grateful if you can review the CSR
> This patch implements lazy initialization for VarHandle working on static
> fields. It has a good initial call performance.
>
> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
> implementation methods. If called via MethodHandle, a barrier is added in the
> Method
> This patch implements lazy initialization for VarHandle working on static
> fields. It has a good initial call performance.
>
> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
> implementation methods. If called via MethodHandle, a barrier is added in the
> Method
On Wed, 28 Jun 2023 01:34:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Tue, 27 Jun 2023 23:33:25 GMT, Chen Liang wrote:
>> test/micro/org/openjdk/bench/java/lang/invoke/LazyStaticColdStart.java line
>> 92:
>>
>>> 90: });
>>> 91:
>>> 92: static {
>>
>> Is this static block required?
>
> I use this block to remove the overhead around Met
On Wed, 28 Jun 2023 00:08:35 GMT, Chen Liang wrote:
>> The MH on VH case is worth considering; the indirect VH cases are already
>> covered by `-Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=true`.
>
> Done; added a test case to test initialization on toMethodHandle use in
> latest push
On Wed, 28 Jun 2023 01:34:30 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
> This patch implements lazy initialization for VarHandle working on static
> fields. It has a good initial call performance.
>
> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
> implementation methods. If called via MethodHandle, a barrier is added in the
> Method
On Tue, 27 Jun 2023 13:57:31 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Wed, 28 Jun 2023 00:13:48 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Tue, 27 Jun 2023 23:33:57 GMT, Chen Liang wrote:
>> test/jdk/java/lang/invoke/VarHandles/LazyInitializingTest.java line 85:
>>
>>> 83:
>>> 84: @Test
>>> 85: public void testInitializationOnVarHandleUse() {
>>
>> I think we will need to expand this to also test operating on a MH to a
> This patch implements lazy initialization for VarHandle working on static
> fields. It has a good initial call performance.
>
> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
> implementation methods. If called via MethodHandle, a barrier is added in the
> Method
On Tue, 27 Jun 2023 21:14:23 GMT, Paul Sandoz wrote:
>> Chen Liang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Rollback VHG changes
>
> test/jdk/java/lang/invoke/VarHandles/LazyInitializingTest.java line 85:
>
>> 83:
>> 84: @Te
> This patch implements lazy initialization for VarHandle working on static
> fields. It has a good initial call performance.
>
> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
> implementation methods. If called via MethodHandle, a barrier is added in the
> Method
On Tue, 27 Jun 2023 13:57:31 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Tue, 27 Jun 2023 13:57:31 GMT, Chen Liang wrote:
>> This patch implements lazy initialization for VarHandle working on static
>> fields. It has a good initial call performance.
>>
>> We introduce a new internal API, `target()` to unpack a lazy VarHandle in VH
>> implementation methods. If c
On Fri, 9 Jun 2023 18:59:41 GMT, Paul Sandoz wrote:
>> Chen Liang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Remove meaningless target calls and clear outdated cache as needed
>
> Something was bothering me about the current complex
On Fri, 9 Jun 2023 18:59:41 GMT, Paul Sandoz wrote:
>> Chen Liang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Remove meaningless target calls and clear outdated cache as needed
>
> Something was bothering me about the current complex
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Fri, 9 Jun 2023 18:59:41 GMT, Paul Sandoz wrote:
>> Chen Liang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Remove meaningless target calls and clear outdated cache as needed
>
> Something was bothering me about the current complex
On Thu, 8 Jun 2023 01:32:20 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Thu, 8 Jun 2023 01:32:20 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Thu, 8 Jun 2023 00:12:39 GMT, Paul Sandoz wrote:
> Ok, yes, it's less likely now but possible a MH has been explicitly obtained
> before the defining class has been intialized. In this case I still think we
> can clear the table out after processing any existing entries, since
> subsequent
On Wed, 7 Jun 2023 22:38:29 GMT, Chen Liang wrote:
> > Change only the static field var handle implementations to call `target()`,
> > since it is unnecessary on the others.
>
> Unfortunately, I don't think there is a convenient way for VH implementations
> to easily unwrap the correct VH; a `
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Wed, 7 Jun 2023 20:26:47 GMT, Paul Sandoz wrote:
> Change only the static field var handle implementations to call `target()`,
> since it is unnecessary on the others.
Unfortunately, I don't think there is a convenient way for VH implementations
to easily unwrap the correct VH; a `target()`
On Wed, 7 Jun 2023 00:10:59 GMT, Paul Sandoz wrote:
>>> I believe instead of changing the guards we can change the implementation
>>> of the static methods on the concrete static VHs to call `asDirect()` (lets
>>> also add `@ForceInline` on `asDirect`), since `linkToStatic` will pass the
>>> a
On Wed, 7 Jun 2023 00:10:59 GMT, Paul Sandoz wrote:
>>> I believe instead of changing the guards we can change the implementation
>>> of the static methods on the concrete static VHs to call `asDirect()` (lets
>>> also add `@ForceInline` on `asDirect`), since `linkToStatic` will pass the
>>> a
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Tue, 6 Jun 2023 22:34:57 GMT, Chen Liang wrote:
> Is this aimed at decreasing long-term invocation cost or the initial
> invocation cost? FYI long-term invocation is already efficient enough; if
> this is for initial invocation, which can potentially bypass costly MH
> construction, I recom
On Tue, 6 Jun 2023 21:29:49 GMT, Paul Sandoz wrote:
> I believe instead of changing the guards we can change the implementation of
> the static methods on the concrete static VHs to call `asDirect()` (lets also
> add `@ForceInline` on `asDirect`), since `linkToStatic` will pass the args to
> t
On Fri, 2 Jun 2023 19:09:49 GMT, Mandy Chung wrote:
> > I wonder if it is possible to transition from an lazy (indirect) VH to a
> > direct VH once initialized i.e., `checkAccessModeThenIsDirect` returns the
> > value of `initialized`.
>
> Sounds a good idea. Once the class is initialized, the
On Sun, 4 Jun 2023 16:12:46 GMT, ExE Boss wrote:
>> Chen Liang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Improve subsequent VH call performance, thanks exeboss
>
> src/java.base/share/classes/java/lang/invoke/LazyInitializingVarHan
On Sun, 4 Jun 2023 13:23:46 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Sat, 3 Jun 2023 03:47:40 GMT, Chen Liang wrote:
>> src/java.base/share/classes/java/lang/invoke/LazyInitializingVarHandle.java
>> line 106:
>>
>>> 104: UNSAFE.ensureClassInitialized(refc);
>>> 105: this.initialized = true;
>>> 106: }
>>
>> This should probably have a fas
On Sat, 3 Jun 2023 02:25:59 GMT, ExE Boss wrote:
>> Chen Liang has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Remove lazy init of MH, for all invocation of the Lazy VH needs this MH
>
> src/java.base/share/classes/java/lang/invoke/LazyI
On Sat, 3 Jun 2023 00:16:23 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Sat, 3 Jun 2023 00:16:23 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Fri, 2 Jun 2023 02:37:13 GMT, Chen Liang wrote:
> I've also updated the benchmark for the latest patch. Unfortunately the
> regular invocations and lazy var handle initial call performance saw a
> decrease.
Maybe I misunderstood what you meant about "a decrease in performance".
> The indir
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Fri, 2 Jun 2023 22:50:21 GMT, Mandy Chung wrote:
> what performance results do you see with this change?
The indirect VH invocation already has a performance similar to the direct
invocation in JMH. Do you mean that I should add `asDirect` to the direct paths
in VH and check the benchmark r
On Fri, 2 Jun 2023 02:12:30 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Fri, 2 Jun 2023 16:29:13 GMT, Paul Sandoz wrote:
> I wonder if it is possible to transition from an lazy (indirect) VH to a
> direct VH once initialized i.e., `checkAccessModeThenIsDirect` returns the
> value of `initialized`. Thereby we reduce the potential footprint cost of
> inflating fu
On Fri, 2 Jun 2023 02:12:30 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Fri, 2 Jun 2023 02:12:30 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Fri, 2 Jun 2023 16:29:13 GMT, Paul Sandoz wrote:
> I wonder if it is possible to transition from an lazy (indirect) VH to a
> direct VH once initialized i.e., `checkAccessModeThenIsDirect` returns the
> value of `initialized`.
Sounds a good idea. Once the class is initialized, the lazy VH
On Fri, 2 Jun 2023 17:16:09 GMT, Mandy Chung wrote:
> > I think we only need to initialize Parent without initializing Child in
> > this case.
>
> The bytecode behavior to access the field via
> `lookup.findStaticVarHandle(Child.class, "value", int[].class)` is
> `Child.value;`. The class or
On Fri, 2 Jun 2023 02:37:13 GMT, Chen Liang wrote:
> I think we only need to initialize Parent without initializing Child in this
> case.
The bytecode behavior to access the field via
`lookup.findStaticVarHandle(Child.class, "value", int[].class)` is
`Child.value;`. The class or interface t
On Fri, 2 Jun 2023 02:12:30 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Fri, 2 Jun 2023 02:12:30 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Fri, 2 Jun 2023 01:19:26 GMT, Chen Liang wrote:
> In addition, should we initialize the ref class or the declaring class only?
> I don't think we need to initialize the ref class when declaring class
> initialization should be sufficient, but that is a change in behavior.
Declaring class wi
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Thu, 1 Jun 2023 21:26:25 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
On Thu, 1 Jun 2023 21:26:25 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indirec
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Thu, 1 Jun 2023 19:39:27 GMT, Mandy Chung wrote:
> As for the implementation of `LazyStaticVarHandle`, I expect that
> `makeFieldHandle` can always create the direct var handle (i.e.
> `FieldStaticReadXXX` var handle) and then wrapped by `LazyStaticVarHandle`
> similar to how `IndirectVarHa
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indire
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indire
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indire
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>> `Indire
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarHandle` to call `asDirect` lazily to accomodate the la
On Fri, 5 May 2023 13:08:33 GMT, Chen Liang wrote:
>> Also, perhaps @PaulSandoz knows more history on this one (I believe this
>> code predates FFM).
>
> Eh? I am not sure what you mean here. This is the essence of the patch, where
> the "TODO" above is fixed: lookup.findStaticVarHandle now cre
On Fri, 5 May 2023 13:02:05 GMT, Maurizio Cimadamore
wrote:
>> src/java.base/share/classes/java/lang/invoke/VarHandles.java line 110:
>>
>>> 108: }
>>> 109: else {
>>> 110: if (UNSAFE.shouldBeInitialized(refc)) {
>>
>> This seems unrelated to the issue this PR is re
On Fri, 5 May 2023 13:03:14 GMT, Chen Liang wrote:
>> src/java.base/share/classes/java/lang/invoke/IndirectVarHandle.java line 74:
>>
>>> 72: @Override
>>> 73: public boolean isAccessModeSupported(AccessMode accessMode) {
>>> 74: var directTarget = this.directTarget;
>>
>> Why i
On Fri, 5 May 2023 13:00:11 GMT, Maurizio Cimadamore
wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>
On Fri, 5 May 2023 13:01:09 GMT, Maurizio Cimadamore
wrote:
>> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>>
>> A few implementation-detail methods in VarHandle are now documented with the
>> implied constraints to avoid subtle problems in the future. Changed
>
On Fri, 5 May 2023 04:48:09 GMT, Chen Liang wrote:
> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
>
> A few implementation-detail methods in VarHandle are now documented with the
> implied constraints to avoid subtle problems in the future. Changed
> `IndirectVarH
Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`.
A few implementation-detail methods in VarHandle are now documented with the
implied constraints to avoid subtle problems in the future. Changed
`IndirectVarHandle` to call `asDirect` lazily to accomodate the lazy VarHand
80 matches
Mail list logo