Skip to content

Commit

Permalink
8320522: Remove code related to RegisterFinalizersAtInit
Browse files Browse the repository at this point in the history
  • Loading branch information
DanHeidinga committed Apr 17, 2024
1 parent 9fd7802 commit 93e154e
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/hotspot/share/c1/c1_GraphBuilder.cpp
Expand Up @@ -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();
}

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/classfile/classFileParser.cpp
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/interpreter/abstractInterpreter.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/interpreter/rewriter.cpp
Expand Up @@ -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) {
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/oops/instanceKlass.cpp
Expand Up @@ -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;
}

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/oops/instanceKlass.hpp
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/opto/parse1.cpp
Expand Up @@ -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();
}

Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/runtime/globals.hpp
Expand Up @@ -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.<init> or after allocation") \
\
develop(bool, RegisterReferences, true, \
"Tell whether the VM should register soft/weak/final/phantom " \
"references") \
Expand Down

0 comments on commit 93e154e

Please sign in to comment.