Re: RFR: 8334771: [TESTBUG] Run TestDockerMemoryMetrics.java with -Xcomp fails exitValue = 137

2024-07-18 Thread duke
On Mon, 24 Jun 2024 16:16:29 GMT, SendaoYan wrote: > Hi all, > After [JDK-8294960](https://bugs.openjdk.org/browse/JDK-8294960), the > footprint memory usage increased significantly when run the testcase with > -Xcomp jvm options, then cause the testcase was killed by docker by OOM. > Maybe

Re: [jdk23] RFR: 8325280: Update troff manpages in JDK 23 before RC

2024-07-18 Thread David Holmes
On Fri, 19 Jul 2024 05:47:15 GMT, David Holmes wrote: > Before RC we need to update the man pages in the repo from their Markdown > sources. All pages at a minimum have 23-ea replaced with 23, and publication > year set to 2024 if needed. > > This also picks up the unpublished changes to java.

[jdk23] RFR: 8325280: Update troff manpages in JDK 23 before RC

2024-07-18 Thread David Holmes
Before RC we need to update the man pages in the repo from their Markdown sources. All pages at a minimum have 23-ea replaced with 23, and publication year set to 2024 if needed. This also picks up the unpublished changes to java.1 from: - [JDK-8324836](https://bugs.openjdk.org/browse/JDK-83248

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Jaikiran Pai
On Thu, 18 Jul 2024 20:51:48 GMT, Naoto Sato wrote: >> Proposing a new overload method for `Process#waitFor()` which takes a >> `Duration` for the timeout value. This will reduce the possibility for >> making mistakes with the `TimeUnit` in the other overload method. A >> corresponding CSR has

Re: RFR: 8334771: [TESTBUG] Run TestDockerMemoryMetrics.java with -Xcomp fails exitValue = 137

2024-07-18 Thread Jaikiran Pai
On Thu, 18 Jul 2024 11:42:17 GMT, SendaoYan wrote: >> Hi all, >> After [JDK-8294960](https://bugs.openjdk.org/browse/JDK-8294960), the >> footprint memory usage increased significantly when run the testcase with >> -Xcomp jvm options, then cause the testcase was killed by docker by OOM. >>

Re: RFR: 4452735: Add GZIPOutputStream constructor to specify Deflater

2024-07-18 Thread Jaikiran Pai
On Wed, 17 Jul 2024 21:07:23 GMT, Archie Cobbs wrote: > The class `GZIPOutputStream` extends `DeflaterOutputStream`, which is logical > because the GZIP encoding is based on ZLIB "deflate" encoding. > > However, while `DeflaterOutputStream` provides constructors that take a > custom `Deflater`

Re: RFR: 8336792: DateTimeFormatterBuilder append zeros based on StringBuilder.repeat

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 23:36:37 GMT, Shaojin Wen wrote: > The StringBuilder.repeat method was added in JDK 21, which can be used to > make some minor optimizations to existing code, including > DateTimeFormatterBuilder Looks good and simple. - Marked as reviewed by liach (Reviewer).

RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation

2024-07-18 Thread Chen Liang
`TypeAnnotation` is not an annotation, as it should not be used in places like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an annotation at a given location instead of to be an annotation. Depends on #20205. - Depends on: https://git.openjdk.org/jdk/pull/20205 C

Re: RFR: 8333396: Use StringBuilder internally for java.text.Format.* formatting [v17]

2024-07-18 Thread lingjun-cg
On Mon, 8 Jul 2024 16:31:23 GMT, Naoto Sato wrote: >> Quick question about the violation of the "This is equivalent to" spec: Does >> our new implementation lead to any observable side effects that make the >> returned results or thrown exceptions different from that of `format(obj, >> new Str

RFR: 8336792: DateTimeFormatterBuilder append zeros based on StringBuilder.repeat

2024-07-18 Thread Shaojin Wen
The StringBuilder.repeat method was added in JDK 21, which can be used to make some minor optimizations to existing code, including DateTimeFormatterBuilder - Commit messages: - use StringBuilder#repeat append zeros Changes: https://git.openjdk.org/jdk/pull/20245/files Webrev: ht

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Naoto Sato
On Thu, 18 Jul 2024 23:02:53 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Process.java line 504: >> >>> 502: */ >>> 503: public boolean waitFor(Duration duration) throws >>> InterruptedException { >>> 504: Objects.requireNonNull(duration, "duration"); >> >>

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Pavel Rappo
On Thu, 18 Jul 2024 20:51:48 GMT, Naoto Sato wrote: >> Proposing a new overload method for `Process#waitFor()` which takes a >> `Duration` for the timeout value. This will reduce the possibility for >> making mistakes with the `TimeUnit` in the other overload method. A >> corresponding CSR has

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 22:57:59 GMT, Pavel Rappo wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> removed a blank line > > src/java.base/share/classes/java/lang/Process.java line 504: > >> 502: */ >> 503: publi

Re: RFR: 8335939: Hide element writing across the ClassFile API [v2]

2024-07-18 Thread Chen Liang
> `WritableElement` has always been one of the biggest peculiarities of > ClassFile API: it exposes element writing yet has no corresponding reading > ability exposed. Its existence creates a lot of API noise, increasing > maintenance cost in the long run. (This is an iceberg whose tip was expos

Re: RFR: 4452735: Add GZIPOutputStream constructor to specify Deflater

2024-07-18 Thread Chen Liang
On Wed, 17 Jul 2024 21:07:23 GMT, Archie Cobbs wrote: > The class `GZIPOutputStream` extends `DeflaterOutputStream`, which is logical > because the GZIP encoding is based on ZLIB "deflate" encoding. > > However, while `DeflaterOutputStream` provides constructors that take a > custom `Deflater`

Re: RFR: 8334772: Change Class::signers to an explicit field [v3]

2024-07-18 Thread David Holmes
On Thu, 18 Jul 2024 13:48:06 GMT, Chen Liang wrote: >> `Class` has 2 VM-injected fields that can be made explicit: `Object[] >> signers` and `ProtectionDomain protectionDomain`. We make the signers field >> explicit. (The ProtectionDomain can be revisited when SecurityManager is >> removed, as

RFR: 8336777: BufferedMethodBuilder not initialized with static flag

2024-07-18 Thread Chen Liang
`BufferedMethodBuilder` accepts a static flag and passes it to the `CodeBuilder` it creates; yet it does not prevent static flag tampering like `DirectMethodBuilder` does. This patch makes their behaviors consistent. Note that the throwing of IAE is provisional; it is open to discussion later.

Re: RFR: 8334772: Change Class::signers to an explicit field [v3]

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 13:48:06 GMT, Chen Liang wrote: >> `Class` has 2 VM-injected fields that can be made explicit: `Object[] >> signers` and `ProtectionDomain protectionDomain`. We make the signers field >> explicit. (The ProtectionDomain can be revisited when SecurityManager is >> removed, as

Integrated: 8334772: Change Class::signers to an explicit field

2024-07-18 Thread Chen Liang
On Wed, 17 Jul 2024 19:47:44 GMT, Chen Liang wrote: > `Class` has 2 VM-injected fields that can be made explicit: `Object[] > signers` and `ProtectionDomain protectionDomain`. We make the signers field > explicit. (The ProtectionDomain can be revisited when SecurityManager is > removed, as Sec

Re: RFR: 8333812: ClassFile.verify() can throw exceptions instead of returning VerifyErrors

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 16:29:17 GMT, Chen Liang wrote: >> `ClassFile.verify()` should always return list of verification errors and >> never throw an exception, even for corrupted classes. >> `BoundAttribute` initializations of `LocalVariableTable` and >> `LocalVariableTypeTable` attributes do not

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Naoto Sato
On Thu, 18 Jul 2024 21:32:31 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Process.java line 505: >> >>> 503: public boolean waitFor(Duration duration) throws >>> InterruptedException { >>> 504: Objects.requireNonNull(duration, "duration"); >>> 505: return

Integrated: 8336585: BoundAttribute.readEntryList not type-safe

2024-07-18 Thread Chen Liang
On Wed, 17 Jul 2024 20:51:32 GMT, Chen Liang wrote: > Qualify the reading of entry lists with the anticipated types up-front, so we > throw the correct `ConstantPoolException` instead of `ClassCastException` > when we encounter malformed attribute lists. (`ClassModel.getInterfaces` > already b

Integrated: 8336588: Ensure Transform downstream receives upstream start items only after downstream started

2024-07-18 Thread Chen Liang
On Wed, 17 Jul 2024 21:31:51 GMT, Chen Liang wrote: > There's another bug in ClassFile transform composition where the downstream > transform receives items from upstream transform's chained builders before > the downstream transform itself starts. This is a simple fix, and a test case > again

Re: RFR: 8328995: Launcher can't open jar files where the offset of the manifest is >4GB [v7]

2024-07-18 Thread Liam Miller-Cushon
On Tue, 4 Jun 2024 17:43:24 GMT, Liam Miller-Cushon wrote: >> This change fixes a zip64 bug in the launcher that is prevent it from >> reading the manifest of jars where the 'relative offset of local header' >> field in the central directory entry is >4GB. As described in APPNOTE.TXT >> 4.5.3,

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 21:27:35 GMT, Roger Riggs wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> removed a blank line > > src/java.base/share/classes/java/lang/Process.java line 505: > >> 503: public boolean waitFo

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Roger Riggs
On Thu, 18 Jul 2024 20:51:48 GMT, Naoto Sato wrote: >> Proposing a new overload method for `Process#waitFor()` which takes a >> `Duration` for the timeout value. This will reduce the possibility for >> making mistakes with the `TimeUnit` in the other overload method. A >> corresponding CSR has

Re: RFR: 8328995: Launcher can't open jar files where the offset of the manifest is >4GB [v8]

2024-07-18 Thread Liam Miller-Cushon
> This change fixes a zip64 bug in the launcher that is prevent it from reading > the manifest of jars where the 'relative offset of local header' field in the > central directory entry is >4GB. As described in APPNOTE.TXT 4.5.3, the > offset is too large to be stored in the central directory it

Re: RFR: 8334772: Change Class::signers to an explicit field [v3]

2024-07-18 Thread David Holmes
On Thu, 18 Jul 2024 13:48:06 GMT, Chen Liang wrote: >> `Class` has 2 VM-injected fields that can be made explicit: `Object[] >> signers` and `ProtectionDomain protectionDomain`. We make the signers field >> explicit. (The ProtectionDomain can be revisited when SecurityManager is >> removed, as

Re: RFR: 8328995: Launcher can't open jar files where the offset of the manifest is >4GB [v7]

2024-07-18 Thread Liam Miller-Cushon
On Thu, 18 Jul 2024 14:55:31 GMT, Jaikiran Pai wrote: >> Liam Miller-Cushon has updated the pull request with a new target base due >> to a merge or a rebase. The incremental webrev excludes the unrelated >> changes brought in by the merge/rebase. The pull request contains eight >> additional

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v2]

2024-07-18 Thread Naoto Sato
On Thu, 18 Jul 2024 05:11:12 GMT, Jaikiran Pai wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> ProcessTools overriding one-arg waitFor() > > src/java.base/share/classes/java/lang/Process.java line 501: > >> 499:

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Chen Liang
On Wed, 17 Jul 2024 21:42:15 GMT, Naoto Sato wrote: >> This method needs to be overridden in  >> `test/lib/jdk/test/lib/process/ProcessTools.java` to call >> `ProcessTools.ProcessImpl::waitForStreams`. > > I don't think current `ProcessTools.startProcess()` even calls `waitFor(long, > TimeUnit)

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 20:51:48 GMT, Naoto Sato wrote: >> Proposing a new overload method for `Process#waitFor()` which takes a >> `Duration` for the timeout value. This will reduce the possibility for >> making mistakes with the `TimeUnit` in the other overload method. A >> corresponding CSR has

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-18 Thread Naoto Sato
> Proposing a new overload method for `Process#waitFor()` which takes a > `Duration` for the timeout value. This will reduce the possibility for making > mistakes with the `TimeUnit` in the other overload method. A corresponding > CSR has also been drafted. Naoto Sato has updated the pull reque

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v3]

2024-07-18 Thread Naoto Sato
On Thu, 18 Jul 2024 19:07:18 GMT, Roger Riggs wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Addressing review comments > > src/java.base/share/classes/java/lang/Process.java line 504: > >> 502: return

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v4]

2024-07-18 Thread Naoto Sato
> Proposing a new overload method for `Process#waitFor()` which takes a > `Duration` for the timeout value. This will reduce the possibility for making > mistakes with the `TimeUnit` in the other overload method. A corresponding > CSR has also been drafted. Naoto Sato has updated the pull reque

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v2]

2024-07-18 Thread Vladimir Ivanov
On Thu, 18 Jul 2024 20:07:14 GMT, Vladimir Ivanov wrote: >> I think not. It'd complicate C++ runtime for no useful reason. > > On the other hand, if `-XX:-UseSecondarySupersTable` is intended solely for > diagnostic purposes, then handling all possible execution modes uniformly is > preferable,

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v2]

2024-07-18 Thread Vladimir Ivanov
On Wed, 17 Jul 2024 17:15:32 GMT, Andrew Haley wrote: >> src/hotspot/share/oops/klass.inline.hpp line 122: >> >>> 120: return true; >>> 121: >>> 122: bool result = lookup_secondary_supers_table(k); >> >> Should `UseSecondarySupersTable` affect `Klass::search_secondary_supers` as >> well

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v2]

2024-07-18 Thread Vladimir Ivanov
On Thu, 18 Jul 2024 16:35:16 GMT, Andrew Haley wrote: >> On a second thought the following setter may be the culprit: >> >> void Klass::set_secondary_supers(Array* secondaries) { >> assert(!UseSecondarySupersTable || secondaries == nullptr, ""); >> set_secondary_supers(secondaries, SECONDARY

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v3]

2024-07-18 Thread Roger Riggs
On Thu, 18 Jul 2024 18:16:48 GMT, Naoto Sato wrote: >> Proposing a new overload method for `Process#waitFor()` which takes a >> `Duration` for the timeout value. This will reduce the possibility for >> making mistakes with the `TimeUnit` in the other overload method. A >> corresponding CSR has

Re: RFR: 8315034 : File.mkdirs() occasionally fails to create folders on Windows shared folder

2024-07-18 Thread Brian Burkhalter
On Thu, 18 Jul 2024 19:16:03 GMT, Weibing Xiao wrote: > It was not backport to jdk8u. https://bugs.openjdk.org/browse/JDK-8321863 is > for 8u411-perf, which is not same as jdk8u release. Thanks for the clarification. - PR Comment: https://git.openjdk.org/jdk/pull/16502#issuecommen

Re: RFR: 8315034 : File.mkdirs() occasionally fails to create folders on Windows shared folder

2024-07-18 Thread Weibing Xiao
On Fri, 3 Nov 2023 18:11:10 GMT, Weibing Xiao wrote: > File.mkdirs() occasionally fails to create folders on Windows shared folders. > It turned out that Windows API FindFirstFileW created the error > ERROR_NO_MORE_FILES. In some of the cases with a valid file path, this error > still returns

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v2]

2024-07-18 Thread Vladimir Ivanov
On Thu, 18 Jul 2024 16:40:47 GMT, Andrew Haley wrote: >> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1040: >> >>> 1038: >>> 1039: // Secondary subtype checking >>> 1040: void lookup_secondary_supers_table(Register sub_klass, >> >> While browsing the code, I noticed that it's fa

Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-07-18 Thread Vicente Romero
On Wed, 17 Jul 2024 08:59:07 GMT, Adam Sotona wrote: >> Class-File API is leaving preview. >> This is a removal of all `@PreviewFeature` annotations from Class-File API. >> It also bumps all `@since` tags and removes >> `jdk.internal.javac.PreviewFeature.Feature.CLASSFILE_API`. >> >> Please rev

Re: RFR: 8315034 : File.mkdirs() occasionally fails to create folders on Windows shared folder

2024-07-18 Thread Brian Burkhalter
On Thu, 11 Jul 2024 13:10:32 GMT, Olivier Masseau wrote: > Hello, Has this been backported to Java 8 ? I can't really find the info. According to the issue [JDK-8321863](https://bugs.openjdk.org/browse/JDK-8321863) it looks like it has been so backported. - PR Comment: https://gi

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v3]

2024-07-18 Thread Naoto Sato
> Proposing a new overload method for `Process#waitFor()` which takes a > `Duration` for the timeout value. This will reduce the possibility for making > mistakes with the `TimeUnit` in the other overload method. A corresponding > CSR has also been drafted. Naoto Sato has updated the pull reque

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 16:14:02 GMT, fabioromano1 wrote: >> I guess you are concerned about an overflow in `s2 + 2 * s`? >> >> If s = 2^32 - 1, then s2 = 2^64 - 2·2^32 + 1 and 2s = 2·2^32 - 2, without >> overflows. >> Thus, s2 + 2s = 2^64 - 1, without overflows. > > @rgiulietti True, it's almost b

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v2]

2024-07-18 Thread Andrew Haley
> This patch expands the use of a hash table for secondary superclasses > to the interpreter, C1, and runtime. It also adds a C2 implementation > of hashed lookup in cases where the superclass isn't known at compile > time. > > HotSpot shared runtime > -- > > Building hashed s

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v34]

2024-07-18 Thread fabioromano1
> I have implemented the Zimmermann's square root algorithm, available in works > [here](https://inria.hal.science/inria-00072854/en/) and > [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). > > The algorithm is proved to be asymptotically faster than the New

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat [v4]

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 15:43:05 GMT, Shaojin Wen wrote: >> class LocalTime { >> public String toString() { >> // ... >> if (nanoValue % 1000_000 == 0) { >> buf.append(Integer.toString((nanoValue / 1000_000) + >> 1000).substring(1)); >>

RFR: 8333812: ClassFile.verify() can throw exceptions instead of returning VerifyErrors

2024-07-18 Thread Adam Sotona
`ClassFile.verify()` should always return list of verification errors and never throw an exception, even for corrupted classes. `BoundAttribute` initializations of `LocalVariableTable` and `LocalVariableTypeTable` attributes do not expect invalid possible locations and cause `ClassCastException`

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v33]

2024-07-18 Thread fabioromano1
> I have implemented the Zimmermann's square root algorithm, available in works > [here](https://inria.hal.science/inria-00072854/en/) and > [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). > > The algorithm is proved to be asymptotically faster than the New

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter

2024-07-18 Thread Andrew Haley
On Thu, 11 Jul 2024 23:39:11 GMT, Vladimir Ivanov wrote: >> This patch expands the use of a hash table for secondary superclasses >> to the interpreter, C1, and runtime. It also adds a C2 implementation >> of hashed lookup in cases where the superclass isn't known at compile >> time. >> >> HotSp

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter

2024-07-18 Thread Andrew Haley
On Thu, 11 Jul 2024 23:22:19 GMT, Vladimir Ivanov wrote: >> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 1433: >> >>> 1431: >>> 1432: // Don't check secondary_super_cache >>> 1433: if (super_check_offset.is_register() >> >> Do you see any effects from this particular change? >>

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter

2024-07-18 Thread Andrew Haley
On Wed, 17 Jul 2024 18:54:32 GMT, Vladimir Ivanov wrote: >> Now it starts to sound concerning... `Klass::set_secondary_supers()` >> initializes both `_secondary_supers` and `_bitmap` which implies that >> `Klass::is_subtype_of()` may be called on not yet initialized Klass. It >> that's the cas

Integrated: 8333768: Minor doc updates to java.lang.{Float, Double}

2024-07-18 Thread Joe Darcy
On Fri, 7 Jun 2024 04:47:12 GMT, Joe Darcy wrote: > Misc small doc updates and addition of `@Overrides` annotations. This pull request has now been integrated. Changeset: bbc79a5e Author:Joe Darcy URL: https://git.openjdk.org/jdk/commit/bbc79a5e0144cb5ee6051e078681f9c6821441cb Stats

Re: RFR: 8333812: ClassFile.verify() can throw exceptions instead of returning VerifyErrors

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 16:23:44 GMT, Adam Sotona wrote: > `ClassFile.verify()` should always return list of verification errors and > never throw an exception, even for corrupted classes. > `BoundAttribute` initializations of `LocalVariableTable` and > `LocalVariableTypeTable` attributes do not ex

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 16:06:31 GMT, Raffaello Giulietti wrote: >>> Experimentally, the following seems a bit faster. In some cases, it avoids >>> a full multiplication, some updates, and has one less test. I hope it is >>> correct as well ;-) >> >> It's a nice code, but I'm afraid that if `s ==

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 15:55:08 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 2032: >> >>> 2030: s = s1; >>> 2031: } >>> 2032: return s; >> >> Experimentally, the following seems a bit faster. >> In some cases, it avoi

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 15:27:53 GMT, Raffaello Giulietti wrote: > Experimentally, the following seems a bit faster. In some cases, it avoids a > full multiplication, some updates, and has one less test. I hope it is > correct as well ;-) It's a nice code, but I'm afraid that if `s == LONG_MASK`

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 15:22:39 GMT, Raffaello Giulietti wrote: >> I found the way: I can test directly the code through >> `java.math.Accessor.java` > > I think there's a misunderstanding here. > > What I'd like to see is a test that verifies the claim > > /* For every long value s in [

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat [v2]

2024-07-18 Thread Shaojin Wen
> class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else if (nanoValue % 1000 == 0) { > buf

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat [v4]

2024-07-18 Thread Shaojin Wen
> class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else if (nanoValue % 1000 == 0) { > buf

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat [v3]

2024-07-18 Thread Shaojin Wen
On Thu, 18 Jul 2024 15:28:23 GMT, Shaojin Wen wrote: >> class LocalTime { >> public String toString() { >> // ... >> if (nanoValue % 1000_000 == 0) { >> buf.append(Integer.toString((nanoValue / 1000_000) + >> 1000).substring(1)); >>

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 13:09:08 GMT, fabioromano1 wrote: >> I have implemented the Zimmermann's square root algorithm, available in >> works [here](https://inria.hal.science/inria-00072854/en/) and >> [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). >> >> The

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat [v3]

2024-07-18 Thread Shaojin Wen
> class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else if (nanoValue % 1000 == 0) { > buf

Re: RFR: 8335480: Only deoptimize threads if needed when closing shared arena [v3]

2024-07-18 Thread Maurizio Cimadamore
On Mon, 15 Jul 2024 16:30:11 GMT, Maurizio Cimadamore wrote: > * there is some issue involving segment access with `int` induction variable > which we should investigate separately This issue is tracked here: https://bugs.openjdk.org/browse/JDK-8336759 - PR Comment: https://git.o

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 15:09:41 GMT, fabioromano1 wrote: >>> I mean only restricted to unsigned `long` perfect squares, something like >>> the following, but written as a proper test >>> >>> ``` >>> long i = 0; >>> for (; i < 1L << 32; ++i) { >>> long x = i * i; >>>

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 15:01:22 GMT, fabioromano1 wrote: >> It takes about 5 s on my laptop. > >> I mean only restricted to unsigned `long` perfect squares, something like >> the following, but written as a proper test >> >> ``` >> long i = 0; >> for (; i < 1L << 32; ++i) { >>

Re: RFR: 8334772: Change Class::signers to an explicit field [v3]

2024-07-18 Thread Roger Riggs
On Thu, 18 Jul 2024 13:48:06 GMT, Chen Liang wrote: >> `Class` has 2 VM-injected fields that can be made explicit: `Object[] >> signers` and `ProtectionDomain protectionDomain`. We make the signers field >> explicit. (The ProtectionDomain can be revisited when SecurityManager is >> removed, as

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 14:55:30 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 2135: >> >>> 2133: * @param limit the offset which is the end of valid words in the >>> input value >>> 2134: * @param blockLen the length of the block in units o

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Brett Okken
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 14:50:00 GMT, Raffaello Giulietti wrote: >> I mean only restricted to unsigned `long` perfect squares, something like >> the following, but written as a proper test >> >> >> long i = 0; >> for (; i < 1L << 32; ++i) { >> long x = i * i; >>

Re: RFR: 8328995: Launcher can't open jar files where the offset of the manifest is >4GB [v7]

2024-07-18 Thread Jaikiran Pai
On Tue, 4 Jun 2024 17:43:24 GMT, Liam Miller-Cushon wrote: >> This change fixes a zip64 bug in the launcher that is prevent it from >> reading the manifest of jars where the 'relative offset of local header' >> field in the central directory entry is >4GB. As described in APPNOTE.TXT >> 4.5.3,

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 13:40:38 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> More accurate comment > > src/java.base/share/classes/java/math/MutableBigInteger.java line 2135: > >> 2133:

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 14:39:16 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1973: >> >>> 1971: >>> 1972: /* For every long value s in [0, 2^32) such that x == s * >>> s, >>> 1973: * it is true that s == Math.round(Math.sqr

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 14:49:19 GMT, Raffaello Giulietti wrote: >> I did it, although I'm afraid it takes up too much running time due to the >> overhead of BigInteger's wrapping... > > I mean only restricted to unsigned `long` perfect squares, something like the > following, but written as a pro

Re: RFR: 8334394: Race condition in Class::protectionDomain [v2]

2024-07-18 Thread Roger Riggs
On Mon, 17 Jun 2024 15:24:27 GMT, Weijun Wang wrote: >> Make sure `pd` is always the same object when `getProtectionDomain0` is null. > > Weijun Wang has updated the pull request incrementally with one additional > commit since the last revision: > > explain why the test is related to the fix

Re: RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v12]

2024-07-18 Thread Jan Kratochvil
On Fri, 12 Jul 2024 13:12:11 GMT, Severin Gehwolf wrote: > There ought to be a way to remove the duplication between cgv1 and cgv2's > impl of `adjust_controller()` but I haven't spent time on that. I have tied to implemented but I am fine to drop it if you don't like it. - PR Com

Re: RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v15]

2024-07-18 Thread Jan Kratochvil
> The testcase requires root permissions. > > Fix by Severin Gehwolf. > Testcase by Jan Kratochvil. Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision: Unify 4 copies of adjust_controller() - Changes: - all: https://gi

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 13:39:01 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> More accurate comment > > src/java.base/share/classes/java/math/MutableBigInteger.java line 1973: > >> 1971:

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Shaojin Wen
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Roger Riggs
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Shaojin Wen
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8334771: [TESTBUG] Run TestDockerMemoryMetrics.java with -Xcomp fails exitValue = 137

2024-07-18 Thread Adam Sotona
On Mon, 24 Jun 2024 16:16:29 GMT, SendaoYan wrote: > Hi all, > After [JDK-8294960](https://bugs.openjdk.org/browse/JDK-8294960), the > footprint memory usage increased significantly when run the testcase with > -Xcomp jvm options, then cause the testcase was killed by docker by OOM. > Maybe

Re: RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v14]

2024-07-18 Thread Severin Gehwolf
On Mon, 15 Jul 2024 07:02:11 GMT, Jan Kratochvil wrote: >> The testcase requires root permissions. >> >> Fix by Severin Gehwolf. >> Testcase by Jan Kratochvil. > > Jan Kratochvil has updated the pull request incrementally with one additional > commit since the last revision: > > Fix a need

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8334772: Change Class::signers to an explicit field [v3]

2024-07-18 Thread Chen Liang
> `Class` has 2 VM-injected fields that can be made explicit: `Object[] > signers` and `ProtectionDomain protectionDomain`. We make the signers field > explicit. (The ProtectionDomain can be revisited when SecurityManager is > removed, as SecurityManager is accessing it via JNI as well.) > > Mi

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Shaojin Wen
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v30]

2024-07-18 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 15:33:39 GMT, fabioromano1 wrote: >> I have implemented the Zimmermann's square root algorithm, available in >> works [here](https://inria.hal.science/inria-00072854/en/) and >> [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). >> >> The

Re: RFR: 8334772: Change Class::signers to an explicit field [v2]

2024-07-18 Thread Alan Bateman
On Thu, 18 Jul 2024 13:31:02 GMT, Chen Liang wrote: >> `Class` has 2 VM-injected fields that can be made explicit: `Object[] >> signers` and `ProtectionDomain protectionDomain`. We make the signers field >> explicit. (The ProtectionDomain can be revisited when SecurityManager is >> removed, as

Re: RFR: 8334772: Change Class::signers to an explicit field [v2]

2024-07-18 Thread Chen Liang
> `Class` has 2 VM-injected fields that can be made explicit: `Object[] > signers` and `ProtectionDomain protectionDomain`. We make the signers field > explicit. (The ProtectionDomain can be revisited when SecurityManager is > removed, as SecurityManager is accessing it via JNI as well.) > > Mi

Re: RFR: 8336741: Optimize LocalTime.toString with StringBuilder.repeat

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 11:32:47 GMT, Shaojin Wen wrote: > class LocalTime { > public String toString() { > // ... > if (nanoValue % 1000_000 == 0) { > buf.append(Integer.toString((nanoValue / 1000_000) + > 1000).substring(1)); > } else

Re: RFR: 8334772: Change Class::signers to an explicit field

2024-07-18 Thread Coleen Phillimore
On Wed, 17 Jul 2024 19:47:44 GMT, Chen Liang wrote: > `Class` has 2 VM-injected fields that can be made explicit: `Object[] > signers` and `ProtectionDomain protectionDomain`. We make the signers field > explicit. (The ProtectionDomain can be revisited when SecurityManager is > removed, as Sec

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

2024-07-18 Thread fabioromano1
> I have implemented the Zimmermann's square root algorithm, available in works > [here](https://inria.hal.science/inria-00072854/en/) and > [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). > > The algorithm is proved to be asymptotically faster than the New

Re: RFR: 8334772: Change Class::signers to an explicit field

2024-07-18 Thread Chen Liang
On Wed, 17 Jul 2024 19:47:44 GMT, Chen Liang wrote: > `Class` has 2 VM-injected fields that can be made explicit: `Object[] > signers` and `ProtectionDomain protectionDomain`. We make the signers field > explicit. (The ProtectionDomain can be revisited when SecurityManager is > removed, as Sec

Re: RFR: 8334772: Change Class::signers to an explicit field

2024-07-18 Thread Alan Bateman
On Thu, 18 Jul 2024 12:30:24 GMT, Coleen Phillimore wrote: > There's a change in the heapDumper.cpp that probably has to change also, > because I think we're now dumping signers twice (two lines). The HPROF heap dump has a slot for signers so have to keep that to avoid breakage. So yes, it mea

Re: RFR: 8334755: Asymptotically faster implementation of square root algorithm [v31]

2024-07-18 Thread fabioromano1
> I have implemented the Zimmermann's square root algorithm, available in works > [here](https://inria.hal.science/inria-00072854/en/) and > [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). > > The algorithm is proved to be asymptotically faster than the New

Re: RFR: 8334772: Change Class::signers to an explicit field

2024-07-18 Thread Coleen Phillimore
On Wed, 17 Jul 2024 19:47:44 GMT, Chen Liang wrote: > `Class` has 2 VM-injected fields that can be made explicit: `Object[] > signers` and `ProtectionDomain protectionDomain`. We make the signers field > explicit. (The ProtectionDomain can be revisited when SecurityManager is > removed, as Sec

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v2]

2024-07-18 Thread Chen Liang
On Thu, 18 Jul 2024 06:22:25 GMT, Alan Bateman wrote: >> I am planning to add `@implSpec` with a separate issue: >> [JDK-8336679](https://bugs.openjdk.org/browse/JDK-8336679) > > Okay, just a bit strange to add waitFor(Duration) here and then follow-up > immediately to change it to move the tex

  1   2   >