comparison src/share/vm/runtime/thread.hpp @ 22877:d68158e12cea

8043224: -Xcheck:jni improvements to exception checking and excessive local refs Summary: Warning when not checking exceptions from function that require so, also when local refs expand beyond capacity. Reviewed-by: dsimms
author poonam
date Wed, 11 Mar 2015 13:36:57 -0700
parents d3f3f7677537
children dd9cc155639c
comparison
equal deleted inserted replaced
22876:364f6c28effb 22877:d68158e12cea
1 /* 1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
924 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site. 924 volatile int _is_method_handle_return; // true (== 1) if the current exception PC is a MethodHandle call site.
925 925
926 // support for JNI critical regions 926 // support for JNI critical regions
927 jint _jni_active_critical; // count of entries into JNI critical region 927 jint _jni_active_critical; // count of entries into JNI critical region
928 928
929 // Checked JNI: function name requires exception check
930 char* _pending_jni_exception_check_fn;
931
929 // For deadlock detection. 932 // For deadlock detection.
930 int _depth_first_number; 933 int _depth_first_number;
931 934
932 // JVMTI PopFrame support 935 // JVMTI PopFrame support
933 // This is set to popframe_pending to signal that top Java frame should be popped immediately 936 // This is set to popframe_pending to signal that top Java frame should be popped immediately
1405 void exit_critical() { assert(Thread::current() == this, 1408 void exit_critical() { assert(Thread::current() == this,
1406 "this must be current thread"); 1409 "this must be current thread");
1407 _jni_active_critical--; 1410 _jni_active_critical--;
1408 assert(_jni_active_critical >= 0, 1411 assert(_jni_active_critical >= 0,
1409 "JNI critical nesting problem?"); } 1412 "JNI critical nesting problem?"); }
1413
1414 // Checked JNI, is the programmer required to check for exceptions, specify which function name
1415 bool is_pending_jni_exception_check() const { return _pending_jni_exception_check_fn != NULL; }
1416 void clear_pending_jni_exception_check() { _pending_jni_exception_check_fn = NULL; }
1417 const char* get_pending_jni_exception_check() const { return _pending_jni_exception_check_fn; }
1418 void set_pending_jni_exception_check(const char* fn_name) { _pending_jni_exception_check_fn = (char*) fn_name; }
1410 1419
1411 // For deadlock detection 1420 // For deadlock detection
1412 int depth_first_number() { return _depth_first_number; } 1421 int depth_first_number() { return _depth_first_number; }
1413 void set_depth_first_number(int dfn) { _depth_first_number = dfn; } 1422 void set_depth_first_number(int dfn) { _depth_first_number = dfn; }
1414 1423