Lines Matching refs:jenv

157 dtj_load_common(JNIEnv *jenv)  in dtj_load_common()  argument
255 status = dtj_cache_jni_classes(jenv, table); in dtj_load_common()
295 dtj_java_class_create(JNIEnv *jenv, jclass *jc, char *name, in dtj_java_class_create() argument
307 dtj_throw_out_of_memory(jenv, in dtj_java_class_create()
316 dtj_throw_out_of_memory(jenv, in dtj_java_class_create()
325 dtj_throw_out_of_memory(jenv, in dtj_java_class_create()
332 dtj_java_method_create(JNIEnv *jenv, jmethodID *jm, char *name, char *signature, in dtj_java_method_create() argument
343 dtj_throw_out_of_memory(jenv, in dtj_java_method_create()
350 dtj_java_static_method_create(JNIEnv *jenv, jmethodID *jm, char *name, in dtj_java_static_method_create() argument
353 dtj_java_method_t *m = dtj_java_method_create(jenv, jm, name, signature, in dtj_java_static_method_create()
362 dtj_java_field_create(JNIEnv *jenv, jfieldID *jf, char *name, char *type, in dtj_java_field_create() argument
373 dtj_throw_out_of_memory(jenv, in dtj_java_field_create()
380 dtj_java_static_field_create(JNIEnv *jenv, jfieldID *jf, char *name, char *type, in dtj_java_static_field_create() argument
383 dtj_java_field_t *f = dtj_java_field_create(jenv, jf, name, type, in dtj_java_static_field_create()
434 dtj_cache_jni_classes(JNIEnv *jenv, const dtj_table_entry_t *table) in dtj_cache_jni_classes() argument
451 dtj_throw_out_of_memory(jenv, "failed class pool creation"); in dtj_cache_jni_classes()
459 dtj_throw_out_of_memory(jenv, "failed method pool creation"); in dtj_cache_jni_classes()
467 dtj_throw_out_of_memory(jenv, "failed field pool creation"); in dtj_cache_jni_classes()
474 dtj_throw_out_of_memory(jenv, "failed class list creation"); in dtj_cache_jni_classes()
478 status = dtj_get_jni_classes(jenv, classes, classpool, methodpool, in dtj_cache_jni_classes()
487 jc = (*jenv)->FindClass(jenv, class->djc_name); in dtj_cache_jni_classes()
492 gjc = (*jenv)->NewGlobalRef(jenv, jc); in dtj_cache_jni_classes()
493 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_cache_jni_classes()
495 dtj_throw_out_of_memory(jenv, in dtj_cache_jni_classes()
500 status = dtj_cache_jni_methods(jenv, class); in dtj_cache_jni_classes()
505 status = dtj_cache_jni_fields(jenv, class); in dtj_cache_jni_classes()
523 dtj_get_jni_classes(JNIEnv *jenv, uu_list_t *classes, in dtj_get_jni_classes() argument
543 dtj_throw_out_of_memory(jenv, in dtj_get_jni_classes()
554 c = dtj_java_class_create(jenv, in dtj_get_jni_classes()
564 dtj_throw_illegal_state(jenv, in dtj_get_jni_classes()
569 m = dtj_java_method_create(jenv, in dtj_get_jni_classes()
578 dtj_throw_out_of_memory(jenv, in dtj_get_jni_classes()
585 dtj_throw_illegal_state(jenv, in dtj_get_jni_classes()
590 m = dtj_java_static_method_create(jenv, in dtj_get_jni_classes()
599 dtj_throw_out_of_memory(jenv, in dtj_get_jni_classes()
606 dtj_throw_illegal_state(jenv, in dtj_get_jni_classes()
611 f = dtj_java_field_create(jenv, in dtj_get_jni_classes()
620 dtj_throw_out_of_memory(jenv, in dtj_get_jni_classes()
627 dtj_throw_illegal_state(jenv, in dtj_get_jni_classes()
632 f = dtj_java_static_field_create(jenv, in dtj_get_jni_classes()
641 dtj_throw_out_of_memory(jenv, in dtj_get_jni_classes()
647 dtj_throw_illegal_state(jenv, in dtj_get_jni_classes()
655 dtj_throw_out_of_memory(jenv, in dtj_get_jni_classes()
665 dtj_cache_jni_methods(JNIEnv *jenv, dtj_java_class_t *c) in dtj_cache_jni_methods() argument
673 jm = (*jenv)->GetStaticMethodID(jenv, *(c->djc_ptr), in dtj_cache_jni_methods()
676 jm = (*jenv)->GetMethodID(jenv, *(c->djc_ptr), in dtj_cache_jni_methods()
691 (*jenv)->ExceptionClear(jenv); in dtj_cache_jni_methods()
696 jc = (*jenv)->FindClass(jenv, in dtj_cache_jni_methods()
698 (*jenv)->ThrowNew(jenv, jc, msg); in dtj_cache_jni_methods()
699 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_cache_jni_methods()
709 dtj_cache_jni_fields(JNIEnv *jenv, dtj_java_class_t *c) in dtj_cache_jni_fields() argument
717 jf = (*jenv)->GetStaticFieldID(jenv, *(c->djc_ptr), in dtj_cache_jni_fields()
720 jf = (*jenv)->GetFieldID(jenv, *(c->djc_ptr), in dtj_cache_jni_fields()
726 (*jenv)->ExceptionClear(jenv); in dtj_cache_jni_fields()
731 jc = (*jenv)->FindClass(jenv, in dtj_cache_jni_fields()
733 (*jenv)->ThrowNew(jenv, jc, msg); in dtj_cache_jni_fields()
734 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_cache_jni_fields()
747 dtj_throw(JNIEnv *jenv, jclass jc, const char *fmt, va_list *ap) in dtj_throw() argument
751 (*jenv)->ThrowNew(jenv, jc, msg); in dtj_throw()
755 dtj_throw_out_of_memory(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_out_of_memory() argument
764 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_throw_out_of_memory()
767 jc = (*jenv)->FindClass(jenv, in dtj_throw_out_of_memory()
770 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_out_of_memory()
771 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_out_of_memory()
776 dtj_throw_null_pointer(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_null_pointer() argument
779 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_null_pointer()
782 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_null_pointer()
783 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_null_pointer()
788 dtj_throw_illegal_state(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_illegal_state() argument
791 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_illegal_state()
794 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_illegal_state()
795 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_illegal_state()
800 dtj_throw_illegal_argument(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_illegal_argument() argument
803 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_illegal_argument()
806 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_illegal_argument()
807 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_illegal_argument()
812 dtj_throw_no_such_element(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_no_such_element() argument
815 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_no_such_element()
818 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_no_such_element()
819 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_no_such_element()
824 dtj_throw_class_cast(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_class_cast() argument
827 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_class_cast()
830 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_class_cast()
831 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_class_cast()
836 dtj_throw_assertion(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_assertion() argument
839 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_assertion()
842 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_assertion()
843 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_assertion()
848 dtj_throw_resource_limit(JNIEnv *jenv, const char *fmt, ...) in dtj_throw_resource_limit() argument
851 jclass jc = (*jenv)->FindClass(jenv, in dtj_throw_resource_limit()
854 dtj_throw(jenv, jc, fmt, &ap); in dtj_throw_resource_limit()
855 (*jenv)->DeleteLocalRef(jenv, jc); in dtj_throw_resource_limit()
860 dtj_wrap_exception(JNIEnv *jenv, const char *file, int line) in dtj_wrap_exception() argument
866 e = (*jenv)->ExceptionOccurred(jenv); in dtj_wrap_exception()
875 (*jenv)->ExceptionClear(jenv); in dtj_wrap_exception()
878 if ((*jenv)->IsInstanceOf(jenv, e, g_nx_jc)) { in dtj_wrap_exception()
880 (*jenv)->Throw(jenv, e); in dtj_wrap_exception()
881 (*jenv)->DeleteLocalRef(jenv, e); in dtj_wrap_exception()
885 jfile = dtj_NewStringNative(jenv, file); in dtj_wrap_exception()
886 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_wrap_exception()
891 (*jenv)->ExceptionClear(jenv); in dtj_wrap_exception()
892 (*jenv)->Throw(jenv, e); in dtj_wrap_exception()
893 (*jenv)->DeleteLocalRef(jenv, e); in dtj_wrap_exception()
897 nx = (jthrowable)(*jenv)->NewObject(jenv, g_nx_jc, g_nxinit_jm, in dtj_wrap_exception()
899 (*jenv)->DeleteLocalRef(jenv, jfile); in dtj_wrap_exception()
900 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_wrap_exception()
901 (*jenv)->ExceptionClear(jenv); in dtj_wrap_exception()
902 (*jenv)->Throw(jenv, e); in dtj_wrap_exception()
903 (*jenv)->DeleteLocalRef(jenv, e); in dtj_wrap_exception()
907 (*jenv)->DeleteLocalRef(jenv, e); in dtj_wrap_exception()
908 (*jenv)->Throw(jenv, nx); in dtj_wrap_exception()
909 (*jenv)->DeleteLocalRef(jenv, nx); in dtj_wrap_exception()
918 dtj_print_object(JNIEnv *jenv, jobject jobj) in dtj_print_object() argument
924 dtj_throw_illegal_state(jenv, in dtj_print_object()
926 (*jenv)->ExceptionDescribe(jenv); /* clears the exception */ in dtj_print_object()
935 jstr = (*jenv)->CallObjectMethod(jenv, jobj, g_tostring_jm); in dtj_print_object()
936 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_print_object()
937 (*jenv)->ExceptionDescribe(jenv); /* clears the exception */ in dtj_print_object()
940 cstr = (*jenv)->GetStringUTFChars(jenv, jstr, 0); in dtj_print_object()
944 (*jenv)->ExceptionDescribe(jenv); /* clears the exception */ in dtj_print_object()
945 (*jenv)->DeleteLocalRef(jenv, jstr); in dtj_print_object()
948 (*jenv)->ReleaseStringUTFChars(jenv, jstr, cstr); in dtj_print_object()
949 (*jenv)->DeleteLocalRef(jenv, jstr); in dtj_print_object()
953 dtj_uint64(JNIEnv *jenv, uint64_t u) in dtj_uint64() argument
959 val64 = (*jenv)->CallStaticObjectMethod(jenv, g_bigint_jc, in dtj_uint64()
965 val64 = (*jenv)->CallStaticObjectMethod(jenv, g_bigint_jc, in dtj_uint64()
968 val64 = (*jenv)->CallObjectMethod(jenv, tmp, in dtj_uint64()
970 (*jenv)->DeleteLocalRef(jenv, tmp); in dtj_uint64()
977 dtj_int128(JNIEnv *jenv, uint64_t high, uint64_t low) in dtj_int128() argument
983 val128 = (*jenv)->CallStaticObjectMethod(jenv, g_bigint_jc, in dtj_int128()
986 val128 = (*jenv)->CallObjectMethod(jenv, tmp, g_bigint_shl_jm, 64); in dtj_int128()
987 (*jenv)->DeleteLocalRef(jenv, tmp); in dtj_int128()
988 low64 = dtj_uint64(jenv, low); in dtj_int128()
990 val128 = (*jenv)->CallObjectMethod(jenv, tmp, g_bigint_or_jm, low64); in dtj_int128()
991 (*jenv)->DeleteLocalRef(jenv, tmp); in dtj_int128()
992 (*jenv)->DeleteLocalRef(jenv, low64); in dtj_int128()
998 dtj_format_string(JNIEnv *jenv, const char *fmt, ...) in dtj_format_string() argument
1009 jstr = dtj_NewStringNative(jenv, str); in dtj_format_string()
1015 dtj_NewStringNative(JNIEnv *jenv, const char *str) in dtj_NewStringNative() argument
1022 dtj_throw_illegal_state(jenv, in dtj_NewStringNative()
1029 bytes = (*jenv)->NewByteArray(jenv, len); in dtj_NewStringNative()
1033 (*jenv)->SetByteArrayRegion(jenv, bytes, 0, len, in dtj_NewStringNative()
1035 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_NewStringNative()
1036 (*jenv)->DeleteLocalRef(jenv, bytes); in dtj_NewStringNative()
1039 result = (*jenv)->NewObject(jenv, g_string_jc, g_strinit_bytes_jm, in dtj_NewStringNative()
1041 (*jenv)->DeleteLocalRef(jenv, bytes); in dtj_NewStringNative()
1047 dtj_GetStringNativeChars(JNIEnv *jenv, jstring jstr) in dtj_GetStringNativeChars() argument
1055 dtj_throw_illegal_state(jenv, in dtj_GetStringNativeChars()
1060 bytes = (*jenv)->CallObjectMethod(jenv, jstr, g_strbytes_jm); in dtj_GetStringNativeChars()
1061 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_GetStringNativeChars()
1065 len = (*jenv)->GetArrayLength(jenv, bytes); in dtj_GetStringNativeChars()
1068 (*jenv)->DeleteLocalRef(jenv, bytes); in dtj_GetStringNativeChars()
1069 dtj_throw_out_of_memory(jenv, in dtj_GetStringNativeChars()
1075 (*jenv)->GetByteArrayRegion(jenv, bytes, 0, len, in dtj_GetStringNativeChars()
1077 (*jenv)->DeleteLocalRef(jenv, bytes); in dtj_GetStringNativeChars()
1085 dtj_ReleaseStringNativeChars(JNIEnv *jenv, jstring jstr, const char *str) in dtj_ReleaseStringNativeChars() argument
1091 dtj_get_argv(JNIEnv *jenv, jobjectArray args, int *argc) in dtj_get_argv() argument
1100 dtj_throw_illegal_state(jenv, in dtj_get_argv()
1105 *argc = (*jenv)->GetArrayLength(jenv, args); in dtj_get_argv()
1114 dtj_throw_out_of_memory(jenv, "Failed to allocate args array"); in dtj_get_argv()
1119 jstr = (*jenv)->GetObjectArrayElement(jenv, args, i); in dtj_get_argv()
1120 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_get_argv()
1124 str = dtj_GetStringNativeChars(jenv, jstr); in dtj_get_argv()
1125 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_get_argv()
1127 (*jenv)->DeleteLocalRef(jenv, jstr); in dtj_get_argv()
1132 dtj_throw_out_of_memory(jenv, "Failed to allocate arg"); in dtj_get_argv()
1134 dtj_ReleaseStringNativeChars(jenv, jstr, str); in dtj_get_argv()
1135 (*jenv)->DeleteLocalRef(jenv, jstr); in dtj_get_argv()
1139 dtj_ReleaseStringNativeChars(jenv, jstr, str); in dtj_get_argv()
1140 (*jenv)->DeleteLocalRef(jenv, jstr); in dtj_get_argv()
1148 dtj_make_argv(JNIEnv *jenv, jstring command, int *argc) in dtj_make_argv() argument
1158 dtj_throw_illegal_state(jenv, in dtj_make_argv()
1164 dtj_throw_null_pointer(jenv, "command is null"); in dtj_make_argv()
1166 } else if ((*jenv)->GetStringLength(jenv, command) == 0) { in dtj_make_argv()
1167 dtj_throw_illegal_argument(jenv, "command is empty"); in dtj_make_argv()
1171 cmd = dtj_GetStringNativeChars(jenv, command); in dtj_make_argv()
1172 if ((*jenv)->ExceptionCheck(jenv)) { in dtj_make_argv()
1178 dtj_throw_out_of_memory(jenv, in dtj_make_argv()
1180 dtj_ReleaseStringNativeChars(jenv, command, cmd); in dtj_make_argv()
1194 dtj_throw_out_of_memory(jenv, "failed to allocate args array"); in dtj_make_argv()
1196 dtj_ReleaseStringNativeChars(jenv, command, cmd); in dtj_make_argv()
1204 dtj_throw_out_of_memory(jenv, "Failed to allocate arg"); in dtj_make_argv()
1207 dtj_ReleaseStringNativeChars(jenv, command, cmd); in dtj_make_argv()
1214 dtj_throw_illegal_argument(jenv, "command is blank"); in dtj_make_argv()
1217 dtj_ReleaseStringNativeChars(jenv, command, cmd); in dtj_make_argv()
1222 dtj_ReleaseStringNativeChars(jenv, command, cmd); in dtj_make_argv()