RFR: 8359380: Rework deferral profile logic after JDK-8346465 [v3]
Sergey Bylokhov
serb at openjdk.org
Mon Aug 18 16:08:39 UTC 2025
> The ICC_Profile class has special logic to postpone actual data loading for as long as possible. To support this we use a lightweight object that stores commonly used metadata such as the number of components that can be accessed without triggering full profile loading. But we currently discard this object once the profile is used for color conversion since the application might modify the profile data in a way that becomes inconsistent with what was previously cached.
>
> After [JDK-8346465](https://bugs.openjdk.org/browse/JDK-8346465) all standard ICC profiles bundled with the JDK are now immutable. This means the deferral logic can be simplified: we no longer need to drop the lightweight metadata object since the underlying data is guaranteed to remain unchanged.
>
> This patch includes two changes:
>
> 1. We [stop](https://github.com/openjdk/jdk/pull/26179/commits/dea4d8cd2a2450841469a289824281142bccacce) discarding the deferred metadata object. It will now used consistently removing the need for a special flag to identify standard profiles.
>
> 2. While implementing the logic above I noticed a [workaround](https://github.com/openjdk/jdk/pull/26179/commits/b40f97cddca3b260761553a1395ad2bac09b5fb6) introduced for [JDK-8272860](https://bugs.openjdk.org/browse/JDK-8272860) no longer applies. This workaround relied on getNumComponents() triggering header profile loading which no longer happens for standard profiles. Initially(at the moment the JDK-8272860 was filed) this caused test failures but due to unrelated changes all those tests now pass. To ensure this issue is still caught in the future, I’ve added a new test case that specifically verifies this behavior.
Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
- Merge branch 'openjdk:master' into JDK-8359380
- Merge branch 'openjdk:master' into JDK-8359380
- pdi->bpi
- Update workaround for 8272860
- 8359380: Rework deferral profile logic after JDK-8346465
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/26179/files
- new: https://git.openjdk.org/jdk/pull/26179/files/78ba5480..b095c5b2
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=26179&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=26179&range=01-02
Stats: 9060 lines in 278 files changed: 5706 ins; 2442 del; 912 mod
Patch: https://git.openjdk.org/jdk/pull/26179.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26179/head:pull/26179
PR: https://git.openjdk.org/jdk/pull/26179
More information about the client-libs-dev
mailing list