Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-14 Thread Jorn Vernee
On Sat, 14 Nov 2020 07:55:35 GMT, Hui Shi wrote: >> Notice that the `/test` command is currently un-available (some >> implementation concerns are still under consideration). As an alternative, >> GitHub actions can be used to do basic automatic testing when pushes occur. >> >> However, pushes

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-14 Thread Hui Shi
On Fri, 13 Nov 2020 16:02:42 GMT, Jorn Vernee wrote: >> Thanks all! May this test-request get approved? > > Notice that the `/test` command is currently un-available (some > implementation concerns are still under consideration). As an alternative, > GitHub actions can be used to do basic autom

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-13 Thread Hui Shi
On Fri, 13 Nov 2020 16:02:42 GMT, Jorn Vernee wrote: >> Thanks all! May this test-request get approved? > > Notice that the `/test` command is currently un-available (some > implementation concerns are still under consideration). As an alternative, > GitHub actions can be used to do basic autom

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-13 Thread Jorn Vernee
On Fri, 13 Nov 2020 14:01:28 GMT, Hui Shi wrote: >> Thanks for the update, latest version looks good. > > Thanks all! May this test-request get approved? Notice that the `/test` command is currently un-available (some implementation concerns are still under consideration). As an alternative, Gi

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-13 Thread Hui Shi
On Fri, 13 Nov 2020 08:33:30 GMT, Alan Bateman wrote: >> Hui Shi has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new commit si

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-13 Thread Alan Bateman
On Fri, 13 Nov 2020 03:50:09 GMT, Hui Shi wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect concurre

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v5]

2020-11-12 Thread Hui Shi
On Thu, 12 Nov 2020 12:23:36 GMT, Alan Bateman wrote: >> @AlanBateman >> >>> What is the reason for using an int? I remember there was a suggestion for >>> three states but two states seems okay so curious why it was changed from >>> boolean to int. >> >> shipilev suggested not to use sub-wo

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v6]

2020-11-12 Thread Hui Shi
> …AccessorImpl object > > We met real problem when using protobuf with option optimized for code size, > detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 > > Optimize solution is adding a new boolean field to detect concurrent method > accessor generation in same NativeMethodAcce

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v5]

2020-11-12 Thread Alan Bateman
On Thu, 12 Nov 2020 04:23:37 GMT, Hui Shi wrote: >> src/java.base/share/classes/jdk/internal/reflect/NativeConstructorAccessorImpl.java >> line 44: >> >>> 42: private DelegatingConstructorAccessorImpl parent; >>> 43: private int numInvocations; >>> 44: private int generated; >> >>

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v5]

2020-11-11 Thread Hui Shi
On Wed, 11 Nov 2020 19:12:08 GMT, Alan Bateman wrote: >> Hui Shi has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. > > src/java.base/share/classes/jdk/internal/re

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v5]

2020-11-11 Thread Alan Bateman
On Wed, 11 Nov 2020 05:38:08 GMT, Hui Shi wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect concurre

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v5]

2020-11-11 Thread Aleksey Shipilev
On Wed, 11 Nov 2020 05:38:08 GMT, Hui Shi wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect concurre

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v2]

2020-11-10 Thread Hui Shi
On Tue, 10 Nov 2020 18:36:22 GMT, Aleksey Shipilev wrote: >> Hui Shi has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new commi

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v2]

2020-11-10 Thread Hui Shi
On Tue, 10 Nov 2020 18:28:11 GMT, Aleksey Shipilev wrote: >> Hui Shi has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new commi

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v5]

2020-11-10 Thread Hui Shi
> …AccessorImpl object > > We met real problem when using protobuf with option optimized for code size, > detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 > > Optimize solution is adding a new boolean field to detect concurrent method > accessor generation in same NativeMethodAcce

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v4]

2020-11-10 Thread Hui Shi
> …AccessorImpl object > > We met real problem when using protobuf with option optimized for code size, > detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 > > Optimize solution is adding a new boolean field to detect concurrent method > accessor generation in same NativeMethodAcce

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v3]

2020-11-10 Thread Hui Shi
> …AccessorImpl object > > We met real problem when using protobuf with option optimized for code size, > detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 > > Optimize solution is adding a new boolean field to detect concurrent method > accessor generation in same NativeMethodAcce

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v2]

2020-11-10 Thread Aleksey Shipilev
On Sun, 8 Nov 2020 05:07:07 GMT, Hui Shi wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect concurren

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v2]

2020-11-08 Thread Hui Shi
On Fri, 6 Nov 2020 08:58:13 GMT, Joel Borggrén-Franck wrote: > Are there any benchmarks to compare this accessor with the previous version > in the presumably common case where there is no or very little contention? > Edit to clarify: it is stated as "trivial" is this also measured somewhere?

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v2]

2020-11-07 Thread Hui Shi
On Thu, 5 Nov 2020 14:59:56 GMT, Alan Bateman wrote: >> I do wonder if it makes sense to handle triple-state `int` here: "not yet >> generated", "generated", "in error"? So that we don't try to generate the >> accessor over and over again when it is in error? > > If we are changing NativeMethod

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod… [v2]

2020-11-07 Thread Hui Shi
> …AccessorImpl object > > We met real problem when using protobuf with option optimized for code size, > detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 > > Optimize solution is adding a new boolean field to detect concurrent method > accessor generation in same NativeMethodAcce

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-06 Thread Joel Borggrén-Franck
On Fri, 6 Nov 2020 00:24:14 GMT, Hui Shi wrote: >> If we are changing NativeMethodAccessorImpl.invoke then we should probably >> do NativeConstructorAccessorImpl.newInstance at the same time. Also >> wondering if we should, while in the area, add "return acc.invoke(obj, >> args)" after setting

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread Hui Shi
On Thu, 5 Nov 2020 14:59:56 GMT, Alan Bateman wrote: > If we are changing NativeMethodAccessorImpl.invoke then we should probably do > NativeConstructorAccessorImpl.newInstance at the same time. Yes, NativeConstructorAccessorImpl should also apply this change. > Also wondering if we should, w

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread David Holmes
On 5/11/2020 7:09 pm, Aleksey Shipilev wrote: On Thu, 5 Nov 2020 02:52:05 GMT, Hui Shi wrote: …AccessorImpl object We met real problem when using protobuf with option optimized for code size, detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 Optimize solution is adding a new bo

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread Claes Redestad
On Thu, 5 Nov 2020 14:59:56 GMT, Alan Bateman wrote: >> I do wonder if it makes sense to handle triple-state `int` here: "not yet >> generated", "generated", "in error"? So that we don't try to generate the >> accessor over and over again when it is in error? > > If we are changing NativeMethod

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread Alan Bateman
On Thu, 5 Nov 2020 09:07:13 GMT, Aleksey Shipilev wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread Hui Shi
On Thu, 5 Nov 2020 09:05:55 GMT, Aleksey Shipilev wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread Hui Shi
On Thu, 5 Nov 2020 09:02:55 GMT, Aleksey Shipilev wrote: >> …AccessorImpl object >> >> We met real problem when using protobuf with option optimized for code size, >> detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 >> >> Optimize solution is adding a new boolean field to detect

Re: RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-05 Thread Aleksey Shipilev
On Thu, 5 Nov 2020 02:52:05 GMT, Hui Shi wrote: > …AccessorImpl object > > We met real problem when using protobuf with option optimized for code size, > detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 > > Optimize solution is adding a new boolean field to detect concurrent meth

RFR: 8255883: Avoid multiple GeneratedMethodAccessor for same NativeMethod…

2020-11-04 Thread Hui Shi
…AccessorImpl object We met real problem when using protobuf with option optimized for code size, detail in JBS https://bugs.openjdk.java.net/browse/JDK-8255883 Optimize solution is adding a new boolean field to detect concurrent method accessor generation in same NativeMethodAccessorImpl objec