RFR: 8241613: Suspicious calls to MacroAssembler::null_check(Register, offset) [v5]

Andrew Dinn adinn at openjdk.org
Mon Mar 27 15:32:06 UTC 2023


On Mon, 27 Mar 2023 11:54:10 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Yes, and preferably with an accompanying comment that explains why the assert is present i.e. that it guarantees that calls to `load_klass` can rely on the SEGV handler to detect null oops. Also a similar comment for the array length offset assertion.
>
> Suggest a global place please and but not in oopDesc::klass_offset_in_bytes() because that would require oop.hpp to include os.hpp.  I couldn't find somewhere good where we wouldn't have to write a large comment to explain the context.

Perhaps in `Universe::genesis()` in file universe.cpp? That is where all sorts of hand-cranked Klass-related gubbins gets set up so it seems like a sensible place to check before the create. Likewise for the array offset assert.

WDYT, Coleen/David?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13026#discussion_r1149426029


More information about the hotspot-runtime-dev mailing list