RFR: 8241613: Suspicious calls to MacroAssembler::null_check(Register, offset) [v2]
Matias Saavedra Silva
matsaave at openjdk.org
Thu Mar 16 20:02:56 UTC 2023
> 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.
Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
load_klass now emits null check and other platforms supported
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13026/files
- new: https://git.openjdk.org/jdk/pull/13026/files/76daacdc..391af540
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13026&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13026&range=00-01
Stats: 20 lines in 10 files changed: 0 ins; 14 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/13026.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/13026/head:pull/13026
PR: https://git.openjdk.org/jdk/pull/13026
More information about the hotspot-runtime-dev
mailing list