224 CompilerThread* current_thread = CompilerThread::current();
225 _factory->remove_symbols();
226 // Need safepoint to clear the env on the thread. RedefineClasses might
227 // be reading it.
228 current_thread->set_env(NULL);
229 )
230 }
231
232 // ------------------------------------------------------------------
233 // Cache Jvmti state
234 bool ciEnv::cache_jvmti_state() {
235 VM_ENTRY_MARK;
236 // Get Jvmti capabilities under lock to get consistant values.
237 MutexLocker mu(JvmtiThreadState_lock);
238 _jvmti_redefinition_count = JvmtiExport::redefinition_count();
239 _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
240 _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables();
241 _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions();
242 _jvmti_can_pop_frame = JvmtiExport::can_pop_frame();
243 _jvmti_can_get_owned_monitor_info = JvmtiExport::can_get_owned_monitor_info();
244 return _task != NULL && _task->method()->is_old();
245 }
246
247 bool ciEnv::jvmti_state_changed() const {
248 // Some classes were redefined
249 if (_jvmti_redefinition_count != JvmtiExport::redefinition_count()) {
250 return true;
251 }
252
253 if (!_jvmti_can_access_local_variables &&
254 JvmtiExport::can_access_local_variables()) {
255 return true;
256 }
257 if (!_jvmti_can_hotswap_or_post_breakpoint &&
258 JvmtiExport::can_hotswap_or_post_breakpoint()) {
259 return true;
260 }
261 if (!_jvmti_can_post_on_exceptions &&
262 JvmtiExport::can_post_on_exceptions()) {
263 return true;
264 }
265 if (!_jvmti_can_pop_frame &&
266 JvmtiExport::can_pop_frame()) {
267 return true;
268 }
269 if (!_jvmti_can_get_owned_monitor_info &&
270 JvmtiExport::can_get_owned_monitor_info()) {
271 return true;
272 }
273
274 return false;
275 }
276
277 // ------------------------------------------------------------------
278 // Cache DTrace flags
279 void ciEnv::cache_dtrace_flags() {
280 // Need lock?
281 _dtrace_extended_probes = ExtendedDTraceProbes;
282 if (_dtrace_extended_probes) {
283 _dtrace_monitor_probes = true;
284 _dtrace_method_probes = true;
285 _dtrace_alloc_probes = true;
286 } else {
287 _dtrace_monitor_probes = DTraceMonitorProbes;
288 _dtrace_method_probes = DTraceMethodProbes;
289 _dtrace_alloc_probes = DTraceAllocProbes;
290 }
|
224 CompilerThread* current_thread = CompilerThread::current();
225 _factory->remove_symbols();
226 // Need safepoint to clear the env on the thread. RedefineClasses might
227 // be reading it.
228 current_thread->set_env(NULL);
229 )
230 }
231
232 // ------------------------------------------------------------------
233 // Cache Jvmti state
234 bool ciEnv::cache_jvmti_state() {
235 VM_ENTRY_MARK;
236 // Get Jvmti capabilities under lock to get consistant values.
237 MutexLocker mu(JvmtiThreadState_lock);
238 _jvmti_redefinition_count = JvmtiExport::redefinition_count();
239 _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint();
240 _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables();
241 _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions();
242 _jvmti_can_pop_frame = JvmtiExport::can_pop_frame();
243 _jvmti_can_get_owned_monitor_info = JvmtiExport::can_get_owned_monitor_info();
244 _jvmti_can_walk_any_space = JvmtiExport::can_walk_any_space();
245 return _task != NULL && _task->method()->is_old();
246 }
247
248 bool ciEnv::jvmti_state_changed() const {
249 // Some classes were redefined
250 if (_jvmti_redefinition_count != JvmtiExport::redefinition_count()) {
251 return true;
252 }
253
254 if (!_jvmti_can_access_local_variables &&
255 JvmtiExport::can_access_local_variables()) {
256 return true;
257 }
258 if (!_jvmti_can_hotswap_or_post_breakpoint &&
259 JvmtiExport::can_hotswap_or_post_breakpoint()) {
260 return true;
261 }
262 if (!_jvmti_can_post_on_exceptions &&
263 JvmtiExport::can_post_on_exceptions()) {
264 return true;
265 }
266 if (!_jvmti_can_pop_frame &&
267 JvmtiExport::can_pop_frame()) {
268 return true;
269 }
270 if (!_jvmti_can_get_owned_monitor_info &&
271 JvmtiExport::can_get_owned_monitor_info()) {
272 return true;
273 }
274 if (!_jvmti_can_walk_any_space &&
275 JvmtiExport::can_walk_any_space()) {
276 return true;
277 }
278
279 return false;
280 }
281
282 // ------------------------------------------------------------------
283 // Cache DTrace flags
284 void ciEnv::cache_dtrace_flags() {
285 // Need lock?
286 _dtrace_extended_probes = ExtendedDTraceProbes;
287 if (_dtrace_extended_probes) {
288 _dtrace_monitor_probes = true;
289 _dtrace_method_probes = true;
290 _dtrace_alloc_probes = true;
291 } else {
292 _dtrace_monitor_probes = DTraceMonitorProbes;
293 _dtrace_method_probes = DTraceMethodProbes;
294 _dtrace_alloc_probes = DTraceAllocProbes;
295 }
|