Skip to content
Closed
8 changes: 5 additions & 3 deletions src/hotspot/share/opto/library_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,8 @@ LibraryCallKit::SavedState::SavedState(LibraryCallKit* kit) :
_kit(kit),
_sp(kit->sp()),
_jvms(kit->jvms()),
_map(kit->clone_map())
_map(kit->clone_map()),
_discarded(false)
{
for (DUIterator_Fast imax, i = kit->control()->fast_outs(imax); i < imax; i++) {
Node* out = kit->control()->fast_out(i);
Expand All @@ -2386,7 +2387,8 @@ LibraryCallKit::SavedState::SavedState(LibraryCallKit* kit) :
}

LibraryCallKit::SavedState::~SavedState() {
if (discarded) {
if (_discarded) {
_kit->destruct_map_clone(_map);
return;
}
_kit->jvms()->set_map(_map);
Expand All @@ -2407,7 +2409,7 @@ LibraryCallKit::SavedState::~SavedState() {
}

void LibraryCallKit::SavedState::discard() {
discarded = true;
_discarded = true;
}

bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, const AccessKind kind, const bool unaligned) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/library_call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class LibraryCallKit : public GraphKit {
JVMState* _jvms;
SafePointNode* _map;
Unique_Node_List _ctrl_succ;
bool discarded = false;
bool _discarded;

public:
SavedState(LibraryCallKit*);
Expand Down