< prev index next >

src/hotspot/share/jfr/jni/jfrJavaSupport.hpp

Print this page

 56 
 57   static void set_field(JfrJavaArguments* args, TRAPS);
 58   static void get_field(JfrJavaArguments* args, TRAPS);
 59   static void new_object(JfrJavaArguments* args, TRAPS);
 60 
 61   // global jni handle result
 62   static void new_object_global_ref(JfrJavaArguments* args, TRAPS);
 63   static void get_field_global_ref(JfrJavaArguments* args, TRAPS);
 64 
 65   // local jni handle result
 66   static void new_object_local_ref(JfrJavaArguments* args, TRAPS);
 67   static void get_field_local_ref(JfrJavaArguments* args, TRAPS);
 68 
 69   static jstring new_string(const char* c_str, TRAPS);
 70   static jobjectArray new_string_array(int length, TRAPS);
 71 
 72   static jobject new_java_lang_Boolean(bool value, TRAPS);
 73   static jobject new_java_lang_Integer(jint value, TRAPS);
 74   static jobject new_java_lang_Long(jlong value, TRAPS);
 75 








 76   // misc
 77   static Klass* klass(const jobject handle);
 78   static const char* c_str(jstring string, JavaThread* jt, bool c_heap = false);
 79   static const char* c_str(oop string, JavaThread* jt, bool c_heap = false);
 80 
 81   // exceptions
 82   static void throw_illegal_state_exception(const char* message, TRAPS);
 83   static void throw_illegal_argument_exception(const char* message, TRAPS);
 84   static void throw_internal_error(const char* message, TRAPS);
 85   static void throw_out_of_memory_error(const char* message, TRAPS);
 86   static void throw_class_format_error(const char* message, TRAPS);
 87   static void throw_runtime_exception(const char* message, TRAPS);
 88 

 89   static bool is_jdk_jfr_module_available();
 90   static bool is_jdk_jfr_module_available(outputStream* stream, TRAPS);
 91 


 92   static jlong jfr_thread_id(jobject thread);
 93   static void exclude(jobject thread);
 94   static void include(jobject thread);
 95   static bool is_excluded(jobject thread);
 96   static void on_thread_start(Thread* t);
 97 
 98   static jobject get_handler(jobject clazz, TRAPS);
 99   static bool set_handler(jobject clazz, jobject handler, TRAPS);
100 
101   // critical
102   static void abort(jstring errorMsg, TRAPS);
103   static void uncaught_exception(jthrowable throwable, JavaThread* t);
104 
105   // asserts
106   DEBUG_ONLY(static void check_java_thread_in_vm(JavaThread* t);)
107   DEBUG_ONLY(static void check_java_thread_in_native(JavaThread* t);)

108 
109   enum CAUSE {
110     VM_ERROR,
111     OUT_OF_MEMORY,
112     STACK_OVERFLOW,
113     RUNTIME_EXCEPTION,
114     UNKNOWN,
115     NOF_CAUSES
116   };
117 
118   static CAUSE cause();
119 
120  private:
121   static CAUSE _cause;
122   static void set_cause(jthrowable throwable, JavaThread* t);
123 };
124 
125 #endif // SHARE_JFR_JNI_JFRJAVASUPPORT_HPP

 56 
 57   static void set_field(JfrJavaArguments* args, TRAPS);
 58   static void get_field(JfrJavaArguments* args, TRAPS);
 59   static void new_object(JfrJavaArguments* args, TRAPS);
 60 
 61   // global jni handle result
 62   static void new_object_global_ref(JfrJavaArguments* args, TRAPS);
 63   static void get_field_global_ref(JfrJavaArguments* args, TRAPS);
 64 
 65   // local jni handle result
 66   static void new_object_local_ref(JfrJavaArguments* args, TRAPS);
 67   static void get_field_local_ref(JfrJavaArguments* args, TRAPS);
 68 
 69   static jstring new_string(const char* c_str, TRAPS);
 70   static jobjectArray new_string_array(int length, TRAPS);
 71 
 72   static jobject new_java_lang_Boolean(bool value, TRAPS);
 73   static jobject new_java_lang_Integer(jint value, TRAPS);
 74   static jobject new_java_lang_Long(jlong value, TRAPS);
 75 
 76   // fields
 77   static bool compute_field_offset(int &dest_offset,
 78                                    Klass* klass,
 79                                    Symbol* name_symbol,
 80                                    Symbol* signature_symbol,
 81                                    bool is_static = false,
 82                                    bool allow_super = false);
 83 
 84   // misc
 85   static Klass* klass(const jobject handle);
 86   static const char* c_str(jstring string, JavaThread* jt, bool c_heap = false);
 87   static const char* c_str(oop string, JavaThread* jt, bool c_heap = false);
 88 
 89   // exceptions
 90   static void throw_illegal_state_exception(const char* message, TRAPS);
 91   static void throw_illegal_argument_exception(const char* message, TRAPS);
 92   static void throw_internal_error(const char* message, TRAPS);
 93   static void throw_out_of_memory_error(const char* message, TRAPS);
 94   static void throw_class_format_error(const char* message, TRAPS);
 95   static void throw_runtime_exception(const char* message, TRAPS);
 96 
 97   // visibility graph
 98   static bool is_jdk_jfr_module_available();
 99   static bool is_jdk_jfr_module_available(outputStream* stream, TRAPS);
100 
101   // thread
102   static JavaThread* get_native(jobject thread);
103   static jlong jfr_thread_id(jobject thread);
104   static void exclude(jobject thread);
105   static void include(jobject thread);
106   static bool is_excluded(jobject thread);
107   static bool on_thread_start(JavaThread* jt, jobject vthread = NULL);
108 
109   static jobject get_handler(jobject clazz, TRAPS);
110   static bool set_handler(jobject clazz, jobject handler, TRAPS);
111 
112   // critical
113   static void abort(jstring errorMsg, TRAPS);
114   static void uncaught_exception(jthrowable throwable, JavaThread* t);
115 
116   // asserts
117   DEBUG_ONLY(static void check_java_thread_in_vm(JavaThread* t);)
118   DEBUG_ONLY(static void check_java_thread_in_native(JavaThread* t);)
119   DEBUG_ONLY(static void check_java_thread_in_java(JavaThread* t););
120 
121   enum CAUSE {
122     VM_ERROR,
123     OUT_OF_MEMORY,
124     STACK_OVERFLOW,
125     RUNTIME_EXCEPTION,
126     UNKNOWN,
127     NOF_CAUSES
128   };
129 
130   static CAUSE cause();
131 
132  private:
133   static CAUSE _cause;
134   static void set_cause(jthrowable throwable, JavaThread* t);
135 };
136 
137 #endif // SHARE_JFR_JNI_JFRJAVASUPPORT_HPP
< prev index next >