8227745: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents

8233915: JVMTI FollowReferences: Java Heap Leak not found because of C2 Scalar Replacement

Reviewed-by: mdoerr, goetz, sspitsyn, kvn
This commit is contained in:
Richard Reingruber 2020-10-20 15:31:55 +00:00
parent f167a71f1d
commit 40f847e2fb
53 changed files with 5744 additions and 218 deletions

View file

@ -34,6 +34,7 @@
#include "memory/resourceArea.hpp"
#include "oops/markWord.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiDeferredUpdates.hpp"
#include "runtime/atomic.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
@ -1560,7 +1561,8 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) {
jt->set_current_waiting_monitor(NULL);
guarantee(_recursions == 0, "invariant");
_recursions = save; // restore the old recursion count
_recursions = save // restore the old recursion count
+ JvmtiDeferredUpdates::get_and_reset_relock_count_after_wait(jt); // increased by the deferred relock count
_waiters--; // decrement the number of waiters
// Verify a few postconditions