Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/hotspot/share/classfile/systemDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ Klass* SystemDictionary::resolve_array_class_or_null(Symbol* class_name,
k = k->array_klass(ndims, CHECK_NULL);
}
} else {
TypeArrayKlass* tak = Universe::typeArrayKlass(t);
k = tak->array_klass(ndims, CHECK_NULL);
k = Universe::typeArrayKlass(t);
k = k->array_klass(ndims, CHECK_NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks puzzling. Why are there two array_klass calls now? Add short comments to explain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sort of see now but am getting squint lines. It's not important for performance to eliminate a virtual call here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Having two array_klass calls were not intentional. I accepted Dean's suggestion in the GitHub UI, but that didn't remove the old array_klass. I think I'll revert that change given that it is not important to devirtualize this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good because I was going to need a lot more coffee to understand why there was a second call. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why devirtualize elsehwere but not here? Maybe it's not a big deal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or to put it another way, what's the advantage of using TypeArrayKlass* tak in similar situations below?

}
return k;
Expand Down