Mercurial > hg > truffle
comparison src/share/vm/runtime/synchronizer.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 436b4a3231bf |
children | e522a00b91aa 070d523b96a7 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1998, 2012, 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. |
75 #ifdef DTRACE_ENABLED | 75 #ifdef DTRACE_ENABLED |
76 | 76 |
77 // Only bother with this argument setup if dtrace is available | 77 // Only bother with this argument setup if dtrace is available |
78 // 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. |
79 | 79 |
80 #define DTRACE_MONITOR_PROBE_COMMON(klassOop, thread) \ | 80 #define DTRACE_MONITOR_PROBE_COMMON(obj, thread) \ |
81 char* bytes = NULL; \ | 81 char* bytes = NULL; \ |
82 int len = 0; \ | 82 int len = 0; \ |
83 jlong jtid = SharedRuntime::get_java_tid(thread); \ | 83 jlong jtid = SharedRuntime::get_java_tid(thread); \ |
84 Symbol* klassname = ((oop)(klassOop))->klass()->klass_part()->name(); \ | 84 Symbol* klassname = ((oop)(obj))->klass()->name(); \ |
85 if (klassname != NULL) { \ | 85 if (klassname != NULL) { \ |
86 bytes = (char*)klassname->bytes(); \ | 86 bytes = (char*)klassname->bytes(); \ |
87 len = klassname->utf8_length(); \ | 87 len = klassname->utf8_length(); \ |
88 } | 88 } |
89 | 89 |
91 HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait, | 91 HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait, |
92 jlong, uintptr_t, char*, int, long); | 92 jlong, uintptr_t, char*, int, long); |
93 HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, | 93 HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, |
94 jlong, uintptr_t, char*, int); | 94 jlong, uintptr_t, char*, int); |
95 | 95 |
96 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ | 96 #define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \ |
97 { \ | 97 { \ |
98 if (DTraceMonitorProbes) { \ | 98 if (DTraceMonitorProbes) { \ |
99 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | 99 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
100 HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \ | 100 HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \ |
101 (monitor), bytes, len, (millis)); \ | 101 (monitor), bytes, len, (millis)); \ |
102 } \ | 102 } \ |
103 } | 103 } |
104 | 104 |
105 #define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \ | 105 #define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \ |
106 { \ | 106 { \ |
107 if (DTraceMonitorProbes) { \ | 107 if (DTraceMonitorProbes) { \ |
108 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | 108 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
109 HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \ | 109 HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \ |
110 (uintptr_t)(monitor), bytes, len); \ | 110 (uintptr_t)(monitor), bytes, len); \ |
111 } \ | 111 } \ |
112 } | 112 } |
113 | 113 |
114 #else /* USDT2 */ | 114 #else /* USDT2 */ |
115 | 115 |
116 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ | 116 #define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \ |
117 { \ | 117 { \ |
118 if (DTraceMonitorProbes) { \ | 118 if (DTraceMonitorProbes) { \ |
119 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | 119 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
120 HOTSPOT_MONITOR_WAIT(jtid, \ | 120 HOTSPOT_MONITOR_WAIT(jtid, \ |
121 (uintptr_t)(monitor), bytes, len, (millis)); \ | 121 (uintptr_t)(monitor), bytes, len, (millis)); \ |
122 } \ | 122 } \ |
123 } | 123 } |
124 | 124 |
125 #define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED | 125 #define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED |
126 | 126 |
127 #define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \ | 127 #define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \ |
128 { \ | 128 { \ |
129 if (DTraceMonitorProbes) { \ | 129 if (DTraceMonitorProbes) { \ |
130 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ | 130 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
131 HOTSPOT_MONITOR_PROBE_##probe(jtid, /* probe = waited */ \ | 131 HOTSPOT_MONITOR_PROBE_##probe(jtid, /* probe = waited */ \ |
132 (uintptr_t)(monitor), bytes, len); \ | 132 (uintptr_t)(monitor), bytes, len); \ |
133 } \ | 133 } \ |
134 } | 134 } |
135 | 135 |
136 #endif /* USDT2 */ | 136 #endif /* USDT2 */ |
137 #else // ndef DTRACE_ENABLED | 137 #else // ndef DTRACE_ENABLED |
138 | 138 |
139 #define DTRACE_MONITOR_WAIT_PROBE(klassOop, thread, millis, mon) {;} | 139 #define DTRACE_MONITOR_WAIT_PROBE(obj, thread, millis, mon) {;} |
140 #define DTRACE_MONITOR_PROBE(probe, klassOop, thread, mon) {;} | 140 #define DTRACE_MONITOR_PROBE(probe, obj, thread, mon) {;} |
141 | 141 |
142 #endif // ndef DTRACE_ENABLED | 142 #endif // ndef DTRACE_ENABLED |
143 | 143 |
144 // This exists only as a workaround of dtrace bug 6254741 | 144 // This exists only as a workaround of dtrace bug 6254741 |
145 int dtrace_waited_probe(ObjectMonitor* monitor, Handle obj, Thread* thr) { | 145 int dtrace_waited_probe(ObjectMonitor* monitor, Handle obj, Thread* thr) { |