[master] RFR: Store (narrow) klass in object header [v2]

Roman Kennke rkennke at openjdk.java.net
Fri May 21 18:41:42 UTC 2021

> This change stores compressed Klass* in the upper 32bits of the object header. It doesn't really use it, yet. But I added some code in heap-object-stats to verify that all objects receive it.
> It is implemented by storing the compressed Klass* into the prototype-header for each Klass, and use that to initialize objects, pretty much like we used to do for +BiasedLocking.
> It will take some serious effort to change all code to use this new location to find the Klass*:
> - We need to change all generated code (intepreter, c1, c2) to load Klass* from the header, and call to runtime when it encounters a displaced header word.
> - We need to change (sliding-compacting) GCs to be able to iterate heap while objects are forwarded. Most likely by using a forwarding table, but I'm not quite sure yet.
> - We need to change rest of runtime to load Klass* from header.
> In this change, I modified some code in G1 that deals with checking consistent header, the same asserts that we have seen in #6. This is rather ugly, but I actually expect those asserts to go away or be rewritten in a more useful way.
> CDS support is noteworthy because we need to ensure that we propagate the actual narrowKlass whenever we (re-)initialize object headers, because that may be encoded with a different base address for archived Klass instances than other Klass instances, and would create a mess if we would re-encode the Klass*.
> Testing
>  - [x] tier1
>  - [x] tier2

Roman Kennke has updated the pull request incrementally with four additional commits since the last revision:

 - 32bit build fixes
 - Assume compressed klass pointers in markWord::set_klass()
 - Put back newline
 - Remove superfluous assert


  - all: https://git.openjdk.java.net/lilliput/pull/7/files
  - new: https://git.openjdk.java.net/lilliput/pull/7/files/b612a5ad..75993587

 - full: https://webrevs.openjdk.java.net/?repo=lilliput&pr=7&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=lilliput&pr=7&range=00-01

  Stats: 18 lines in 6 files changed: 4 ins; 4 del; 10 mod
  Patch: https://git.openjdk.java.net/lilliput/pull/7.diff
  Fetch: git fetch https://git.openjdk.java.net/lilliput pull/7/head:pull/7

PR: https://git.openjdk.java.net/lilliput/pull/7

More information about the lilliput-dev mailing list