Skip to content

Commit

Permalink
using improved type for non-constants
Browse files Browse the repository at this point in the history
  • Loading branch information
chhagedorn committed Mar 28, 2024
1 parent 26a717d commit 660c0de
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hotspot/share/opto/graphKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3359,8 +3359,12 @@ Node* GraphKit::gen_checkcast(Node *obj, Node* superklass,
if (cast_obj == nullptr) {
// Generate the subtype check
Node* improved_superklass = superklass;
if (improved_klass_ptr_type != klass_ptr_type && improved_klass_ptr_type->singleton()) {
improved_superklass = makecon(improved_klass_ptr_type);
if (improved_klass_ptr_type != klass_ptr_type) {
if (improved_klass_ptr_type->singleton()) {
improved_superklass = makecon(improved_klass_ptr_type);
} else {
improved_superklass = _gvn.transform(new CastPPNode(nullptr, superklass, improved_klass_ptr_type));
}
}
Node* not_subtype_ctrl = gen_subtype_check(not_null_obj, improved_superklass);

Expand Down

0 comments on commit 660c0de

Please sign in to comment.