annotate src/share/vm/prims/jniCheck.cpp @ 2192:b92c45f2bc75

7016023: Enable building ARM and PPC from src/closed repository Reviewed-by: dholmes, bdelsart
author bobv
date Wed, 02 Feb 2011 11:35:26 -0500
parents 3582bf76420e
children c7f3d0b4570f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1142
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1142
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1142
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "classfile/systemDictionary.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "classfile/vmSymbols.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "oops/instanceKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "oops/oop.inline.hpp"
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1989
diff changeset
30 #include "oops/symbol.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "prims/jni.h"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "prims/jniCheck.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
33 #include "prims/jvm_misc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
34 #include "runtime/fieldDescriptor.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
35 #include "runtime/handles.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
36 #include "runtime/interfaceSupport.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
37 #include "runtime/jfieldIDWorkaround.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
38 #include "runtime/thread.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
39 #ifdef TARGET_ARCH_x86
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
40 # include "jniTypes_x86.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
41 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
42 #ifdef TARGET_ARCH_sparc
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
43 # include "jniTypes_sparc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
44 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
45 #ifdef TARGET_ARCH_zero
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
46 # include "jniTypes_zero.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
47 #endif
2192
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2177
diff changeset
48 #ifdef TARGET_ARCH_arm
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2177
diff changeset
49 # include "jniTypes_arm.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2177
diff changeset
50 #endif
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2177
diff changeset
51 #ifdef TARGET_ARCH_ppc
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2177
diff changeset
52 # include "jniTypes_ppc.hpp"
b92c45f2bc75 7016023: Enable building ARM and PPC from src/closed repository
bobv
parents: 2177
diff changeset
53 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Heap objects are allowed to be directly referenced only in VM code,
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // not in native code.
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 #define ASSERT_OOPS_ALLOWED \
a61af66fc99e Initial load
duke
parents:
diff changeset
60 assert(JavaThread::current()->thread_state() == _thread_in_vm, \
a61af66fc99e Initial load
duke
parents:
diff changeset
61 "jniCheck examining oops in bad state.")
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // Execute the given block of source code with the thread in VM state.
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // To do this, transition from the NATIVE state to the VM state, execute
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // the code, and transtition back. The ThreadInVMfromNative constructor
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // performs the transition to VM state, its destructor restores the
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // NATIVE state.
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 #define IN_VM(source_code) { \
a61af66fc99e Initial load
duke
parents:
diff changeset
71 { \
a61af66fc99e Initial load
duke
parents:
diff changeset
72 ThreadInVMfromNative __tiv(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
73 source_code \
a61af66fc99e Initial load
duke
parents:
diff changeset
74 } \
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
79 * DECLARATIONS
a61af66fc99e Initial load
duke
parents:
diff changeset
80 */
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 static struct JNINativeInterface_ * unchecked_jni_NativeInterface;
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
86 * MACRO DEFINITIONS
a61af66fc99e Initial load
duke
parents:
diff changeset
87 */
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // All JNI checked functions here use JNI_ENTRY_CHECKED() instead of the
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // QUICK_ENTRY or LEAF variants found in jni.cpp. This allows handles
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // to be created if a fatal error should occur.
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // Check for thread not attached to VM; need to catch this before
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // assertions in the wrapper routines might fire
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 // Check for env being the one value appropriate for this thread.
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 #define JNI_ENTRY_CHECKED(result_type, header) \
a61af66fc99e Initial load
duke
parents:
diff changeset
99 extern "C" { \
a61af66fc99e Initial load
duke
parents:
diff changeset
100 result_type JNICALL header { \
a61af66fc99e Initial load
duke
parents:
diff changeset
101 JavaThread* thr = (JavaThread*)ThreadLocalStorage::get_thread_slow();\
a61af66fc99e Initial load
duke
parents:
diff changeset
102 if (thr == NULL || !thr->is_Java_thread()) { \
a61af66fc99e Initial load
duke
parents:
diff changeset
103 tty->print_cr(fatal_using_jnienv_in_nonjava); \
a61af66fc99e Initial load
duke
parents:
diff changeset
104 os::abort(true); \
a61af66fc99e Initial load
duke
parents:
diff changeset
105 } \
a61af66fc99e Initial load
duke
parents:
diff changeset
106 JNIEnv* xenv = thr->jni_environment(); \
a61af66fc99e Initial load
duke
parents:
diff changeset
107 if (env != xenv) { \
a61af66fc99e Initial load
duke
parents:
diff changeset
108 NativeReportJNIFatalError(thr, warn_wrong_jnienv); \
a61af66fc99e Initial load
duke
parents:
diff changeset
109 } \
a61af66fc99e Initial load
duke
parents:
diff changeset
110 __ENTRY(result_type, header, thr)
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112
a61af66fc99e Initial load
duke
parents:
diff changeset
113 #define UNCHECKED() (unchecked_jni_NativeInterface)
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 static const char * warn_wrong_jnienv = "Using JNIEnv in the wrong thread";
a61af66fc99e Initial load
duke
parents:
diff changeset
116 static const char * warn_bad_class_descriptor = "JNI FindClass received a bad class descriptor \"%s\". A correct class descriptor " \
a61af66fc99e Initial load
duke
parents:
diff changeset
117 "has no leading \"L\" or trailing \";\". Incorrect descriptors will not be accepted in future releases.";
a61af66fc99e Initial load
duke
parents:
diff changeset
118 static const char * fatal_using_jnienv_in_nonjava = "FATAL ERROR in native method: Using JNIEnv in non-Java thread";
a61af66fc99e Initial load
duke
parents:
diff changeset
119 static const char * warn_other_function_in_critical = "Warning: Calling other JNI functions in the scope of " \
a61af66fc99e Initial load
duke
parents:
diff changeset
120 "Get/ReleasePrimitiveArrayCritical or Get/ReleaseStringCritical";
a61af66fc99e Initial load
duke
parents:
diff changeset
121 static const char * fatal_bad_ref_to_jni = "Bad global or local ref passed to JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
122 static const char * fatal_received_null_class = "JNI received a null class";
a61af66fc99e Initial load
duke
parents:
diff changeset
123 static const char * fatal_class_not_a_class = "JNI received a class argument that is not a class";
a61af66fc99e Initial load
duke
parents:
diff changeset
124 static const char * fatal_class_not_a_throwable_class = "JNI Throw or ThrowNew received a class argument that is not a Throwable or Throwable subclass";
a61af66fc99e Initial load
duke
parents:
diff changeset
125 static const char * fatal_wrong_class_or_method = "Wrong object class or methodID passed to JNI call";
917
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
126 static const char * fatal_non_weak_method = "non-weak methodID passed to JNI call";
0
a61af66fc99e Initial load
duke
parents:
diff changeset
127 static const char * fatal_unknown_array_object = "Unknown array object passed to JNI array operations";
a61af66fc99e Initial load
duke
parents:
diff changeset
128 static const char * fatal_object_array_expected = "Object array expected but not received for JNI array operation";
a61af66fc99e Initial load
duke
parents:
diff changeset
129 static const char * fatal_non_array = "Non-array passed to JNI array operations";
a61af66fc99e Initial load
duke
parents:
diff changeset
130 static const char * fatal_element_type_mismatch = "Array element type mismatch in JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
131 static const char * fatal_should_be_static = "Non-static field ID passed to JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
132 static const char * fatal_wrong_static_field = "Wrong static field ID passed to JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
133 static const char * fatal_static_field_not_found = "Static field not found in JNI get/set field operations";
a61af66fc99e Initial load
duke
parents:
diff changeset
134 static const char * fatal_static_field_mismatch = "Field type (static) mismatch in JNI get/set field operations";
a61af66fc99e Initial load
duke
parents:
diff changeset
135 static const char * fatal_should_be_nonstatic = "Static field ID passed to JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
136 static const char * fatal_null_object = "Null object passed to JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
137 static const char * fatal_wrong_field = "Wrong field ID passed to JNI";
a61af66fc99e Initial load
duke
parents:
diff changeset
138 static const char * fatal_instance_field_not_found = "Instance field not found in JNI get/set field operations";
a61af66fc99e Initial load
duke
parents:
diff changeset
139 static const char * fatal_instance_field_mismatch = "Field type (instance) mismatch in JNI get/set field operations";
a61af66fc99e Initial load
duke
parents:
diff changeset
140 static const char * fatal_non_string = "JNI string operation received a non-string";
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // When in VM state:
a61af66fc99e Initial load
duke
parents:
diff changeset
144 static void ReportJNIWarning(JavaThread* thr, const char *msg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 tty->print_cr("WARNING in native method: %s", msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
146 thr->print_stack();
a61af66fc99e Initial load
duke
parents:
diff changeset
147 }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 // When in NATIVE state:
a61af66fc99e Initial load
duke
parents:
diff changeset
150 static void NativeReportJNIFatalError(JavaThread* thr, const char *msg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
151 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
152 ReportJNIFatalError(thr, msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
153 )
a61af66fc99e Initial load
duke
parents:
diff changeset
154 }
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 static void NativeReportJNIWarning(JavaThread* thr, const char *msg) {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
158 ReportJNIWarning(thr, msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
159 )
a61af66fc99e Initial load
duke
parents:
diff changeset
160 }
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
166 * SUPPORT FUNCTIONS
a61af66fc99e Initial load
duke
parents:
diff changeset
167 */
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
170 functionEnterCritical(JavaThread* thr)
a61af66fc99e Initial load
duke
parents:
diff changeset
171 {
a61af66fc99e Initial load
duke
parents:
diff changeset
172 if (thr->has_pending_exception()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
173 NativeReportJNIWarning(thr, "JNI call made with exception pending");
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
178 functionEnterCriticalExceptionAllowed(JavaThread* thr)
a61af66fc99e Initial load
duke
parents:
diff changeset
179 {
a61af66fc99e Initial load
duke
parents:
diff changeset
180 }
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
183 functionEnter(JavaThread* thr)
a61af66fc99e Initial load
duke
parents:
diff changeset
184 {
a61af66fc99e Initial load
duke
parents:
diff changeset
185 if (thr->in_critical()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
186 tty->print_cr(warn_other_function_in_critical);
a61af66fc99e Initial load
duke
parents:
diff changeset
187 }
a61af66fc99e Initial load
duke
parents:
diff changeset
188 if (thr->has_pending_exception()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
189 NativeReportJNIWarning(thr, "JNI call made with exception pending");
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191 }
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
194 functionEnterExceptionAllowed(JavaThread* thr)
a61af66fc99e Initial load
duke
parents:
diff changeset
195 {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 if (thr->in_critical()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
197 tty->print_cr(warn_other_function_in_critical);
a61af66fc99e Initial load
duke
parents:
diff changeset
198 }
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
202 functionExit(JNIEnv *env)
a61af66fc99e Initial load
duke
parents:
diff changeset
203 {
a61af66fc99e Initial load
duke
parents:
diff changeset
204 /* nothing to do at this time */
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
208 checkStaticFieldID(JavaThread* thr, jfieldID fid, jclass cls, int ftype)
a61af66fc99e Initial load
duke
parents:
diff changeset
209 {
a61af66fc99e Initial load
duke
parents:
diff changeset
210 fieldDescriptor fd;
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212 /* make sure it is a static field */
a61af66fc99e Initial load
duke
parents:
diff changeset
213 if (!jfieldIDWorkaround::is_static_jfieldID(fid))
a61af66fc99e Initial load
duke
parents:
diff changeset
214 ReportJNIFatalError(thr, fatal_should_be_static);
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 /* validate the class being passed */
a61af66fc99e Initial load
duke
parents:
diff changeset
217 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
218 klassOop k_oop = jniCheck::validate_class(thr, cls, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
219
a61af66fc99e Initial load
duke
parents:
diff changeset
220 /* check for proper subclass hierarchy */
a61af66fc99e Initial load
duke
parents:
diff changeset
221 JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fid);
a61af66fc99e Initial load
duke
parents:
diff changeset
222 klassOop f_oop = id->holder();
a61af66fc99e Initial load
duke
parents:
diff changeset
223 if (!instanceKlass::cast(k_oop)->is_subtype_of(f_oop))
a61af66fc99e Initial load
duke
parents:
diff changeset
224 ReportJNIFatalError(thr, fatal_wrong_static_field);
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 /* check for proper field type */
a61af66fc99e Initial load
duke
parents:
diff changeset
227 if (!instanceKlass::cast(f_oop)->find_local_field_from_offset(
a61af66fc99e Initial load
duke
parents:
diff changeset
228 id->offset(), true, &fd))
a61af66fc99e Initial load
duke
parents:
diff changeset
229 ReportJNIFatalError(thr, fatal_static_field_not_found);
a61af66fc99e Initial load
duke
parents:
diff changeset
230 if ((fd.field_type() != ftype) &&
a61af66fc99e Initial load
duke
parents:
diff changeset
231 !(fd.field_type() == T_ARRAY && ftype == T_OBJECT)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 ReportJNIFatalError(thr, fatal_static_field_mismatch);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234 }
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
237 checkInstanceFieldID(JavaThread* thr, jfieldID fid, jobject obj, int ftype)
a61af66fc99e Initial load
duke
parents:
diff changeset
238 {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 fieldDescriptor fd;
a61af66fc99e Initial load
duke
parents:
diff changeset
240
a61af66fc99e Initial load
duke
parents:
diff changeset
241 /* make sure it is an instance field */
a61af66fc99e Initial load
duke
parents:
diff changeset
242 if (jfieldIDWorkaround::is_static_jfieldID(fid))
a61af66fc99e Initial load
duke
parents:
diff changeset
243 ReportJNIFatalError(thr, fatal_should_be_nonstatic);
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 /* validate the object being passed and then get its class */
a61af66fc99e Initial load
duke
parents:
diff changeset
246 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
247 oop oopObj = jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
248 if (!oopObj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
249 ReportJNIFatalError(thr, fatal_null_object);
a61af66fc99e Initial load
duke
parents:
diff changeset
250 }
a61af66fc99e Initial load
duke
parents:
diff changeset
251 klassOop k_oop = oopObj->klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
252
a61af66fc99e Initial load
duke
parents:
diff changeset
253 if (!jfieldIDWorkaround::is_valid_jfieldID(k_oop, fid)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
254 ReportJNIFatalError(thr, fatal_wrong_field);
a61af66fc99e Initial load
duke
parents:
diff changeset
255 }
a61af66fc99e Initial load
duke
parents:
diff changeset
256
a61af66fc99e Initial load
duke
parents:
diff changeset
257 /* make sure the field exists */
a61af66fc99e Initial load
duke
parents:
diff changeset
258 int offset = jfieldIDWorkaround::from_instance_jfieldID(k_oop, fid);
a61af66fc99e Initial load
duke
parents:
diff changeset
259 if (!instanceKlass::cast(k_oop)->contains_field_offset(offset))
a61af66fc99e Initial load
duke
parents:
diff changeset
260 ReportJNIFatalError(thr, fatal_wrong_field);
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262 /* check for proper field type */
a61af66fc99e Initial load
duke
parents:
diff changeset
263 if (!instanceKlass::cast(k_oop)->find_field_from_offset(offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
264 false, &fd))
a61af66fc99e Initial load
duke
parents:
diff changeset
265 ReportJNIFatalError(thr, fatal_instance_field_not_found);
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 if ((fd.field_type() != ftype) &&
a61af66fc99e Initial load
duke
parents:
diff changeset
268 !(fd.field_type() == T_ARRAY && ftype == T_OBJECT)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
269 ReportJNIFatalError(thr, fatal_instance_field_mismatch);
a61af66fc99e Initial load
duke
parents:
diff changeset
270 }
a61af66fc99e Initial load
duke
parents:
diff changeset
271 }
a61af66fc99e Initial load
duke
parents:
diff changeset
272
a61af66fc99e Initial load
duke
parents:
diff changeset
273 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
274 checkString(JavaThread* thr, jstring js)
a61af66fc99e Initial load
duke
parents:
diff changeset
275 {
a61af66fc99e Initial load
duke
parents:
diff changeset
276 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
277 oop s = jniCheck::validate_object(thr, js);
a61af66fc99e Initial load
duke
parents:
diff changeset
278 if (!s || !java_lang_String::is_instance(s))
a61af66fc99e Initial load
duke
parents:
diff changeset
279 ReportJNIFatalError(thr, fatal_non_string);
a61af66fc99e Initial load
duke
parents:
diff changeset
280 }
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282 static inline void
a61af66fc99e Initial load
duke
parents:
diff changeset
283 checkArray(JavaThread* thr, jarray jArray, int elementType)
a61af66fc99e Initial load
duke
parents:
diff changeset
284 {
a61af66fc99e Initial load
duke
parents:
diff changeset
285 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
286 arrayOop aOop;
a61af66fc99e Initial load
duke
parents:
diff changeset
287
a61af66fc99e Initial load
duke
parents:
diff changeset
288 aOop = (arrayOop)jniCheck::validate_object(thr, jArray);
a61af66fc99e Initial load
duke
parents:
diff changeset
289 if (aOop == NULL || !aOop->is_array())
a61af66fc99e Initial load
duke
parents:
diff changeset
290 ReportJNIFatalError(thr, fatal_non_array);
a61af66fc99e Initial load
duke
parents:
diff changeset
291
a61af66fc99e Initial load
duke
parents:
diff changeset
292 if (elementType != -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
293 if (aOop->is_typeArray()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
294 BasicType array_type = typeArrayKlass::cast(aOop->klass())->element_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
295 if (array_type != elementType)
a61af66fc99e Initial load
duke
parents:
diff changeset
296 ReportJNIFatalError(thr, fatal_element_type_mismatch);
a61af66fc99e Initial load
duke
parents:
diff changeset
297 } else if (aOop->is_objArray()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
298 if ( T_OBJECT != elementType)
a61af66fc99e Initial load
duke
parents:
diff changeset
299 ReportJNIFatalError(thr, fatal_object_array_expected);
a61af66fc99e Initial load
duke
parents:
diff changeset
300 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
301 ReportJNIFatalError(thr, fatal_unknown_array_object);
a61af66fc99e Initial load
duke
parents:
diff changeset
302 }
a61af66fc99e Initial load
duke
parents:
diff changeset
303 }
a61af66fc99e Initial load
duke
parents:
diff changeset
304 }
a61af66fc99e Initial load
duke
parents:
diff changeset
305
a61af66fc99e Initial load
duke
parents:
diff changeset
306
a61af66fc99e Initial load
duke
parents:
diff changeset
307 oop jniCheck::validate_handle(JavaThread* thr, jobject obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
308 if (JNIHandles::is_frame_handle(thr, obj) ||
a61af66fc99e Initial load
duke
parents:
diff changeset
309 JNIHandles::is_local_handle(thr, obj) ||
a61af66fc99e Initial load
duke
parents:
diff changeset
310 JNIHandles::is_global_handle(obj) ||
a61af66fc99e Initial load
duke
parents:
diff changeset
311 JNIHandles::is_weak_global_handle(obj)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
313 return JNIHandles::resolve_external_guard(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
314 }
a61af66fc99e Initial load
duke
parents:
diff changeset
315 ReportJNIFatalError(thr, fatal_bad_ref_to_jni);
a61af66fc99e Initial load
duke
parents:
diff changeset
316 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
317 }
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320 methodOop jniCheck::validate_jmethod_id(JavaThread* thr, jmethodID method_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
321 ASSERT_OOPS_ALLOWED;
917
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
322 // do the fast jmethodID check first
0
a61af66fc99e Initial load
duke
parents:
diff changeset
323 methodOop moop = JNIHandles::checked_resolve_jmethod_id(method_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
324 if (moop == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
325 ReportJNIFatalError(thr, fatal_wrong_class_or_method);
a61af66fc99e Initial load
duke
parents:
diff changeset
326 }
917
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
327 // jmethodIDs are supposed to be weak global handles, but that
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
328 // can be expensive so check it last
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
329 else if (!JNIHandles::is_weak_global_handle((jobject) method_id)) {
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
330 ReportJNIFatalError(thr, fatal_non_weak_method);
1760a1cbed36 6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
dcubed
parents: 470
diff changeset
331 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
332 return moop;
a61af66fc99e Initial load
duke
parents:
diff changeset
333 }
a61af66fc99e Initial load
duke
parents:
diff changeset
334
a61af66fc99e Initial load
duke
parents:
diff changeset
335
a61af66fc99e Initial load
duke
parents:
diff changeset
336 oop jniCheck::validate_object(JavaThread* thr, jobject obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
337 if (!obj)
a61af66fc99e Initial load
duke
parents:
diff changeset
338 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
339 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
340 oop oopObj = jniCheck::validate_handle(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
341 if (!oopObj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
342 ReportJNIFatalError(thr, fatal_bad_ref_to_jni);
a61af66fc99e Initial load
duke
parents:
diff changeset
343 }
a61af66fc99e Initial load
duke
parents:
diff changeset
344 return oopObj;
a61af66fc99e Initial load
duke
parents:
diff changeset
345 }
a61af66fc99e Initial load
duke
parents:
diff changeset
346
a61af66fc99e Initial load
duke
parents:
diff changeset
347 // Warn if a class descriptor is in decorated form; class descriptors
a61af66fc99e Initial load
duke
parents:
diff changeset
348 // passed to JNI findClass should not be decorated unless they are
a61af66fc99e Initial load
duke
parents:
diff changeset
349 // array descriptors.
a61af66fc99e Initial load
duke
parents:
diff changeset
350 void jniCheck::validate_class_descriptor(JavaThread* thr, const char* name) {
a61af66fc99e Initial load
duke
parents:
diff changeset
351 if (name == NULL) return; // implementation accepts NULL so just return
a61af66fc99e Initial load
duke
parents:
diff changeset
352
a61af66fc99e Initial load
duke
parents:
diff changeset
353 size_t len = strlen(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 if (len >= 2 &&
a61af66fc99e Initial load
duke
parents:
diff changeset
356 name[0] == JVM_SIGNATURE_CLASS && // 'L'
a61af66fc99e Initial load
duke
parents:
diff changeset
357 name[len-1] == JVM_SIGNATURE_ENDCLASS ) { // ';'
a61af66fc99e Initial load
duke
parents:
diff changeset
358 char msg[JVM_MAXPATHLEN];
a61af66fc99e Initial load
duke
parents:
diff changeset
359 jio_snprintf(msg, JVM_MAXPATHLEN, warn_bad_class_descriptor, name);
a61af66fc99e Initial load
duke
parents:
diff changeset
360 ReportJNIWarning(thr, msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
361 }
a61af66fc99e Initial load
duke
parents:
diff changeset
362 }
a61af66fc99e Initial load
duke
parents:
diff changeset
363
a61af66fc99e Initial load
duke
parents:
diff changeset
364 klassOop jniCheck::validate_class(JavaThread* thr, jclass clazz, bool allow_primitive) {
a61af66fc99e Initial load
duke
parents:
diff changeset
365 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
366 oop mirror = jniCheck::validate_handle(thr, clazz);
a61af66fc99e Initial load
duke
parents:
diff changeset
367 if (!mirror) {
a61af66fc99e Initial load
duke
parents:
diff changeset
368 ReportJNIFatalError(thr, fatal_received_null_class);
a61af66fc99e Initial load
duke
parents:
diff changeset
369 }
a61af66fc99e Initial load
duke
parents:
diff changeset
370
1142
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 917
diff changeset
371 if (mirror->klass() != SystemDictionary::Class_klass()) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
372 ReportJNIFatalError(thr, fatal_class_not_a_class);
a61af66fc99e Initial load
duke
parents:
diff changeset
373 }
a61af66fc99e Initial load
duke
parents:
diff changeset
374
a61af66fc99e Initial load
duke
parents:
diff changeset
375 klassOop k = java_lang_Class::as_klassOop(mirror);
a61af66fc99e Initial load
duke
parents:
diff changeset
376 // Make allowances for primitive classes ...
a61af66fc99e Initial load
duke
parents:
diff changeset
377 if (!(k != NULL || allow_primitive && java_lang_Class::is_primitive(mirror))) {
a61af66fc99e Initial load
duke
parents:
diff changeset
378 ReportJNIFatalError(thr, fatal_class_not_a_class);
a61af66fc99e Initial load
duke
parents:
diff changeset
379 }
a61af66fc99e Initial load
duke
parents:
diff changeset
380 return k;
a61af66fc99e Initial load
duke
parents:
diff changeset
381 }
a61af66fc99e Initial load
duke
parents:
diff changeset
382
a61af66fc99e Initial load
duke
parents:
diff changeset
383 void jniCheck::validate_throwable_klass(JavaThread* thr, klassOop klass) {
a61af66fc99e Initial load
duke
parents:
diff changeset
384 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
385 assert(klass != NULL, "klass argument must have a value");
a61af66fc99e Initial load
duke
parents:
diff changeset
386
a61af66fc99e Initial load
duke
parents:
diff changeset
387 if (!Klass::cast(klass)->oop_is_instance() ||
1142
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 917
diff changeset
388 !instanceKlass::cast(klass)->is_subclass_of(SystemDictionary::Throwable_klass())) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
389 ReportJNIFatalError(thr, fatal_class_not_a_throwable_class);
a61af66fc99e Initial load
duke
parents:
diff changeset
390 }
a61af66fc99e Initial load
duke
parents:
diff changeset
391 }
a61af66fc99e Initial load
duke
parents:
diff changeset
392
a61af66fc99e Initial load
duke
parents:
diff changeset
393 void jniCheck::validate_call_object(JavaThread* thr, jobject obj, jmethodID method_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
394 /* validate the object being passed */
a61af66fc99e Initial load
duke
parents:
diff changeset
395 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
396 jniCheck::validate_jmethod_id(thr, method_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
397 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
398 }
a61af66fc99e Initial load
duke
parents:
diff changeset
399
a61af66fc99e Initial load
duke
parents:
diff changeset
400 void jniCheck::validate_call_class(JavaThread* thr, jclass clazz, jmethodID method_id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
401 /* validate the class being passed */
a61af66fc99e Initial load
duke
parents:
diff changeset
402 ASSERT_OOPS_ALLOWED;
a61af66fc99e Initial load
duke
parents:
diff changeset
403 jniCheck::validate_jmethod_id(thr, method_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
404 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
405 }
a61af66fc99e Initial load
duke
parents:
diff changeset
406
a61af66fc99e Initial load
duke
parents:
diff changeset
407
a61af66fc99e Initial load
duke
parents:
diff changeset
408 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
409 * IMPLEMENTATION OF FUNCTIONS IN CHECKED TABLE
a61af66fc99e Initial load
duke
parents:
diff changeset
410 */
a61af66fc99e Initial load
duke
parents:
diff changeset
411
a61af66fc99e Initial load
duke
parents:
diff changeset
412 JNI_ENTRY_CHECKED(jclass,
a61af66fc99e Initial load
duke
parents:
diff changeset
413 checked_jni_DefineClass(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
414 const char *name,
a61af66fc99e Initial load
duke
parents:
diff changeset
415 jobject loader,
a61af66fc99e Initial load
duke
parents:
diff changeset
416 const jbyte *buf,
a61af66fc99e Initial load
duke
parents:
diff changeset
417 jsize len))
a61af66fc99e Initial load
duke
parents:
diff changeset
418 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
419 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
420 jniCheck::validate_object(thr, loader);
a61af66fc99e Initial load
duke
parents:
diff changeset
421 )
a61af66fc99e Initial load
duke
parents:
diff changeset
422 jclass result = UNCHECKED()->DefineClass(env, name, loader, buf, len);
a61af66fc99e Initial load
duke
parents:
diff changeset
423 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
424 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
425 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
426
a61af66fc99e Initial load
duke
parents:
diff changeset
427 JNI_ENTRY_CHECKED(jclass,
a61af66fc99e Initial load
duke
parents:
diff changeset
428 checked_jni_FindClass(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
429 const char *name))
a61af66fc99e Initial load
duke
parents:
diff changeset
430 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
431 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
432 jniCheck::validate_class_descriptor(thr, name);
a61af66fc99e Initial load
duke
parents:
diff changeset
433 )
a61af66fc99e Initial load
duke
parents:
diff changeset
434 jclass result = UNCHECKED()->FindClass(env, name);
a61af66fc99e Initial load
duke
parents:
diff changeset
435 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
436 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
437 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
438
a61af66fc99e Initial load
duke
parents:
diff changeset
439 JNI_ENTRY_CHECKED(jmethodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
440 checked_jni_FromReflectedMethod(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
441 jobject method))
a61af66fc99e Initial load
duke
parents:
diff changeset
442 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
443 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
444 jniCheck::validate_object(thr, method);
a61af66fc99e Initial load
duke
parents:
diff changeset
445 )
a61af66fc99e Initial load
duke
parents:
diff changeset
446 jmethodID result = UNCHECKED()->FromReflectedMethod(env, method);
a61af66fc99e Initial load
duke
parents:
diff changeset
447 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
448 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
449 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
450
a61af66fc99e Initial load
duke
parents:
diff changeset
451 JNI_ENTRY_CHECKED(jfieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
452 checked_jni_FromReflectedField(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
453 jobject field))
a61af66fc99e Initial load
duke
parents:
diff changeset
454 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
455 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
456 jniCheck::validate_object(thr, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
457 )
a61af66fc99e Initial load
duke
parents:
diff changeset
458 jfieldID result = UNCHECKED()->FromReflectedField(env, field);
a61af66fc99e Initial load
duke
parents:
diff changeset
459 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
460 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
461 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
462
a61af66fc99e Initial load
duke
parents:
diff changeset
463 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
464 checked_jni_ToReflectedMethod(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
465 jclass cls,
a61af66fc99e Initial load
duke
parents:
diff changeset
466 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
467 jboolean isStatic))
a61af66fc99e Initial load
duke
parents:
diff changeset
468 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
469 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
470 jniCheck::validate_class(thr, cls, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
471 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
472 )
a61af66fc99e Initial load
duke
parents:
diff changeset
473 jobject result = UNCHECKED()->ToReflectedMethod(env, cls, methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
474 isStatic);
a61af66fc99e Initial load
duke
parents:
diff changeset
475 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
476 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
477 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
478
a61af66fc99e Initial load
duke
parents:
diff changeset
479 JNI_ENTRY_CHECKED(jclass,
a61af66fc99e Initial load
duke
parents:
diff changeset
480 checked_jni_GetSuperclass(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
481 jclass sub))
a61af66fc99e Initial load
duke
parents:
diff changeset
482 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
483 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
484 jniCheck::validate_class(thr, sub, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
485 )
a61af66fc99e Initial load
duke
parents:
diff changeset
486 jclass result = UNCHECKED()->GetSuperclass(env, sub);
a61af66fc99e Initial load
duke
parents:
diff changeset
487 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
488 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
489 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
490
a61af66fc99e Initial load
duke
parents:
diff changeset
491 JNI_ENTRY_CHECKED(jboolean,
a61af66fc99e Initial load
duke
parents:
diff changeset
492 checked_jni_IsAssignableFrom(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
493 jclass sub,
a61af66fc99e Initial load
duke
parents:
diff changeset
494 jclass sup))
a61af66fc99e Initial load
duke
parents:
diff changeset
495 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
496 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
497 jniCheck::validate_class(thr, sub, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
498 jniCheck::validate_class(thr, sup, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
499 )
a61af66fc99e Initial load
duke
parents:
diff changeset
500 jboolean result = UNCHECKED()->IsAssignableFrom(env, sub, sup);
a61af66fc99e Initial load
duke
parents:
diff changeset
501 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
502 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
503 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
504
a61af66fc99e Initial load
duke
parents:
diff changeset
505 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
506 checked_jni_ToReflectedField(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
507 jclass cls,
a61af66fc99e Initial load
duke
parents:
diff changeset
508 jfieldID fieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
509 jboolean isStatic))
a61af66fc99e Initial load
duke
parents:
diff changeset
510 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
511 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
512 jniCheck::validate_class(thr, cls, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
513 )
a61af66fc99e Initial load
duke
parents:
diff changeset
514 jobject result = UNCHECKED()->ToReflectedField(env, cls, fieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
515 isStatic);
a61af66fc99e Initial load
duke
parents:
diff changeset
516 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
517 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
518 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
519
a61af66fc99e Initial load
duke
parents:
diff changeset
520 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
521 checked_jni_Throw(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
522 jthrowable obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
523 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
524 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
525 oop oopObj = jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
526 if (oopObj == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
527 // Unchecked Throw tolerates a NULL obj, so just warn
a61af66fc99e Initial load
duke
parents:
diff changeset
528 ReportJNIWarning(thr, "JNI Throw called with NULL throwable");
a61af66fc99e Initial load
duke
parents:
diff changeset
529 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
530 jniCheck::validate_throwable_klass(thr, oopObj->klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
531 }
a61af66fc99e Initial load
duke
parents:
diff changeset
532 )
a61af66fc99e Initial load
duke
parents:
diff changeset
533 jint result = UNCHECKED()->Throw(env, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
534 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
535 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
536 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
537
a61af66fc99e Initial load
duke
parents:
diff changeset
538 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
539 checked_jni_ThrowNew(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
540 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
541 const char *msg))
a61af66fc99e Initial load
duke
parents:
diff changeset
542 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
543 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
544 klassOop k = jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
545 assert(k != NULL, "validate_class shouldn't return NULL klassOop");
a61af66fc99e Initial load
duke
parents:
diff changeset
546 jniCheck::validate_throwable_klass(thr, k);
a61af66fc99e Initial load
duke
parents:
diff changeset
547 )
a61af66fc99e Initial load
duke
parents:
diff changeset
548 jint result = UNCHECKED()->ThrowNew(env, clazz, msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
549 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
550 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
551 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
552
a61af66fc99e Initial load
duke
parents:
diff changeset
553 JNI_ENTRY_CHECKED(jthrowable,
a61af66fc99e Initial load
duke
parents:
diff changeset
554 checked_jni_ExceptionOccurred(JNIEnv *env))
a61af66fc99e Initial load
duke
parents:
diff changeset
555 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
556 jthrowable result = UNCHECKED()->ExceptionOccurred(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
557 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
558 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
559 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
560
a61af66fc99e Initial load
duke
parents:
diff changeset
561 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
562 checked_jni_ExceptionDescribe(JNIEnv *env))
a61af66fc99e Initial load
duke
parents:
diff changeset
563 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
564 UNCHECKED()->ExceptionDescribe(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
565 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
566 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
567
a61af66fc99e Initial load
duke
parents:
diff changeset
568 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
569 checked_jni_ExceptionClear(JNIEnv *env))
a61af66fc99e Initial load
duke
parents:
diff changeset
570 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
571 UNCHECKED()->ExceptionClear(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
572 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
573 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
574
a61af66fc99e Initial load
duke
parents:
diff changeset
575 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
576 checked_jni_FatalError(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
577 const char *msg))
a61af66fc99e Initial load
duke
parents:
diff changeset
578 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
579 UNCHECKED()->FatalError(env, msg);
a61af66fc99e Initial load
duke
parents:
diff changeset
580 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
581 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
582
a61af66fc99e Initial load
duke
parents:
diff changeset
583 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
584 checked_jni_PushLocalFrame(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
585 jint capacity))
a61af66fc99e Initial load
duke
parents:
diff changeset
586 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
587 if (capacity < 0)
a61af66fc99e Initial load
duke
parents:
diff changeset
588 NativeReportJNIFatalError(thr, "negative capacity");
a61af66fc99e Initial load
duke
parents:
diff changeset
589 jint result = UNCHECKED()->PushLocalFrame(env, capacity);
a61af66fc99e Initial load
duke
parents:
diff changeset
590 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
591 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
592 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
593
a61af66fc99e Initial load
duke
parents:
diff changeset
594 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
595 checked_jni_PopLocalFrame(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
596 jobject result))
a61af66fc99e Initial load
duke
parents:
diff changeset
597 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
598 jobject res = UNCHECKED()->PopLocalFrame(env, result);
a61af66fc99e Initial load
duke
parents:
diff changeset
599 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
600 return res;
a61af66fc99e Initial load
duke
parents:
diff changeset
601 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
602
a61af66fc99e Initial load
duke
parents:
diff changeset
603 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
604 checked_jni_NewGlobalRef(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
605 jobject lobj))
a61af66fc99e Initial load
duke
parents:
diff changeset
606 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
607 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
608 if (lobj != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
609 jniCheck::validate_handle(thr, lobj);
a61af66fc99e Initial load
duke
parents:
diff changeset
610 }
a61af66fc99e Initial load
duke
parents:
diff changeset
611 )
a61af66fc99e Initial load
duke
parents:
diff changeset
612 jobject result = UNCHECKED()->NewGlobalRef(env,lobj);
a61af66fc99e Initial load
duke
parents:
diff changeset
613 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
614 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
615 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
616
a61af66fc99e Initial load
duke
parents:
diff changeset
617 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
618 checked_jni_DeleteGlobalRef(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
619 jobject gref))
a61af66fc99e Initial load
duke
parents:
diff changeset
620 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
621 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
622 jniCheck::validate_object(thr, gref);
a61af66fc99e Initial load
duke
parents:
diff changeset
623 if (gref && !JNIHandles::is_global_handle(gref)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
624 ReportJNIFatalError(thr,
a61af66fc99e Initial load
duke
parents:
diff changeset
625 "Invalid global JNI handle passed to DeleteGlobalRef");
a61af66fc99e Initial load
duke
parents:
diff changeset
626 }
a61af66fc99e Initial load
duke
parents:
diff changeset
627 )
a61af66fc99e Initial load
duke
parents:
diff changeset
628 UNCHECKED()->DeleteGlobalRef(env,gref);
a61af66fc99e Initial load
duke
parents:
diff changeset
629 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
630 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
631
a61af66fc99e Initial load
duke
parents:
diff changeset
632 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
633 checked_jni_DeleteLocalRef(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
634 jobject obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
635 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
636 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
637 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
638 if (obj && !(JNIHandles::is_local_handle(thr, obj) ||
a61af66fc99e Initial load
duke
parents:
diff changeset
639 JNIHandles::is_frame_handle(thr, obj)))
a61af66fc99e Initial load
duke
parents:
diff changeset
640 ReportJNIFatalError(thr,
a61af66fc99e Initial load
duke
parents:
diff changeset
641 "Invalid local JNI handle passed to DeleteLocalRef");
a61af66fc99e Initial load
duke
parents:
diff changeset
642 )
a61af66fc99e Initial load
duke
parents:
diff changeset
643 UNCHECKED()->DeleteLocalRef(env, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
644 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
645 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
646
a61af66fc99e Initial load
duke
parents:
diff changeset
647 JNI_ENTRY_CHECKED(jboolean,
a61af66fc99e Initial load
duke
parents:
diff changeset
648 checked_jni_IsSameObject(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
649 jobject obj1,
a61af66fc99e Initial load
duke
parents:
diff changeset
650 jobject obj2))
a61af66fc99e Initial load
duke
parents:
diff changeset
651 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
652 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
653 /* This JNI function can be used to compare weak global references
a61af66fc99e Initial load
duke
parents:
diff changeset
654 * to NULL objects. If the handles are valid, but contain NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
655 * then don't attempt to validate the object.
a61af66fc99e Initial load
duke
parents:
diff changeset
656 */
a61af66fc99e Initial load
duke
parents:
diff changeset
657 if (obj1 != NULL && jniCheck::validate_handle(thr, obj1) != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
658 jniCheck::validate_object(thr, obj1);
a61af66fc99e Initial load
duke
parents:
diff changeset
659 }
a61af66fc99e Initial load
duke
parents:
diff changeset
660 if (obj2 != NULL && jniCheck::validate_handle(thr, obj2) != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
661 jniCheck::validate_object(thr, obj2);
a61af66fc99e Initial load
duke
parents:
diff changeset
662 }
a61af66fc99e Initial load
duke
parents:
diff changeset
663 )
a61af66fc99e Initial load
duke
parents:
diff changeset
664 jboolean result = UNCHECKED()->IsSameObject(env,obj1,obj2);
a61af66fc99e Initial load
duke
parents:
diff changeset
665 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
666 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
667 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
668
a61af66fc99e Initial load
duke
parents:
diff changeset
669 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
670 checked_jni_NewLocalRef(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
671 jobject ref))
a61af66fc99e Initial load
duke
parents:
diff changeset
672 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
673 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
674 if (ref != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
675 jniCheck::validate_handle(thr, ref);
a61af66fc99e Initial load
duke
parents:
diff changeset
676 }
a61af66fc99e Initial load
duke
parents:
diff changeset
677 )
a61af66fc99e Initial load
duke
parents:
diff changeset
678 jobject result = UNCHECKED()->NewLocalRef(env, ref);
a61af66fc99e Initial load
duke
parents:
diff changeset
679 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
680 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
681 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
682
a61af66fc99e Initial load
duke
parents:
diff changeset
683 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
684 checked_jni_EnsureLocalCapacity(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
685 jint capacity))
a61af66fc99e Initial load
duke
parents:
diff changeset
686 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
687 if (capacity < 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
688 NativeReportJNIFatalError(thr, "negative capacity");
a61af66fc99e Initial load
duke
parents:
diff changeset
689 }
a61af66fc99e Initial load
duke
parents:
diff changeset
690 jint result = UNCHECKED()->EnsureLocalCapacity(env, capacity);
a61af66fc99e Initial load
duke
parents:
diff changeset
691 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
692 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
693 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
694
a61af66fc99e Initial load
duke
parents:
diff changeset
695 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
696 checked_jni_AllocObject(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
697 jclass clazz))
a61af66fc99e Initial load
duke
parents:
diff changeset
698 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
699 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
700 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
701 )
a61af66fc99e Initial load
duke
parents:
diff changeset
702 jobject result = UNCHECKED()->AllocObject(env,clazz);
a61af66fc99e Initial load
duke
parents:
diff changeset
703 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
704 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
705 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
706
a61af66fc99e Initial load
duke
parents:
diff changeset
707 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
708 checked_jni_NewObject(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
709 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
710 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
711 ...))
a61af66fc99e Initial load
duke
parents:
diff changeset
712 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
713 va_list args;
a61af66fc99e Initial load
duke
parents:
diff changeset
714 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
715 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
716 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
717 )
a61af66fc99e Initial load
duke
parents:
diff changeset
718 va_start(args, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
719 jobject result = UNCHECKED()->NewObjectV(env,clazz,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
720 va_end(args);
a61af66fc99e Initial load
duke
parents:
diff changeset
721 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
722 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
723 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
724
a61af66fc99e Initial load
duke
parents:
diff changeset
725 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
726 checked_jni_NewObjectV(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
727 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
728 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
729 va_list args))
a61af66fc99e Initial load
duke
parents:
diff changeset
730 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
731 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
732 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
733 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
734 )
a61af66fc99e Initial load
duke
parents:
diff changeset
735 jobject result = UNCHECKED()->NewObjectV(env,clazz,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
736 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
737 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
738 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
739
a61af66fc99e Initial load
duke
parents:
diff changeset
740 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
741 checked_jni_NewObjectA(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
742 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
743 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
744 const jvalue *args))
a61af66fc99e Initial load
duke
parents:
diff changeset
745 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
746 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
747 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
748 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
749 )
a61af66fc99e Initial load
duke
parents:
diff changeset
750 jobject result = UNCHECKED()->NewObjectA(env,clazz,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
751 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
752 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
753 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
754
a61af66fc99e Initial load
duke
parents:
diff changeset
755 JNI_ENTRY_CHECKED(jclass,
a61af66fc99e Initial load
duke
parents:
diff changeset
756 checked_jni_GetObjectClass(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
757 jobject obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
758 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
759 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
760 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
761 )
a61af66fc99e Initial load
duke
parents:
diff changeset
762 jclass result = UNCHECKED()->GetObjectClass(env,obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
763 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
764 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
765 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
766
a61af66fc99e Initial load
duke
parents:
diff changeset
767 JNI_ENTRY_CHECKED(jboolean,
a61af66fc99e Initial load
duke
parents:
diff changeset
768 checked_jni_IsInstanceOf(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
769 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
770 jclass clazz))
a61af66fc99e Initial load
duke
parents:
diff changeset
771 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
772 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
773 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
774 jniCheck::validate_class(thr, clazz, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
775 )
a61af66fc99e Initial load
duke
parents:
diff changeset
776 jboolean result = UNCHECKED()->IsInstanceOf(env,obj,clazz);
a61af66fc99e Initial load
duke
parents:
diff changeset
777 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
778 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
779 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
780
a61af66fc99e Initial load
duke
parents:
diff changeset
781 JNI_ENTRY_CHECKED(jmethodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
782 checked_jni_GetMethodID(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
783 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
784 const char *name,
a61af66fc99e Initial load
duke
parents:
diff changeset
785 const char *sig))
a61af66fc99e Initial load
duke
parents:
diff changeset
786 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
787 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
788 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
789 )
a61af66fc99e Initial load
duke
parents:
diff changeset
790 jmethodID result = UNCHECKED()->GetMethodID(env,clazz,name,sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
791 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
792 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
793 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
794
a61af66fc99e Initial load
duke
parents:
diff changeset
795 #define WRAPPER_CallMethod(ResultType, Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
796 JNI_ENTRY_CHECKED(ResultType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
797 checked_jni_Call##Result##Method(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
798 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
799 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
800 ...)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
801 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
802 va_list args; \
a61af66fc99e Initial load
duke
parents:
diff changeset
803 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
804 jniCheck::validate_call_object(thr, obj, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
805 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
806 va_start(args,methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
807 ResultType result =UNCHECKED()->Call##Result##MethodV(env, obj, methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
808 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
809 va_end(args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
810 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
811 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
812 JNI_END \
a61af66fc99e Initial load
duke
parents:
diff changeset
813 \
a61af66fc99e Initial load
duke
parents:
diff changeset
814 JNI_ENTRY_CHECKED(ResultType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
815 checked_jni_Call##Result##MethodV(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
816 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
817 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
818 va_list args)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
819 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
820 IN_VM(\
a61af66fc99e Initial load
duke
parents:
diff changeset
821 jniCheck::validate_call_object(thr, obj, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
822 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
823 ResultType result = UNCHECKED()->Call##Result##MethodV(env, obj, methodID,\
a61af66fc99e Initial load
duke
parents:
diff changeset
824 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
825 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
826 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
827 JNI_END \
a61af66fc99e Initial load
duke
parents:
diff changeset
828 \
a61af66fc99e Initial load
duke
parents:
diff changeset
829 JNI_ENTRY_CHECKED(ResultType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
830 checked_jni_Call##Result##MethodA(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
831 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
832 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
833 const jvalue * args)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
834 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
835 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
836 jniCheck::validate_call_object(thr, obj, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
837 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
838 ResultType result = UNCHECKED()->Call##Result##MethodA(env, obj, methodID,\
a61af66fc99e Initial load
duke
parents:
diff changeset
839 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
840 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
841 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
842 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
843
a61af66fc99e Initial load
duke
parents:
diff changeset
844 WRAPPER_CallMethod(jobject,Object)
a61af66fc99e Initial load
duke
parents:
diff changeset
845 WRAPPER_CallMethod(jboolean,Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
846 WRAPPER_CallMethod(jbyte,Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
847 WRAPPER_CallMethod(jshort,Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
848 WRAPPER_CallMethod(jchar,Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
849 WRAPPER_CallMethod(jint,Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
850 WRAPPER_CallMethod(jlong,Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
851 WRAPPER_CallMethod(jfloat,Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
852 WRAPPER_CallMethod(jdouble,Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
853
a61af66fc99e Initial load
duke
parents:
diff changeset
854 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
855 checked_jni_CallVoidMethod(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
856 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
857 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
858 ...))
a61af66fc99e Initial load
duke
parents:
diff changeset
859 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
860 va_list args;
a61af66fc99e Initial load
duke
parents:
diff changeset
861 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
862 jniCheck::validate_call_object(thr, obj, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
863 )
a61af66fc99e Initial load
duke
parents:
diff changeset
864 va_start(args,methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
865 UNCHECKED()->CallVoidMethodV(env,obj,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
866 va_end(args);
a61af66fc99e Initial load
duke
parents:
diff changeset
867 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
868 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
869
a61af66fc99e Initial load
duke
parents:
diff changeset
870 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
871 checked_jni_CallVoidMethodV(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
872 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
873 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
874 va_list args))
a61af66fc99e Initial load
duke
parents:
diff changeset
875 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
876 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
877 jniCheck::validate_call_object(thr, obj, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
878 )
a61af66fc99e Initial load
duke
parents:
diff changeset
879 UNCHECKED()->CallVoidMethodV(env,obj,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
880 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
881 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
882
a61af66fc99e Initial load
duke
parents:
diff changeset
883 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
884 checked_jni_CallVoidMethodA(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
885 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
886 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
887 const jvalue * args))
a61af66fc99e Initial load
duke
parents:
diff changeset
888 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
889 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
890 jniCheck::validate_call_object(thr, obj, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
891 )
a61af66fc99e Initial load
duke
parents:
diff changeset
892 UNCHECKED()->CallVoidMethodA(env,obj,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
893 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
894 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
895
a61af66fc99e Initial load
duke
parents:
diff changeset
896 #define WRAPPER_CallNonvirtualMethod(ResultType, Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
897 JNI_ENTRY_CHECKED(ResultType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
898 checked_jni_CallNonvirtual##Result##Method(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
899 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
900 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
901 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
902 ...)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
903 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
904 va_list args; \
a61af66fc99e Initial load
duke
parents:
diff changeset
905 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
906 jniCheck::validate_call_object(thr, obj, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
907 jniCheck::validate_call_class(thr, clazz, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
908 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
909 va_start(args,methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
910 ResultType result = UNCHECKED()->CallNonvirtual##Result##MethodV(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
911 obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
912 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
913 methodID,\
a61af66fc99e Initial load
duke
parents:
diff changeset
914 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
915 va_end(args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
916 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
917 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
918 JNI_END \
a61af66fc99e Initial load
duke
parents:
diff changeset
919 \
a61af66fc99e Initial load
duke
parents:
diff changeset
920 JNI_ENTRY_CHECKED(ResultType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
921 checked_jni_CallNonvirtual##Result##MethodV(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
922 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
923 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
924 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
925 va_list args)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
926 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
927 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
928 jniCheck::validate_call_object(thr, obj, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
929 jniCheck::validate_call_class(thr, clazz, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
930 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
931 ResultType result = UNCHECKED()->CallNonvirtual##Result##MethodV(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
932 obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
933 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
934 methodID,\
a61af66fc99e Initial load
duke
parents:
diff changeset
935 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
936 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
937 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
938 JNI_END \
a61af66fc99e Initial load
duke
parents:
diff changeset
939 \
a61af66fc99e Initial load
duke
parents:
diff changeset
940 JNI_ENTRY_CHECKED(ResultType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
941 checked_jni_CallNonvirtual##Result##MethodA(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
942 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
943 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
944 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
945 const jvalue * args)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
946 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
947 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
948 jniCheck::validate_call_object(thr, obj, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
949 jniCheck::validate_call_class(thr, clazz, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
950 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
951 ResultType result = UNCHECKED()->CallNonvirtual##Result##MethodA(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
952 obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
953 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
954 methodID,\
a61af66fc99e Initial load
duke
parents:
diff changeset
955 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
956 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
957 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
958 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
959
a61af66fc99e Initial load
duke
parents:
diff changeset
960 WRAPPER_CallNonvirtualMethod(jobject,Object)
a61af66fc99e Initial load
duke
parents:
diff changeset
961 WRAPPER_CallNonvirtualMethod(jboolean,Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
962 WRAPPER_CallNonvirtualMethod(jbyte,Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
963 WRAPPER_CallNonvirtualMethod(jshort,Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
964 WRAPPER_CallNonvirtualMethod(jchar,Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
965 WRAPPER_CallNonvirtualMethod(jint,Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
966 WRAPPER_CallNonvirtualMethod(jlong,Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
967 WRAPPER_CallNonvirtualMethod(jfloat,Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
968 WRAPPER_CallNonvirtualMethod(jdouble,Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
969
a61af66fc99e Initial load
duke
parents:
diff changeset
970 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
971 checked_jni_CallNonvirtualVoidMethod(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
972 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
973 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
974 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
975 ...))
a61af66fc99e Initial load
duke
parents:
diff changeset
976 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
977 va_list args;
a61af66fc99e Initial load
duke
parents:
diff changeset
978 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
979 jniCheck::validate_call_object(thr, obj, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
980 jniCheck::validate_call_class(thr, clazz, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
981 )
a61af66fc99e Initial load
duke
parents:
diff changeset
982 va_start(args,methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
983 UNCHECKED()->CallNonvirtualVoidMethodV(env,obj,clazz,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
984 va_end(args);
a61af66fc99e Initial load
duke
parents:
diff changeset
985 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
986 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
987
a61af66fc99e Initial load
duke
parents:
diff changeset
988 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
989 checked_jni_CallNonvirtualVoidMethodV(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
990 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
991 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
992 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
993 va_list args))
a61af66fc99e Initial load
duke
parents:
diff changeset
994 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
995 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
996 jniCheck::validate_call_object(thr, obj, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
997 jniCheck::validate_call_class(thr, clazz, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
998 )
a61af66fc99e Initial load
duke
parents:
diff changeset
999 UNCHECKED()->CallNonvirtualVoidMethodV(env,obj,clazz,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
1000 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1001 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1002
a61af66fc99e Initial load
duke
parents:
diff changeset
1003 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1004 checked_jni_CallNonvirtualVoidMethodA(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1005 jobject obj,
a61af66fc99e Initial load
duke
parents:
diff changeset
1006 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
1007 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1008 const jvalue * args))
a61af66fc99e Initial load
duke
parents:
diff changeset
1009 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1010 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1011 jniCheck::validate_call_object(thr, obj, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
1012 jniCheck::validate_call_class(thr, clazz, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
1013 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1014 UNCHECKED()->CallNonvirtualVoidMethodA(env,obj,clazz,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
1015 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1016 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1017
a61af66fc99e Initial load
duke
parents:
diff changeset
1018 JNI_ENTRY_CHECKED(jfieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1019 checked_jni_GetFieldID(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1020 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
1021 const char *name,
a61af66fc99e Initial load
duke
parents:
diff changeset
1022 const char *sig))
a61af66fc99e Initial load
duke
parents:
diff changeset
1023 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1024 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1025 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
1026 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1027 jfieldID result = UNCHECKED()->GetFieldID(env,clazz,name,sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
1028 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1029 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1030 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1031
a61af66fc99e Initial load
duke
parents:
diff changeset
1032 #define WRAPPER_GetField(ReturnType,Result,FieldType) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1033 JNI_ENTRY_CHECKED(ReturnType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1034 checked_jni_Get##Result##Field(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1035 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1036 jfieldID fieldID)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1037 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1038 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1039 checkInstanceFieldID(thr, fieldID, obj, FieldType); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1040 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1041 ReturnType result = UNCHECKED()->Get##Result##Field(env,obj,fieldID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1042 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1043 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1044 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1045
a61af66fc99e Initial load
duke
parents:
diff changeset
1046 WRAPPER_GetField(jobject, Object, T_OBJECT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1047 WRAPPER_GetField(jboolean, Boolean, T_BOOLEAN)
a61af66fc99e Initial load
duke
parents:
diff changeset
1048 WRAPPER_GetField(jbyte, Byte, T_BYTE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1049 WRAPPER_GetField(jshort, Short, T_SHORT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1050 WRAPPER_GetField(jchar, Char, T_CHAR)
a61af66fc99e Initial load
duke
parents:
diff changeset
1051 WRAPPER_GetField(jint, Int, T_INT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1052 WRAPPER_GetField(jlong, Long, T_LONG)
a61af66fc99e Initial load
duke
parents:
diff changeset
1053 WRAPPER_GetField(jfloat, Float, T_FLOAT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1054 WRAPPER_GetField(jdouble, Double, T_DOUBLE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1055
a61af66fc99e Initial load
duke
parents:
diff changeset
1056 #define WRAPPER_SetField(ValueType,Result,FieldType) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1057 JNI_ENTRY_CHECKED(void, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1058 checked_jni_Set##Result##Field(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1059 jobject obj, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1060 jfieldID fieldID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1061 ValueType val)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1062 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1063 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1064 checkInstanceFieldID(thr, fieldID, obj, FieldType); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1065 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1066 UNCHECKED()->Set##Result##Field(env,obj,fieldID,val); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1067 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1068 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1069
a61af66fc99e Initial load
duke
parents:
diff changeset
1070 WRAPPER_SetField(jobject, Object, T_OBJECT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1071 WRAPPER_SetField(jboolean, Boolean, T_BOOLEAN)
a61af66fc99e Initial load
duke
parents:
diff changeset
1072 WRAPPER_SetField(jbyte, Byte, T_BYTE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1073 WRAPPER_SetField(jshort, Short, T_SHORT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1074 WRAPPER_SetField(jchar, Char, T_CHAR)
a61af66fc99e Initial load
duke
parents:
diff changeset
1075 WRAPPER_SetField(jint, Int, T_INT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1076 WRAPPER_SetField(jlong, Long, T_LONG)
a61af66fc99e Initial load
duke
parents:
diff changeset
1077 WRAPPER_SetField(jfloat, Float, T_FLOAT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1078 WRAPPER_SetField(jdouble, Double, T_DOUBLE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1079
a61af66fc99e Initial load
duke
parents:
diff changeset
1080
a61af66fc99e Initial load
duke
parents:
diff changeset
1081 JNI_ENTRY_CHECKED(jmethodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1082 checked_jni_GetStaticMethodID(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1083 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
1084 const char *name,
a61af66fc99e Initial load
duke
parents:
diff changeset
1085 const char *sig))
a61af66fc99e Initial load
duke
parents:
diff changeset
1086 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1087 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1088 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
1089 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1090 jmethodID result = UNCHECKED()->GetStaticMethodID(env,clazz,name,sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
1091 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1092 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1093 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1094
a61af66fc99e Initial load
duke
parents:
diff changeset
1095 #define WRAPPER_CallStaticMethod(ReturnType,Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1096 JNI_ENTRY_CHECKED(ReturnType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1097 checked_jni_CallStatic##Result##Method(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1098 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1099 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1100 ...)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1101 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1102 va_list args; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1103 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1104 jniCheck::validate_jmethod_id(thr, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1105 jniCheck::validate_class(thr, clazz, false); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1106 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1107 va_start(args,methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1108 ReturnType result = UNCHECKED()->CallStatic##Result##MethodV(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1109 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1110 methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1111 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1112 va_end(args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1113 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1114 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1115 JNI_END \
a61af66fc99e Initial load
duke
parents:
diff changeset
1116 \
a61af66fc99e Initial load
duke
parents:
diff changeset
1117 JNI_ENTRY_CHECKED(ReturnType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1118 checked_jni_CallStatic##Result##MethodV(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1119 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1120 jmethodID methodID,\
a61af66fc99e Initial load
duke
parents:
diff changeset
1121 va_list args)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1122 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1123 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1124 jniCheck::validate_jmethod_id(thr, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1125 jniCheck::validate_class(thr, clazz, false); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1126 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1127 ReturnType result = UNCHECKED()->CallStatic##Result##MethodV(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1128 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1129 methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1130 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1131 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1132 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1133 JNI_END \
a61af66fc99e Initial load
duke
parents:
diff changeset
1134 \
a61af66fc99e Initial load
duke
parents:
diff changeset
1135 JNI_ENTRY_CHECKED(ReturnType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1136 checked_jni_CallStatic##Result##MethodA(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1137 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1138 jmethodID methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1139 const jvalue *args)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1140 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1141 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1142 jniCheck::validate_jmethod_id(thr, methodID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1143 jniCheck::validate_class(thr, clazz, false); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1144 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1145 ReturnType result = UNCHECKED()->CallStatic##Result##MethodA(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1146 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1147 methodID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1148 args); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1149 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1150 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1151 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1152
a61af66fc99e Initial load
duke
parents:
diff changeset
1153 WRAPPER_CallStaticMethod(jobject,Object)
a61af66fc99e Initial load
duke
parents:
diff changeset
1154 WRAPPER_CallStaticMethod(jboolean,Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
1155 WRAPPER_CallStaticMethod(jbyte,Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
1156 WRAPPER_CallStaticMethod(jshort,Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
1157 WRAPPER_CallStaticMethod(jchar,Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
1158 WRAPPER_CallStaticMethod(jint,Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
1159 WRAPPER_CallStaticMethod(jlong,Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
1160 WRAPPER_CallStaticMethod(jfloat,Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
1161 WRAPPER_CallStaticMethod(jdouble,Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
1162
a61af66fc99e Initial load
duke
parents:
diff changeset
1163 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1164 checked_jni_CallStaticVoidMethod(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1165 jclass cls,
a61af66fc99e Initial load
duke
parents:
diff changeset
1166 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1167 ...))
a61af66fc99e Initial load
duke
parents:
diff changeset
1168 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1169 va_list args;
a61af66fc99e Initial load
duke
parents:
diff changeset
1170 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1171 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
1172 jniCheck::validate_class(thr, cls, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
1173 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1174 va_start(args,methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
1175 UNCHECKED()->CallStaticVoidMethodV(env,cls,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
1176 va_end(args);
a61af66fc99e Initial load
duke
parents:
diff changeset
1177 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1178 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1179
a61af66fc99e Initial load
duke
parents:
diff changeset
1180 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1181 checked_jni_CallStaticVoidMethodV(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1182 jclass cls,
a61af66fc99e Initial load
duke
parents:
diff changeset
1183 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1184 va_list args))
a61af66fc99e Initial load
duke
parents:
diff changeset
1185 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1186 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1187 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
1188 jniCheck::validate_class(thr, cls, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
1189 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1190 UNCHECKED()->CallStaticVoidMethodV(env,cls,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
1191 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1192 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1193
a61af66fc99e Initial load
duke
parents:
diff changeset
1194 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1195 checked_jni_CallStaticVoidMethodA(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1196 jclass cls,
a61af66fc99e Initial load
duke
parents:
diff changeset
1197 jmethodID methodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1198 const jvalue * args))
a61af66fc99e Initial load
duke
parents:
diff changeset
1199 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1200 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1201 jniCheck::validate_jmethod_id(thr, methodID);
a61af66fc99e Initial load
duke
parents:
diff changeset
1202 jniCheck::validate_class(thr, cls, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
1203 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1204 UNCHECKED()->CallStaticVoidMethodA(env,cls,methodID,args);
a61af66fc99e Initial load
duke
parents:
diff changeset
1205 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1206 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1207
a61af66fc99e Initial load
duke
parents:
diff changeset
1208 JNI_ENTRY_CHECKED(jfieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1209 checked_jni_GetStaticFieldID(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1210 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
1211 const char *name,
a61af66fc99e Initial load
duke
parents:
diff changeset
1212 const char *sig))
a61af66fc99e Initial load
duke
parents:
diff changeset
1213 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1214 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1215 jniCheck::validate_class(thr, clazz, false);
a61af66fc99e Initial load
duke
parents:
diff changeset
1216 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1217 jfieldID result = UNCHECKED()->GetStaticFieldID(env,clazz,name,sig);
a61af66fc99e Initial load
duke
parents:
diff changeset
1218 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1219 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1220 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1221
a61af66fc99e Initial load
duke
parents:
diff changeset
1222 #define WRAPPER_GetStaticField(ReturnType,Result,FieldType) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1223 JNI_ENTRY_CHECKED(ReturnType, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1224 checked_jni_GetStatic##Result##Field(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1225 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1226 jfieldID fieldID)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1227 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1228 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1229 jniCheck::validate_class(thr, clazz, false); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1230 checkStaticFieldID(thr, fieldID, clazz, FieldType); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1231 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1232 ReturnType result = UNCHECKED()->GetStatic##Result##Field(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1233 clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1234 fieldID); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1235 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1236 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1237 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1238
a61af66fc99e Initial load
duke
parents:
diff changeset
1239 WRAPPER_GetStaticField(jobject, Object, T_OBJECT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1240 WRAPPER_GetStaticField(jboolean, Boolean, T_BOOLEAN)
a61af66fc99e Initial load
duke
parents:
diff changeset
1241 WRAPPER_GetStaticField(jbyte, Byte, T_BYTE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1242 WRAPPER_GetStaticField(jshort, Short, T_SHORT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1243 WRAPPER_GetStaticField(jchar, Char, T_CHAR)
a61af66fc99e Initial load
duke
parents:
diff changeset
1244 WRAPPER_GetStaticField(jint, Int, T_INT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1245 WRAPPER_GetStaticField(jlong, Long, T_LONG)
a61af66fc99e Initial load
duke
parents:
diff changeset
1246 WRAPPER_GetStaticField(jfloat, Float, T_FLOAT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1247 WRAPPER_GetStaticField(jdouble, Double, T_DOUBLE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1248
a61af66fc99e Initial load
duke
parents:
diff changeset
1249 #define WRAPPER_SetStaticField(ValueType,Result,FieldType) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1250 JNI_ENTRY_CHECKED(void, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1251 checked_jni_SetStatic##Result##Field(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1252 jclass clazz, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1253 jfieldID fieldID, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1254 ValueType value)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1255 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1256 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1257 jniCheck::validate_class(thr, clazz, false); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1258 checkStaticFieldID(thr, fieldID, clazz, FieldType); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1259 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1260 UNCHECKED()->SetStatic##Result##Field(env,clazz,fieldID,value); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1261 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1262 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1263
a61af66fc99e Initial load
duke
parents:
diff changeset
1264 WRAPPER_SetStaticField(jobject, Object, T_OBJECT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1265 WRAPPER_SetStaticField(jboolean, Boolean, T_BOOLEAN)
a61af66fc99e Initial load
duke
parents:
diff changeset
1266 WRAPPER_SetStaticField(jbyte, Byte, T_BYTE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1267 WRAPPER_SetStaticField(jshort, Short, T_SHORT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1268 WRAPPER_SetStaticField(jchar, Char, T_CHAR)
a61af66fc99e Initial load
duke
parents:
diff changeset
1269 WRAPPER_SetStaticField(jint, Int, T_INT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1270 WRAPPER_SetStaticField(jlong, Long, T_LONG)
a61af66fc99e Initial load
duke
parents:
diff changeset
1271 WRAPPER_SetStaticField(jfloat, Float, T_FLOAT)
a61af66fc99e Initial load
duke
parents:
diff changeset
1272 WRAPPER_SetStaticField(jdouble, Double, T_DOUBLE)
a61af66fc99e Initial load
duke
parents:
diff changeset
1273
a61af66fc99e Initial load
duke
parents:
diff changeset
1274
a61af66fc99e Initial load
duke
parents:
diff changeset
1275 JNI_ENTRY_CHECKED(jstring,
a61af66fc99e Initial load
duke
parents:
diff changeset
1276 checked_jni_NewString(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1277 const jchar *unicode,
a61af66fc99e Initial load
duke
parents:
diff changeset
1278 jsize len))
a61af66fc99e Initial load
duke
parents:
diff changeset
1279 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1280 jstring result = UNCHECKED()->NewString(env,unicode,len);
a61af66fc99e Initial load
duke
parents:
diff changeset
1281 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1282 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1283 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1284
a61af66fc99e Initial load
duke
parents:
diff changeset
1285 JNI_ENTRY_CHECKED(jsize,
a61af66fc99e Initial load
duke
parents:
diff changeset
1286 checked_jni_GetStringLength(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1287 jstring str))
a61af66fc99e Initial load
duke
parents:
diff changeset
1288 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1289 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1290 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1291 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1292 jsize result = UNCHECKED()->GetStringLength(env,str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1293 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1294 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1295 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1296
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1297 // Arbitrary (but well-known) tag
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1298 const jint STRING_TAG = 0x47114711;
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1299
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1300 JNI_ENTRY_CHECKED(const jchar *,
a61af66fc99e Initial load
duke
parents:
diff changeset
1301 checked_jni_GetStringChars(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1302 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1303 jboolean *isCopy))
a61af66fc99e Initial load
duke
parents:
diff changeset
1304 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1305 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1306 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1307 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1308 const jchar *result = UNCHECKED()->GetStringChars(env,str,isCopy);
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1309 assert (isCopy == NULL || *isCopy == JNI_TRUE, "GetStringChars didn't return a copy as expected");
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1310
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1311 size_t len = UNCHECKED()->GetStringLength(env,str) + 1; // + 1 for NULL termination
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1312 jint* tagLocation = (jint*) AllocateHeap(len * sizeof(jchar) + sizeof(jint), "checked_jni_GetStringChars");
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1313 *tagLocation = STRING_TAG;
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1314 jchar* newResult = (jchar*) (tagLocation + 1);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1315 memcpy(newResult, result, len * sizeof(jchar));
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1316 // Avoiding call to UNCHECKED()->ReleaseStringChars() since that will fire unexpected dtrace probes
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1317 // Note that the dtrace arguments for the allocated memory will not match up with this solution.
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1318 FreeHeap((char*)result);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1319
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1320 functionExit(env);
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1321 return newResult;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1322 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1323
a61af66fc99e Initial load
duke
parents:
diff changeset
1324 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1325 checked_jni_ReleaseStringChars(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1326 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1327 const jchar *chars))
a61af66fc99e Initial load
duke
parents:
diff changeset
1328 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1329 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1330 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1331 )
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1332 if (chars == NULL) {
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1333 // still do the unchecked call to allow dtrace probes
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1334 UNCHECKED()->ReleaseStringChars(env,str,chars);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1335 }
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1336 else {
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1337 jint* tagLocation = ((jint*) chars) - 1;
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1338 if (*tagLocation != STRING_TAG) {
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1339 NativeReportJNIFatalError(thr, "ReleaseStringChars called on something not allocated by GetStringChars");
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1340 }
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1341 UNCHECKED()->ReleaseStringChars(env,str,(const jchar*)tagLocation);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1342 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1343 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1344 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1345
a61af66fc99e Initial load
duke
parents:
diff changeset
1346 JNI_ENTRY_CHECKED(jstring,
a61af66fc99e Initial load
duke
parents:
diff changeset
1347 checked_jni_NewStringUTF(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1348 const char *utf))
a61af66fc99e Initial load
duke
parents:
diff changeset
1349 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1350 jstring result = UNCHECKED()->NewStringUTF(env,utf);
a61af66fc99e Initial load
duke
parents:
diff changeset
1351 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1352 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1353 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1354
a61af66fc99e Initial load
duke
parents:
diff changeset
1355 JNI_ENTRY_CHECKED(jsize,
a61af66fc99e Initial load
duke
parents:
diff changeset
1356 checked_jni_GetStringUTFLength(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1357 jstring str))
a61af66fc99e Initial load
duke
parents:
diff changeset
1358 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1359 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1360 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1361 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1362 jsize result = UNCHECKED()->GetStringUTFLength(env,str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1363 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1364 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1365 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1366
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1367 // Arbitrary (but well-known) tag - different than GetStringChars
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1368 const jint STRING_UTF_TAG = 0x48124812;
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1369
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1370 JNI_ENTRY_CHECKED(const char *,
a61af66fc99e Initial load
duke
parents:
diff changeset
1371 checked_jni_GetStringUTFChars(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1372 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1373 jboolean *isCopy))
a61af66fc99e Initial load
duke
parents:
diff changeset
1374 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1375 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1376 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1377 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1378 const char *result = UNCHECKED()->GetStringUTFChars(env,str,isCopy);
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1379 assert (isCopy == NULL || *isCopy == JNI_TRUE, "GetStringUTFChars didn't return a copy as expected");
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1380
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1381 size_t len = strlen(result) + 1; // + 1 for NULL termination
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1382 jint* tagLocation = (jint*) AllocateHeap(len + sizeof(jint), "checked_jni_GetStringUTFChars");
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1383 *tagLocation = STRING_UTF_TAG;
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1384 char* newResult = (char*) (tagLocation + 1);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1385 strcpy(newResult, result);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1386 // Avoiding call to UNCHECKED()->ReleaseStringUTFChars() since that will fire unexpected dtrace probes
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1387 // Note that the dtrace arguments for the allocated memory will not match up with this solution.
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1388 FreeHeap((char*)result);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1389
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1390 functionExit(env);
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1391 return newResult;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1392 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1393
a61af66fc99e Initial load
duke
parents:
diff changeset
1394 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1395 checked_jni_ReleaseStringUTFChars(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1396 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1397 const char* chars))
a61af66fc99e Initial load
duke
parents:
diff changeset
1398 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1399 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1400 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1401 )
1989
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1402 if (chars == NULL) {
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1403 // still do the unchecked call to allow dtrace probes
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1404 UNCHECKED()->ReleaseStringUTFChars(env,str,chars);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1405 }
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1406 else {
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1407 jint* tagLocation = ((jint*) chars) - 1;
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1408 if (*tagLocation != STRING_UTF_TAG) {
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1409 NativeReportJNIFatalError(thr, "ReleaseStringUTFChars called on something not allocated by GetStringUTFChars");
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1410 }
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1411 UNCHECKED()->ReleaseStringUTFChars(env,str,(const char*)tagLocation);
017cd8bce8a8 6539281: -Xcheck:jni should validate char* argument to ReleaseStringUTFChars
sla
parents: 1972
diff changeset
1412 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1413 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1414 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1415
a61af66fc99e Initial load
duke
parents:
diff changeset
1416 JNI_ENTRY_CHECKED(jsize,
a61af66fc99e Initial load
duke
parents:
diff changeset
1417 checked_jni_GetArrayLength(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1418 jarray array))
a61af66fc99e Initial load
duke
parents:
diff changeset
1419 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1420 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1421 checkArray(thr, array, -1);
a61af66fc99e Initial load
duke
parents:
diff changeset
1422 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1423 jsize result = UNCHECKED()->GetArrayLength(env,array);
a61af66fc99e Initial load
duke
parents:
diff changeset
1424 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1425 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1426 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1427
a61af66fc99e Initial load
duke
parents:
diff changeset
1428 JNI_ENTRY_CHECKED(jobjectArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
1429 checked_jni_NewObjectArray(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1430 jsize len,
a61af66fc99e Initial load
duke
parents:
diff changeset
1431 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
1432 jobject init))
a61af66fc99e Initial load
duke
parents:
diff changeset
1433 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1434 jobjectArray result = UNCHECKED()->NewObjectArray(env,len,clazz,init);
a61af66fc99e Initial load
duke
parents:
diff changeset
1435 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1436 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1437 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1438
a61af66fc99e Initial load
duke
parents:
diff changeset
1439 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
1440 checked_jni_GetObjectArrayElement(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1441 jobjectArray array,
a61af66fc99e Initial load
duke
parents:
diff changeset
1442 jsize index))
a61af66fc99e Initial load
duke
parents:
diff changeset
1443 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1444 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1445 checkArray(thr, array, T_OBJECT);
a61af66fc99e Initial load
duke
parents:
diff changeset
1446 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1447 jobject result = UNCHECKED()->GetObjectArrayElement(env,array,index);
a61af66fc99e Initial load
duke
parents:
diff changeset
1448 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1449 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1450 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1451
a61af66fc99e Initial load
duke
parents:
diff changeset
1452 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1453 checked_jni_SetObjectArrayElement(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1454 jobjectArray array,
a61af66fc99e Initial load
duke
parents:
diff changeset
1455 jsize index,
a61af66fc99e Initial load
duke
parents:
diff changeset
1456 jobject val))
a61af66fc99e Initial load
duke
parents:
diff changeset
1457 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1458 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1459 checkArray(thr, array, T_OBJECT);
a61af66fc99e Initial load
duke
parents:
diff changeset
1460 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1461 UNCHECKED()->SetObjectArrayElement(env,array,index,val);
a61af66fc99e Initial load
duke
parents:
diff changeset
1462 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1463 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1464
a61af66fc99e Initial load
duke
parents:
diff changeset
1465 #define WRAPPER_NewScalarArray(Return, Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1466 JNI_ENTRY_CHECKED(Return, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1467 checked_jni_New##Result##Array(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1468 jsize len)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1469 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1470 Return result = UNCHECKED()->New##Result##Array(env,len); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1471 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1472 return (Return) result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1473 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1474
a61af66fc99e Initial load
duke
parents:
diff changeset
1475 WRAPPER_NewScalarArray(jbooleanArray, Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
1476 WRAPPER_NewScalarArray(jbyteArray, Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
1477 WRAPPER_NewScalarArray(jshortArray, Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
1478 WRAPPER_NewScalarArray(jcharArray, Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
1479 WRAPPER_NewScalarArray(jintArray, Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
1480 WRAPPER_NewScalarArray(jlongArray, Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
1481 WRAPPER_NewScalarArray(jfloatArray, Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
1482 WRAPPER_NewScalarArray(jdoubleArray, Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
1483
a61af66fc99e Initial load
duke
parents:
diff changeset
1484 #define WRAPPER_GetScalarArrayElements(ElementTag,ElementType,Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1485 JNI_ENTRY_CHECKED(ElementType *, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1486 checked_jni_Get##Result##ArrayElements(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1487 ElementType##Array array, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1488 jboolean *isCopy)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1489 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1490 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1491 checkArray(thr, array, ElementTag); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1492 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1493 ElementType *result = UNCHECKED()->Get##Result##ArrayElements(env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1494 array, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1495 isCopy); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1496 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1497 return result; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1498 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1499
a61af66fc99e Initial load
duke
parents:
diff changeset
1500 WRAPPER_GetScalarArrayElements(T_BOOLEAN, jboolean, Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
1501 WRAPPER_GetScalarArrayElements(T_BYTE, jbyte, Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
1502 WRAPPER_GetScalarArrayElements(T_SHORT, jshort, Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
1503 WRAPPER_GetScalarArrayElements(T_CHAR, jchar, Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
1504 WRAPPER_GetScalarArrayElements(T_INT, jint, Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
1505 WRAPPER_GetScalarArrayElements(T_LONG, jlong, Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
1506 WRAPPER_GetScalarArrayElements(T_FLOAT, jfloat, Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
1507 WRAPPER_GetScalarArrayElements(T_DOUBLE, jdouble, Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
1508
a61af66fc99e Initial load
duke
parents:
diff changeset
1509 #define WRAPPER_ReleaseScalarArrayElements(ElementTag,ElementType,Result,Tag) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1510 JNI_ENTRY_CHECKED(void, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1511 checked_jni_Release##Result##ArrayElements(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1512 ElementType##Array array, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1513 ElementType *elems, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1514 jint mode)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1515 functionEnterExceptionAllowed(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1516 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1517 checkArray(thr, array, ElementTag); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1518 ASSERT_OOPS_ALLOWED; \
a61af66fc99e Initial load
duke
parents:
diff changeset
1519 typeArrayOop a = typeArrayOop(JNIHandles::resolve_non_null(array)); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1520 /* cannot check validity of copy, unless every request is logged by
a61af66fc99e Initial load
duke
parents:
diff changeset
1521 * checking code. Implementation of this check is deferred until a
a61af66fc99e Initial load
duke
parents:
diff changeset
1522 * subsequent release.
a61af66fc99e Initial load
duke
parents:
diff changeset
1523 */ \
a61af66fc99e Initial load
duke
parents:
diff changeset
1524 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1525 UNCHECKED()->Release##Result##ArrayElements(env,array,elems,mode); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1526 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1527 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1528
a61af66fc99e Initial load
duke
parents:
diff changeset
1529 WRAPPER_ReleaseScalarArrayElements(T_BOOLEAN,jboolean, Boolean, bool)
a61af66fc99e Initial load
duke
parents:
diff changeset
1530 WRAPPER_ReleaseScalarArrayElements(T_BYTE, jbyte, Byte, byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
1531 WRAPPER_ReleaseScalarArrayElements(T_SHORT, jshort, Short, short)
a61af66fc99e Initial load
duke
parents:
diff changeset
1532 WRAPPER_ReleaseScalarArrayElements(T_CHAR, jchar, Char, char)
a61af66fc99e Initial load
duke
parents:
diff changeset
1533 WRAPPER_ReleaseScalarArrayElements(T_INT, jint, Int, int)
a61af66fc99e Initial load
duke
parents:
diff changeset
1534 WRAPPER_ReleaseScalarArrayElements(T_LONG, jlong, Long, long)
a61af66fc99e Initial load
duke
parents:
diff changeset
1535 WRAPPER_ReleaseScalarArrayElements(T_FLOAT, jfloat, Float, float)
a61af66fc99e Initial load
duke
parents:
diff changeset
1536 WRAPPER_ReleaseScalarArrayElements(T_DOUBLE, jdouble, Double, double)
a61af66fc99e Initial load
duke
parents:
diff changeset
1537
a61af66fc99e Initial load
duke
parents:
diff changeset
1538 #define WRAPPER_GetScalarArrayRegion(ElementTag,ElementType,Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1539 JNI_ENTRY_CHECKED(void, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1540 checked_jni_Get##Result##ArrayRegion(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1541 ElementType##Array array, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1542 jsize start, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1543 jsize len, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1544 ElementType *buf)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1545 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1546 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1547 checkArray(thr, array, ElementTag); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1548 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1549 UNCHECKED()->Get##Result##ArrayRegion(env,array,start,len,buf); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1550 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1551 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1552
a61af66fc99e Initial load
duke
parents:
diff changeset
1553 WRAPPER_GetScalarArrayRegion(T_BOOLEAN, jboolean, Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
1554 WRAPPER_GetScalarArrayRegion(T_BYTE, jbyte, Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
1555 WRAPPER_GetScalarArrayRegion(T_SHORT, jshort, Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
1556 WRAPPER_GetScalarArrayRegion(T_CHAR, jchar, Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
1557 WRAPPER_GetScalarArrayRegion(T_INT, jint, Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
1558 WRAPPER_GetScalarArrayRegion(T_LONG, jlong, Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
1559 WRAPPER_GetScalarArrayRegion(T_FLOAT, jfloat, Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
1560 WRAPPER_GetScalarArrayRegion(T_DOUBLE, jdouble, Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
1561
a61af66fc99e Initial load
duke
parents:
diff changeset
1562 #define WRAPPER_SetScalarArrayRegion(ElementTag,ElementType,Result) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1563 JNI_ENTRY_CHECKED(void, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1564 checked_jni_Set##Result##ArrayRegion(JNIEnv *env, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1565 ElementType##Array array, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1566 jsize start, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1567 jsize len, \
a61af66fc99e Initial load
duke
parents:
diff changeset
1568 const ElementType *buf)) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1569 functionEnter(thr); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1570 IN_VM( \
a61af66fc99e Initial load
duke
parents:
diff changeset
1571 checkArray(thr, array, ElementTag); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1572 ) \
a61af66fc99e Initial load
duke
parents:
diff changeset
1573 UNCHECKED()->Set##Result##ArrayRegion(env,array,start,len,buf); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1574 functionExit(env); \
a61af66fc99e Initial load
duke
parents:
diff changeset
1575 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1576
a61af66fc99e Initial load
duke
parents:
diff changeset
1577 WRAPPER_SetScalarArrayRegion(T_BOOLEAN, jboolean, Boolean)
a61af66fc99e Initial load
duke
parents:
diff changeset
1578 WRAPPER_SetScalarArrayRegion(T_BYTE, jbyte, Byte)
a61af66fc99e Initial load
duke
parents:
diff changeset
1579 WRAPPER_SetScalarArrayRegion(T_SHORT, jshort, Short)
a61af66fc99e Initial load
duke
parents:
diff changeset
1580 WRAPPER_SetScalarArrayRegion(T_CHAR, jchar, Char)
a61af66fc99e Initial load
duke
parents:
diff changeset
1581 WRAPPER_SetScalarArrayRegion(T_INT, jint, Int)
a61af66fc99e Initial load
duke
parents:
diff changeset
1582 WRAPPER_SetScalarArrayRegion(T_LONG, jlong, Long)
a61af66fc99e Initial load
duke
parents:
diff changeset
1583 WRAPPER_SetScalarArrayRegion(T_FLOAT, jfloat, Float)
a61af66fc99e Initial load
duke
parents:
diff changeset
1584 WRAPPER_SetScalarArrayRegion(T_DOUBLE, jdouble, Double)
a61af66fc99e Initial load
duke
parents:
diff changeset
1585
a61af66fc99e Initial load
duke
parents:
diff changeset
1586 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
1587 checked_jni_RegisterNatives(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1588 jclass clazz,
a61af66fc99e Initial load
duke
parents:
diff changeset
1589 const JNINativeMethod *methods,
a61af66fc99e Initial load
duke
parents:
diff changeset
1590 jint nMethods))
a61af66fc99e Initial load
duke
parents:
diff changeset
1591 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1592 jint result = UNCHECKED()->RegisterNatives(env,clazz,methods,nMethods);
a61af66fc99e Initial load
duke
parents:
diff changeset
1593 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1594 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1595 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1596
a61af66fc99e Initial load
duke
parents:
diff changeset
1597 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
1598 checked_jni_UnregisterNatives(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1599 jclass clazz))
a61af66fc99e Initial load
duke
parents:
diff changeset
1600 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1601 jint result = UNCHECKED()->UnregisterNatives(env,clazz);
a61af66fc99e Initial load
duke
parents:
diff changeset
1602 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1603 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1604 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1605
a61af66fc99e Initial load
duke
parents:
diff changeset
1606 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
1607 checked_jni_MonitorEnter(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1608 jobject obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
1609 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1610 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1611 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1612 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1613 jint result = UNCHECKED()->MonitorEnter(env,obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1614 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1615 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1616 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1617
a61af66fc99e Initial load
duke
parents:
diff changeset
1618 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
1619 checked_jni_MonitorExit(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1620 jobject obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
1621 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1622 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1623 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1624 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1625 jint result = UNCHECKED()->MonitorExit(env,obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1626 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1627 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1628 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1629
a61af66fc99e Initial load
duke
parents:
diff changeset
1630 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
1631 checked_jni_GetJavaVM(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1632 JavaVM **vm))
a61af66fc99e Initial load
duke
parents:
diff changeset
1633 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1634 jint result = UNCHECKED()->GetJavaVM(env,vm);
a61af66fc99e Initial load
duke
parents:
diff changeset
1635 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1636 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1637 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1638
a61af66fc99e Initial load
duke
parents:
diff changeset
1639 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1640 checked_jni_GetStringRegion(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1641 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1642 jsize start,
a61af66fc99e Initial load
duke
parents:
diff changeset
1643 jsize len,
a61af66fc99e Initial load
duke
parents:
diff changeset
1644 jchar *buf))
a61af66fc99e Initial load
duke
parents:
diff changeset
1645 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1646 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1647 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1648 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1649 UNCHECKED()->GetStringRegion(env, str, start, len, buf);
a61af66fc99e Initial load
duke
parents:
diff changeset
1650 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1651 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1652
a61af66fc99e Initial load
duke
parents:
diff changeset
1653 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1654 checked_jni_GetStringUTFRegion(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1655 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1656 jsize start,
a61af66fc99e Initial load
duke
parents:
diff changeset
1657 jsize len,
a61af66fc99e Initial load
duke
parents:
diff changeset
1658 char *buf))
a61af66fc99e Initial load
duke
parents:
diff changeset
1659 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1660 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1661 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1662 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1663 UNCHECKED()->GetStringUTFRegion(env, str, start, len, buf);
a61af66fc99e Initial load
duke
parents:
diff changeset
1664 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1665 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1666
a61af66fc99e Initial load
duke
parents:
diff changeset
1667 JNI_ENTRY_CHECKED(void *,
a61af66fc99e Initial load
duke
parents:
diff changeset
1668 checked_jni_GetPrimitiveArrayCritical(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1669 jarray array,
a61af66fc99e Initial load
duke
parents:
diff changeset
1670 jboolean *isCopy))
a61af66fc99e Initial load
duke
parents:
diff changeset
1671 functionEnterCritical(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1672 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1673 checkArray(thr, array, -1);
a61af66fc99e Initial load
duke
parents:
diff changeset
1674 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1675 void *result = UNCHECKED()->GetPrimitiveArrayCritical(env, array, isCopy);
a61af66fc99e Initial load
duke
parents:
diff changeset
1676 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1677 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1678 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1679
a61af66fc99e Initial load
duke
parents:
diff changeset
1680 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1681 checked_jni_ReleasePrimitiveArrayCritical(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1682 jarray array,
a61af66fc99e Initial load
duke
parents:
diff changeset
1683 void *carray,
a61af66fc99e Initial load
duke
parents:
diff changeset
1684 jint mode))
a61af66fc99e Initial load
duke
parents:
diff changeset
1685 functionEnterCriticalExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1686 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1687 checkArray(thr, array, -1);
a61af66fc99e Initial load
duke
parents:
diff changeset
1688 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1689 /* The Hotspot JNI code does not use the parameters, so just check the
a61af66fc99e Initial load
duke
parents:
diff changeset
1690 * array parameter as a minor sanity check
a61af66fc99e Initial load
duke
parents:
diff changeset
1691 */
a61af66fc99e Initial load
duke
parents:
diff changeset
1692 UNCHECKED()->ReleasePrimitiveArrayCritical(env, array, carray, mode);
a61af66fc99e Initial load
duke
parents:
diff changeset
1693 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1694 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1695
a61af66fc99e Initial load
duke
parents:
diff changeset
1696 JNI_ENTRY_CHECKED(const jchar*,
a61af66fc99e Initial load
duke
parents:
diff changeset
1697 checked_jni_GetStringCritical(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1698 jstring string,
a61af66fc99e Initial load
duke
parents:
diff changeset
1699 jboolean *isCopy))
a61af66fc99e Initial load
duke
parents:
diff changeset
1700 functionEnterCritical(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1701 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1702 checkString(thr, string);
a61af66fc99e Initial load
duke
parents:
diff changeset
1703 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1704 const jchar *result = UNCHECKED()->GetStringCritical(env, string, isCopy);
a61af66fc99e Initial load
duke
parents:
diff changeset
1705 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1706 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1707 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1708
a61af66fc99e Initial load
duke
parents:
diff changeset
1709 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1710 checked_jni_ReleaseStringCritical(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1711 jstring str,
a61af66fc99e Initial load
duke
parents:
diff changeset
1712 const jchar *chars))
a61af66fc99e Initial load
duke
parents:
diff changeset
1713 functionEnterCriticalExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1714 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1715 checkString(thr, str);
a61af66fc99e Initial load
duke
parents:
diff changeset
1716 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1717 /* The Hotspot JNI code does not use the parameters, so just check the
a61af66fc99e Initial load
duke
parents:
diff changeset
1718 * string parameter as a minor sanity check
a61af66fc99e Initial load
duke
parents:
diff changeset
1719 */
a61af66fc99e Initial load
duke
parents:
diff changeset
1720 UNCHECKED()->ReleaseStringCritical(env, str, chars);
a61af66fc99e Initial load
duke
parents:
diff changeset
1721 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1722 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1723
a61af66fc99e Initial load
duke
parents:
diff changeset
1724 JNI_ENTRY_CHECKED(jweak,
a61af66fc99e Initial load
duke
parents:
diff changeset
1725 checked_jni_NewWeakGlobalRef(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1726 jobject obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
1727 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1728 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1729 if (obj != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
1730 jniCheck::validate_handle(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1731 }
a61af66fc99e Initial load
duke
parents:
diff changeset
1732 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1733 jweak result = UNCHECKED()->NewWeakGlobalRef(env, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1734 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1735 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1736 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1737
a61af66fc99e Initial load
duke
parents:
diff changeset
1738 JNI_ENTRY_CHECKED(void,
a61af66fc99e Initial load
duke
parents:
diff changeset
1739 checked_jni_DeleteWeakGlobalRef(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1740 jweak ref))
a61af66fc99e Initial load
duke
parents:
diff changeset
1741 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1742 UNCHECKED()->DeleteWeakGlobalRef(env, ref);
a61af66fc99e Initial load
duke
parents:
diff changeset
1743 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1744 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1745
a61af66fc99e Initial load
duke
parents:
diff changeset
1746 JNI_ENTRY_CHECKED(jboolean,
a61af66fc99e Initial load
duke
parents:
diff changeset
1747 checked_jni_ExceptionCheck(JNIEnv *env))
a61af66fc99e Initial load
duke
parents:
diff changeset
1748 functionEnterExceptionAllowed(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1749 jboolean result = UNCHECKED()->ExceptionCheck(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1750 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1751 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1752 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1753
a61af66fc99e Initial load
duke
parents:
diff changeset
1754 JNI_ENTRY_CHECKED(jobject,
a61af66fc99e Initial load
duke
parents:
diff changeset
1755 checked_jni_NewDirectByteBuffer(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1756 void *address,
a61af66fc99e Initial load
duke
parents:
diff changeset
1757 jlong capacity))
a61af66fc99e Initial load
duke
parents:
diff changeset
1758 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1759 jobject result = UNCHECKED()->NewDirectByteBuffer(env, address, capacity);
a61af66fc99e Initial load
duke
parents:
diff changeset
1760 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1761 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1762 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1763
a61af66fc99e Initial load
duke
parents:
diff changeset
1764 JNI_ENTRY_CHECKED(void *,
a61af66fc99e Initial load
duke
parents:
diff changeset
1765 checked_jni_GetDirectBufferAddress(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1766 jobject buf))
a61af66fc99e Initial load
duke
parents:
diff changeset
1767 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1768 void* result = UNCHECKED()->GetDirectBufferAddress(env, buf);
a61af66fc99e Initial load
duke
parents:
diff changeset
1769 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1770 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1771 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1772
a61af66fc99e Initial load
duke
parents:
diff changeset
1773 JNI_ENTRY_CHECKED(jlong,
a61af66fc99e Initial load
duke
parents:
diff changeset
1774 checked_jni_GetDirectBufferCapacity(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1775 jobject buf))
a61af66fc99e Initial load
duke
parents:
diff changeset
1776 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1777 jlong result = UNCHECKED()->GetDirectBufferCapacity(env, buf);
a61af66fc99e Initial load
duke
parents:
diff changeset
1778 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1779 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1780 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1781
a61af66fc99e Initial load
duke
parents:
diff changeset
1782 JNI_ENTRY_CHECKED(jobjectRefType,
a61af66fc99e Initial load
duke
parents:
diff changeset
1783 checked_jni_GetObjectRefType(JNIEnv *env,
a61af66fc99e Initial load
duke
parents:
diff changeset
1784 jobject obj))
a61af66fc99e Initial load
duke
parents:
diff changeset
1785 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1786 /* validate the object being passed */
a61af66fc99e Initial load
duke
parents:
diff changeset
1787 IN_VM(
a61af66fc99e Initial load
duke
parents:
diff changeset
1788 jniCheck::validate_object(thr, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1789 )
a61af66fc99e Initial load
duke
parents:
diff changeset
1790 jobjectRefType result = UNCHECKED()->GetObjectRefType(env, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
1791 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1792 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1793 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1794
a61af66fc99e Initial load
duke
parents:
diff changeset
1795
a61af66fc99e Initial load
duke
parents:
diff changeset
1796 JNI_ENTRY_CHECKED(jint,
a61af66fc99e Initial load
duke
parents:
diff changeset
1797 checked_jni_GetVersion(JNIEnv *env))
a61af66fc99e Initial load
duke
parents:
diff changeset
1798 functionEnter(thr);
a61af66fc99e Initial load
duke
parents:
diff changeset
1799 jint result = UNCHECKED()->GetVersion(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1800 functionExit(env);
a61af66fc99e Initial load
duke
parents:
diff changeset
1801 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
1802 JNI_END
a61af66fc99e Initial load
duke
parents:
diff changeset
1803
a61af66fc99e Initial load
duke
parents:
diff changeset
1804
a61af66fc99e Initial load
duke
parents:
diff changeset
1805
a61af66fc99e Initial load
duke
parents:
diff changeset
1806 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
1807 * Structure containing all checked jni functions
a61af66fc99e Initial load
duke
parents:
diff changeset
1808 */
a61af66fc99e Initial load
duke
parents:
diff changeset
1809 struct JNINativeInterface_ checked_jni_NativeInterface = {
a61af66fc99e Initial load
duke
parents:
diff changeset
1810 NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
1811 NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
1812 NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
1813
a61af66fc99e Initial load
duke
parents:
diff changeset
1814 NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
1815
a61af66fc99e Initial load
duke
parents:
diff changeset
1816 checked_jni_GetVersion,
a61af66fc99e Initial load
duke
parents:
diff changeset
1817
a61af66fc99e Initial load
duke
parents:
diff changeset
1818 checked_jni_DefineClass,
a61af66fc99e Initial load
duke
parents:
diff changeset
1819 checked_jni_FindClass,
a61af66fc99e Initial load
duke
parents:
diff changeset
1820
a61af66fc99e Initial load
duke
parents:
diff changeset
1821 checked_jni_FromReflectedMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1822 checked_jni_FromReflectedField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1823
a61af66fc99e Initial load
duke
parents:
diff changeset
1824 checked_jni_ToReflectedMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1825
a61af66fc99e Initial load
duke
parents:
diff changeset
1826 checked_jni_GetSuperclass,
a61af66fc99e Initial load
duke
parents:
diff changeset
1827 checked_jni_IsAssignableFrom,
a61af66fc99e Initial load
duke
parents:
diff changeset
1828
a61af66fc99e Initial load
duke
parents:
diff changeset
1829 checked_jni_ToReflectedField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1830
a61af66fc99e Initial load
duke
parents:
diff changeset
1831 checked_jni_Throw,
a61af66fc99e Initial load
duke
parents:
diff changeset
1832 checked_jni_ThrowNew,
a61af66fc99e Initial load
duke
parents:
diff changeset
1833 checked_jni_ExceptionOccurred,
a61af66fc99e Initial load
duke
parents:
diff changeset
1834 checked_jni_ExceptionDescribe,
a61af66fc99e Initial load
duke
parents:
diff changeset
1835 checked_jni_ExceptionClear,
a61af66fc99e Initial load
duke
parents:
diff changeset
1836 checked_jni_FatalError,
a61af66fc99e Initial load
duke
parents:
diff changeset
1837
a61af66fc99e Initial load
duke
parents:
diff changeset
1838 checked_jni_PushLocalFrame,
a61af66fc99e Initial load
duke
parents:
diff changeset
1839 checked_jni_PopLocalFrame,
a61af66fc99e Initial load
duke
parents:
diff changeset
1840
a61af66fc99e Initial load
duke
parents:
diff changeset
1841 checked_jni_NewGlobalRef,
a61af66fc99e Initial load
duke
parents:
diff changeset
1842 checked_jni_DeleteGlobalRef,
a61af66fc99e Initial load
duke
parents:
diff changeset
1843 checked_jni_DeleteLocalRef,
a61af66fc99e Initial load
duke
parents:
diff changeset
1844 checked_jni_IsSameObject,
a61af66fc99e Initial load
duke
parents:
diff changeset
1845
a61af66fc99e Initial load
duke
parents:
diff changeset
1846 checked_jni_NewLocalRef,
a61af66fc99e Initial load
duke
parents:
diff changeset
1847 checked_jni_EnsureLocalCapacity,
a61af66fc99e Initial load
duke
parents:
diff changeset
1848
a61af66fc99e Initial load
duke
parents:
diff changeset
1849 checked_jni_AllocObject,
a61af66fc99e Initial load
duke
parents:
diff changeset
1850 checked_jni_NewObject,
a61af66fc99e Initial load
duke
parents:
diff changeset
1851 checked_jni_NewObjectV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1852 checked_jni_NewObjectA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1853
a61af66fc99e Initial load
duke
parents:
diff changeset
1854 checked_jni_GetObjectClass,
a61af66fc99e Initial load
duke
parents:
diff changeset
1855 checked_jni_IsInstanceOf,
a61af66fc99e Initial load
duke
parents:
diff changeset
1856
a61af66fc99e Initial load
duke
parents:
diff changeset
1857 checked_jni_GetMethodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1858
a61af66fc99e Initial load
duke
parents:
diff changeset
1859 checked_jni_CallObjectMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1860 checked_jni_CallObjectMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1861 checked_jni_CallObjectMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1862 checked_jni_CallBooleanMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1863 checked_jni_CallBooleanMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1864 checked_jni_CallBooleanMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1865 checked_jni_CallByteMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1866 checked_jni_CallByteMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1867 checked_jni_CallByteMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1868 checked_jni_CallCharMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1869 checked_jni_CallCharMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1870 checked_jni_CallCharMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1871 checked_jni_CallShortMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1872 checked_jni_CallShortMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1873 checked_jni_CallShortMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1874 checked_jni_CallIntMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1875 checked_jni_CallIntMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1876 checked_jni_CallIntMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1877 checked_jni_CallLongMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1878 checked_jni_CallLongMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1879 checked_jni_CallLongMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1880 checked_jni_CallFloatMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1881 checked_jni_CallFloatMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1882 checked_jni_CallFloatMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1883 checked_jni_CallDoubleMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1884 checked_jni_CallDoubleMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1885 checked_jni_CallDoubleMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1886 checked_jni_CallVoidMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1887 checked_jni_CallVoidMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1888 checked_jni_CallVoidMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1889
a61af66fc99e Initial load
duke
parents:
diff changeset
1890 checked_jni_CallNonvirtualObjectMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1891 checked_jni_CallNonvirtualObjectMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1892 checked_jni_CallNonvirtualObjectMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1893 checked_jni_CallNonvirtualBooleanMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1894 checked_jni_CallNonvirtualBooleanMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1895 checked_jni_CallNonvirtualBooleanMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1896 checked_jni_CallNonvirtualByteMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1897 checked_jni_CallNonvirtualByteMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1898 checked_jni_CallNonvirtualByteMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1899 checked_jni_CallNonvirtualCharMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1900 checked_jni_CallNonvirtualCharMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1901 checked_jni_CallNonvirtualCharMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1902 checked_jni_CallNonvirtualShortMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1903 checked_jni_CallNonvirtualShortMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1904 checked_jni_CallNonvirtualShortMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1905 checked_jni_CallNonvirtualIntMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1906 checked_jni_CallNonvirtualIntMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1907 checked_jni_CallNonvirtualIntMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1908 checked_jni_CallNonvirtualLongMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1909 checked_jni_CallNonvirtualLongMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1910 checked_jni_CallNonvirtualLongMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1911 checked_jni_CallNonvirtualFloatMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1912 checked_jni_CallNonvirtualFloatMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1913 checked_jni_CallNonvirtualFloatMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1914 checked_jni_CallNonvirtualDoubleMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1915 checked_jni_CallNonvirtualDoubleMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1916 checked_jni_CallNonvirtualDoubleMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1917 checked_jni_CallNonvirtualVoidMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1918 checked_jni_CallNonvirtualVoidMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1919 checked_jni_CallNonvirtualVoidMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1920
a61af66fc99e Initial load
duke
parents:
diff changeset
1921 checked_jni_GetFieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1922
a61af66fc99e Initial load
duke
parents:
diff changeset
1923 checked_jni_GetObjectField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1924 checked_jni_GetBooleanField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1925 checked_jni_GetByteField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1926 checked_jni_GetCharField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1927 checked_jni_GetShortField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1928 checked_jni_GetIntField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1929 checked_jni_GetLongField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1930 checked_jni_GetFloatField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1931 checked_jni_GetDoubleField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1932
a61af66fc99e Initial load
duke
parents:
diff changeset
1933 checked_jni_SetObjectField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1934 checked_jni_SetBooleanField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1935 checked_jni_SetByteField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1936 checked_jni_SetCharField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1937 checked_jni_SetShortField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1938 checked_jni_SetIntField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1939 checked_jni_SetLongField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1940 checked_jni_SetFloatField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1941 checked_jni_SetDoubleField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1942
a61af66fc99e Initial load
duke
parents:
diff changeset
1943 checked_jni_GetStaticMethodID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1944
a61af66fc99e Initial load
duke
parents:
diff changeset
1945 checked_jni_CallStaticObjectMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1946 checked_jni_CallStaticObjectMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1947 checked_jni_CallStaticObjectMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1948 checked_jni_CallStaticBooleanMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1949 checked_jni_CallStaticBooleanMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1950 checked_jni_CallStaticBooleanMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1951 checked_jni_CallStaticByteMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1952 checked_jni_CallStaticByteMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1953 checked_jni_CallStaticByteMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1954 checked_jni_CallStaticCharMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1955 checked_jni_CallStaticCharMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1956 checked_jni_CallStaticCharMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1957 checked_jni_CallStaticShortMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1958 checked_jni_CallStaticShortMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1959 checked_jni_CallStaticShortMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1960 checked_jni_CallStaticIntMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1961 checked_jni_CallStaticIntMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1962 checked_jni_CallStaticIntMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1963 checked_jni_CallStaticLongMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1964 checked_jni_CallStaticLongMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1965 checked_jni_CallStaticLongMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1966 checked_jni_CallStaticFloatMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1967 checked_jni_CallStaticFloatMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1968 checked_jni_CallStaticFloatMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1969 checked_jni_CallStaticDoubleMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1970 checked_jni_CallStaticDoubleMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1971 checked_jni_CallStaticDoubleMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1972 checked_jni_CallStaticVoidMethod,
a61af66fc99e Initial load
duke
parents:
diff changeset
1973 checked_jni_CallStaticVoidMethodV,
a61af66fc99e Initial load
duke
parents:
diff changeset
1974 checked_jni_CallStaticVoidMethodA,
a61af66fc99e Initial load
duke
parents:
diff changeset
1975
a61af66fc99e Initial load
duke
parents:
diff changeset
1976 checked_jni_GetStaticFieldID,
a61af66fc99e Initial load
duke
parents:
diff changeset
1977
a61af66fc99e Initial load
duke
parents:
diff changeset
1978 checked_jni_GetStaticObjectField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1979 checked_jni_GetStaticBooleanField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1980 checked_jni_GetStaticByteField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1981 checked_jni_GetStaticCharField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1982 checked_jni_GetStaticShortField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1983 checked_jni_GetStaticIntField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1984 checked_jni_GetStaticLongField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1985 checked_jni_GetStaticFloatField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1986 checked_jni_GetStaticDoubleField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1987
a61af66fc99e Initial load
duke
parents:
diff changeset
1988 checked_jni_SetStaticObjectField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1989 checked_jni_SetStaticBooleanField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1990 checked_jni_SetStaticByteField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1991 checked_jni_SetStaticCharField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1992 checked_jni_SetStaticShortField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1993 checked_jni_SetStaticIntField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1994 checked_jni_SetStaticLongField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1995 checked_jni_SetStaticFloatField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1996 checked_jni_SetStaticDoubleField,
a61af66fc99e Initial load
duke
parents:
diff changeset
1997
a61af66fc99e Initial load
duke
parents:
diff changeset
1998 checked_jni_NewString,
a61af66fc99e Initial load
duke
parents:
diff changeset
1999 checked_jni_GetStringLength,
a61af66fc99e Initial load
duke
parents:
diff changeset
2000 checked_jni_GetStringChars,
a61af66fc99e Initial load
duke
parents:
diff changeset
2001 checked_jni_ReleaseStringChars,
a61af66fc99e Initial load
duke
parents:
diff changeset
2002
a61af66fc99e Initial load
duke
parents:
diff changeset
2003 checked_jni_NewStringUTF,
a61af66fc99e Initial load
duke
parents:
diff changeset
2004 checked_jni_GetStringUTFLength,
a61af66fc99e Initial load
duke
parents:
diff changeset
2005 checked_jni_GetStringUTFChars,
a61af66fc99e Initial load
duke
parents:
diff changeset
2006 checked_jni_ReleaseStringUTFChars,
a61af66fc99e Initial load
duke
parents:
diff changeset
2007
a61af66fc99e Initial load
duke
parents:
diff changeset
2008 checked_jni_GetArrayLength,
a61af66fc99e Initial load
duke
parents:
diff changeset
2009
a61af66fc99e Initial load
duke
parents:
diff changeset
2010 checked_jni_NewObjectArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2011 checked_jni_GetObjectArrayElement,
a61af66fc99e Initial load
duke
parents:
diff changeset
2012 checked_jni_SetObjectArrayElement,
a61af66fc99e Initial load
duke
parents:
diff changeset
2013
a61af66fc99e Initial load
duke
parents:
diff changeset
2014 checked_jni_NewBooleanArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2015 checked_jni_NewByteArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2016 checked_jni_NewCharArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2017 checked_jni_NewShortArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2018 checked_jni_NewIntArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2019 checked_jni_NewLongArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2020 checked_jni_NewFloatArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2021 checked_jni_NewDoubleArray,
a61af66fc99e Initial load
duke
parents:
diff changeset
2022
a61af66fc99e Initial load
duke
parents:
diff changeset
2023 checked_jni_GetBooleanArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2024 checked_jni_GetByteArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2025 checked_jni_GetCharArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2026 checked_jni_GetShortArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2027 checked_jni_GetIntArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2028 checked_jni_GetLongArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2029 checked_jni_GetFloatArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2030 checked_jni_GetDoubleArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2031
a61af66fc99e Initial load
duke
parents:
diff changeset
2032 checked_jni_ReleaseBooleanArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2033 checked_jni_ReleaseByteArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2034 checked_jni_ReleaseCharArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2035 checked_jni_ReleaseShortArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2036 checked_jni_ReleaseIntArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2037 checked_jni_ReleaseLongArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2038 checked_jni_ReleaseFloatArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2039 checked_jni_ReleaseDoubleArrayElements,
a61af66fc99e Initial load
duke
parents:
diff changeset
2040
a61af66fc99e Initial load
duke
parents:
diff changeset
2041 checked_jni_GetBooleanArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2042 checked_jni_GetByteArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2043 checked_jni_GetCharArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2044 checked_jni_GetShortArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2045 checked_jni_GetIntArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2046 checked_jni_GetLongArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2047 checked_jni_GetFloatArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2048 checked_jni_GetDoubleArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2049
a61af66fc99e Initial load
duke
parents:
diff changeset
2050 checked_jni_SetBooleanArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2051 checked_jni_SetByteArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2052 checked_jni_SetCharArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2053 checked_jni_SetShortArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2054 checked_jni_SetIntArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2055 checked_jni_SetLongArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2056 checked_jni_SetFloatArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2057 checked_jni_SetDoubleArrayRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2058
a61af66fc99e Initial load
duke
parents:
diff changeset
2059 checked_jni_RegisterNatives,
a61af66fc99e Initial load
duke
parents:
diff changeset
2060 checked_jni_UnregisterNatives,
a61af66fc99e Initial load
duke
parents:
diff changeset
2061
a61af66fc99e Initial load
duke
parents:
diff changeset
2062 checked_jni_MonitorEnter,
a61af66fc99e Initial load
duke
parents:
diff changeset
2063 checked_jni_MonitorExit,
a61af66fc99e Initial load
duke
parents:
diff changeset
2064
a61af66fc99e Initial load
duke
parents:
diff changeset
2065 checked_jni_GetJavaVM,
a61af66fc99e Initial load
duke
parents:
diff changeset
2066
a61af66fc99e Initial load
duke
parents:
diff changeset
2067 checked_jni_GetStringRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2068 checked_jni_GetStringUTFRegion,
a61af66fc99e Initial load
duke
parents:
diff changeset
2069
a61af66fc99e Initial load
duke
parents:
diff changeset
2070 checked_jni_GetPrimitiveArrayCritical,
a61af66fc99e Initial load
duke
parents:
diff changeset
2071 checked_jni_ReleasePrimitiveArrayCritical,
a61af66fc99e Initial load
duke
parents:
diff changeset
2072
a61af66fc99e Initial load
duke
parents:
diff changeset
2073 checked_jni_GetStringCritical,
a61af66fc99e Initial load
duke
parents:
diff changeset
2074 checked_jni_ReleaseStringCritical,
a61af66fc99e Initial load
duke
parents:
diff changeset
2075
a61af66fc99e Initial load
duke
parents:
diff changeset
2076 checked_jni_NewWeakGlobalRef,
a61af66fc99e Initial load
duke
parents:
diff changeset
2077 checked_jni_DeleteWeakGlobalRef,
a61af66fc99e Initial load
duke
parents:
diff changeset
2078
a61af66fc99e Initial load
duke
parents:
diff changeset
2079 checked_jni_ExceptionCheck,
a61af66fc99e Initial load
duke
parents:
diff changeset
2080
a61af66fc99e Initial load
duke
parents:
diff changeset
2081 checked_jni_NewDirectByteBuffer,
a61af66fc99e Initial load
duke
parents:
diff changeset
2082 checked_jni_GetDirectBufferAddress,
a61af66fc99e Initial load
duke
parents:
diff changeset
2083 checked_jni_GetDirectBufferCapacity,
a61af66fc99e Initial load
duke
parents:
diff changeset
2084
a61af66fc99e Initial load
duke
parents:
diff changeset
2085 // New 1.6 Features
a61af66fc99e Initial load
duke
parents:
diff changeset
2086
a61af66fc99e Initial load
duke
parents:
diff changeset
2087 checked_jni_GetObjectRefType
a61af66fc99e Initial load
duke
parents:
diff changeset
2088 };
a61af66fc99e Initial load
duke
parents:
diff changeset
2089
a61af66fc99e Initial load
duke
parents:
diff changeset
2090
a61af66fc99e Initial load
duke
parents:
diff changeset
2091 // Returns the function structure
a61af66fc99e Initial load
duke
parents:
diff changeset
2092 struct JNINativeInterface_* jni_functions_check() {
a61af66fc99e Initial load
duke
parents:
diff changeset
2093
a61af66fc99e Initial load
duke
parents:
diff changeset
2094 unchecked_jni_NativeInterface = jni_functions_nocheck();
a61af66fc99e Initial load
duke
parents:
diff changeset
2095
a61af66fc99e Initial load
duke
parents:
diff changeset
2096 // make sure the last pointer in the checked table is not null, indicating
a61af66fc99e Initial load
duke
parents:
diff changeset
2097 // an addition to the JNINativeInterface_ structure without initializing
a61af66fc99e Initial load
duke
parents:
diff changeset
2098 // it in the checked table.
a61af66fc99e Initial load
duke
parents:
diff changeset
2099 debug_only(int *lastPtr = (int *)((char *)&checked_jni_NativeInterface + \
a61af66fc99e Initial load
duke
parents:
diff changeset
2100 sizeof(*unchecked_jni_NativeInterface) - sizeof(char *));)
a61af66fc99e Initial load
duke
parents:
diff changeset
2101 assert(*lastPtr != 0,
a61af66fc99e Initial load
duke
parents:
diff changeset
2102 "Mismatched JNINativeInterface tables, check for new entries");
a61af66fc99e Initial load
duke
parents:
diff changeset
2103
a61af66fc99e Initial load
duke
parents:
diff changeset
2104 // with -verbose:jni this message will print
a61af66fc99e Initial load
duke
parents:
diff changeset
2105 if (PrintJNIResolving) {
a61af66fc99e Initial load
duke
parents:
diff changeset
2106 tty->print_cr("Checked JNI functions are being used to " \
a61af66fc99e Initial load
duke
parents:
diff changeset
2107 "validate JNI usage");
a61af66fc99e Initial load
duke
parents:
diff changeset
2108 }
a61af66fc99e Initial load
duke
parents:
diff changeset
2109
a61af66fc99e Initial load
duke
parents:
diff changeset
2110 return &checked_jni_NativeInterface;
a61af66fc99e Initial load
duke
parents:
diff changeset
2111 }