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

Andrew Dinn adinn at openjdk.org
Mon Mar 27 09:25:41 UTC 2023


On Mon, 27 Mar 2023 02:34:37 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Removed accidental change
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 4319:
> 
>> 4317: void MacroAssembler::load_klass(Register dst, Register src) {
>> 4318:   assert(oopDesc::klass_offset_in_bytes() < static_cast<intptr_t>(os::vm_page_size()),
>> 4319:          "Doesn't need explicit null check");
> 
> Sorry I meant for this to be a "global" assert somewhere, executed once per VM startup, not done on each call like this.

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.

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

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


More information about the hotspot-runtime-dev mailing list