Skip to content

8373348: [lworld] Cache AdapterHandleEntry::_sig_cc field in AOTCache#2348

Draft
matias9927 wants to merge 7 commits into
openjdk:lworldfrom
matias9927:sig_cc_8373348
Draft

8373348: [lworld] Cache AdapterHandleEntry::_sig_cc field in AOTCache#2348
matias9927 wants to merge 7 commits into
openjdk:lworldfrom
matias9927:sig_cc_8373348

Conversation

@matias9927
Copy link
Copy Markdown
Contributor

@matias9927 matias9927 commented Apr 21, 2026

Currently, scalarized calling conventions used by the compilers are recalculated each runtime even though adapters can be stored in the AOT cache. This change archives _sig_cc and _sig_cc_ro to avoid recomputing them even when the adapter can be restored from the AOT archive. Verified with tier 1-5 tests.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8373348: [lworld] Cache AdapterHandleEntry::_sig_cc field in AOTCache (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2348/head:pull/2348
$ git checkout pull/2348

Update a local copy of the PR:
$ git checkout pull/2348
$ git pull https://git.openjdk.org/valhalla.git pull/2348/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2348

View PR using the GUI difftool:
$ git pr show -t 2348

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2348.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Apr 21, 2026

👋 Welcome back matsaave! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Apr 21, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@matias9927 matias9927 marked this pull request as ready for review April 21, 2026 18:21
@openjdk openjdk Bot added the rfr Pull request is ready for review label Apr 21, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Apr 21, 2026

Webrevs

@iklam
Copy link
Copy Markdown
Member

iklam commented Apr 22, 2026

Since you are archiving SigEntry, I think it's a good time to reduce its size and also make its contents deterministic. It currently looks like this:

(gdb) ptype/o SigEntry
/* offset      |    size */  type = class SigEntry {
                             public:
/*      0      |       1 */    BasicType _bt;
/* XXX  3-byte hole      */
/*      4      |       4 */    int _offset;
/*      8      |       8 */    Symbol *_name;
/*     16      |       1 */    bool _null_marker;
/*     17      |       1 */    bool _vt_oop;
/* XXX  6-byte padding   */

How about:

class SigEntry {
 public:
  BasicType _bt;      // Basic type of the argument
  bool _null_marker;  // Is it a null marker? For printing
  bool _vt_oop;       // Is it a possibly null buffer
  bool _unused;       // Set to 0 for deterministic CDS contents
  int _offset;        // Offset of the field in its value class holder for scalarized arguments (-1 otherwise). Used for packing and unpacking.
  Symbol* _name;      // Symbol for printing

  SigEntry()
    : _bt(T_ILLEGAL), _null_marker(false), _vt_oop(false), _unused(false),  _offset(-1), _name(nullptr){}
   ...

@Arraying
Copy link
Copy Markdown
Member

A couple of drive-by questions:

  • On top of _sig_cc and _sig_cc_ro, we also have _sig. Why don't we have to archive this?
  • At some point, I knew what "ro" stood for. I know we have 3 types of (compiled) entry points, and I took a look around the codebase a bit, but I genuinely couldn't find what it's an acronym form. Is there documentation anywhere, and if not, as a follow-up, could we write a couple of sentences (e.g., CompiledEntrySignature)?

@matias9927 matias9927 marked this pull request as draft April 22, 2026 14:26
@openjdk openjdk Bot removed the rfr Pull request is ready for review label Apr 22, 2026
@matias9927
Copy link
Copy Markdown
Contributor Author

This PR was reverted to a draft due to some performance regressions. Once a more performant version of this patch is available it will be open for review again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants