Re: RFR: 8287073: NPE from CgroupV2Subsystem.getInstance()

2022-05-25 Thread Peter Levart
On Fri, 20 May 2022 08:34:58 GMT, Maxim Kartashev wrote: > Following the logic from the comment directly above the changed line, since > it doesn't matter which controller we pick, pick any available controller > instead of the one called "memory" specifically. This way we are guarded >

Re: RFR: 8287073: NPE from CgroupV2Subsystem.getInstance()

2022-05-25 Thread Peter Levart
On Wed, 25 May 2022 14:39:42 GMT, Peter Levart wrote: >> Following the logic from the comment directly above the changed line, since >> it doesn't matter which controller we pick, pick any available controller >> instead of the one called "memory" specifically. This way we are guarded >>

Re: RFR: 8279986: methods Math::asXExact for safely checked primitive casts

2022-05-25 Thread Brian Goetz
Themotivation behind this PR isnot driven by pattern matching:John Rose (the reporter of the JBS issue) is concerned about having safer casts that, in addition, can be JITted to efficient code. Yes, of course.  But also, as the platform evolves, it often happens that the same issues

Re: RFR: 8279986: methods Math::asXExact for safely checked primitive casts

2022-05-25 Thread Brian Goetz
Another way to evaluate answers here is: are we inventing new relations, or merely clarifying old ones?  The latter is often more desirable. For example, we might say that x:X can be converted exactly to Y, for primitive X and Y, iff:     eq( (X) (Y) x, x ) where `eq` is `==` for

Re: RFR: 8284960: Integration of JEP 426: Vector API (Fourth Incubator) [v9]

2022-05-25 Thread Vladimir Kozlov
On Wed, 25 May 2022 06:29:06 GMT, Jatin Bhateja wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8284960: Review comments resolved. > > Hi @vnkozlov , Your comments have been addressed. @jatin-bhateja something

RFR: [CSR] 8287026: Changes related to overflow handling in Random.doubles

2022-05-25 Thread Raffaello Giulietti
Please review this CSR [1], whose aim is to bring the extended behavior of the PR [2] in sync with the spec. Greetings Raffaello [1] https://bugs.openjdk.java.net/browse/JDK-8287026 [2] https://git.openjdk.java.net/jdk/pull/8791

Re: RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v10]

2022-05-25 Thread XenoAmess
On Wed, 25 May 2022 05:22:44 GMT, Stuart Marks wrote: > Yes, this test fails with IllegalAccessException. Probably it's easiest to > use a VarHandle to get private fields, similar to other usage already in this > test. > > This test case is a bit odd though in that it's supposed to test

Re: RFR: 8287187: Utilize HashMap.newHashMap() in CLDRConverter [v2]

2022-05-25 Thread Naoto Sato
> Refactoring the leftover self-calculations of the optimized `HashMap` initial > value with `newHashMap()` method. Also replaced some string literals using > text blocks for better readability. Confirmed that the output resource bundle > sources are effectively (sans indentation) the same as

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v3]

2022-05-25 Thread Ioi Lam
On Wed, 25 May 2022 15:50:32 GMT, Severin Gehwolf wrote: >> It confused me, fwiw. Anyway up to you. It's not super important. > > works for me. +1. Note the typo > `anyCgroupsV1Controller/anyCgroupsV2Controller` not **V1** twice. Oops, I'll fixed that. Thanks! - PR:

Re: RFR: 8287206: Use WrongThreadException for confinement errors

2022-05-25 Thread Uwe Schindler
On Tue, 24 May 2022 09:26:44 GMT, Maurizio Cimadamore wrote: > This patch tweaks the foreign API to use the newly added > `WrongThreadException` instead of `IllegalStateException` to report > confinement errors. I changed the PR on our side, `IllegalStateException` is fine, if you catch it

Re: RFR: 8287187: Utilize HashMap.newHashMap() in CLDRConverter [v2]

2022-05-25 Thread Joe Wang
On Wed, 25 May 2022 17:15:18 GMT, Naoto Sato wrote: >> Refactoring the leftover self-calculations of the optimized `HashMap` >> initial value with `newHashMap()` method. Also replaced some string literals >> using text blocks for better readability. Confirmed that the output resource >>

Re: RFR: [CSR] 8287026: Changes related to overflow handling in Random.doubles

2022-05-25 Thread Raffaello Giulietti
Sorry, it's the other way round! To bring the spec in sync with the extended behavior of the PR [2] From: core-libs-dev on behalf of Raffaello Giulietti Date: Wednesday, 25 May 2022 at 18:57 To: core-libs-dev@openjdk.java.net Subject: RFR: [CSR] 8287026: Changes related to overflow handling

Re: RFR: JDK-8281001 Examine the behavior of Class::forName if the caller is null [v2]

2022-05-25 Thread Mandy Chung
On Tue, 17 May 2022 20:16:48 GMT, Tim Prinzing wrote: >> The Class::forName behavior change to match JNI FindClass is a compatible >> change and seems pretty attractive as it would be expected that >> Class::forName would give the same behavior as FindClass which uses the >> system

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v20]

2022-05-25 Thread Roger Riggs
On Wed, 25 May 2022 00:35:24 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >>

Re: RFR: 8279986: methods Math::asXExact for safely checked primitive casts

2022-05-25 Thread Raffaello Giulietti
When they return, these methods meet the property, even for -0.0 provided the underlying eq is floating-point ==, not *::compare: -0.0 -> 0 -> 0.0 and there is a loss of information about the sign bit. However, as currently stated, the property is not 100% correct. For example, (long)

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v3]

2022-05-25 Thread Severin Gehwolf
On Wed, 25 May 2022 15:51:04 GMT, Ioi Lam wrote: >> This PR fixes a bug found on an Ubuntu host that's mostly running with >> cgroupv2, but there's a controller (freezer) that is mounted in cgroupv1 >> mode. >> >> The container support code in the VM and JDK checks if we have >>

RFR: 8287187: Utilize HashMap.newHashMap() in CLDRConverter

2022-05-25 Thread Naoto Sato
Refactoring the leftover self-calculations of the optimized `HashMap` initial value with `newHashMap()` method. Also replaced some string literals using text blocks for better readability. Confirmed that the output resource bundle sources are effectively (sans indentation) the same as the

Re: RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v10]

2022-05-25 Thread Naoto Sato
On Wed, 25 May 2022 05:42:22 GMT, Stuart Marks wrote: > (Also, I haven't seen `StringTokenizer` in a long time) That's some old code lingering in locale-related stuff. Will fix them after this PR gets integrated. - PR: https://git.openjdk.java.net/jdk/pull/8302

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v2]

2022-05-25 Thread Ioi Lam
On Tue, 24 May 2022 19:36:57 GMT, Severin Gehwolf wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @jerboaa comments > > Looks good. Thanks for the thorough analysis. Thanks @jerboaa and @mseledts for the review.

Integrated: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller

2022-05-25 Thread Ioi Lam
On Mon, 23 May 2022 22:11:47 GMT, Ioi Lam wrote: > This PR fixes a bug found on an Ubuntu host that's mostly running with > cgroupv2, but there's a controller (freezer) that is mounted in cgroupv1 mode. > > The container support code in the VM and JDK checks if we have simultaneously >

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v4]

2022-05-25 Thread Ioi Lam
> This PR fixes a bug found on an Ubuntu host that's mostly running with > cgroupv2, but there's a controller (freezer) that is mounted in cgroupv1 mode. > > The container support code in the VM and JDK checks if we have simultaneously > mounted v1 and v2 containers. If so, we revert to

Re: RFR: 8284638: store skip buffers in InputStream Object [v15]

2022-05-25 Thread Sergey Kuksenko
On Tue, 24 May 2022 20:40:51 GMT, XenoAmess wrote: >> @jmehrens what about this then? >> I think it safe now(actually this mechanism is learned from Reader) > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > invert if; refine

Re: RFR: 8286562: GCC 12 reports some compiler warnings [v9]

2022-05-25 Thread Kim Barrett
On Wed, 25 May 2022 09:16:43 GMT, Yasumasa Suenaga wrote: >> I saw some compiler warnings when I tried to build OpenJDK with GCC 12.0.1 >> on Fedora 36. >> As you can see, the warnings spreads several areas. Let me know if I should >> separate them by area. >> >> * -Wstringop-overflow >>

RFR: 8287003: InputStreamReader::read() can return zero despite writing a char in the buffer

2022-05-25 Thread Brian Burkhalter
If only a leftover `char` remains in the stream, do not add `-1` to the return value in `lockedRead()`. - Commit messages: - 8287003: InputStreamReader::read() can return zero despite writing a char in the buffer Changes: https://git.openjdk.java.net/jdk/pull/8895/files Webrev:

Re: RFR: 8284960: Integration of JEP 426: Vector API (Fourth Incubator) [v9]

2022-05-25 Thread Jatin Bhateja
On Wed, 25 May 2022 05:50:23 GMT, Jatin Bhateja wrote: >> Hi All, >> >> Patch adds the planned support for new vector operations and APIs targeted >> for [JEP 426: Vector API (Fourth >> Incubator).](https://bugs.openjdk.java.net/browse/JDK-8280173) >> >> Following is the brief summary of

Integrated: 8287181: Avoid redundant HashMap.containsKey calls in InternalLocaleBuilder.setExtension

2022-05-25 Thread Andrey Turbanov
On Sat, 30 Apr 2022 17:10:55 GMT, Andrey Turbanov wrote: > No need to separately perform `HashMap.containsKey` before `HashMap.remove` > call. If key is present - it will be removed anyway. If it's not present, > nothing will be deleted. This pull request has now been integrated. Changeset:

RFR: 8287285: Avoid redundant HashMap.containsKey call in java.util.zip.ZipFile.Source.get

2022-05-25 Thread Andrey Turbanov
The method `java.util.zip.ZipFile.Source#get` could be improved by usage of `Map.putIfAbsent` instead of separate `containsKey`/`get`/`put` calls. We known that HashMap `java.util.zip.ZipFile.Source#files` can contain only non-null values. And to check if putIfAbsent was successful or not we

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v2]

2022-05-25 Thread Severin Gehwolf
On Tue, 24 May 2022 19:49:35 GMT, Ioi Lam wrote: >> My bad. How about `Intentional incomplete switch. There are ...`? Anyway, >> why is the empty `default` case needed other than for the comment? > > To me, the `default:` switch is a clear indication that "everything else > comes here". So you

Re: RFR: 8284960: Integration of JEP 426: Vector API (Fourth Incubator) [v8]

2022-05-25 Thread Jatin Bhateja
On Mon, 23 May 2022 22:17:40 GMT, Vladimir Kozlov wrote: >> Jatin Bhateja has updated the pull request incrementally with one additional >> commit since the last revision: >> >> 8284960: Integrating incremental patches. > > src/hotspot/cpu/x86/assembler_x86.cpp line 8173: > >> 8171: >>

Re: RFR: 8284960: Integration of JEP 426: Vector API (Fourth Incubator) [v10]

2022-05-25 Thread Jatin Bhateja
> Hi All, > > Patch adds the planned support for new vector operations and APIs targeted > for [JEP 426: Vector API (Fourth > Incubator).](https://bugs.openjdk.java.net/browse/JDK-8280173) > > Following is the brief summary of changes:- > > 1) Extends the scope of existing lanewise API for

Re: RFR: 8286562: GCC 12 reports some compiler warnings [v9]

2022-05-25 Thread Yasumasa Suenaga
> I saw some compiler warnings when I tried to build OpenJDK with GCC 12.0.1 on > Fedora 36. > As you can see, the warnings spreads several areas. Let me know if I should > separate them by area. > > * -Wstringop-overflow > * src/hotspot/share/oops/array.hpp > * >

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

2022-05-25 Thread Laurent Bourgès
On Mon, 14 Mar 2022 19:12:29 GMT, iaroslavski wrote: >> Sorting: >> >> - adopt radix sort for sequential and parallel sorts on >> int/long/float/double arrays (almost random and length > 6K) >> - fix tryMergeRuns() to better handle case when the last run is a single >> element >> - minor

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

2022-05-25 Thread quincunx-45
On Mon, 14 Mar 2022 19:12:29 GMT, iaroslavski wrote: >> Sorting: >> >> - adopt radix sort for sequential and parallel sorts on >> int/long/float/double arrays (almost random and length > 6K) >> - fix tryMergeRuns() to better handle case when the last run is a single >> element >> - minor

Re: RFR: 8286562: GCC 12 reports some compiler warnings [v8]

2022-05-25 Thread Yasumasa Suenaga
On Wed, 25 May 2022 01:50:57 GMT, Kim Barrett wrote: >> Yasumasa Suenaga has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 11 commits: >> >> - Merge remote-tracking branch 'upstream/master' into gcc12-warnings >> - Use getter

Re: RFR: 8284199: Implementation of Structured Concurrency (Incubator) [v3]

2022-05-25 Thread Maurizio Cimadamore
On Tue, 24 May 2022 15:15:43 GMT, Alan Bateman wrote: >> This is the implementation of JEP 428: Structured Concurrency (Incubator). >> >> This is a non-final API that provides a gentle on-ramp to structure a task >> as a family of concurrent subtasks, and to coordinate the subtasks as a unit.

Re: RFR: 8273346: Expand library mappings to IEEE 754 operations

2022-05-25 Thread Raffaello Giulietti
On Wed, 25 May 2022 00:19:41 GMT, Joe Darcy wrote: > Generally add apiNote's to map from Java library methods to particular IEEE > 754 operations. For now, I only added such notes to java.lang.Math and not > java.lang.StrictMath. src/java.base/share/classes/java/lang/Math.java line 771: >

Re: RFR: 8279986: methods Math::asXExact for safely checked primitive casts [v6]

2022-05-25 Thread Raffaello Giulietti
> Add a family of "safe" cast methods. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: 8279986: methods Math::asXExact for safely checked primitive casts - Changes: - all:

RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Claes Redestad
The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` allows keys to be compacted when all byte values of the key fit in 4 bits, otherwise a byte array is allocated and used. This means that all transforms with a kind value above 15 will be forced to allocate and use array

Re: RFR: 8287206: Use WrongThreadException for confinement errors

2022-05-25 Thread Maurizio Cimadamore
On Tue, 24 May 2022 09:26:44 GMT, Maurizio Cimadamore wrote: > This patch tweaks the foreign API to use the newly added > `WrongThreadException` instead of `IllegalStateException` to report > confinement errors. > Thinking more about it: `IllegalStateException` is fine for a closed >

Re: RFR: 8287206: Use WrongThreadException for confinement errors

2022-05-25 Thread Maurizio Cimadamore
On Wed, 25 May 2022 10:16:54 GMT, Maurizio Cimadamore wrote: > > Thinking more about it: `IllegalStateException` is fine for a closed > > `MemorySession`. If used by wrong thread the exception was indeed > > confusing. Now that the abiguity is gone, I can change our (Lucene) code > > and

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v3]

2022-05-25 Thread Jaikiran Pai
On Tue, 24 May 2022 13:08:53 GMT, liach wrote: > so on a mismatch, it would print parameter type initialized after > instantiation expected: true actual: false That looks fine then. I hadn't looked closely at what testng prints and I had thought that on an assertion failure it would print

Integrated: 8287206: Use WrongThreadException for confinement errors

2022-05-25 Thread Maurizio Cimadamore
On Tue, 24 May 2022 09:26:44 GMT, Maurizio Cimadamore wrote: > This patch tweaks the foreign API to use the newly added > `WrongThreadException` instead of `IllegalStateException` to report > confinement errors. This pull request has now been integrated. Changeset: e1f140d2 Author:

Re: RFR: 8287206: Use WrongThreadException for confinement errors

2022-05-25 Thread Uwe Schindler
On Tue, 24 May 2022 09:26:44 GMT, Maurizio Cimadamore wrote: > This patch tweaks the foreign API to use the newly added > `WrongThreadException` instead of `IllegalStateException` to report > confinement errors. I have seen this PR now: Would it be also a good idea to replace the

Re: Stream.fromForEach(Consumer>)

2022-05-25 Thread Peter Levart
Hi, On 23/05/2022 14:53, Brian Goetz wrote: ... Are there any useful Consumer> in the wild, that are actually typed like that?  I doubt it (there are many things convertible to it, though.)  Which suggests it might be fruitful to define a FI:     interface PushSource {     void

Re: RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v3]

2022-05-25 Thread Jaikiran Pai
On Tue, 24 May 2022 13:07:08 GMT, liach wrote: >> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 605: >> >>> 603: mv.visitLdcInsn(Type.getObjectType(dotToSlash(className))); >>> 604: mv.visitMethodInsn(INVOKEVIRTUAL, JL_CLASS, >>> 605:

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

2022-05-25 Thread iaroslavski
On Mon, 14 Mar 2022 19:12:29 GMT, iaroslavski wrote: >> Sorting: >> >> - adopt radix sort for sequential and parallel sorts on >> int/long/float/double arrays (almost random and length > 6K) >> - fix tryMergeRuns() to better handle case when the last run is a single >> element >> - minor

Re: RFR: 8287206: Use WrongThreadException for confinement errors

2022-05-25 Thread Uwe Schindler
On Tue, 24 May 2022 09:26:44 GMT, Maurizio Cimadamore wrote: > This patch tweaks the foreign API to use the newly added > `WrongThreadException` instead of `IllegalStateException` to report > confinement errors. Thinking more about it: `IllegalStateException` is fine for a closed

Re: RFR: 8202449: overflow handling in Random.doubles [v3]

2022-05-25 Thread Raffaello Giulietti
On Tue, 24 May 2022 12:58:45 GMT, Raffaello Giulietti wrote: >> Extend the range of Random.doubles(double, double) and similar methods. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: > > 8202449: overflow handling in

Re: RFR: 8287073: NPE from CgroupV2Subsystem.getInstance()

2022-05-25 Thread Vladimir Kempik
On Fri, 20 May 2022 08:34:58 GMT, Maxim Kartashev wrote: > Following the logic from the comment directly above the changed line, since > it doesn't matter which controller we pick, pick any available controller > instead of the one called "memory" specifically. This way we are guarded >

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

2022-05-25 Thread iaroslavski
On Mon, 14 Mar 2022 19:12:29 GMT, iaroslavski wrote: >> Sorting: >> >> - adopt radix sort for sequential and parallel sorts on >> int/long/float/double arrays (almost random and length > 6K) >> - fix tryMergeRuns() to better handle case when the last run is a single >> element >> - minor

Integrated: 8262889: Compiler implementation for Record Patterns

2022-05-25 Thread Jan Lahoda
On Tue, 3 May 2022 12:07:50 GMT, Jan Lahoda wrote: > 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: >

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jim Laskey
On Wed, 25 May 2022 09:38:08 GMT, Claes Redestad wrote: > The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with

Re: RFR: 8262889: Compiler implementation for Record Patterns [v7]

2022-05-25 Thread Rémi Forax
On Wed, 25 May 2022 04:20:35 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >>

Re: RFR: 8279986: methods Math::asXExact for safely checked primitive casts

2022-05-25 Thread Raffaello Giulietti
The motivation behind this PR is not driven by pattern matching: John Rose (the reporter of the JBS issue) is concerned about having safer casts that, in addition, can be JITted to efficient code. But I get your point that having non-throwing tests better serves pattern matching. However, I’m

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v2]

2022-05-25 Thread Claes Redestad
> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a kind value above 15 will be forced to allocate and use

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v2]

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 14:03:41 GMT, Claes Redestad wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >>

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently [v3]

2022-05-25 Thread Claes Redestad
> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with a kind value above 15 will be forced to allocate and use

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 09:38:08 GMT, Claes Redestad wrote: > The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` > allows keys to be compacted when all byte values of the key fit in 4 bits, > otherwise a byte array is allocated and used. This means that all transforms > with

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:27:17 GMT, Jorn Vernee wrote: >> The bespoke caching scheme in `jl.invoke.LambdaFormEditor.TransformKey` >> allows keys to be compacted when all byte values of the key fit in 4 bits, >> otherwise a byte array is allocated and used. This means that all transforms >> with

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:28:52 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java line 239: >> >>> 237: for (int i = 0; i < b23456.length; i++) { >>> 238: int b = b23456[i] & 0xFF; >>> 239: bitset |= b; >> >>

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Claes Redestad
On Wed, 25 May 2022 13:30:23 GMT, Jorn Vernee wrote: >> Maybe not... argument positions should fit in a byte as well. But, maybe >> there are other problematic cases? Or are the ints guaranteed to fit in a >> byte? > > Maybe an `assert b == b23456[i]` would be nice here. All usage implies the

Re: RFR: 8287292: Improve TransformKey to pack more kinds of transforms efficiently

2022-05-25 Thread Jorn Vernee
On Wed, 25 May 2022 13:37:14 GMT, Claes Redestad wrote: >> Maybe an `assert b == b23456[i]` would be nice here. > > All usage implies the int is an argument position, which by spec is > constrained to be in the 0-255 range. But surely checking or asserting > shouldn't hurt. Yes, please. IMHO

Re: RFR: 8287244: Add bound check in indexed memory access var handle [v3]

2022-05-25 Thread Jorn Vernee
On Tue, 24 May 2022 18:15:45 GMT, Maurizio Cimadamore wrote: >> Constructing indexed var handles using the `MemoryLayout` API produces >> `VarHandle` which do not check the input indices for out-of-bounds >> conditions. >> While this can never result in a VM crash (after all the memory

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v3]

2022-05-25 Thread Ioi Lam
On Tue, 24 May 2022 19:49:35 GMT, Ioi Lam wrote: >> My bad. How about `Intentional incomplete switch. There are ...`? Anyway, >> why is the empty `default` case needed other than for the comment? > > To me, the `default:` switch is a clear indication that "everything else > comes here". So you

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v3]

2022-05-25 Thread Severin Gehwolf
On Wed, 25 May 2022 08:40:48 GMT, Severin Gehwolf wrote: >> If you don't like the `default:` coding style, how about this: >> >> >> switch (info.getName()) { >> // Only the following controllers are important to Java. All >> // other controllers (such as freezer) are ignored and >> // are not

Re: RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v3]

2022-05-25 Thread Ioi Lam
> This PR fixes a bug found on an Ubuntu host that's mostly running with > cgroupv2, but there's a controller (freezer) that is mounted in cgroupv1 mode. > > The container support code in the VM and JDK checks if we have simultaneously > mounted v1 and v2 containers. If so, we revert to

Re: RFR: 8287073: NPE from CgroupV2Subsystem.getInstance()

2022-05-25 Thread Maxim Kartashev
On Wed, 25 May 2022 14:47:06 GMT, Peter Levart wrote: >> src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java >> line 113: >> >>> 111: CgroupInfo anyController = >>> infos.values().iterator().next(); >>> 112: CgroupSubsystem subsystem = >>>