mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8276422: Add command-line option to disable finalization
Co-authored-by: David Holmes <dholmes@openjdk.org> Co-authored-by: Brent Christian <bchristi@openjdk.org> Reviewed-by: dholmes, kbarrett, bchristi
This commit is contained in:
parent
ec7cb6d5d3
commit
d7ad546758
13 changed files with 265 additions and 17 deletions
|
@ -2835,7 +2835,8 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
|
|||
annotation_default_length,
|
||||
CHECK_NULL);
|
||||
|
||||
if (name == vmSymbols::finalize_method_name() &&
|
||||
if (InstanceKlass::is_finalization_enabled() &&
|
||||
name == vmSymbols::finalize_method_name() &&
|
||||
signature == vmSymbols::void_method_signature()) {
|
||||
if (m->is_empty_method()) {
|
||||
_has_empty_finalizer = true;
|
||||
|
@ -4171,7 +4172,8 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) {
|
|||
bool f = false;
|
||||
const Method* const m = ik->lookup_method(vmSymbols::finalize_method_name(),
|
||||
vmSymbols::void_method_signature());
|
||||
if (m != NULL && !m->is_empty_method()) {
|
||||
if (InstanceKlass::is_finalization_enabled() &&
|
||||
(m != NULL) && !m->is_empty_method()) {
|
||||
f = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue