File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1
- http://www.javaseiten.de/jvmisi.html#iload_1
2
- https://jvilk.com/blog/java-8-wtf-ambiguous-method-lookup/
3
- https://stackoverflow.com/questions/13978355/on-signature-polymorphic-methods-in-java-7/14000576#14000576
1
+ - http://www.javaseiten.de/jvmisi.html#iload_1
2
+ - https://jvilk.com/blog/java-8-wtf-ambiguous-method-lookup/
3
+ - https://stackoverflow.com/questions/13978355/on-signature-polymorphic-methods-in-java-7/14000576#14000576
4
+ - https://docs.oracle.com/javase/9/docs/specs/jni/functions.html
4
5
5
6
# Chapter 2: The Structure of the Java Virtual Machine
6
7
Original file line number Diff line number Diff line change @@ -262,9 +262,24 @@ jobject NewLocalRef
262
262
UNIMPLEMENTED (" NewLocalRef" );
263
263
}
264
264
265
+ // TODO should this be configureable?
266
+ // jdk11u-dev/src/hotspot/share/runtime/globals.hpp
267
+ // https://docs.oracle.com/javase/9/docs/specs/jni/functions.html#ensurelocalcapacity
268
+ static const jint MaxJNILocalCapacity = -1 ;
269
+
265
270
jint EnsureLocalCapacity
266
271
(JNIEnv *env, jint capacity) {
267
- UNIMPLEMENTED (" EnsureLocalCapacity" );
272
+ LOG (" EnsureLocalCapacity" );
273
+
274
+ jint ret;
275
+ if (capacity >= 0 &&
276
+ ((MaxJNILocalCapacity <= 0 ) || (capacity <= MaxJNILocalCapacity))) {
277
+ ret = JNI_OK;
278
+ } else {
279
+ ret = JNI_ERR;
280
+ }
281
+
282
+ return ret;
268
283
}
269
284
270
285
jobject AllocObject
@@ -906,7 +921,9 @@ void DeleteWeakGlobalRef
906
921
907
922
jboolean ExceptionCheck
908
923
(JNIEnv *env) {
909
- UNIMPLEMENTED (" ExceptionCheck" );
924
+ LOG (" ExceptionCheck" );
925
+ auto *thread = (Thread *) env->functions ->reserved0 ;
926
+ return thread->current_exception != JAVA_NULL;
910
927
}
911
928
912
929
jobject NewDirectByteBuffer
You can’t perform that action at this time.
0 commit comments