-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Save stubgen stubs #28433
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
base: master
Are you sure you want to change the base?
Save stubgen stubs #28433
Conversation
|
👋 Welcome back adinn! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This PR still needs to ensure that pre-universe stub entries are registered in the AOT address table. These stubs cannot be saved and restored because the AOT cache does not exist before universe init. As a consequence their addresses cannot be registered using the normal generate time mechanism. The required fix will be to add them via special case handling as soon as the AOT cache and address table have been initialised (preferably at the point where the majority of external addresses are registered). This omission is not a problem for this patch i.e. as far as reference from existing stubs is concerned since none of the saved stubs targets to a pre-universe stub entry. However, they ought to be registered in case that situation changes or in case an nmethod that gets saved to and reloaded from the AOT cache needs at some point to target a pre-universe stub. |
| int entry_count = StubInfo::entry_count(stub_id); | ||
| assert(entry_count == 1, "sanity check"); | ||
| if (find_archive_data(stub_id)) { | ||
| address start = nullptr; | ||
| address end = nullptr; | ||
| load_archive_data(stub_id, start, end); | ||
| return start; | ||
| } | ||
|
|
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.
This code pattern repeats a lot. Can we move it into load_archive_data()?
address start = load_archive_data(stub_id);
if (start != nullptr) {
return start;
}
And have an other specialized load_archive_data if you need end value.
| void StubGenerator_AOTAddressTable_init() { | ||
| ResourceMark rm; | ||
| GrowableArray<address> external_addresses; | ||
| // publish static addresses referred to by aarch64 generator | ||
| StubGenerator::init_AOTAddressTable(external_addresses); | ||
| // publish external data addresses defined in nested aarch64 class | ||
| StubRoutines::aarch64::init_AOTAddressTable(external_addresses); | ||
| AOTCodeCache::publish_external_addresses(external_addresses); | ||
| } |
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.
This and *init_AOTAddressTable() methods should be under #if INCLUDE_CDS
|
|
||
| // Non-generated init method | ||
|
|
||
| void StubRoutines::init_AOTAddressTable() { |
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.
Can this body be in platform specific file.
|
I noticed that we have to add a lot of local data tables addresses for stubs (math intrinsics). |
This PR adds save and restore of all generated stubs to the AOT code cache on x86 and aarch64. Other arches are modified to deal with the related generic PAI changes.
Small changes were required to the aarch64 and x86_64 generator code in order to meet two key constraints:
Progress
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28433/head:pull/28433$ git checkout pull/28433Update a local copy of the PR:
$ git checkout pull/28433$ git pull https://git.openjdk.org/jdk.git pull/28433/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28433View PR using the GUI difftool:
$ git pr show -t 28433Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28433.diff