319 _dynamic_code_event_collector = collector;
320 }
321 void set_vm_object_alloc_event_collector(JvmtiVMObjectAllocEventCollector* collector) {
322 _vm_object_alloc_event_collector = collector;
323 }
324
325
326 //
327 // Frame routines
328 //
329
330 public:
331
332 // true when the thread was suspended with a pointer to the last Java frame.
333 bool has_last_frame() { return _thread->has_last_Java_frame(); }
334
335 void update_for_pop_top_frame();
336
337 // already holding JvmtiThreadState_lock - retrieve or create JvmtiThreadState
338 // Can return NULL if JavaThread is exiting.
339 inline static JvmtiThreadState *state_for_while_locked(JavaThread *thread) {
340 assert(JvmtiThreadState_lock->is_locked(), "sanity check");
341
342 JvmtiThreadState *state = thread->jvmti_thread_state();
343 if (state == NULL) {
344 if (thread->is_exiting()) {
345 // don't add a JvmtiThreadState to a thread that is exiting
346 return NULL;
347 }
348
349 state = new JvmtiThreadState(thread);
350 }
351 return state;
352 }
353
354 // retrieve or create JvmtiThreadState
355 // Can return NULL if JavaThread is exiting.
356 inline static JvmtiThreadState *state_for(JavaThread *thread) {
357 JvmtiThreadState *state = thread->jvmti_thread_state();
358 if (state == NULL) {
359 MutexLocker mu(JvmtiThreadState_lock);
360 // check again with the lock held
361 state = state_for_while_locked(thread);
362 } else {
363 CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
364 }
365 return state;
366 }
367
368 // JVMTI ForceEarlyReturn support
369
370 // This is set to earlyret_pending to signal that top Java frame
371 // should be returned immediately
372 public:
373 int _earlyret_state;
374 TosState _earlyret_tos;
375 jvalue _earlyret_value;
376 oop _earlyret_oop; // Used to return an oop result into Java code from
377 // ForceEarlyReturnObject, GC-preserved
378
379 // Setting and clearing earlyret_state
380 // earlyret_pending indicates that a ForceEarlyReturn() has been
381 // requested and not yet been completed.
382 public:
383 enum EarlyretState {
384 earlyret_inactive = 0,
385 earlyret_pending = 1
386 };
|
319 _dynamic_code_event_collector = collector;
320 }
321 void set_vm_object_alloc_event_collector(JvmtiVMObjectAllocEventCollector* collector) {
322 _vm_object_alloc_event_collector = collector;
323 }
324
325
326 //
327 // Frame routines
328 //
329
330 public:
331
332 // true when the thread was suspended with a pointer to the last Java frame.
333 bool has_last_frame() { return _thread->has_last_Java_frame(); }
334
335 void update_for_pop_top_frame();
336
337 // already holding JvmtiThreadState_lock - retrieve or create JvmtiThreadState
338 // Can return NULL if JavaThread is exiting.
339 static JvmtiThreadState *state_for_while_locked(JavaThread *thread);
340 // retrieve or create JvmtiThreadState
341 // Can return NULL if JavaThread is exiting.
342 static JvmtiThreadState *state_for(JavaThread *thread);
343
344 // JVMTI ForceEarlyReturn support
345
346 // This is set to earlyret_pending to signal that top Java frame
347 // should be returned immediately
348 public:
349 int _earlyret_state;
350 TosState _earlyret_tos;
351 jvalue _earlyret_value;
352 oop _earlyret_oop; // Used to return an oop result into Java code from
353 // ForceEarlyReturnObject, GC-preserved
354
355 // Setting and clearing earlyret_state
356 // earlyret_pending indicates that a ForceEarlyReturn() has been
357 // requested and not yet been completed.
358 public:
359 enum EarlyretState {
360 earlyret_inactive = 0,
361 earlyret_pending = 1
362 };
|