7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "jni.h"
27 #include "classfile/javaClasses.inline.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "memory/guardedMemory.hpp"
31 #include "oops/instanceKlass.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "oops/symbol.hpp"
34 #include "prims/jniCheck.hpp"
35 #include "prims/jvm.h"
36 #include "prims/jvm_misc.hpp"
37 #include "runtime/fieldDescriptor.hpp"
38 #include "runtime/handles.hpp"
39 #include "runtime/interfaceSupport.hpp"
40 #include "runtime/jfieldIDWorkaround.hpp"
41 #include "runtime/thread.inline.hpp"
42
43 // Complain every extra number of unplanned local refs
44 #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32
45
46 // Heap objects are allowed to be directly referenced only in VM code,
47 // not in native code.
48
49 #define ASSERT_OOPS_ALLOWED \
50 assert(JavaThread::current()->thread_state() == _thread_in_vm, \
51 "jniCheck examining oops in bad state.")
52
53
54 // Execute the given block of source code with the thread in VM state.
55 // To do this, transition from the NATIVE state to the VM state, execute
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "jni.h"
27 #include "jvm.h"
28 #include "classfile/javaClasses.inline.hpp"
29 #include "classfile/systemDictionary.hpp"
30 #include "classfile/vmSymbols.hpp"
31 #include "memory/guardedMemory.hpp"
32 #include "oops/instanceKlass.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "oops/symbol.hpp"
35 #include "prims/jniCheck.hpp"
36 #include "prims/jvm_misc.hpp"
37 #include "runtime/fieldDescriptor.hpp"
38 #include "runtime/handles.hpp"
39 #include "runtime/interfaceSupport.hpp"
40 #include "runtime/jfieldIDWorkaround.hpp"
41 #include "runtime/thread.inline.hpp"
42
43 // Complain every extra number of unplanned local refs
44 #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32
45
46 // Heap objects are allowed to be directly referenced only in VM code,
47 // not in native code.
48
49 #define ASSERT_OOPS_ALLOWED \
50 assert(JavaThread::current()->thread_state() == _thread_in_vm, \
51 "jniCheck examining oops in bad state.")
52
53
54 // Execute the given block of source code with the thread in VM state.
55 // To do this, transition from the NATIVE state to the VM state, execute
|