RFR: 8356126: Duplication handling and optimization of CaptureCallState [v9]

Chen Liang liach at openjdk.org
Tue May 6 22:21:16 UTC 2025


On Tue, 6 May 2025 22:11:49 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Credit to @lukellmann that the duplication arg handling in #24742 avoided throwing exceptions but produced a wrong option. This patch fixes that and removed stream usages in CaptureCallState to speed up bootstrap.
>> 
>> Also, the previous patch affected the toString display of the option; I added a unit test to ensure the option prints names that is user-friendly.
>> 
>> Another thing I noted is `CapturableState` uses `OperatingSystem`; using `valueOf` brings a performance overhead due to setups with reflection, so I made this lazy. (The enum is thread safe, so we allow racy access to the cache field)
>> 
>> Testing: jdk/lang/foreign, tier 1-3 in progress.
>
> Chen Liang has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Indicate source file
>  - Keep in sync comments

Thanks for the review! Tier 1-3 tests all pass. Will wait for people to check out this utility class version.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25025#issuecomment-2856250459


More information about the core-libs-dev mailing list