diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index 396c83c6ab976..a361f3da9c281 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.cpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp @@ -1556,8 +1556,7 @@ void GraphBuilder::call_register_finalizer() { void GraphBuilder::method_return(Value x, bool ignore_return) { - if (RegisterFinalizersAtInit && - method()->intrinsic_id() == vmIntrinsics::_Object_init) { + if (method()->intrinsic_id() == vmIntrinsics::_Object_init) { call_register_finalizer(); } diff --git a/src/hotspot/share/classfile/classFileParser.cpp b/src/hotspot/share/classfile/classFileParser.cpp index fa7ca41e0c536..734b425cb4593 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -4188,8 +4188,7 @@ void ClassFileParser::set_precomputed_flags(InstanceKlass* ik) { // If it cannot be fast-path allocated, set a bit in the layout helper. // See documentation of InstanceKlass::can_be_fastpath_allocated(). assert(ik->size_helper() > 0, "layout_helper is initialized"); - if ((!RegisterFinalizersAtInit && ik->has_finalizer()) - || ik->is_abstract() || ik->is_interface() + if (ik->is_abstract() || ik->is_interface() || (ik->name() == vmSymbols::java_lang_Class() && ik->class_loader() == nullptr) || ik->size_helper() >= FastAllocateSizeLimit) { // Forbid fast-path allocation. diff --git a/src/hotspot/share/interpreter/abstractInterpreter.cpp b/src/hotspot/share/interpreter/abstractInterpreter.cpp index ff039a8945520..b880f86e51ef1 100644 --- a/src/hotspot/share/interpreter/abstractInterpreter.cpp +++ b/src/hotspot/share/interpreter/abstractInterpreter.cpp @@ -149,7 +149,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(const methodHan case vmIntrinsics::_dsqrt_strict: return java_lang_math_sqrt_strict; case vmIntrinsics::_Reference_get: return java_lang_ref_reference_get; case vmIntrinsics::_Object_init: - if (RegisterFinalizersAtInit && m->code_size() == 1) { + if (m->code_size() == 1) { // We need to execute the special return bytecode to check for // finalizer registration so create a normal frame. return zerolocals; diff --git a/src/hotspot/share/interpreter/rewriter.cpp b/src/hotspot/share/interpreter/rewriter.cpp index ea9b9cff95237..07ea1e2e2044b 100644 --- a/src/hotspot/share/interpreter/rewriter.cpp +++ b/src/hotspot/share/interpreter/rewriter.cpp @@ -531,7 +531,7 @@ void Rewriter::rewrite_bytecodes(TRAPS) { // determine index maps for Method* rewriting compute_index_maps(); - if (RegisterFinalizersAtInit && _klass->name() == vmSymbols::java_lang_Object()) { + if (_klass->name() == vmSymbols::java_lang_Object()) { bool did_rewrite = false; int i = _methods->length(); while (i-- > 0) { diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 43bec86d8e5f1..9ca3c0264a058 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1515,9 +1515,6 @@ instanceOop InstanceKlass::allocate_instance(TRAPS) { instanceOop i; i = (instanceOop)Universe::heap()->obj_allocate(this, size, CHECK_NULL); - if (has_finalizer_flag && !RegisterFinalizersAtInit) { - i = register_finalizer(i, CHECK_NULL); - } return i; } diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index b5f598030ef26..a77227198f63e 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -959,7 +959,6 @@ class InstanceKlass: public Klass { // This bit is initialized in classFileParser.cpp. // It is false under any of the following conditions: // - the class is abstract (including any interface) - // - the class has a finalizer (if !RegisterFinalizersAtInit) // - the class size is larger than FastAllocateSizeLimit // - the class is java/lang/Class, which cannot be allocated directly bool can_be_fastpath_allocated() const { diff --git a/src/hotspot/share/opto/parse1.cpp b/src/hotspot/share/opto/parse1.cpp index 97cc025b45b72..5f86847442208 100644 --- a/src/hotspot/share/opto/parse1.cpp +++ b/src/hotspot/share/opto/parse1.cpp @@ -2239,8 +2239,7 @@ void Parse::rtm_deopt() { //------------------------------return_current--------------------------------- // Append current _map to _exit_return void Parse::return_current(Node* value) { - if (RegisterFinalizersAtInit && - method()->intrinsic_id() == vmIntrinsics::_Object_init) { + if (method()->intrinsic_id() == vmIntrinsics::_Object_init) { call_register_finalizer(); } diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index ef6c0dcd9f619..a7a6f7d97a847 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -671,10 +671,6 @@ const int ObjectAlignmentInBytes = 8; product(bool, PrintWarnings, true, \ "Print JVM warnings to output stream") \ \ - product(bool, RegisterFinalizersAtInit, true, \ - "(Deprecated) Register finalizable objects at end of " \ - "Object. or after allocation") \ - \ develop(bool, RegisterReferences, true, \ "Tell whether the VM should register soft/weak/final/phantom " \ "references") \