Integrated: 8241613: Suspicious calls to MacroAssembler::null_check(Register, offset)
Matias Saavedra Silva
matsaave at openjdk.org
Mon Apr 3 13:02:16 UTC 2023
On Tue, 14 Mar 2023 18:17:09 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
> In several places in HotSpot, the method MacroAssembler::null_check(Register, offset) is called in a way that never produces any null check in the assembly code. The method null_check(Register, offset) calls needs_explicit_null_check(offset) to determine if it must emit a null check in the assembly code or not.
>
> needs_explicit_null_check(offset) returns true only if the offset is negative or bigger than the os page size.
> the offset being passed is the offset of a field in the header of Java object or a Java array. In both cases, the offset is always positive and smaller than an os page size. A null_check() call with a single parameter will always produce a null check in assembly.
>
> The cases suggested in the issue have been addressed by either removing or preserving the null_check. Verified with tier 1-3 tests.
This pull request has now been integrated.
Changeset: 127afd34
Author: Matias Saavedra Silva <matsaave at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/127afd3445814a1c06e60955813a5948488b1a1c
Stats: 75 lines in 22 files changed: 6 ins; 47 del; 22 mod
8241613: Suspicious calls to MacroAssembler::null_check(Register, offset)
Reviewed-by: dholmes, coleenp, fparain, adinn
-------------
PR: https://git.openjdk.org/jdk/pull/13026
More information about the hotspot-runtime-dev
mailing list