RFR: 8330339: G1: Refactor G1BlockOffsetTable APIs
Albert Mingkun Yang
ayang at openjdk.org
Wed Apr 17 06:47:01 UTC 2024
On Tue, 16 Apr 2024 13:28:19 GMT, Guoxiong Li <gli at openjdk.org> wrote:
> Hi all,
>
> This patch moves several methods to the `private` part.
>
> Thanks for taking the time to review.
>
> Best Regards,
> -- Guoxiong
Since link-time-opt is disabled by default on most platforms (`# Only arm-32 should have link-time-opt enabled as default`), compiler needs to "see" the body of a method/function to not treat it as blackbox, i.e. emitting `call` in asm. As a result, inline.hpp is meant to expose some non-trivial & perf-critical methods to callers in another file (translation unit) so that compiler can perform more/better optimizations.
> I think the non-trivial inlined methods should be put in `inline.hpp`
I think it's more precise to say body of perf-critical public apis should be placed in hpp/inline.hpp. In order for compiler to see through those apis, their recursive callees should be "inlinable" (e.g. placed in inline.hpp) as well. Otherwise, the effect of placing those apis in inline.hpp will be limited.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18800#issuecomment-2060494291
More information about the hotspot-gc-dev
mailing list