[lworld] RFR: 8354068: [lworld] Fold strict final fields more aggressively
Quan Anh Mai
qamai at openjdk.org
Tue Apr 8 21:12:31 UTC 2025
On Tue, 8 Apr 2025 19:17:20 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
> Hi,
>
> When we do incremental inlining, we need to be more aggressive to ensure that value objects are not unexpectedly materialized. This is done by trying to fold loads from strict final fields in an aggressive manner.
>
> Please take a look and leave your reviews, thanks a lot.
Although, we can say that trusted fields are in trusted class which should not leak instances before the completion of the constructor, and probably a weaker version of this could be ported to those trusted fields. I think making those fields strict instead would be a better move. The fact that an object must initialize all its strict final fields before we can do anything with it is a really strong guarantee that makes reasoning much easier, especially when we have to deal with concurrent accesses.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1424#issuecomment-2787669735
More information about the valhalla-dev
mailing list