Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Alan Bateman
On Sat, 16 Dec 2023 17:50:07 GMT, Markus KARG wrote: > Let's follow Alan's proposal and simply inline this. I didn't suggest inlining this. I just asked not to add a new package com.sun.io with a single method class. Also as the concerns with BAIS and BIS are not the same (they do overlap but

RFR: 8320707: Virtual thread test updates

2023-12-16 Thread Alan Bateman
A lot of test changes have accumulated in the loom repo, this includes both new tests and updates to existing tests. Some of these updates can be brought to the main line. This update brings over: - The existing tests for pinning use synchronized blocks. In preparation for changes to allow carr

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes

2023-12-16 Thread Chen Liang
On Sat, 16 Dec 2023 19:49:12 GMT, ExE Boss wrote: >> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy >> classes. >> >> This patch converts it to use Classfile API. >> >> It is continuation of https://github.com/openjdk/jdk/pull/10991 >> >> Any comments and suggestions ar

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes

2023-12-16 Thread ExE Boss
On Fri, 15 Dec 2023 12:54:27 GMT, Adam Sotona wrote: > java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcom

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v4]

2023-12-16 Thread Vladimir Sitnikov
On Sat, 16 Dec 2023 14:07:52 GMT, Markus KARG wrote: >> Fixes JDK-8322141 >> >> As suggested by @vlsi and documented by @bplb this PR does not return, but >> only sets the maximum result value. > > Markus KARG has updated the pull request incrementally with one additional > commit since the la

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v4]

2023-12-16 Thread Vladimir Sitnikov
On Sat, 16 Dec 2023 14:07:52 GMT, Markus KARG wrote: >> Fixes JDK-8322141 >> >> As suggested by @vlsi and documented by @bplb this PR does not return, but >> only sets the maximum result value. > > Markus KARG has updated the pull request incrementally with one additional > commit since the la

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v2]

2023-12-16 Thread Chen Liang
On Sat, 16 Dec 2023 17:28:13 GMT, ExE Boss wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added missing comment > > src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java > line 187: > >> 1

Re: RFR: 7036144: GZIPInputStream readTrailer uses faulty available() test for end-of-stream [v4]

2023-12-16 Thread Archie Cobbs
On Sat, 16 Dec 2023 05:53:34 GMT, Bernd wrote: > I wonder: if the stream does no longer depend on this `available()` condition > to be true, does that mean it’s no longer (indirectly) verified? I'm not sure I understand ... what do you mean by "verified"? If what you're saying is "Previously w

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v13]

2023-12-16 Thread Markus KARG
On Wed, 13 Dec 2023 08:41:37 GMT, Vladimir Sitnikov wrote: >> Sergey Tsypanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8320971: Fix JavaDoc > > test/jdk/java/io/BufferedInputStream/TransferToTrusted.java line 52: > >> 50:

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Markus KARG
On Sat, 16 Dec 2023 17:13:17 GMT, Chen Liang wrote: >>> If we drop the method for now I have to write it later again, I guess >> >> Maybe, but it's archived so it's easy enough. > > If this is only used after Module system is ready, we can use something like: > https://github.com/openjdk/jdk/blo

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Markus KARG
On Thu, 14 Dec 2023 08:47:03 GMT, Sergey Tsypanov wrote: >> It looks like we can skip copying of `byte[]` in >> `BufferedInputStream.implTransferTo()` for `OutputStreams` residing in >> `java.io`. >> >> See comment by @vlsi in >> https://github.com/openjdk/jdk/pull/10525/files#diff-e19c508d1b

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Markus KARG
On Sat, 16 Dec 2023 15:55:48 GMT, Brian Goetz wrote: >> @mkarg , thank you for the review, I replied in JIRA to avoid mixing >> comments across different issues: >> https://bugs.openjdk.org/browse/JDK-8321271?focusedId=14634794&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpan

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v4]

2023-12-16 Thread Markus KARG
On Sat, 16 Dec 2023 14:07:52 GMT, Markus KARG wrote: >> Fixes JDK-8322141 >> >> As suggested by @vlsi and documented by @bplb this PR does not return, but >> only sets the maximum result value. > > Markus KARG has updated the pull request incrementally with one additional > commit since the la

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v2]

2023-12-16 Thread ExE Boss
On Fri, 15 Dec 2023 12:26:50 GMT, Adam Sotona wrote: >> java.base java.lang.invoke package heavily uses ASM to generate lambdas and >> method handles. >> >> This patch converts ASM calls to Classfile API. >> >> This PR is continuation of https://github.com/openjdk/jdk/pull/12945 >> >> Any com

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Chen Liang
On Sat, 16 Dec 2023 00:11:05 GMT, Brian Burkhalter wrote: >> If we drop the method for now I have to write it later again, I guess > >> If we drop the method for now I have to write it later again, I guess > > Maybe, but it's archived so it's easy enough. If this is only used after Module syste

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v2]

2023-12-16 Thread Chen Liang
On Fri, 15 Dec 2023 12:26:50 GMT, Adam Sotona wrote: >> java.base java.lang.invoke package heavily uses ASM to generate lambdas and >> method handles. >> >> This patch converts ASM calls to Classfile API. >> >> This PR is continuation of https://github.com/openjdk/jdk/pull/12945 >> >> Any com

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Brian Goetz
On Sat, 16 Dec 2023 15:40:50 GMT, Vladimir Sitnikov wrote: >> @vlsi This is a very interesting solution 🤩, but it opens a number of >> questions! 🤔 As a start, here are mine: >> * You propose a new public method (`OutputStream.write(ByteBuffer)`) as part >> of your solution. We need to discuss

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Vladimir Sitnikov
On Sat, 16 Dec 2023 14:52:42 GMT, Markus KARG wrote: >> I've created a draft change for `OutputStream#write(ByteBuffer)`, and I have >> benchmarked several cases including >> `ByteArrayInputStream.transferTo(BufferedOutputStream(ByteArrayOutputStream))`, >> `ByteArrayInputStream.transferTo(Dat

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v2]

2023-12-16 Thread Chen Liang
On Fri, 15 Dec 2023 13:02:57 GMT, Adam Sotona wrote: >> src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java >> line 548: >> >>> 546: static ClassDesc classDesc(Class cls) { >>> 547: return cls.isHidden() ? >>> ClassDesc.ofInternalName(cls.getName().replace

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v2]

2023-12-16 Thread Chen Liang
On Fri, 15 Dec 2023 12:26:50 GMT, Adam Sotona wrote: >> java.base java.lang.invoke package heavily uses ASM to generate lambdas and >> method handles. >> >> This patch converts ASM calls to Classfile API. >> >> This PR is continuation of https://github.com/openjdk/jdk/pull/12945 >> >> Any com

Should Class.name field be @Stable?

2023-12-16 Thread -
Hello, I just noticed the Class.name field is mutable but not @Stable, meaning `Class.getName()` calls are not eligible for constant folding. The last update to this field is in 2019 in JDK-8216302 when the field initialization was done directly by a write from hotspot code (for the class name is

Re: RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

2023-12-16 Thread Markus KARG
On Sat, 16 Dec 2023 07:24:59 GMT, Vladimir Sitnikov wrote: >>>The backing array is not frozen so a read-only view doesn't address the >>>second part of the concern where the target keeps a reference. >> >> The users outside of OpenJDK would not have a reference to `byte[]`. >> Do you mean a re

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v3]

2023-12-16 Thread Vladimir Sitnikov
On Fri, 15 Dec 2023 18:37:53 GMT, Markus KARG wrote: >> Fixes JDK-8322141 >> >> As suggested by @vlsi and documented by @bplb this PR does not return, but >> only sets the maximum result value. > > Markus KARG has updated the pull request incrementally with one additional > commit since the la

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v4]

2023-12-16 Thread Markus KARG
> Fixes JDK-8322141 > > As suggested by @vlsi and documented by @bplb this PR does not return, but > only sets the maximum result value. Markus KARG has updated the pull request incrementally with one additional commit since the last revision: Test was using Integer but must use Long --

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v4]

2023-12-16 Thread Markus KARG
On Fri, 15 Dec 2023 22:40:17 GMT, Brian Burkhalter wrote: >>> > [...] maybe we need to come up with tests that quickly check the handling >>> > at this limit. >> >>> @mkarg Do you intend to provide any such test as part of this request? >> >> @bplb I quickly drafted an absolute minimal test fo

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v3]

2023-12-16 Thread Markus KARG
On Sat, 16 Dec 2023 08:56:16 GMT, Markus KARG wrote: >> test/jdk/java/io/SequenceInputStream/TransferTo.java line 160: >> >>> 158: pos++; >>> 159: return b; >>> 160: } >> >> To trigger the problematic case, we need to transfer more than >> `Long.MAX_

Re: RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v3]

2023-12-16 Thread Markus KARG
On Sat, 16 Dec 2023 07:02:57 GMT, Vladimir Sitnikov wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> New test asserts subsequent input stream is read when preceding stream >> already was MAX_VALUE long. > > test/jd