RFR: 8278548: G1: Remove unnecessary check in forward_to_block_containing_addr

Thomas Schatzl tschatzl at openjdk.java.net
Mon Dec 13 09:40:13 UTC 2021


On Sat, 11 Dec 2021 14:53:27 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> I added an assert. However, it's quite odd to mention the klass pointer in this context: it's unclear why the klass is not null and why a non-null klass pointer is useful or required here.

Looking at `block_start`, you are right that this is not absolutely necessary, it can handle arbitrary locations (at least below TAMS) to start from. It will fail above TAMS though as the code directly accesses these objects' `size()` in that area.

Having slightly stronger assumptions, that all block starts are valid objects, does not seem to hurt.

The error message could mention something like "start of block must be an initialized object" instead?

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

PR: https://git.openjdk.java.net/jdk/pull/6797



More information about the hotspot-gc-dev mailing list