On Thu, 27 Aug 2026 09:27:18 GMT, Axel Boldt-Christmas <[email protected]> 
wrote:

>> Historically we have had displaced markWord's because locking (stack locks, 
>> and inflated monitors).
>> 
>> After the `UseObjectMonitorTable` removal there are no more need to protect 
>> against displaced markWords.
>> 
>> I suggest we simplify this logic and clean up the interface w.r.t. 
>> `identity_hash`.
>> 
>> Changes the `fast_no_hash_check` and `has_no_hash` into `has_identity_hash` 
>> and `has_hash` checks. 
>> As before it is invalid to read the hash on marked objects, added asserts to 
>> ensure this.
>> Rewrote `oopDesc::slow_identity_hash` to not regenerate a new hash every 
>> time it transiently fails to install the hash in the markWord due to some 
>> other header change.
>> 
>> There are a few places which right now calls `identity_hash` from develop 
>> logging / introspection printing `InstanceStackChunkKlass::print_chunk` and 
>> `Continuation::print`. It is a bit unfortunate that we have these 
>> side-effects in debug VMs. But think we should handle these in a future RFE.
>> 
>> Testing (in progress):
>> * Tier 1-3 Oracle supported platforms
>> * GHA
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Axel Boldt-Christmas has updated the pull request incrementally with two 
> additional commits since the last revision:
> 
>  - Use is_valhalla_enable instead of enable_preview
>  - Add newline to comment

src/hotspot/share/oops/markWord.hpp line 275:

> 273:   // hash operations
> 274:   intptr_t hash() const {
> 275:     precond(!is_marked());

@xmas92: This function is also used during error reporting and the `precond` 
causes "error occurred during error reporting" in hs_err files. E.g.:

R8 =
[error occurred during error reporting (printing register info), id 0xe0000000, 
Internal Error 
(/workspace/openjdk-jdk-dev-linux_x86_64-dbg/jdk/src/hotspot/share/oops/markWord.hpp:275)]

I guess that the caller is wrong, but I just wanted to mention it here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32535#discussion_r4602890008

Reply via email to