Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/synchronizer.cpp @ 4137:04b9a2566eec
Merge with hsx23/hotspot.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 17 Dec 2011 21:40:27 +0100 |
parents | 0654ee04b214 436b4a3231bf |
children | e522a00b91aa |
comparison
equal
deleted
inserted
replaced
3737:9dc19b7d89a3 | 4137:04b9a2566eec |
---|---|
49 #endif | 49 #endif |
50 #ifdef TARGET_OS_FAMILY_windows | 50 #ifdef TARGET_OS_FAMILY_windows |
51 # include "os_windows.inline.hpp" | 51 # include "os_windows.inline.hpp" |
52 # include "thread_windows.inline.hpp" | 52 # include "thread_windows.inline.hpp" |
53 #endif | 53 #endif |
54 #ifdef TARGET_OS_FAMILY_bsd | |
55 # include "os_bsd.inline.hpp" | |
56 # include "thread_bsd.inline.hpp" | |
57 #endif | |
54 | 58 |
55 #if defined(__GNUC__) && !defined(IA64) | 59 #if defined(__GNUC__) && !defined(IA64) |
56 // Need to inhibit inlining for older versions of GCC to avoid build-time failures | 60 // Need to inhibit inlining for older versions of GCC to avoid build-time failures |
57 #define ATTR __attribute__((noinline)) | 61 #define ATTR __attribute__((noinline)) |
58 #else | 62 #else |
70 | 74 |
71 #ifdef DTRACE_ENABLED | 75 #ifdef DTRACE_ENABLED |
72 | 76 |
73 // Only bother with this argument setup if dtrace is available | 77 // Only bother with this argument setup if dtrace is available |
74 // TODO-FIXME: probes should not fire when caller is _blocked. assert() accordingly. | 78 // TODO-FIXME: probes should not fire when caller is _blocked. assert() accordingly. |
75 | |
76 HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait, | |
77 jlong, uintptr_t, char*, int, long); | |
78 HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, | |
79 jlong, uintptr_t, char*, int); | |
80 | 79 |
81 #define DTRACE_MONITOR_PROBE_COMMON(klassOop, thread) \ | 80 #define DTRACE_MONITOR_PROBE_COMMON(klassOop, thread) \ |
82 char* bytes = NULL; \ | 81 char* bytes = NULL; \ |
83 int len = 0; \ | 82 int len = 0; \ |
84 jlong jtid = SharedRuntime::get_java_tid(thread); \ | 83 jlong jtid = SharedRuntime::get_java_tid(thread); \ |
86 if (klassname != NULL) { \ | 85 if (klassname != NULL) { \ |
87 bytes = (char*)klassname->bytes(); \ | 86 bytes = (char*)klassname->bytes(); \ |
88 len = klassname->utf8_length(); \ | 87 len = klassname->utf8_length(); \ |
89 } | 88 } |
90 | 89 |
90 #ifndef USDT2 | |
91 HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait, | |
92 jlong, uintptr_t, char*, int, long); | |
93 HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, | |
94 jlong, uintptr_t, char*, int); | |
95 | |
91 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ | 96 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ |
92 { \ | 97 { \ |
93 if (DTraceMonitorProbes) { \ | 98 if (DTraceMonitorProbes) { \ |
94 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | 99 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ |
95 HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \ | 100 HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \ |
104 HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \ | 109 HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \ |
105 (uintptr_t)(monitor), bytes, len); \ | 110 (uintptr_t)(monitor), bytes, len); \ |
106 } \ | 111 } \ |
107 } | 112 } |
108 | 113 |
114 #else /* USDT2 */ | |
115 | |
116 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ | |
117 { \ | |
118 if (DTraceMonitorProbes) { \ | |
119 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | |
120 HOTSPOT_MONITOR_WAIT(jtid, \ | |
121 (uintptr_t)(monitor), bytes, len, (millis)); \ | |
122 } \ | |
123 } | |
124 | |
125 #define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED | |
126 | |
127 #define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \ | |
128 { \ | |
129 if (DTraceMonitorProbes) { \ | |
130 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | |
131 HOTSPOT_MONITOR_PROBE_##probe(jtid, /* probe = waited */ \ | |
132 (uintptr_t)(monitor), bytes, len); \ | |
133 } \ | |
134 } | |
135 | |
136 #endif /* USDT2 */ | |
109 #else // ndef DTRACE_ENABLED | 137 #else // ndef DTRACE_ENABLED |
110 | 138 |
111 #define DTRACE_MONITOR_WAIT_PROBE(klassOop, thread, millis, mon) {;} | 139 #define DTRACE_MONITOR_WAIT_PROBE(klassOop, thread, millis, mon) {;} |
112 #define DTRACE_MONITOR_PROBE(probe, klassOop, thread, mon) {;} | 140 #define DTRACE_MONITOR_PROBE(probe, klassOop, thread, mon) {;} |
113 | 141 |