comparison src/share/vm/prims/unsafe.cpp @ 10405:f2110083203d

8005849: JEP 167: Event-Based JVM Tracing Reviewed-by: acorn, coleenp, sla Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author sla
date Mon, 10 Jun 2013 11:30:51 +0200
parents 609aad72004a
children 836a62f43af9 190899198332
comparison
equal deleted inserted replaced
10404:d0add7016434 10405:f2110083203d
1 /* 1 /*
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
34 #include "runtime/globals.hpp" 34 #include "runtime/globals.hpp"
35 #include "runtime/interfaceSupport.hpp" 35 #include "runtime/interfaceSupport.hpp"
36 #include "runtime/reflection.hpp" 36 #include "runtime/reflection.hpp"
37 #include "runtime/synchronizer.hpp" 37 #include "runtime/synchronizer.hpp"
38 #include "services/threadService.hpp" 38 #include "services/threadService.hpp"
39 #include "trace/tracing.hpp"
39 #include "utilities/copy.hpp" 40 #include "utilities/copy.hpp"
40 #include "utilities/dtrace.hpp" 41 #include "utilities/dtrace.hpp"
41 42
42 /* 43 /*
43 * Implementation of class sun.misc.Unsafe 44 * Implementation of class sun.misc.Unsafe
1202 } 1203 }
1203 UNSAFE_END 1204 UNSAFE_END
1204 1205
1205 UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute, jlong time)) 1206 UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute, jlong time))
1206 UnsafeWrapper("Unsafe_Park"); 1207 UnsafeWrapper("Unsafe_Park");
1208 EventThreadPark event;
1207 #ifndef USDT2 1209 #ifndef USDT2
1208 HS_DTRACE_PROBE3(hotspot, thread__park__begin, thread->parker(), (int) isAbsolute, time); 1210 HS_DTRACE_PROBE3(hotspot, thread__park__begin, thread->parker(), (int) isAbsolute, time);
1209 #else /* USDT2 */ 1211 #else /* USDT2 */
1210 HOTSPOT_THREAD_PARK_BEGIN( 1212 HOTSPOT_THREAD_PARK_BEGIN(
1211 (uintptr_t) thread->parker(), (int) isAbsolute, time); 1213 (uintptr_t) thread->parker(), (int) isAbsolute, time);
1216 HS_DTRACE_PROBE1(hotspot, thread__park__end, thread->parker()); 1218 HS_DTRACE_PROBE1(hotspot, thread__park__end, thread->parker());
1217 #else /* USDT2 */ 1219 #else /* USDT2 */
1218 HOTSPOT_THREAD_PARK_END( 1220 HOTSPOT_THREAD_PARK_END(
1219 (uintptr_t) thread->parker()); 1221 (uintptr_t) thread->parker());
1220 #endif /* USDT2 */ 1222 #endif /* USDT2 */
1223 if (event.should_commit()) {
1224 oop obj = thread->current_park_blocker();
1225 event.set_klass(obj ? obj->klass() : NULL);
1226 event.set_timeout(time);
1227 event.set_address(obj ? (TYPE_ADDRESS) (uintptr_t) obj : 0);
1228 event.commit();
1229 }
1221 UNSAFE_END 1230 UNSAFE_END
1222 1231
1223 UNSAFE_ENTRY(void, Unsafe_Unpark(JNIEnv *env, jobject unsafe, jobject jthread)) 1232 UNSAFE_ENTRY(void, Unsafe_Unpark(JNIEnv *env, jobject unsafe, jobject jthread))
1224 UnsafeWrapper("Unsafe_Unpark"); 1233 UnsafeWrapper("Unsafe_Unpark");
1225 Parker* p = NULL; 1234 Parker* p = NULL;