-
Notifications
You must be signed in to change notification settings - Fork 759
Add storage, retrieval of AOT method dependencies #20581
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
Conversation
Attn @mpirvu. This is just the dependency storage/retrieval implementation. I've mentioned before that I was storing the offset to the dependencies next to the well-known classes offset, in the relocation record header. That happens starting here. While I was doing that previously, I believe this conflicts with AOT method compression in the SCC - I'd have to decompress the stored data just to read off the offset, because the relocation records are compressed as well. I've chosen not to store the dependency offset in the compiled body at all, and instead look up the dependencies by key when I need them. Alternatively, I could store the dependency chain offset in the AOT method header itself. |
cursor += dependencyKeyPrefixLength; | ||
|
||
convertUnsignedOffsetToASCII(offset, cursor); | ||
keyLength = (cursor - buffer) + _numDigitsForCacheOffsets + 1; // NULL terminator not included in _numDigitsForCacheOffsets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the keyLength includes the NULL terminator
* The dependencies of an AOT method are encoded as an array of uintptr_t values. The first entry is the number | ||
* of elements in the entire array. The subsequent entries are encoded offsets to the class chains of classes that | ||
* need to be loaded or initialized before the compiled body can be loaded. The entry will be the offset itself | ||
* if the class must be initialized, and it will be (offset & ~1) if the class only needs to be loaded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the comment. Do you erase the last bit or set the last bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I erase the last bit. Class chain offsets always have their last bit set. I've clarified.
b39688a
to
62f91cc
Compare
jenkins compile all jdk21 |
One build error:
The imports must be slightly different on aarch64_mac. |
62f91cc
to
b28ad15
Compare
I think |
When the dependencies of compiled AOT method bodies are tracked, they will be stored in the SCC as arrays of uintptr_t values, with the first entry being the length of the array, and the subsequent entries being encoded class chain offsets. The low bit of the class chain offset will be cleared if the corresponding class merely needs to be loaded before the compiled method body in the SCC can be loaded. This infrastructure is currently unused. Signed-off-by: Christian Despres <[email protected]>
b28ad15
to
429d0a8
Compare
jenkins compile all jdk21 |
The new code is not executed, so compile tests are sufficient. |
When the dependencies of compiled AOT method bodies are tracked, they will be stored in the SCC as arrays of uintptr_t values, with the first entry being the length of the array, and the subsequent entries being encoded class chain offsets. The low bit of the class chain offset will be cleared if the corresponding class merely needs to be loaded before the compiled method body in the SCC can be loaded.
This infrastructure is currently unused.
Related: #20529