Re: RFR: 8288933: Improve the implementation of Double/Float.isInfinite

2022-07-17 Thread Claes Redestad
On Thu, 14 Jul 2022 05:17:09 GMT, Joe Darcy  wrote:

> @cl4es, what set of platforms do we usually consider for evaluating 
> performance changes like 

A mix of x86 and aarch64 systems, some old, some new. We could run the 
microbenchmark on our internal performance system to verify the reported 
performance gain. I assume the first score column is the baseline and the 
second the patched version, so a 2x gain on x86, right @merykitty?

-

PR: https://git.openjdk.org/jdk/pull/9238


Integrated: Merge jdk19

2022-07-17 Thread Jesper Wilhelmsson
On Sat, 16 Jul 2022 12:26:23 GMT, Jesper Wilhelmsson  
wrote:

> Forwardport JDK 19 -> JDK 20

This pull request has now been integrated.

Changeset: 522b6574
Author:Jesper Wilhelmsson 
URL:   
https://git.openjdk.org/jdk/commit/522b65743ca10fcba0a27d25b8fa1131e228
Stats: 68 lines in 7 files changed: 34 ins; 12 del; 22 mod

Merge

-

PR: https://git.openjdk.org/jdk/pull/9526


[jdk19] RFR: 8278274: Update nroff pages in JDK 19 before RC

2022-07-17 Thread David Holmes
Please review these changes to the nroff manpage files so that they match their 
markdown sources that Oracle maintains.

All pages at a minimum have 19-ea replaced with 19, and copyright set to 2022 
if needed.  Additionally:

The Java manpage was missing updates from:
- [JDK-8282018](https://bugs.openjdk.org/browse/JDK-8282018): Add captions to 
tables on java man page.

The Java manpage has slight formatting differences from:
- [JDK-8262004](https://bugs.openjdk.org/browse/JDK-8262004): Classpath 
separator: Man page says semicolon; should be colon on Linux
- [JDK-8236569](https://bugs.openjdk.org/browse/JDK-8236569): -Xss not multiple 
of 4K does not work for the main thread on macOS

The Java manpage has a typo fixed in mainline by 
[JDK-8279047](https://bugs.openjdk.org/browse/JDK-8279047) (for JDK 20)


The keytool manpage was missing updates from:
- [JDK-8282014](https://bugs.openjdk.org/browse/JDK-8282014): Add captions to 
tables on keytool man page.
- [JDK-8267319](https://bugs.openjdk.org/browse/JDK-8267319): Use larger 
default key sizes and algorithms based on CNSA

The jar manpage was missing updates from:
- [JDK-8278764](https://bugs.openjdk.org/browse/JDK-8278764): jar and jmod man 
pages need the new --date documenting from CSR 
[JDK-8277755](https://bugs.openjdk.org/browse/JDK-8277755)

The jarsigner manpage was missing updates from:
- [JDK-8282015](https://bugs.openjdk.org/browse/JDK-8282015): Add captions to 
tables on jarsigner man page.
- [JDK-8267319](https://bugs.openjdk.org/browse/JDK-8267319): Use larger 
default key sizes and algorithms based on CNSA

The javadoc manpage was missing updates from:
- [JDK-8279034](https://bugs.openjdk.org/browse/JDK-8279034): Update man page 
for javadoc `--date` option

The jmod manpage was missing updates from:
- [JDK-8278764](https://bugs.openjdk.org/browse/JDK-8278764): jar and jmod man 
pages need the new --date documenting from CSR 
[JDK-8277755](https://bugs.openjdk.org/browse/JDK-8277755)

The jpackage manpage was missing updates from:
- [JDK-8285146](https://bugs.openjdk.org/browse/JDK-8285146): Document jpackage 
resource dir feature
- [JDK-8284695](https://bugs.openjdk.org/browse/JDK-8284695): Update jpackage 
man pages for JDK 19
- [JDK-8284209](https://bugs.openjdk.org/browse/JDK-8284209): Replace remaining 
usages of 'a the' in source code

The jshell manpage was missing updates from:
- [JDK-8282016](https://bugs.openjdk.org/browse/JDK-8282016): Add captions to 
tables on jshell man page.

-

Commit messages:
 - 8278274: Update nroff pages in JDK 19 before RC

Changes: https://git.openjdk.org/jdk19/pull/145/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk19&pr=145&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8278274
  Stats: 515 lines in 28 files changed: 431 ins; 16 del; 68 mod
  Patch: https://git.openjdk.org/jdk19/pull/145.diff
  Fetch: git fetch https://git.openjdk.org/jdk19 pull/145/head:pull/145

PR: https://git.openjdk.org/jdk19/pull/145


Re: RFR: 8288933: Improve the implementation of Double/Float.isInfinite

2022-07-17 Thread Quan Anh Mai
On Sun, 17 Jul 2022 10:58:45 GMT, Claes Redestad  wrote:

>> @merykitty, the proposed change is functionally correct.
>> 
>> @cl4es, what set of platforms do we usually consider for evaluating 
>> performance changes like this?
>
>> @cl4es, what set of platforms do we usually consider for evaluating 
>> performance changes like 
> 
> A mix of x86 and aarch64 systems, some old, some new. We could run the 
> microbenchmark on our internal performance system to verify the reported 
> performance gain. I assume the first score column is the baseline and the 
> second the patched version, so a 2x gain on x86, right @merykitty?

@cl4es  yes the former numbers are the baseline and the latters are of this 
patch

-

PR: https://git.openjdk.org/jdk/pull/9238


[jdk19] RFR: 8290417: CDS cannot archive lamda proxy with useImplMethodHandle

2022-07-17 Thread Ioi Lam
Since the impact of this bug can be big, and the fix is simple and low risk 
(just avoids doing optimizations), I'd like to put this into JDK 19 before RDP2 
(Jul 21).

CDS cannot handle Lambda proxy classes that are generated in the 
useImplMethodHandle mode. This could happen with classfiles generated by JDK 8 
or JDK 11 that access protected methods in a base class from a different 
package. E.g.,


class pkg1.Base {
protected void doit(String s) {
System.out.println(s);
}
}
class pkg2.Child  extends pkg1.Base {
void test() {
Optional opt = Optional.of("foo");
opt.ifPresent(this::doit);
}
}


More details of useImplMethodHandle can be found here: 
https://github.com/openjdk/jdk/blob/522b65743ca10fcba0a27d25b8fa1131e228/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java#L183-L191

More details about the condition that triggers the error can be found in the 
test file Child.jcod.

-

Commit messages:
 - 8290417: CDS cannot archive lamda proxy with useImplMethodHandle

Changes: https://git.openjdk.org/jdk19/pull/146/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk19&pr=146&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8290417
  Stats: 436 lines in 6 files changed: 434 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk19/pull/146.diff
  Fetch: git fetch https://git.openjdk.org/jdk19 pull/146/head:pull/146

PR: https://git.openjdk.org/jdk19/pull/146


Re: [jdk19] RFR: 8290417: CDS cannot archive lamda proxy with useImplMethodHandle

2022-07-17 Thread David Holmes
On Mon, 18 Jul 2022 03:15:02 GMT, Ioi Lam  wrote:

> Since the impact of this bug can be big, and the fix is simple and low risk 
> (just avoids doing optimizations), I'd like to put this into JDK 19 before 
> RDP2 (Jul 21).
> 
> CDS cannot handle Lambda proxy classes that are generated in the 
> useImplMethodHandle mode. This could happen with classfiles generated by JDK 
> 8 or JDK 11 that access protected methods in a base class from a different 
> package. E.g.,
> 
> 
> class pkg1.Base {
> protected void doit(String s) {
> System.out.println(s);
> }
> }
> class pkg2.Child  extends pkg1.Base {
> void test() {
> Optional opt = Optional.of("foo");
> opt.ifPresent(this::doit);
> }
> }
> 
> 
> More details of useImplMethodHandle can be found here: 
> https://github.com/openjdk/jdk/blob/522b65743ca10fcba0a27d25b8fa1131e228/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java#L183-L191
> 
> More details about the condition that triggers the error can be found in the 
> test file Child.jcod.

Looks good!

Thanks.

test/hotspot/jtreg/runtime/cds/appcds/LambdaWithUseImplMethodHandle.java line 
28:

> 26:  * @test
> 27:  * @bug 8290417
> 28:  * @summary CDS cannot archive lamda proxy with useImplMethodHandle

typo: lamda -> lambda

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicLambdaWithUseImplMethodHandle.java
 line 28:

> 26:  * @test
> 27:  * @bug 8290417
> 28:  * @summary CDS cannot archive lamda proxy with useImplMethodHandle

typo: lamda -> lambda

-

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk19/pull/146


Re: [jdk19] RFR: 8290417: CDS cannot archive lamda proxy with useImplMethodHandle [v2]

2022-07-17 Thread Ioi Lam
> Since the impact of this bug can be big, and the fix is simple and low risk 
> (just avoids doing optimizations), I'd like to put this into JDK 19 before 
> RDP2 (Jul 21).
> 
> CDS cannot handle Lambda proxy classes that are generated in the 
> useImplMethodHandle mode. This could happen with classfiles generated by JDK 
> 8 or JDK 11 that access protected methods in a base class from a different 
> package. E.g.,
> 
> 
> class pkg1.Base {
> protected void doit(String s) {
> System.out.println(s);
> }
> }
> class pkg2.Child  extends pkg1.Base {
> void test() {
> Optional opt = Optional.of("foo");
> opt.ifPresent(this::doit);
> }
> }
> 
> 
> More details of useImplMethodHandle can be found here: 
> https://github.com/openjdk/jdk/blob/522b65743ca10fcba0a27d25b8fa1131e228/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java#L183-L191
> 
> More details about the condition that triggers the error can be found in the 
> test file Child.jcod.

Ioi Lam has updated the pull request incrementally with one additional commit 
since the last revision:

  fixed typo

-

Changes:
  - all: https://git.openjdk.org/jdk19/pull/146/files
  - new: https://git.openjdk.org/jdk19/pull/146/files/5ce2cbd9..7122e367

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk19&pr=146&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk19&pr=146&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk19/pull/146.diff
  Fetch: git fetch https://git.openjdk.org/jdk19 pull/146/head:pull/146

PR: https://git.openjdk.org/jdk19/pull/146


Re: RFR: 8284493: Fix rounding error in computeNextExponential [v14]

2022-07-17 Thread Chris Hennick
On Sun, 19 Jun 2022 23:38:36 GMT, Chris Hennick  wrote:

>> This PR improves both the performance of `nextExponential` and 
>> `nextGaussian` and the distribution of output at the tails. It fixes the 
>> following imperfections:
>> 
>> * Repeatedly adding DoubleZigguratTables.exponentialX0 to extra causes a 
>> rounding error to accumulate at the tail of the distribution (probably 
>> starting around `2*exponentialX0 == 0x1.e46eff20739afp3 ~ 15.1`); this PR 
>> fixes that by tracking the multiple of exponentialX0 as a long. (This 
>> distortion is worst when `x > 0x1.0p56` since in that case, a rounding error 
>> means `extra + x == extra`.
>> * Reduces several equations using `Math.fma`. (This will almost certainly 
>> improve performance, and may or may not improve output distribution.)
>> * Uses the newly-extracted `computeWinsorizedNextExponential` function to 
>> greatly reduce the probability that `nextGaussian` suffers from *two* tail 
>> cases of `nextExponential`.
>
> Chris Hennick has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Rewrite Javadoc

Keep open; I'll submit some benchmarks when I have a chance.

-

PR: https://git.openjdk.org/jdk/pull/8131