403 // JavaThread lifecycle support:
404 static jvmtiError cv_external_thread_to_JavaThread(ThreadsList * t_list,
405 jthread thread,
406 JavaThread ** jt_pp,
407 oop * thread_oop_p);
408 static jvmtiError cv_oop_to_JavaThread(ThreadsList * t_list, oop thread_oop,
409 JavaThread ** jt_pp);
410 };
411
412 // Support class used by JvmtiDynamicCodeEventCollector and others. It
413 // describes a single code blob by name and address range.
414 class JvmtiCodeBlobDesc : public CHeapObj<mtInternal> {
415 private:
416 char _name[64];
417 address _code_begin;
418 address _code_end;
419
420 public:
421 JvmtiCodeBlobDesc(const char *name, address code_begin, address code_end) {
422 assert(name != NULL, "all code blobs must be named");
423 strncpy(_name, name, sizeof(_name));
424 _name[sizeof(_name)-1] = '\0';
425 _code_begin = code_begin;
426 _code_end = code_end;
427 }
428 char* name() { return _name; }
429 address code_begin() { return _code_begin; }
430 address code_end() { return _code_end; }
431 };
432
433 // JvmtiEventCollector is a helper class to setup thread for
434 // event collection.
435 class JvmtiEventCollector : public StackObj {
436 private:
437 JvmtiEventCollector* _prev; // Save previous one to support nested event collector.
438 bool _unset_jvmti_thread_state;
439
440 public:
441 JvmtiEventCollector() : _prev(NULL), _unset_jvmti_thread_state(false) {}
442
443 void setup_jvmti_thread_state(); // Set this collector in current thread, returns if success.
|
403 // JavaThread lifecycle support:
404 static jvmtiError cv_external_thread_to_JavaThread(ThreadsList * t_list,
405 jthread thread,
406 JavaThread ** jt_pp,
407 oop * thread_oop_p);
408 static jvmtiError cv_oop_to_JavaThread(ThreadsList * t_list, oop thread_oop,
409 JavaThread ** jt_pp);
410 };
411
412 // Support class used by JvmtiDynamicCodeEventCollector and others. It
413 // describes a single code blob by name and address range.
414 class JvmtiCodeBlobDesc : public CHeapObj<mtInternal> {
415 private:
416 char _name[64];
417 address _code_begin;
418 address _code_end;
419
420 public:
421 JvmtiCodeBlobDesc(const char *name, address code_begin, address code_end) {
422 assert(name != NULL, "all code blobs must be named");
423 strncpy(_name, name, sizeof(_name) - 1);
424 _name[sizeof(_name)-1] = '\0';
425 _code_begin = code_begin;
426 _code_end = code_end;
427 }
428 char* name() { return _name; }
429 address code_begin() { return _code_begin; }
430 address code_end() { return _code_end; }
431 };
432
433 // JvmtiEventCollector is a helper class to setup thread for
434 // event collection.
435 class JvmtiEventCollector : public StackObj {
436 private:
437 JvmtiEventCollector* _prev; // Save previous one to support nested event collector.
438 bool _unset_jvmti_thread_state;
439
440 public:
441 JvmtiEventCollector() : _prev(NULL), _unset_jvmti_thread_state(false) {}
442
443 void setup_jvmti_thread_state(); // Set this collector in current thread, returns if success.
|