-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8354887: Preserve runtime blobs in AOT code cache #25019
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
Changes from 9 commits
5091d66
4912fa7
ee815cc
0a5ed57
0903fe0
7b18fc1
808b149
733f5b0
c15ebdb
a6d83a1
ba612da
de227cf
9fcc91b
fa998b3
98e5fa0
c7341cd
a664568
5d7c3aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -421,6 +421,7 @@ reg_class int_rdi_reg(RDI); | |
source_hpp %{ | ||
|
||
#include "peephole_x86_64.hpp" | ||
#include "code/aotCodeCache.hpp" | ||
|
||
bool castLL_is_imm32(const Node* n); | ||
|
||
|
@@ -1859,8 +1860,12 @@ encode %{ | |
%} | ||
|
||
enc_class Java_To_Runtime(method meth) %{ | ||
// No relocation needed | ||
__ mov64(r10, (int64_t) $meth$$method); | ||
if (AOTCodeCache::is_on_for_dump()) { | ||
// Created runtime_call_type relocation when caching code | ||
__ lea(r10, RuntimeAddress((address)$meth$$method)); | ||
} else { | ||
__ mov64(r10, (int64_t) $meth$$method); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should do it always, not conditionally. On AArch64 it is unconditional - relocation processing know how to do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will update |
||
__ call(r10); | ||
__ post_call_nop(); | ||
%} | ||
|
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.
For most shared blobs we have a single entry at offset 0. However, for the deopt blob we have 3 (or 5) extra entry points which are embedded in the deopt blob as field values. Saving and restoring the blob internal state removes the need to pass a count and array of entry offsets into load_code_blob and store_code_blob at this point.
That makes we wonder if we need to do the same with AdapterBlob. If we embedded the offsets that are currently stored in AdapterHandlerEntry into AdapterBlob then we could also avoid having to explicitly pass the count and array of offsets at AOT load/store for adapters. The getters in AdapterHandlerEntry could fetch them indirectly or else the entry could cache them locally when it is initialized depending on whether we care about a memory indirection. Maybe this would make things more uniform?
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.
yup, I agree and I have the similar idea of storing entry points in AdapterBlob just like DeoptimizationBlob. Currently the pointer to AdapterBlob is not maintained anywhere. So the AdapterHandlerEntry would also have to maintain pointer to AdapterBlob.
I was actually wondering if we can eliminate AdapterHandlerEntry by also storing AdapterFingerprint in the AdapterBlob. The Method can then have a pointer to AdapterBlob.
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 will open an RFE to move entry points to AdapterBlob.
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.
Yes, let's do that in follow up RFE.
@adinn can you approve current changes so we can proceed?
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.
Done!