mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8241071: Generation of classes.jsa with -Xshare:dump is not deterministic
Reviewed-by: dholmes, stuefe
This commit is contained in:
parent
957eb270f0
commit
eadcb08c3c
20 changed files with 369 additions and 92 deletions
|
@ -174,10 +174,22 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
inline unsigned DumpTimeSharedClassTable_hash(InstanceKlass* const& k) {
|
||||
if (DumpSharedSpaces) {
|
||||
// Deterministic archive contents
|
||||
uintx delta = k->name() - MetaspaceShared::symbol_rs_base();
|
||||
return primitive_hash<uintx>(delta);
|
||||
} else {
|
||||
// Deterministic archive is not possible because classes can be loaded
|
||||
// in multiple threads.
|
||||
return primitive_hash<InstanceKlass*>(k);
|
||||
}
|
||||
}
|
||||
|
||||
class DumpTimeSharedClassTable: public ResourceHashtable<
|
||||
InstanceKlass*,
|
||||
DumpTimeSharedClassInfo,
|
||||
primitive_hash<InstanceKlass*>,
|
||||
&DumpTimeSharedClassTable_hash,
|
||||
primitive_equals<InstanceKlass*>,
|
||||
15889, // prime number
|
||||
ResourceObj::C_HEAP>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue