mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8153312: Constrain AppCDS behavior
Reviewed-by: iklam, acorn, mschoene
This commit is contained in:
parent
2a09a3923a
commit
bd07a43e61
7 changed files with 131 additions and 19 deletions
|
@ -313,6 +313,33 @@ void Method::remove_unshareable_info() {
|
|||
unlink_method();
|
||||
}
|
||||
|
||||
void Method::set_vtable_index(int index) {
|
||||
if (is_shared() && !MetaspaceShared::remapped_readwrite()) {
|
||||
// At runtime initialize_vtable is rerun as part of link_class_impl()
|
||||
// for a shared class loaded by the non-boot loader to obtain the loader
|
||||
// constraints based on the runtime classloaders' context.
|
||||
return; // don't write into the shared class
|
||||
} else {
|
||||
_vtable_index = index;
|
||||
}
|
||||
}
|
||||
|
||||
void Method::set_itable_index(int index) {
|
||||
if (is_shared() && !MetaspaceShared::remapped_readwrite()) {
|
||||
// At runtime initialize_itable is rerun as part of link_class_impl()
|
||||
// for a shared class loaded by the non-boot loader to obtain the loader
|
||||
// constraints based on the runtime classloaders' context. The dumptime
|
||||
// itable index should be the same as the runtime index.
|
||||
assert(_vtable_index == itable_index_max - index,
|
||||
"archived itable index is different from runtime index");
|
||||
return; // don’t write into the shared class
|
||||
} else {
|
||||
_vtable_index = itable_index_max - index;
|
||||
}
|
||||
assert(valid_itable_index(), "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Method::was_executed_more_than(int n) {
|
||||
// Invocation counter is reset when the Method* is compiled.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue