RFR: 8356126: Revisit CaptureCallState [v4]

Jaikiran Pai jpai at openjdk.org
Mon May 5 08:22:48 UTC 2025


On Mon, 5 May 2025 04:50:30 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 one additional commit since the last revision:
> 
>   No env to test

On a general note, I think the title of the JBS issue needs to better state what this change is about. From what I understand, this is a bug fix which addresses an issue in `jdk.internal.foreign.abi.LinkerOptions.capturedCallState()` method where it could have returned an incorrect value. I think the issue type also should be changed to Bug instead of Sub-task.

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

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


More information about the core-libs-dev mailing list