< prev index next >

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

Print this page

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








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

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


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

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

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