Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor JITServer AOT cache reading #16228

Merged
merged 2 commits into from Nov 11, 2022

Conversation

cjjdespres
Copy link
Contributor

This PR cleans up some of the JITServer AOT cache reading code from the recent #15949.

  • A new cache read context struct simplifies passing around the relevant state when reading a cache file
  • The various read functions for the individual cache records (other than CachedAOTMethod) have been consolidated into a single AOTCacheRecord::readRecord function template.

Related: #16109

@cjjdespres
Copy link
Contributor Author

Attn @mpirvu.

@mpirvu mpirvu self-assigned this Oct 31, 2022
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Oct 31, 2022
@mpirvu mpirvu added this to In progress in JIT as a Service via automation Oct 31, 2022
@cjjdespres
Copy link
Contributor Author

I'm still testing this, but something appears to be wrong with AOTCacheClassRecord reading.

@cjjdespres
Copy link
Contributor Author

Oh, of course, I use the data of the freshly-allocated record before memcpying it.

@cjjdespres cjjdespres force-pushed the persist-refactor branch 2 times, most recently from 3d57f36 to b55a0cb Compare November 1, 2022 19:13
@cjjdespres
Copy link
Contributor Author

I've also unified the CachedAOTMethod::read function with the AOTCacheRecord::readRecord function.

@cjjdespres
Copy link
Contributor Author

I believe this is the outstanding refactoring done. If there's anything that I've forgotten, let me know.

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I have a few inline questions.

runtime/compiler/runtime/JITServerAOTCache.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@AlexeyKhrabrov AlexeyKhrabrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall except a few minor things (see inline comments).

There are still a few more refactoring opportunities, but they can be addressed later:

  • SerializedAOTMethod and CachedAOTMethod could be added to the AOTSerializationRecord and AOTCacheRecord class hierarchies.
  • The combination of a key-record map, list head and tail, etc. for each record type in JITServerAOTCache could be turned into a single struct template.
  • Lists of fields per record type could be replaced with arrays indexed by record type in some places.

runtime/compiler/runtime/JITServerAOTCache.hpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/JITServerAOTCache.cpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/JITServerAOTCache.cpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/JITServerAOTCache.hpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/JITServerAOTCache.cpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/JITServerAOTCache.hpp Outdated Show resolved Hide resolved
@cjjdespres cjjdespres force-pushed the persist-refactor branch 2 times, most recently from 613a184 to a9d76fc Compare November 10, 2022 16:14
@cjjdespres
Copy link
Contributor Author

I believe that is all of the comments addressed.

Copy link
Contributor

@AlexeyKhrabrov AlexeyKhrabrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except one small change below.

Signed-off-by: Christian Despres <despresc@ibm.com>
Signed-off-by: Christian Despres <despresc@ibm.com>
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpirvu
Copy link
Contributor

mpirvu commented Nov 10, 2022

jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit jdk17

@mpirvu
Copy link
Contributor

mpirvu commented Nov 11, 2022

jenkins test sanity plinuxjit jdk17

@mpirvu mpirvu merged commit 70a06b9 into eclipse-openj9:master Nov 11, 2022
JIT as a Service automation moved this from In progress to Done Nov 11, 2022
@mpirvu mpirvu linked an issue Nov 11, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
Development

Successfully merging this pull request may close these issues.

Add persistence to the JITServer AOT cache
3 participants