Re: RFR: 8269537: memset() is called after operator new [v3]

2021-10-06 Thread Kim Barrett
On Tue, 5 Oct 2021 20:39:30 GMT, Leo Korinth wrote: >> The basic problem is that we are relying on undefined behaviour, as >> documented in the code: >> >> // This whole business of passing information from ResourceObj::operator new >> // to the ResourceObj constructor via fields in the "object

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v8]

2021-10-06 Thread Ioi Lam
On Wed, 6 Oct 2021 21:53:30 GMT, Yumin Qi wrote: >> Please review, >> Refactor fundamental CDS FileMapHeader code for reliable reading of basic >> info from shared archive. >> With the change, it makes it possible to read an archive generated by >> different version of hotspot. Also it is p

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v3]

2021-10-06 Thread Serguei Spitsyn
On Wed, 6 Oct 2021 19:00:35 GMT, Andrey Turbanov wrote: >> There are few places in code where manual while loop is used with Iterator >> to iterate over Collection. >> Instead of manual while cycles it's preferred to use enhanced-for cycle >> instead: it's less verbose, makes code easier to re

Re: RFR: 8274004: Change 'nonleaf' rank name

2021-10-06 Thread David Holmes
On Wed, 6 Oct 2021 23:27:17 GMT, Coleen Phillimore wrote: > Also fixes: 8273956: Add checking for rank values > > This change does 3 things. I could separate them but this has all been > tested together and most of the change is mechanical. The first is a simple > rename of nonleaf => safepo

Re: RFR: 8274004: Change 'nonleaf' rank name

2021-10-06 Thread Daniel D . Daugherty
On Wed, 6 Oct 2021 23:27:17 GMT, Coleen Phillimore wrote: > Also fixes: 8273956: Add checking for rank values > > This change does 3 things. I could separate them but this has all been > tested together and most of the change is mechanical. The first is a simple > rename of nonleaf => safepo

Re: RFR: 8274004: Change 'nonleaf' rank name

2021-10-06 Thread Daniel D . Daugherty
On Wed, 6 Oct 2021 23:27:17 GMT, Coleen Phillimore wrote: > 8273956: Add checking for rank values > > This change does 3 things. I could separate them but this has all been > tested together and most of the change is mechanical. The first is a simple > rename of nonleaf => safepoint. The se

RFR: 8274004: Change 'nonleaf' rank name

2021-10-06 Thread Coleen Phillimore
8273956: Add checking for rank values This change does 3 things. I could separate them but this has all been tested together and most of the change is mechanical. The first is a simple rename of nonleaf => safepoint. The second change is to add the enum class Rank which only allows subtracti

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v8]

2021-10-06 Thread Yumin Qi
> Please review, > Refactor fundamental CDS FileMapHeader code for reliable reading of basic > info from shared archive. > With the change, it makes it possible to read an archive generated by > different version of hotspot. Also it is possible to automatically generate a > CDS archive If th

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v3]

2021-10-06 Thread Chris Plummer
On Wed, 6 Oct 2021 19:00:35 GMT, Andrey Turbanov wrote: >> There are few places in code where manual while loop is used with Iterator >> to iterate over Collection. >> Instead of manual while cycles it's preferred to use enhanced-for cycle >> instead: it's less verbose, makes code easier to re

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-06 Thread Yumin Qi
On Wed, 6 Oct 2021 17:01:58 GMT, Ioi Lam wrote: >> see above reply. We need read the full _header_size for _header. Also note >> that helper class will delete gen_header when out of scope. > > I see. I think your current code is fine. > > Note that the current code writes the header as a FileMa

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v2]

2021-10-06 Thread Andrey Turbanov
On Wed, 6 Oct 2021 18:51:16 GMT, Serguei Spitsyn wrote: >There are still extra space in the file InvokableTypeImpl.java. updated `InvokableTypeImpl.java` too - PR: https://git.openjdk.java.net/jdk/pull/5577

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v3]

2021-10-06 Thread Andrey Turbanov
> There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read and it's less > error-prone. > It doesn't have any performa

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v2]

2021-10-06 Thread Serguei Spitsyn
On Wed, 6 Oct 2021 07:00:34 GMT, Andrey Turbanov wrote: >> There are few places in code where manual while loop is used with Iterator >> to iterate over Collection. >> Instead of manual while cycles it's preferred to use enhanced-for cycle >> instead: it's less verbose, makes code easier to re

Re: RFR: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management [v2]

2021-10-06 Thread Daniel Fuchs
On Fri, 1 Oct 2021 21:12:57 GMT, Andrey Turbanov wrote: >> There are a few places in code, where manual `for` loop is used with >> Iterator to iterate over Collection. >> Instead of manual `for` cycles, it's preferred to use enhanced-for cycle >> instead: it's less verbose, makes code easier t

Integrated: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management

2021-10-06 Thread Andrey Turbanov
On Sat, 25 Sep 2021 10:51:12 GMT, Andrey Turbanov wrote: > There are a few places in code, where manual `for` loop is used with Iterator > to iterate over Collection. > Instead of manual `for` cycles, it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to r

Integrated: 8274464: Remove redundant stream() call before forEach in java.* modules

2021-10-06 Thread Andrey Turbanov
On Wed, 15 Sep 2021 07:12:25 GMT, Andrey Turbanov wrote: > 8274464: Remove redundant stream() call before forEach in java.* modules This pull request has now been integrated. Changeset: f3cedbe9 Author:Andrey Turbanov Committer: Daniel Fuchs URL: https://git.openjdk.java.net/jdk/c

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v7]

2021-10-06 Thread Yumin Qi
> Please review, > Refactor fundamental CDS FileMapHeader code for reliable reading of basic > info from shared archive. > With the change, it makes it possible to read an archive generated by > different version of hotspot. Also it is possible to automatically generate a > CDS archive If th

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-06 Thread Yumin Qi
On Wed, 6 Oct 2021 04:09:32 GMT, Ioi Lam wrote: >> Yumin Qi has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Added a helper class to facilitate checking archive > > src/hotspot/share/cds/filemap.cpp line 1099: > >> 1097: lseek(_fd, _

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-06 Thread Ioi Lam
On Wed, 6 Oct 2021 16:44:25 GMT, Yumin Qi wrote: >> src/hotspot/share/cds/filemap.cpp line 1205: >> >>> 1203: } >>> 1204: >>> 1205: _header = (FileMapHeader*)os::malloc(gen_header->_header_size, >>> mtInternal); >> >> There's no need to allocate and read the header again. It's already in

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v6]

2021-10-06 Thread Ioi Lam
On Wed, 6 Oct 2021 17:01:31 GMT, Yumin Qi wrote: >> Please review, >> Refactor fundamental CDS FileMapHeader code for reliable reading of basic >> info from shared archive. >> With the change, it makes it possible to read an archive generated by >> different version of hotspot. Also it is p

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v6]

2021-10-06 Thread Yumin Qi
> Please review, > Refactor fundamental CDS FileMapHeader code for reliable reading of basic > info from shared archive. > With the change, it makes it possible to read an archive generated by > different version of hotspot. Also it is possible to automatically generate a > CDS archive If th

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-06 Thread Yumin Qi
On Wed, 6 Oct 2021 04:15:06 GMT, Ioi Lam wrote: >> Yumin Qi has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Added a helper class to facilitate checking archive > > src/hotspot/share/cds/filemap.cpp line 1205: > >> 1203: } >> 1204: >>

Re: RFR: 8273152: Refactor CDS FileMapHeader loading code [v5]

2021-10-06 Thread Yumin Qi
On Wed, 6 Oct 2021 04:17:16 GMT, Ioi Lam wrote: >> Yumin Qi has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Added a helper class to facilitate checking archive > > src/jdk.hotspot.agent/share/native/libsaproc/ps_core_common.c line 369: >

Withdrawn: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend

2021-10-06 Thread Richard Reingruber
On Mon, 4 Oct 2021 14:07:18 GMT, Richard Reingruber wrote: > This change fixes the deadlock described in the JBS-bug by: > > * Releasing `handlerLock` before waiting on `threadLock` in > `blockOnDebuggerSuspend()` > > * Notifying on `threadLock` after resuming all threads in > `threadControl_

Re: RFR: 8274687: JDWP can deadlock VM if Java thread waits in blockOnDebuggerSuspend

2021-10-06 Thread Richard Reingruber
On Mon, 4 Oct 2021 14:07:18 GMT, Richard Reingruber wrote: > This change fixes the deadlock described in the JBS-bug by: > > * Releasing `handlerLock` before waiting on `threadLock` in > `blockOnDebuggerSuspend()` > > * Notifying on `threadLock` after resuming all threads in > `threadControl_

Re: RFR: 8269537: memset() is called after operator new [v3]

2021-10-06 Thread Leo Korinth
On Tue, 5 Oct 2021 20:39:30 GMT, Leo Korinth wrote: >> The basic problem is that we are relying on undefined behaviour, as >> documented in the code: >> >> // This whole business of passing information from ResourceObj::operator new >> // to the ResourceObj constructor via fields in the "object

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v2]

2021-10-06 Thread Andrey Turbanov
> There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read and it's less > error-prone. > It doesn't have any performa

Re: RFR: 8274755: Replace 'while' cycles with iterator with enhanced-for in jdk.jdi [v2]

2021-10-06 Thread Andrey Turbanov
On Tue, 5 Oct 2021 19:55:12 GMT, Serguei Spitsyn wrote: >There are plenty of such spaces added in this PR. >Could you, please, fix them? Thank you for review. Done. - PR: https://git.openjdk.java.net/jdk/pull/5577