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

2024-07-17 Thread SendaoYan
On Thu, 18 Jul 2024 05:52:51 GMT, Jaikiran Pai wrote: > So I think we should have this increase in memory reviewed by @asotona or > someone familiar in that area, before deciding whether these tests should be > changed. Okey. - PR Comment: https://git.openjdk.org/jdk/pull/19864#i

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

2024-07-17 Thread Alan Bateman
On Wed, 17 Jul 2024 21:42:17 GMT, Naoto Sato wrote: >> It will be addressed by https://bugs.openjdk.org/browse/JDK-8336679 > > 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) h

Re: RFR: 8266431: Dual-Pivot Quicksort improvements (Radix sort) [v11]

2024-07-17 Thread Vladimir Yaroslavskiy
On Sun, 22 Oct 2023 17:26:52 GMT, Laurent Bourgès wrote: >> * improved mixed insertion sort (makes whole sorting faster) >> * introduced Radix which sort shows several times boost of performance and >> has linear complexity instead of n*ln(n) >> * improved merging sort for almost sorted data >>

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

2024-07-17 Thread Jaikiran Pai
On Mon, 24 Jun 2024 16:16:29 GMT, SendaoYan wrote: > 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 the footprint m

RFR: 8336706: Optimize LocalDate.toString with StringBuilder.repeat

2024-07-17 Thread Shaojin Wen
class LocalDate { public String toString() { if (absYear < 1000) { if (yearValue < 0) { buf.append(yearValue - 1).deleteCharAt(1); } else { buf.append(yearValue + 1).deleteCharAt(0); } // ... } } Cur

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

2024-07-17 Thread Jaikiran Pai
On Wed, 17 Jul 2024 21:41:16 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) [v2]

2024-07-17 Thread Jaikiran Pai
On Wed, 17 Jul 2024 21:41:16 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) [v2]

2024-07-17 Thread Jaikiran Pai
On Wed, 17 Jul 2024 21:41:16 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

Withdrawn: 8331196: vector api: Remove unnecessary index check in Byte/ShortVector.fromArray/fromArray0Template

2024-07-17 Thread duke
On Fri, 26 Apr 2024 14:06:02 GMT, Hamlin Li wrote: > Hi, > Can you help to review this simple patch? > Some index check in Byte/ShortVector.fromArray/fromArray0Template seems not > necessary, could be removed. > Thanks This pull request has been closed without being integrated. -

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

2024-07-17 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: RFR: 8334771: [TESTBUG] Run TestDockerMemoryMetrics.java with -Xcomp fails exitValue = 137

2024-07-17 Thread SendaoYan
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: 8334771: [TESTBUG] Run TestDockerMemoryMetrics.java with -Xcomp fails exitValue = 137

2024-07-17 Thread Leonid Mesnik
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: 8333893: Optimization for StringBuilder append boolean & null [v14]

2024-07-17 Thread Shaojin Wen
> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into > primitive arrays by combining values ​​into larger stores. > > This PR rewrites the code of appendNull and append(boolean) methods so that > these two methods can be optimized by C2. Shaojin Wen has updated the pul

Re: RFR: 8334342: Add MergeStore JMH benchmarks [v6]

2024-07-17 Thread Shaojin Wen
> [8318446](https://github.com/openjdk/jdk/pull/16245) brings MergeStore. We > need a JMH Benchmark to evaluate the performance of various batch operations > and the effect of MergeStore. Shaojin Wen has updated the pull request with a new target base due to a merge or a rebase. The incrementa

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-17 Thread Chen Liang
On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. On a strategic view, this index field should just become final >> so that `Name` becomes eligible for value class migration once valhalla >> comes. Thi

Re: RFR: 6356745: (coll) Add PriorityQueue(Collection, Comparator) [v6]

2024-07-17 Thread Chen Liang
On Thu, 4 Jan 2024 14:21:54 GMT, Valeh Hajiyev wrote: >>>I think this ticket should focus on adding the new constructor as part of >>>the API. >> >> Okay. I would think the code would avoid heapify when the caller does >> foolish things with this API such as: >> >> SortedSet ss = filledSorte

Re: RFR: 6356745: (coll) Add PriorityQueue(Collection, Comparator) [v6]

2024-07-17 Thread Chen Liang
On Thu, 4 Jan 2024 15:34:03 GMT, Jason Mehrens wrote: >>> > I think this ticket should focus on adding the new constructor as part of >>> > the API. >>> >>> Okay. I would think the code would avoid heapify when the caller does >>> foolish things with this API such as: >>> >>> ``` >>> SortedSe

Re: RFR: 6356745: (coll) Add PriorityQueue(Collection, Comparator) [v6]

2024-07-17 Thread Archie Cobbs
On Thu, 28 Dec 2023 00:09:09 GMT, Valeh Hajiyev wrote: >> This commit addresses the current limitation in the `PriorityQueue` >> implementation, which lacks a constructor to efficiently create a priority >> queue with a custom comparator and an existing collection. In order to >> create such a

Re: RFR: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long)

2024-07-17 Thread Jasmine Karthikeyan
On Wed, 17 Jul 2024 09:18:31 GMT, Galder Zamarreño wrote: > Do you want a microbenchmark for the performance of vectorized max/min long? Yeah, I think a simple benchmark that tests for long min/max vectorization and reduction would be good. I worry that checking performance manually like in `R

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

2024-07-17 Thread David Holmes
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-17 Thread Naoto Sato
On Wed, 17 Jul 2024 20:00:18 GMT, ExE Boss wrote: >>> waitFor can be overridden by pre-24 subclasses to provide a better >>> implementation while ... >> >> It doesn't really make sense to extend Process, except maybe for mocking or >> other testing. Process is really for JDK implementations, i

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

2024-07-17 Thread Naoto Sato
On Wed, 17 Jul 2024 21:39:39 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Process.java line 481: >> >>> 479: * this method returns immediately with the value {@code false}. >>> 480: * >>> 481: * The default implementation of this method polls the {@code >>> exi

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

2024-07-17 Thread Chen Liang
On Wed, 17 Jul 2024 18:28:10 GMT, Alan Bateman 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 481: > >> 479:

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

2024-07-17 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

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

2024-07-17 Thread Chen Liang
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 against `ClassTransform` is added. - Commit messages:

RFR: 4452735: Add GZIPOutputStream constructor to specify Deflater

2024-07-17 Thread Archie Cobbs
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 `Deflator` argument supplied by the caller, `GZIPOutputStream` has no such

Re: RFR: 8336585: BoundAttribute.readEntryList not type-safe

2024-07-17 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

RFR: 8336585: BoundAttribute.readEntryList not type-safe

2024-07-17 Thread Chen Liang
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 behave correctly, in comparison) - Commit message

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

2024-07-17 Thread Vladimir Ivanov
On Wed, 17 Jul 2024 15:19:18 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

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

2024-07-17 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.) Migrate the JN

Re: RFR: 8336479: Provide Process.waitFor(Duration)

2024-07-17 Thread ExE Boss
On Wed, 17 Jul 2024 18:31:32 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/lang/Process.java line 504: >> >>> 502: return false; >>> 503: >>> 504: return waitForNanos(TimeUnit.NANOSECONDS.convert(duration)); >> >> `waitFor` can be overridden by pre-24 subclas

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

2024-07-17 Thread Uwe Schindler
On Wed, 17 Jul 2024 15:19:18 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

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

2024-07-17 Thread Vladimir Ivanov
On Wed, 17 Jul 2024 18:46:11 GMT, Vladimir Ivanov wrote: >> This is because the C++ runtime does secondary super cache lookups even >> before the bitmap has been calculated and the hash table sorted. In this >> case the bitmap is zero, so teh search thinks there are no secondary supers. >> Set

Re: RFR: 8329597: C2: Intrinsify Reference.clear

2024-07-17 Thread Aleksey Shipilev
On Thu, 11 Jul 2024 15:28:37 GMT, Aleksey Shipilev wrote: > [JDK-8240696](https://bugs.openjdk.org/browse/JDK-8240696) added the native > method for `Reference.clear`. The original patch skipped intrinsification of > this method, because we thought `Reference.clear` is not on a performance > s

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

2024-07-17 Thread Vladimir Ivanov
On Wed, 17 Jul 2024 17:13:49 GMT, Andrew Haley wrote: >> Another observation while browsing the code: `_secondary_supers_bitmap` >> would be a better name. (Same considerations apply to `_hash_slot`.) > > This is because the C++ runtime does secondary super cache lookups even > before the bitma

Re: RFR: 8329597: C2: Intrinsify Reference.clear

2024-07-17 Thread Aleksey Shipilev
On Fri, 12 Jul 2024 13:19:31 GMT, Aleksey Shipilev wrote: >>> > The reason we did not do this before is that this is not a strong >>> > reference store. Strong reference stores with a SATB collector will keep >>> > the referent alive, which is typically the exact opposite of what a user >>> >

Re: RFR: 8329597: C2: Intrinsify Reference.clear

2024-07-17 Thread Kim Barrett
On Mon, 15 Jul 2024 16:09:39 GMT, Kim Barrett wrote: > > Aw, nice usability landmine. I thought C2 barrier set would assert on me if > > it cannot deliver. Apparently not, [...] > > Reference.refersTo has similar issues. See refersToImpl and refersTo0 in both > Reference and PhantomReference.

Re: RFR: 8329597: C2: Intrinsify Reference.clear

2024-07-17 Thread Kim Barrett
On Fri, 12 Jul 2024 13:19:31 GMT, Aleksey Shipilev wrote: > > The runtime use of the Access API knows how to resolve an unknown oop ref > > strength using AccessBarrierSupport::resolve_unknown_oop_ref_strength. > > However, we do not have support for that in the C2 backend. In fact, it > > doe

Re: RFR: 8329597: C2: Intrinsify Reference.clear [v2]

2024-07-17 Thread Aleksey Shipilev
> [JDK-8240696](https://bugs.openjdk.org/browse/JDK-8240696) added the native > method for `Reference.clear`. The original patch skipped intrinsification of > this method, because we thought `Reference.clear` is not on a performance > sensitive path. However, it shows up prominently on simple be

Withdrawn: 8334772: Change Class::protectionDomain and signers to explicit fields

2024-07-17 Thread Chen Liang
On Wed, 17 Jul 2024 17:47:11 GMT, Chen Liang wrote: > Please review this change that moves `Class.protectionDomain` and `signers` > to explicit fields. > > Related native methods in `Class` and `AccessController::getProtectionDomain` > are converted to pure Java. These fields are still set and

Re: RFR: 8334772: Change Class::protectionDomain and signers to explicit fields

2024-07-17 Thread Chen Liang
On Wed, 17 Jul 2024 17:47:11 GMT, Chen Liang wrote: > Please review this change that moves `Class.protectionDomain` and `signers` > to explicit fields. > > Related native methods in `Class` and `AccessController::getProtectionDomain` > are converted to pure Java. These fields are still set and

Re: RFR: 8334772: Change Class::protectionDomain and signers to explicit fields

2024-07-17 Thread Alan Bateman
On Wed, 17 Jul 2024 17:47:11 GMT, Chen Liang wrote: > Please review this change that moves `Class.protectionDomain` and `signers` > to explicit fields. > > Related native methods in `Class` and `AccessController::getProtectionDomain` > are converted to pure Java. These fields are still set and

Re: RFR: 8336479: Provide Process.waitFor(Duration)

2024-07-17 Thread Alan Bateman
On Wed, 17 Jul 2024 17:51:52 GMT, Chen Liang wrote: > waitFor can be overridden by pre-24 subclasses to provide a better > implementation while ... It doesn't really make sense to extend Process, except maybe for mocking or other testing. Process is really for JDK implementations, it's just hi

Re: RFR: 8336479: Provide Process.waitFor(Duration)

2024-07-17 Thread Alan Bateman
On Wed, 17 Jul 2024 17:36:29 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 als

Re: RFR: 8336479: Provide Process.waitFor(Duration)

2024-07-17 Thread Chen Liang
On Wed, 17 Jul 2024 17:36:29 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 als

RFR: 8336479: Provide Process.waitFor(Duration)

2024-07-17 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. - Commit messages: - initial co

RFR: 8334772: Change Class::protectionDomain and signers to explicit fields

2024-07-17 Thread Chen Liang
Please review this change that moves `Class.protectionDomain` and `signers` to explicit fields. Related native methods in `Class` and `AccessController::getProtectionDomain` are converted to pure Java. These fields are still set and used by hotspot. Also fixes the incorrect `protectiondomain_si

Re: RFR: 8336043: Add quality of implementation discussion to Object.{equals, toString, hashCode}

2024-07-17 Thread Kevin Bourrillion
On Thu, 11 Jul 2024 00:10:02 GMT, Stuart Marks wrote: >> First pass at adding some quality of implementation discussions around the >> overridable methods of Object. > > src/java.base/share/classes/java/lang/Object.java line 53: > >> 51: * {@link VirtualMachineError} is possible during the exe

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

2024-07-17 Thread Andrew Haley
On Fri, 5 Jul 2024 22:37:34 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. >> >> HotSpo

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

2024-07-17 Thread Andrew Haley
On Thu, 11 Jul 2024 23:47:51 GMT, Vladimir Ivanov wrote: >> src/hotspot/share/oops/klass.cpp line 284: >> >>> 282: // which doesn't zero out the memory before calling the constructor. >>> 283: Klass::Klass(KlassKind kind) : _kind(kind), >>> 284:_bitmap(SECONDARY_S

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

2024-07-17 Thread Vladimir Kozlov
On Wed, 17 Jul 2024 15:19:18 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 16:39:10 GMT, fabioromano1 wrote: >> Can try with the old release and the incorrect code again? >> If the results disagree with newer releases then I'd be interested in which >> release you were using, as to analyze the generated code and possibly file a >> bug report for th

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 16:16:12 GMT, Raffaello Giulietti wrote: >> Can try with the old release and the incorrect code again? >> If the results disagree with newer releases then I'd be interested in which >> release you were using, as to analyze the generated code and possibly file a >> bug repor

Re: RFR: 8336300: DateFormatSymbols#getInstanceRef returns non-cached instance [v2]

2024-07-17 Thread Naoto Sato
On Tue, 16 Jul 2024 16:54:09 GMT, Naoto Sato wrote: >> Removing a redundant private method, which has the same implementation with >> the public sibling and obsolete method description. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revisio

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 16:16:12 GMT, Raffaello Giulietti wrote: >> Can try with the old release and the incorrect code again? >> If the results disagree with newer releases then I'd be interested in which >> release you were using, as to analyze the generated code and possibly file a >> bug repor

Integrated: 8336300: DateFormatSymbols#getInstanceRef returns non-cached instance

2024-07-17 Thread Naoto Sato
On Tue, 16 Jul 2024 16:33:02 GMT, Naoto Sato wrote: > Removing a redundant private method, which has the same implementation with > the public sibling and obsolete method description. This pull request has now been integrated. Changeset: 10186ff4 Author:Naoto Sato URL: https://git.

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 15:59:30 GMT, fabioromano1 wrote: >> Sorry, disregard the above as it doesn't work for x = 0. > > @rgiulietti Probably I used a too older release to try the incorrect code Can try with the old release and the incorrect code again? If the results disagree with newer releases t

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 16:15:47 GMT, Raffaello Giulietti wrote: >> @rgiulietti Probably I used a too older release to try the incorrect code > > Can try with the old release and the incorrect code again? > If the results disagree with newer releases then I'd be interested in which > release you we

Re: RFR: 8336275: Move common Method and Constructor fields to Executable [v2]

2024-07-17 Thread Chen Liang
On Wed, 17 Jul 2024 03:03:23 GMT, Chen Liang wrote: >> Move fields common to Method and Field to executable, which simplifies >> implementation. Removed useless transient modifiers as Method and Field were >> never serializable. >> >> Note to core-libs reviewers: Please review the associated C

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 15:11:36 GMT, Raffaello Giulietti wrote: >> Also, this avoids a test >> >> if (Long.compareUnsigned(x, s * s - 1) <= 0) { // benign over- >> and underflows >> s--; >> } > > Sorry, disregard the above as it doesn't work for x = 0. @r

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

2024-07-17 Thread Maurizio Cimadamore
On Wed, 17 Jul 2024 15:19:18 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

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

2024-07-17 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: 8334755: Asymptotically faster implementation of square root algorithm [v28]

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 15:11:36 GMT, Raffaello Giulietti wrote: >> Also, this avoids a test >> >> if (Long.compareUnsigned(x, s * s - 1) <= 0) { // benign over- >> and underflows >> s--; >> } > > Sorry, disregard the above as it doesn't work for x = 0. >

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

2024-07-17 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: 8335480: Only deoptimize threads if needed when closing shared arena [v7]

2024-07-17 Thread Jorn Vernee
> This PR limits the number of cases in which we deoptimize frames when closing > a shared Arena. The initial intent of this was to improve the performance of > shared arena closure in cases where a lot of threads are accessing and > closing shared arenas at the same time (see attached benchmark

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 15:08:22 GMT, Raffaello Giulietti wrote: >> @rgiulietti This is so strange... anyway, I tried also `long x = n * n`, >> `long s = Math.round(Math.sqrt(x >= 0 ? x : x + 0x1p64))` with the test `s < >> n`, which I think it's more mathematically natural, and also this never

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 14:30:33 GMT, fabioromano1 wrote: >> I tried on older release, they all agree. > > @rgiulietti This is so strange... anyway, I tried also `long x = n * n`, > `long s = Math.round(Math.sqrt(x >= 0 ? x : x + 0x1p64))` with the test `s < > n`, which I think it's more mathemati

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 14:11:20 GMT, fabioromano1 wrote: >> There are no counterexamples for perfect squares if you write `long s = >> (long) Math.rint(Math.sqrt(x >= 0 ? x : x + 0x1p64));`. > > @rgiulietti Is it normal that the same code did not find counterexamples > until recently, and now it f

Re: RFR: 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID [v2]

2024-07-17 Thread Thomas Stuefe
On Wed, 17 Jul 2024 14:02:01 GMT, Thomas Stuefe wrote: >> Sonia Zaldana Calles has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Updating copyright headers > > src/hotspot/share/code/codeCache.cpp line 1800: > >> 1798: jio_snprintf(fn

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 14:17:48 GMT, Raffaello Giulietti wrote: >> @rgiulietti Is it normal that the same code did not find counterexamples >> until recently, and now it finds them? > > I tried on older release, they all agree. @rgiulietti This is so strange... anyway, I tried also `long x = n *

Re: RFR: 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID [v2]

2024-07-17 Thread Thomas Stuefe
On Wed, 17 Jul 2024 14:02:31 GMT, Sonia Zaldana Calles wrote: >> Hi all, >> >> This PR addresses [8334492](https://bugs.openjdk.org/browse/JDK-8334492) >> enabling jcmd diagnostic commands that issue an output file to accept the >> `%p` pattern in the file name and substitute it for the PID.

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-17 Thread Chen Liang
On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. On a strategic view, this index field should just become final >> so that `Name` becomes eligible for value class migration once valhalla >> comes. Thi

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 13:57:20 GMT, Raffaello Giulietti wrote: >> I hope these errors are not due to an implementation change in the virtual >> machine instructions... > > There are no counterexamples for perfect squares if you write `long s = > (long) Math.rint(Math.sqrt(x >= 0 ? x : x + 0x1p64

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-17 Thread Jorn Vernee
On Wed, 17 Jul 2024 13:44:58 GMT, Aleksey Shipilev wrote: > > @shipilev Would you re-review this patch, or are you no longer interested > > now that `@Stable` is removed? > > I am not sure I understand the performance implications for this change. I > can see the optimization for avoiding `Nam

Re: RFR: 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID [v2]

2024-07-17 Thread Sonia Zaldana Calles
> Hi all, > > This PR addresses [8334492](https://bugs.openjdk.org/browse/JDK-8334492) > enabling jcmd diagnostic commands that issue an output file to accept the > `%p` pattern in the file name and substitute it for the PID. > > This PR addresses the following diagnostic commands: > - [x] C

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

2024-07-17 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 13:57:06 GMT, fabioromano1 wrote: >> In fact, if you run this code: >> `long limit = 1L << 32; >> for (long n = 0; n < limit; n++) { >> long x = n * n; >> if (n != (long) Math.sqrt(x >= 0 ? x : x + 0x1p64)) { >> System.out.println(n); >> } >> }` >>

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 13:48:59 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1978: >> >>> 1976: * is either correct, or rounded up by one if the value >>> is too high >>> 1977: * and too close to the next perfect square. >>

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

2024-07-17 Thread fabioromano1
On Wed, 17 Jul 2024 13:15:17 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Optimized shift-and-add operations > > src/java.base/share/classes/java/math/MutableBigInteger.java line 1978:

RFR: 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID

2024-07-17 Thread Sonia Zaldana Calles
Hi all, This PR addresses [8334492](https://bugs.openjdk.org/browse/JDK-8334492) enabling jcmd diagnostic commands that issue an output file to accept the `%p` pattern in the file name and substitute it for the PID. This PR addresses the following diagnostic commands: - [x] Compiler.perfmap

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-17 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 13:39:02 GMT, Aleksey Shipilev wrote: >> Indeed, for some reason I thought the range of short is -256 to 255 instead >> of -65536 to 65535 > >> Indeed, for some reason I thought the range of short is -256 to 255 instead >> of -65536 to 65535 > > Yeah, I thought something li

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

2024-07-17 Thread Chris Hegarty
On Mon, 15 Jul 2024 12:59:27 GMT, Maurizio Cimadamore wrote: > Effectively, once all the issues surrounding reachability fences will be > addressed, we should be able to achieve numbers similar to above even in the > case of shared close. Is there an issue where I can follow this? [ EDIT: o

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

2024-07-17 Thread Chris Hegarty
On Tue, 16 Jul 2024 18:09:20 GMT, Jorn Vernee wrote: >> This PR limits the number of cases in which we deoptimize frames when >> closing a shared Arena. The initial intent of this was to improve the >> performance of shared arena closure in cases where a lot of threads are >> accessing and clo

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

2024-07-17 Thread Raffaello Giulietti
On Mon, 15 Jul 2024 19:58:23 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: 8335939: Hide element writing across the ClassFile API

2024-07-17 Thread Chen Liang
On Wed, 17 Jul 2024 08:33:27 GMT, Adam Sotona wrote: >> `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 co

Re: RFR: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long)

2024-07-17 Thread Galder Zamarreño
On Wed, 10 Jul 2024 14:24:05 GMT, Jasmine Karthikeyan wrote: > The C2 changes look nice! I just added one comment here about style. It would > also be good to add some IR tests checking that the intrinsic is creating > `MaxL`/`MinL` nodes before macro expansion, and a microbenchmark to compare

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

2024-07-17 Thread Adam Sotona
> 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 review. > > Thanks, > Adam Adam Sotona has updated the pull re

Re: RFR: 8335939: Hide element writing across the ClassFile API

2024-07-17 Thread Adam Sotona
On Tue, 16 Jul 2024 23:50:17 GMT, Chen Liang wrote: > `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

Re: RFR: 8335939: Hide element writing across the ClassFile API

2024-07-17 Thread Adam Sotona
On Tue, 16 Jul 2024 23:50:17 GMT, Chen Liang wrote: > `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

Re: RFR: 8336300: DateFormatSymbols#getInstanceRef returns non-cached instance [v2]

2024-07-17 Thread Andrey Turbanov
On Tue, 16 Jul 2024 16:54:09 GMT, Naoto Sato wrote: >> Removing a redundant private method, which has the same implementation with >> the public sibling and obsolete method description. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revisio

Re: RFR: 8335938: Review XxxBuilder.original and XxxModel.parent [v2]

2024-07-17 Thread Adam Sotona
On Mon, 15 Jul 2024 15:16:23 GMT, Chen Liang wrote: >> Remove unused `Class/Field/Method/CodeBuilder.original()`, and make >> `Field/Method/CodeModel.parent()` return present only if it's bound (i.e. >> not buffered transformed). See the CSR for details. > > Chen Liang has updated the pull requ

Re: RFR: 8315884: New Object to ObjectMonitor mapping [v9]

2024-07-17 Thread David Holmes
On Mon, 15 Jul 2024 00:50:30 GMT, Axel Boldt-Christmas wrote: >> When inflating a monitor the `ObjectMonitor*` is written directly over the >> `markWord` and any overwritten data is displaced into a displaced >> `markWord`. This is problematic for concurrent GCs which needs extra care or >> l