mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8043224: -Xcheck:jni improvements to exception checking and excessive local refs
Warning when not checking exceptions from function that require so, also when local refs expand beyond capacity. Reviewed-by: zgu, coleenp, hseigel
This commit is contained in:
parent
b6a2f946f6
commit
d9b63bdbdd
6 changed files with 201 additions and 101 deletions
|
@ -915,6 +915,9 @@ class JavaThread: public Thread {
|
|||
// support for JNI critical regions
|
||||
jint _jni_active_critical; // count of entries into JNI critical region
|
||||
|
||||
// Checked JNI: function name requires exception check
|
||||
char* _pending_jni_exception_check_fn;
|
||||
|
||||
// For deadlock detection.
|
||||
int _depth_first_number;
|
||||
|
||||
|
@ -1400,6 +1403,12 @@ class JavaThread: public Thread {
|
|||
assert(_jni_active_critical >= 0,
|
||||
"JNI critical nesting problem?"); }
|
||||
|
||||
// Checked JNI, is the programmer required to check for exceptions, specify which function name
|
||||
bool is_pending_jni_exception_check() const { return _pending_jni_exception_check_fn != NULL; }
|
||||
void clear_pending_jni_exception_check() { _pending_jni_exception_check_fn = NULL; }
|
||||
const char* get_pending_jni_exception_check() const { return _pending_jni_exception_check_fn; }
|
||||
void set_pending_jni_exception_check(const char* fn_name) { _pending_jni_exception_check_fn = (char*) fn_name; }
|
||||
|
||||
// For deadlock detection
|
||||
int depth_first_number() { return _depth_first_number; }
|
||||
void set_depth_first_number(int dfn) { _depth_first_number = dfn; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue