[master] RFR: Load Klass* from header, C2 implementation

Roman Kennke rkennke at openjdk.java.net
Fri Feb 4 15:58:55 UTC 2022


This implements loading the compressed Klass* from the object header in C2.
This is quite a hack: normally we should change the load offset everywhere in C2 from 8 (current klass_offset_in_bytes) to 0 (the mark word offset). However, offset = 0 has different meaning in C2, it means no offset, and throws off all sorts of stuff in C2. Realistically, in the long run, we want to change to loading from offset 4 (upper half of the header), but we currently need to deal with locking, and thus load from offset 0.

I fake it: I pretend to load from offset 4 everywhere in C2 ideal graph, but then load from offset 0 and check the mark bits instead. We can't leave the offset in ideal graph at 8 because that is going to conflict with loads from first field as soon as we drop the Klass*.

We also need to ensure that C2 knows that the condition flags are clobbered (cr), and that src and dst are not the same register.

Testing:
 - [x] tier1 (x86_64, aarch64)
 - [ ] tier2
 - [ ] tier3

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

Commit messages:
 - Improve aarch64 LoadNKlass impl
 - Improve x86 LoadNKlass
 - Remove duplicate generate_load_nklass()
 - Merge remote-tracking branch 'upstream/master' into klass-from-header-c2
 - Merge conflicts
 - Merge remote-tracking branch 'origin/klass-from-header-c2' into klass-from-header-c2
 - Merge branch 'master' into klass-from-header-c2
 - Remove klass_offset memory edge
 - Restore memory edge to klass_offset, we still need it
 - Remove assert
 - ... and 26 more: https://git.openjdk.java.net/lilliput/compare/cf682984...42d01cb2

Changes: https://git.openjdk.java.net/lilliput/pull/29/files
 Webrev: https://webrevs.openjdk.java.net/?repo=lilliput&pr=29&range=00
  Stats: 65 lines in 17 files changed: 15 ins; 3 del; 47 mod
  Patch: https://git.openjdk.java.net/lilliput/pull/29.diff
  Fetch: git fetch https://git.openjdk.java.net/lilliput pull/29/head:pull/29

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


More information about the lilliput-dev mailing list