On Sat, 23 Nov 2024 16:29:10 GMT, Quan Anh Mai <qa...@openjdk.org> wrote:
> Hi, > > This patch sharpens the return types of various internal methods. This helps > the compiler to have better information when the corresponding methods are > not inlined. > > Please take a look and leave your reviews, thanks a lot. I see this patch is in 2 parts: 1. Move of `AbstractMemorySegmentImpl::sessionImpl` to `scope` (a covariant override). This involves a lot of usage updates. 2. More specific return types for many other methods. Should these 2 be in 2 patches, as 1 has a lot of renaming changes? src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java line 392: > 390: > 391: @Override > 392: public MemorySessionImpl scope() { Should this be `final` and `@ForceInline` to better match the old behavior of `sessionImpl`? ------------- PR Review: https://git.openjdk.org/jdk/pull/22344#pullrequestreview-2456444601 PR Review Comment: https://git.openjdk.org/jdk/pull/22344#discussion_r1855230734