Skip to content

Commit

Permalink
Fix 2.0 : Add uncast in LibraryCallKit::classify_unsafe_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Holenstein committed Sep 18, 2024
1 parent 34c6e0d commit 2ab02f8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hotspot/share/opto/library_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ LibraryCallKit::classify_unsafe_addr(Node* &base, Node* &offset, BasicType type)
if (base_type == nullptr) {
// Unknown type.
return Type::AnyPtr;
} else if (base_type == TypePtr::NULL_PTR) {
} else if (_gvn.type(base->uncast()) == TypePtr::NULL_PTR) {
// Since this is a null+long form, we have to switch to a rawptr.
base = _gvn.transform(new CastX2PNode(offset));
offset = MakeConX(0);
Expand Down Expand Up @@ -2359,9 +2359,8 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
SafePointNode* old_map = clone_map();

Node* adr = make_unsafe_address(base, offset, type, kind == Relaxed);
if (stopped()) {
return true;
}
assert(!stopped(), "Inlining of unsafe access failed: address construction stopped unexpectedly");

if (_gvn.type(base)->isa_ptr() == TypePtr::NULL_PTR) {
if (type != T_OBJECT) {
decorators |= IN_NATIVE; // off-heap primitive access
Expand Down

0 comments on commit 2ab02f8

Please sign in to comment.