[master] RFR: Load Klass from header, C1/x86 implementation

Roman Kennke rkennke at openjdk.java.net
Fri Oct 15 18:03:30 UTC 2021


This implements loading the Klass* from object header (instead of dedicated Klass* field) in C1 generated code. It introduces a new C1 LIR opcode (LoadKlass) and related CodeStub for the slow-path runtime-call.

The original implementation was brittle in that it emits the decode_klass() whenever it encounters a load that is T_ADDRESS and from klass_offset_in_bytes() (e.g. 4 or 8). Lucky that we did not seem to emit any unrelated such loads. This new implementation uses a dedicated C1 op instead, and expands this to the corresponding load of the header word, and call into slow-path upon fast-path-failure, in the LIR assembler.

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

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

Commit messages:
 - Merge branch 'master' into klass-from-header-c1
 - Revert unnecessary changes
 - Merge branch 'master' into klass-from-header-c1
 - Merge branch 'master' into klass-from-header-c1
 - Swap xchg and store_register() to avoid trashing the argument
 - Merge remote-tracking branch 'origin/klass-from-header-c1' into klass-from-header-c1
 - Merge branch 'master' into klass-from-header-c1
 - Use xchg instead of push/pop to preserve rax in load-klass runtime call stub
 - Make mark-load opaque in the LIR of load-klass
 - Use any register for getting the Klass* result, and shuffle slow-path regs accordingly
 - ... and 12 more: https://git.openjdk.java.net/lilliput/compare/6373b6fe...a04787d8

Changes: https://git.openjdk.java.net/lilliput/pull/20/files
 Webrev: https://webrevs.openjdk.java.net/?repo=lilliput&pr=20&range=00
  Stats: 161 lines in 13 files changed: 140 ins; 11 del; 10 mod
  Patch: https://git.openjdk.java.net/lilliput/pull/20.diff
  Fetch: git fetch https://git.openjdk.java.net/lilliput pull/20/head:pull/20

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


More information about the lilliput-dev mailing list