RFR: 8275527: Separate/refactor forward pointer access [v3]

Roman Kennke rkennke at openjdk.java.net
Thu Oct 28 11:47:52 UTC 2021


> Accessing the forward pointer overlay of object headers is currently done in a somewhat crude way. oopDesc::forwardee() and oopeDesc::is_forwarded() both load the header-word. This seems kinda bad, because they are most often used in conjunction, e.g.:
> fwd = obj->forwarded() ? obj->forwardee() : promote_obj();
> 
> or similar constructs.
> 
> Also, in some places, the forwardee is accessed in a more direct fashion using markWord::decode_pointer(), or as HeapWord*, sometimes is_forwarded() is determined by forwardee() == NULL checks (and crude overrides to prepare non-forwarded headers to return NULL in such checks, see g1Full* source files).
> 
> I propose to extract and refactor forward pointer access in a way to better support above pattern. In-fact I originally wrote this with performance-enhancement in mind (see oopForwarding.hpp header for more details), but I could not show any actual performance improvements, so let's consider this purely on cleanliness and separation-of-concerns basis.
> 
> Testing:
>  - [x] tier
>  - [x] tier2
>  - [x] hotspot_gc

Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:

  Fix Parallel GC mistake

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/5955/files
  - new: https://git.openjdk.java.net/jdk/pull/5955/files/75fdec35..a9f0c845

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5955&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5955&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5955.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5955/head:pull/5955

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



More information about the hotspot-gc-dev mailing list