src/share/vm/prims/unsafe.cpp

changeset 9858
b985cbb00e68
parent 9327
f96fcd9e1e1b
child 9865
5a83b7215107
     1.1 --- a/src/share/vm/prims/unsafe.cpp	Thu Aug 01 03:44:03 2019 +0100
     1.2 +++ b/src/share/vm/prims/unsafe.cpp	Mon Aug 12 18:30:40 2019 +0300
     1.3 @@ -28,6 +28,7 @@
     1.4  #if INCLUDE_ALL_GCS
     1.5  #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
     1.6  #endif // INCLUDE_ALL_GCS
     1.7 +#include "jfr/jfrEvents.hpp"
     1.8  #include "memory/allocation.inline.hpp"
     1.9  #include "prims/jni.h"
    1.10  #include "prims/jvm.h"
    1.11 @@ -38,7 +39,6 @@
    1.12  #include "runtime/reflection.hpp"
    1.13  #include "runtime/synchronizer.hpp"
    1.14  #include "services/threadService.hpp"
    1.15 -#include "trace/tracing.hpp"
    1.16  #include "utilities/copy.hpp"
    1.17  #include "utilities/dtrace.hpp"
    1.18  
    1.19 @@ -1236,6 +1236,15 @@
    1.20  #endif
    1.21  UNSAFE_END
    1.22  
    1.23 +static void post_thread_park_event(EventThreadPark* event, const oop obj, jlong timeout) {
    1.24 +  assert(event != NULL, "invariant");
    1.25 +  assert(event->should_commit(), "invariant");
    1.26 +  event->set_parkedClass((obj != NULL) ? obj->klass() : NULL);
    1.27 +  event->set_timeout(timeout);
    1.28 +  event->set_address((obj != NULL) ? (u8)cast_from_oop<uintptr_t>(obj) : 0);
    1.29 +  event->commit();
    1.30 +}
    1.31 +
    1.32  UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute, jlong time))
    1.33    UnsafeWrapper("Unsafe_Park");
    1.34    EventThreadPark event;
    1.35 @@ -1254,11 +1263,7 @@
    1.36                            (uintptr_t) thread->parker());
    1.37  #endif /* USDT2 */
    1.38    if (event.should_commit()) {
    1.39 -    oop obj = thread->current_park_blocker();
    1.40 -    event.set_klass((obj != NULL) ? obj->klass() : NULL);
    1.41 -    event.set_timeout(time);
    1.42 -    event.set_address((obj != NULL) ? (TYPE_ADDRESS) cast_from_oop<uintptr_t>(obj) : 0);
    1.43 -    event.commit();
    1.44 +    post_thread_park_event(&event, thread->current_park_blocker(), time);
    1.45    }
    1.46  UNSAFE_END
    1.47  

mercurial