< prev index next >

src/hotspot/share/prims/jvmtiUtil.hpp

Print this page

39 class JvmtiUtil : AllStatic {
40 
41   static ResourceArea* _single_threaded_resource_area;
42 
43   static const char* _error_names[];
44   static const bool  _event_threaded[];
45 
46 public:
47 
48   static ResourceArea* single_threaded_resource_area();
49 
50   static const char* error_name(int num)    { return _error_names[num]; }    // To Do: add range checking
51 
52   static const bool has_event_capability(jvmtiEvent event_type, const jvmtiCapabilities* capabilities_ptr);
53 
54   static const bool  event_threaded(int num) {
55     if (num >= JVMTI_MIN_EVENT_TYPE_VAL && num <= JVMTI_MAX_EVENT_TYPE_VAL) {
56       return _event_threaded[num];
57     }
58     if (num >= EXT_MIN_EVENT_TYPE_VAL && num <= EXT_MAX_EVENT_TYPE_VAL) {
59       return false;
60     }
61     ShouldNotReachHere();
62     return false;
63   }
64 };
65 
66 
67 ///////////////////////////////////////////////////////////////
68 //
69 // class SafeResourceMark
70 //
71 // ResourceMarks that work before threads exist
72 //
73 
74 class SafeResourceMark : public ResourceMark {
75 
76   ResourceArea* safe_resource_area() {
77     Thread* thread;
78 
79     if (Threads::number_of_threads() == 0) {

39 class JvmtiUtil : AllStatic {
40 
41   static ResourceArea* _single_threaded_resource_area;
42 
43   static const char* _error_names[];
44   static const bool  _event_threaded[];
45 
46 public:
47 
48   static ResourceArea* single_threaded_resource_area();
49 
50   static const char* error_name(int num)    { return _error_names[num]; }    // To Do: add range checking
51 
52   static const bool has_event_capability(jvmtiEvent event_type, const jvmtiCapabilities* capabilities_ptr);
53 
54   static const bool  event_threaded(int num) {
55     if (num >= JVMTI_MIN_EVENT_TYPE_VAL && num <= JVMTI_MAX_EVENT_TYPE_VAL) {
56       return _event_threaded[num];
57     }
58     if (num >= EXT_MIN_EVENT_TYPE_VAL && num <= EXT_MAX_EVENT_TYPE_VAL) {
59       return (num != EXT_EVENT_CLASS_UNLOAD);
60     }
61     ShouldNotReachHere();
62     return false;
63   }
64 };
65 
66 
67 ///////////////////////////////////////////////////////////////
68 //
69 // class SafeResourceMark
70 //
71 // ResourceMarks that work before threads exist
72 //
73 
74 class SafeResourceMark : public ResourceMark {
75 
76   ResourceArea* safe_resource_area() {
77     Thread* thread;
78 
79     if (Threads::number_of_threads() == 0) {
< prev index next >