[lworld] RFR: 8262863: [lworld] C2 should keep track of the oop even if an inline type is returned as fields

Tobias Hartmann thartmann at openjdk.java.net
Tue Mar 2 15:37:14 UTC 2021


If an inline type is returned, its fields are passed in registers if possible. The first register (rax) either contains a pointer to the InlineKlass to allow buffering in interpreted or C1 compiled callers or an oop if the inline type has already been buffered. Currently, a C2 compiled caller completely ignores the first register and just uses the field values returned in the other registers.

With this patch, C2 checks if an oop is returned and keeps track of it to avoid unnecessary re-buffering. This significantly boosts performance of cases were inlining fails and the callee is interpreted, C1 compiled or had to buffer the inline type for another reason (for example, due a store to a non-flattened field/array).

Thanks,
Tobias

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

Commit messages:
 - 8262863: [lworld] C2 should keep track of the oop even if an inline type is returned as fields

Changes: https://git.openjdk.java.net/valhalla/pull/357/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=357&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262863
  Stats: 21 lines in 5 files changed: 17 ins; 2 del; 2 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/357.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/357/head:pull/357

PR: https://git.openjdk.java.net/valhalla/pull/357



More information about the valhalla-dev mailing list