diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index 3f7f086220fef..e9d433a13155a 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 7e39cafa8113b..2c9f3b5b7aa5d 100644 --- a/src/hotspot/share/classfile/classFileParser.cpp +++ b/src/hotspot/share/classfile/classFileParser.cpp @@ -4135,8 +4135,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 27e6b3881e852..d55f8b54268fd 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 9d8f602a4fe1b..f6fcc0486aa13 100644 --- a/src/hotspot/share/interpreter/rewriter.cpp +++ b/src/hotspot/share/interpreter/rewriter.cpp @@ -524,7 +524,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 bab6010866780..d23188efce544 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -1503,9 +1503,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 58ed347f6afa5..b9f6c5d969dea 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -964,7 +964,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 0b867c69ebc74..38d70597434b0 100644 --- a/src/hotspot/share/opto/parse1.cpp +++ b/src/hotspot/share/opto/parse1.cpp @@ -2197,8 +2197,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(); }