< prev index next >

src/hotspot/share/prims/jvmtiTagMap.cpp

Print this page
rev 60137 : 8227745: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents
Reviewed-by: mdoerr, goetz

*** 45,54 **** --- 45,55 ---- #include "prims/jvmtiEventController.inline.hpp" #include "prims/jvmtiExport.hpp" #include "prims/jvmtiImpl.hpp" #include "prims/jvmtiTagMap.hpp" #include "runtime/biasedLocking.hpp" + #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.inline.hpp" #include "runtime/mutex.hpp"
*** 1486,1495 **** --- 1487,1500 ---- void JvmtiTagMap::iterate_over_heap(jvmtiHeapObjectFilter object_filter, Klass* klass, jvmtiHeapObjectCallback heap_object_callback, const void* user_data) { + // EA based optimizations on tagged objects are already reverted. + EscapeBarrier eb(JavaThread::current(), + object_filter == JVMTI_HEAP_OBJECT_UNTAGGED || object_filter == JVMTI_HEAP_OBJECT_EITHER); + eb.deoptimize_objects_all_threads(); MutexLocker ml(Heap_lock); IterateOverHeapObjectClosure blk(this, klass, object_filter, heap_object_callback,
*** 1503,1512 **** --- 1508,1520 ---- void JvmtiTagMap::iterate_through_heap(jint heap_filter, Klass* klass, const jvmtiHeapCallbacks* callbacks, const void* user_data) { + // EA based optimizations on tagged objects are already reverted. + EscapeBarrier eb(JavaThread::current(), !(heap_filter & JVMTI_HEAP_FILTER_UNTAGGED)); + eb.deoptimize_objects_all_threads(); MutexLocker ml(Heap_lock); IterateThroughHeapObjectClosure blk(this, klass, heap_filter, callbacks,
*** 3258,3267 **** --- 3266,3278 ---- // iterate over all objects that are reachable from a set of roots void JvmtiTagMap::iterate_over_reachable_objects(jvmtiHeapRootCallback heap_root_callback, jvmtiStackReferenceCallback stack_ref_callback, jvmtiObjectReferenceCallback object_ref_callback, const void* user_data) { + JavaThread* jt = JavaThread::current(); + EscapeBarrier eb(jt, true); + eb.deoptimize_objects_all_threads(); MutexLocker ml(Heap_lock); BasicHeapWalkContext context(heap_root_callback, stack_ref_callback, object_ref_callback); VM_HeapWalkOperation op(this, Handle(), context, user_data); VMThread::execute(&op); }
*** 3285,3296 **** jobject object, const jvmtiHeapCallbacks* callbacks, const void* user_data) { oop obj = JNIHandles::resolve(object); ! Handle initial_object(Thread::current(), obj); ! MutexLocker ml(Heap_lock); AdvancedHeapWalkContext context(heap_filter, klass, callbacks); VM_HeapWalkOperation op(this, initial_object, context, user_data); VMThread::execute(&op); } --- 3296,3311 ---- jobject object, const jvmtiHeapCallbacks* callbacks, const void* user_data) { oop obj = JNIHandles::resolve(object); ! JavaThread* jt = JavaThread::current(); ! Handle initial_object(jt, obj); ! // EA based optimizations that are tagged or reachable from initial_object are already reverted. ! EscapeBarrier eb(jt, ! initial_object.is_null() && !(heap_filter & JVMTI_HEAP_FILTER_UNTAGGED)); ! eb.deoptimize_objects_all_threads(); MutexLocker ml(Heap_lock); AdvancedHeapWalkContext context(heap_filter, klass, callbacks); VM_HeapWalkOperation op(this, initial_object, context, user_data); VMThread::execute(&op); }
< prev index next >