summaryrefslogtreecommitdiff
path: root/libjava/jni.cc
Commit message (Collapse)AuthorAgeFilesLines
* * gcj/javaprims.h (_Jv_Utf8Const): Change struct to a class,bothner2004-08-121-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | with private fields and access methods. (_Jv_NewStringUTF, _Jv_hashUtf8String): New function declarations. * gcj/cni.h (_Jv_NewStringUTF): Move to javaprims.h. * prims.cc (_Jv_Utf8COnst::init): New method implementation. ( _Jv_makeUtf8Const): Rewrite using new constructors. (hashUtf8String): Rename to +_Jv_hashUtf8String and make non-static. * defineclass.cc: Use new _Utf8Const access/convenience methods. * jni.cc: Likewise. * resolve.cc: Likewise. * gcj/field.h: Likewise. * include/jvm.h: Likewise. * java/lang/Class.h: Likewise. * java/lang/natClass.cc: Likwise. * java/lang/natClassLoader.cc: Likewise * java/lang/reflect/natMethod.cc: Likewise * verify.cc: Likewise. (_Jv_BytecodeVerifier::make_utf8_const): Optimize. (~_Jv_BytecodeVerifier): Don't need second _Jv_Free call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85854 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc: Reindented.tromey2004-08-031-37/+37
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85491 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_NewGlobalRef, JNICALL _Jv_JNI_DeleteGlobalRef,bothner2004-06-301-186/+186
| | | | | | | | etc etc): Remove needless parenthesis, which causes __stdcall__ attribute on MinGW to get ignored. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83892 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetAnyMethodID): Add name and signature tomark2004-06-111-2/+7
| | | | | | | NoSuchMethodError. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82972 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-04-19 Bryce McKinlay <mckinlay@redhat.com>bryce2004-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * class.c (make_class_data): Add new field aux_info. * decl.c (java_init_decl_processing): Push type and decl for `aux_info'. 2004-04-19 Bryce McKinlay <mckinlay@redhat.com> * gcj/cni.h (JvAllocObject): Remove these obsolete, undocumented CNI calls. * include/java-interp.h (_Jv_InterpClass): No longer extends java.lang.Class. * java/lang/Class.h (Class): Add new field `aux_info'. * boehm.cc (_Jv_MarkObj): Update java.lang.Class marking. * defineclass.cc: Remove Class<->_Jv_InterpClass casts. Use Class->aux_info instead. * jni.cc (_Jv_JNI_AllocObject): Use _Jv_AllocObject. * resolve.cc: Remove Class<->_Jv_InterpClass casts. Use Class->aux_info instead. * java/io/natObjectInputStream.cc (allocateObject): Use _Jv_AllocObject. * java/lang/natClass.cc (newInstance): Likewise. * java/lang/natClassLoader.cc (_Jv_NewClass): Likewise. * java/lang/natObject.cc (clone): Likewise. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise. * java/lang/natVMClassLoader.cc (defineClass): Don't use JvAllocObject. Allocate klass->aux_info here for interpreted class. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80875 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-02-01 Michael Koch <konqueror@gmx.de>mkoch2004-02-011-1/+1
| | | | | | | | | | * include/jvm.h (MAYBE_UNUSED): New macro tp mark probably unused arguments. * jni.cc (_Jv_LookupJNIMethod): Mark 'args_size' unused. * verify.cc (debug_print): Mark 'fmt' unused. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77079 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if stringtromey2003-11-181-2/+4
| | | | | | | is null. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73707 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string totromey2003-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | JvGetStringUTFRegion. * java/lang/natPosixProcess.cc (new_string): Pass length of string to JvGetStringUTFRegion. * java/lang/natDouble.cc (parseDouble): Pass length of string to JvGetStringUTFRegion. * java/lang/natWin32Process.cc (startProcess): Pass length of string to JvGetStringUTFRegion. * java/lang/natClass.cc (forName): Pass length of string to JvGetStringUTFRegion. * gnu/gcj/runtime/natNameFinder.cc (getExternalLabel): Pass length of string to JvGetStringUTFRegion. * gnu/gcj/convert/natIconv.cc (init): Pass length of string to JvGetStringUTFRegion. * gnu/awt/gtk/natGtkLabelPeer.cc (setText): Pass length of string to JvGetStringUTFRegion. * gnu/awt/gtk/natGtkButtonPeer.cc (setLabel): Pass length of string to JvGetStringUTFRegion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73571 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (JNI_CreateJavaVM): Remove JNIEXPORT.membar2003-11-121-3/+3
| | | | | | | | | | | | | (JNI_GetCreatedJavaVMs): Likewise. (JNI_GetDefaultJavaVMInitArgs): Likewise. * include/jni.h (JNIIMPEXP): Remove definition and replace with... (__GCJ_JNIIMPEXP__): New macro, applicable only to libgcj symbols, (__GCJ_DLL__): New macro, controlling __GCJ_JNIIMPEXP__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73484 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-10-26 Bryce McKinlay <bryce@mckinlay.net.nz>bryce2003-10-261-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * java/lang/reflect/Constructor.java (toString): Avoid extra whitespace on constructor with no modifiers. * java/lang/reflect/natConstructor.java (newInstance): Look up caller and perform accessibility check only if constructor is non-public and accessible flag is not set. 2003-10-26 Bryce McKinlay <bryce@mckinlay.net.nz> * jni.cc (_Jv_JNI_CallAnyMethodV, _Jv_JNI_CallAnyMethodA, _Jv_JNI_CallAnyVoidMethodV, _Jv_JNI_CallAnyVoidMethodA): Don't use _Jv_LookupDeclaredMethod(). Call _Jv_CallAnyMethodA with is_virtual_call argument. * include/jvm.h (_Jv_isVirtualMethod): Moved and renamed from natClass.cc. * java/lang/natClass.cc (_Jv_LayoutVTableMethods): Use _Jv_isVirtualMethod. * java/lang/reflect/natMethod.cc (invoke): Don't use _Jv_LookupDeclaredMethod. (_Jv_CallAnyMethodA): New is_virtual_call argument. If specified, look up method in target object's vtable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72942 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-09-22 Michael Koch <konqueror@gmx.de>mkoch2003-09-221-3/+1
| | | | | | | | * jni.cc (_Jv_LookupJNIMethod): Remove workaround that should hide a compiler warning but produces a different one now. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71650 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-08-20 Graydon Hoare <graydon@redhat.com>graydon2003-08-201-5/+15
| | | | | | | | * jni.cc: Replace "cheating" pointer-casting code with extract_from_jvalue<> template. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70613 138bc75d-0d04-0410-961f-82ee72b054a4
* PR libgcj/11951:tromey2003-08-181-24/+12
| | | | | | | | | | | | | | | | | | * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Returns void. Throw VirtualMachineError if ffi fails. Initialize return value. Added is_jni_call argument; only wrap exception if not a JNI call. Use descriptive message if operation not supported. (_Jv_GetTypesFromSignature): Use declaring class' loader to find array class. * include/jvm.h (_Jv_CallAnyMethodA): Updated declaration. * jni.cc (_Jv_JNI_CallAnyMethodV): Updated for new form of _Jv_CallAnyMethodA. (_Jv_JNI_CallAnyMethodA): Likewise. (_Jv_JNI_CallAnyVoidMethodV): Likewise. (_Jv_JNI_CallAnyVoidMethodA): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70544 138bc75d-0d04-0410-961f-82ee72b054a4
* * java/lang/Runtime.java: Comment fix.tromey2003-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/lang/ClassLoader.java (isAncestorOf): New method. (getParent): Uncommented security check. Use isAncestorOf. * include/jvm.h (_Jv_CheckAccess): Declare. * java/lang/reflect/natConstructor.cc (newInstance): Perform access check. Include IllegalAccessException.h, ArrayIndexOutOfBoundsException.h. * java/lang/reflect/natArray.cc (newInstance): Pass caller's class loader to _Jv_GetArrayClass. Include ArrayIndexOutOfBoundsException.h. * java/lang/reflect/Field.java: Update comment to reflect status. (equals): Fixed indentation. * java/lang/Class.h (Class): Declare memberAccessCheck, not checkMemberAccess. Make _Jv_CheckAccess a friend. * java/lang/Class.java (memberAccessCheck): New method from Classpath. (checkMemberAccess): Removed. (getDeclaredMethod): Use memberAccessCheck. (getField): Likewise. (getMethod): Likewise. * resolve.cc (_Jv_ResolvePoolEntry): Use _Jv_CheckAccess. (_Jv_SearchMethodInClass): Likewise. * prims.cc (_Jv_CheckAccess): New function. * jni.cc (_Jv_JNI_FindClass): Use getClassLoaderInternal. (_Jv_JNI_GetAnyFieldID): Likewise. * java/lang/natClass.cc (forName): Use getClassLoaderInternal. (getClassLoader): Added security check. (getConstructor): Call memberAccessCheck. (getDeclaredClasses): Likewise. (getDeclaredField): Likewise. (getDeclaredFields): Likewise. (_getConstructors): Likewise. (getDeclaredConstructor): Likewise. (getDeclaredMethods): Likewise. (getFields): Likewise. (getMethods): Likewise. (newInstance): Likewise. (_Jv_MakeVTable): Put method name in exception. * java/lang/reflect/natMethod.cc (getType): Use getClassLoaderInternal. (_Jv_GetTypesFromSignature): Likewise. (invoke): Perform access check. (_Jv_CallAnyMethodA): Removed old FIXME comments. Include ArrayIndexOutOfBoundsException.h. * java/lang/reflect/natField.cc (getType): Use getClassLoaderInternal. (_Jv_CheckFieldAccessibility): Removed. (getAddr): Use _Jv_CheckAccess; find caller. Include ArrayIndexOutOfBoundsException.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69621 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-06-17 Michael Koch <konqueror@gmx.de>mkoch2003-06-171-10/+16
| | | | | | | | | | | | | | | | | | * java/nio/DirectByteBufferImpl.java (address): Made package private. (DirectByteBufferImpl): New constructor. * java/nio/natDirectByteBufferImpl.cc (allocateImpl): Moved to java.nio namespace, implemented. (freeImpl): Likewise. (getImpl): Likewise. (putImpl): Likewise. * jni.cc (_Jv_JNI_NewDirectByteBuffer): Implemented. (_Jv_JNI_GetDirectBufferAddress): Implemented. (_Jv_JNI_GetDirectBufferCapacity): Implemented. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68105 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-06-11 Andrew Haley <aph@redhat.com>aph2003-06-121-38/+94
| | | | | | | | | | | | | | * jni.cc (_Jv_JNI_check_types): New. (_Jv_JNI_SetPrimgitiveArrayRegion): Check array type. (_Jv_JNI_GetPrimitiveArrayRegion): Ditto. (_Jv_JNI_GetPrimitiveArrayElements): Ditto. (_Jv_JNI_ReleasePrimitiveArrayElements): Ditto. * java/lang/natVMSecurityManager.cc (getClassContext): Fix infinite loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67835 138bc75d-0d04-0410-961f-82ee72b054a4
* 2003-02-12 Ranjit Mathew <rmathew@hotmail.com>tromey2003-02-121-12/+75
| | | | | | | | | | | | | * jni.cc (_Jv_LookupJNIMethod): Modify to accept the size of the arguments for a JNI function. For Win32, modify to search for all forms of possible exported names of an stdcall JNI function. (_Jv_JNIMethod::call): Modify to calculate the size of the arguments passed to a JNI function and pass it to _Jv_LookupJNIMethod. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62796 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_NewObjectArray): Check that initializer can betromey2003-01-311-1/+6
| | | | | | | | | cast to element type. (_Jv_JNI_SetObjectArrayElement): Check array bounds. (_Jv_JNI_GetObjectArrayElement): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62210 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc: Added `name' argument.tromey2002-12-031-2/+3
| | | | | | | | | * include/jni.h (struct JNINativeInterface) [DefineClass]: Added `const char *' argument. (class _Jv_JNIEnv) [DefineClass]: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59756 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-11-19 Ranjit Mathew <rmathew@hotmail.com>tromey2002-11-191-124/+133
| | | | | | | | | | | | * include/jni.h: Add missing JNICALL and JNIEXPORT attributes to function and function pointer declarations in accordance with Sun's JDKs. Define JNIIMPEXP to either JNIEXPORT or JNIIMPORT based on whether __GCJ_JNI_IMPL__ has been defined or not. * jni.cc: Add missing JNICALL and JNIEXPORT attributes to JNI function definitions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59277 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_GetJNIEnvNewFrame): Set env->ex in all cases.tromey2002-11-101-2/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58971 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (array_from_valist): Assume that jlong won't betromey2002-11-061-2/+8
| | | | | | | promoted. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58859 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment.tromey2002-10-231-8/+8
| | | | | | | | (array_from_valist): Correctly handle promotion for jint, jlong, jfloat, and jdouble. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58476 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNIFunctions): Fixed typo.tromey2002-05-101-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53353 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in: Rebuilt.tromey2002-04-101-16/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (java/lang/Thread.h): Mark _Jv_AttachCurrentThreadAsDaemon as friend. * gcj/javaprims.h (_Jv_AttachCurrentThreadAsDaemon): Declare. * gcj/cni.h (JvAttachCurrentThreadAsDaemon): New function. * java/lang/natThread.cc (_Jv_AttachCurrentThreadAsDaemon): New function. * java/lang/natRuntime.cc (_load): Recognize JNI_VERSION_1_4. * jni.cc (_Jv_JNI_GetVersion): Return JNI_VERSION_1_4. (_Jv_JNI_InvokeFunctions): Added _Jv_JNI_AttachCurrentThreadAsDaemon. (_Jv_JNI_GetEnv): Handle JNI_VERSION_1_4. (JNI_GetDefaultJavaVMInitArgs): Likewise. (JNI_CreateJavaVM): Likewise. (_Jv_JNI_AttachCurrentThread): Likewise. (_Jv_JNI_AttachCurrentThread): Added `is_daemon' argument. (_Jv_JNI_AttachCurrentThreadAsDaemon): New method. (_Jv_JNIFunctions): Initialize new fields. (_Jv_JNI_NewDirectByteBuffer): New function. (_Jv_JNI_GetDirectBufferAddress): Likewise. (_Jv_JNI_GetDirectBufferCapacity): Likewise. * include/jni.h (JNI_VERSION_1_4): New macro. (JNIInvokeInterface::AttachCurrentThreadAsDaemon): New field. (_Jv_JavaVM::AttachCurrentThreadAsDaemon): New method. (JNINativeInterface::NewDirectByteBuffer): New field. (JNINativeInterface::GetDirectBufferAddress): New field. (JNINativeInterface::GetDirectBufferCapacity): New field. (_Jv_JNIEnv::NewDirectByteBuffer): New method. (_Jv_JNIEnv::GetDirectBufferAddress): New method. (_Jv_JNIEnv::GetDirectBufferCapacity): New method. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52144 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_LookupJNIMethod): Throw UnsatisfiedLinkError, nottromey2002-03-051-2/+2
| | | | | | | AbstractMethodError. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50337 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-02-13 Martin Kahlert <martin.kahlert@infineon.com>tromey2002-02-131-2/+1
| | | | | | | | * jni.cc (_Jv_JNI_AttachCurrentThread): env->locals assigned correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49737 138bc75d-0d04-0410-961f-82ee72b054a4
* 2002-02-08 Martin Kahlert <martin.kahlert@infineon.com>tromey2002-02-081-2/+11
| | | | | | | | | | * jni.cc (_Jv_JNI_NewLocalRef): Make sure, that NULL frame is not dereferenced. (_Jv_JNI_AttachCurrentThread): Produce full featured env->locals frame. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49615 138bc75d-0d04-0410-961f-82ee72b054a4
* For PR libgcj/5103:tromey2001-12-161-4/+0
| | | | | | | | | | | | | | | | | * include/jvm.h (__GCJ_JNI_IMPL__): Define. * include/config.h.in: Rebuilt. * configure: Rebuilt. * configure.in: Define JV_HAVE_INTTYPES_H if inttypes.h found. Added comment for HAVE_DLOPEN to avoid autoheader error. * gcj/libgcj-config.h.in (JV_HAVE_INTTYPES_H): Added. * include/jni.h: Include <gcj/libgcj-config.h>. Don't include CNI-specific headers if we are compiling ordinary JNI code with a C++ compiler. Include <inttypes.h> and JNIWeakRef.h when appropriate. * jni.cc: Don't include JNIWeakRef.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48082 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (call): Synchronize if required.tromey2001-12-121-0/+14
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47949 138bc75d-0d04-0410-961f-82ee72b054a4
* Obvious jni weak reference fixgreen2001-11-171-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47128 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in: Rebuilt.tromey2001-11-131-20/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (ordinary_java_source_files): Added JNIWeakRef.java. * jni.cc: Include JNIWeakRef.h. (unwrap): New function. (_Jv_JNI_DefineClass): Use it. (_Jv_JNI_GetSuperclass): Likewise. (_Jv_JNI_IsAssignableFrom): Likewise. (_Jv_JNI_Throw): Likewise. (_Jv_JNI_ThrowNew): Likewise. (_Jv_JNI_IsSameObject): Likewise. (_Jv_JNI_AllocObject): Likewise. (_Jv_JNI_GetObjectClass): Likewise. (_Jv_JNI_IsInstanceOf): Likewise. (_Jv_JNI_GetAnyMethodID): Likewise. (array_from_valist): Likewise. (_Jv_JNI_CallAnyMethodV): Likewise. (_Jv_JNI_CallAnyMethodA): Likewise. (_Jv_JNI_CallAnyVoidMethodV): Likewise. (_Jv_JNI_CallAnyVoidMethodA): Likewise. (_Jv_JNI_CallStaticMethodV): Likewise. (_Jv_JNI_CallStaticMethod): Likewise. (_Jv_JNI_CallStaticMethodA): Likewise. (_Jv_JNI_NewObjectV): Likewise. (_Jv_JNI_NewObject): Likewise. (_Jv_JNI_NewObjectA): Likewise. (_Jv_JNI_GetField): Likewise. (_Jv_JNI_SetField): Likewise. (_Jv_JNI_GetAnyFieldID): Likewise. (_Jv_JNI_SetStaticField): Likewise. (_Jv_JNI_GetStringLength): Likewise. (_Jv_JNI_GetStringChars): Likewise. (_Jv_JNI_ReleaseStringChars): Likewise. (_Jv_JNI_GetStringUTFLength): Likewise (_Jv_JNI_GetStringUTFChars): Likewise. (_Jv_JNI_GetStringRegion): Likewise. (_Jv_JNI_GetStringUTFRegion): Likewise. (_Jv_JNI_GetStringCritical): Likewise. (_Jv_JNI_GetArrayLength): Likewise. (_Jv_JNI_NewObjectArray): Likewise. (_Jv_JNI_GetObjectArrayElement): Likewise. (_Jv_JNI_SetObjectArrayElement): Likewise. (_Jv_JNI_GetPrimitiveArrayElements): Likewise. (_Jv_JNI_ReleasePrimitiveArrayElements): Likewise. (_Jv_JNI_GetPrimitiveArrayRegion): Likewise. (_Jv_JNI_SetPrimitiveArrayRegion): Likewise. (_Jv_JNI_MonitorEnter): Likewise. (_Jv_JNI_MonitorExit): Likewise. (_Jv_JNI_ToReflectedField): Likewise. (_Jv_JNI_FromReflectedField): Likewise. (_Jv_JNI_ToReflectedMethod): Likewise. (_Jv_JNI_FromReflectedMethod): Likewise. (_Jv_JNI_NewGlobalRef): Likewise. (_Jv_JNI_DeleteGlobalRef): Likewise. (_Jv_JNI_DeleteLocalRef): Likewise. (_Jv_JNI_NewLocalRef): Likewise. (_Jv_JNI_NewWeakGlobalRef): New function. (_Jv_JNI_DeleteWeakGlobalRef): Likewise. (_Jv_JNIFunctions): Updated for new methods. (NOT_IMPL): Removed. * gnu/gcj/runtime/JNIWeakRef.java: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46990 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (JNI_CreateJavaVM): Call _Jv_CreateJavaVM. Don't callbryce2001-10-301-2/+3
| | | | | | | _Jv_JNI_Init. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46633 138bc75d-0d04-0410-961f-82ee72b054a4
* Eliminate use of C++ static constructors.bryce2001-10-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * interpret.cc: Remove static Utf8Consts. Use namespace gcj. * jni.cc: Likewise. * resolve.cc: Likewise. * defineclass.cc: Likewise. (_Jv_ClassReader::handleClassBegin): Synchronize call to _Jv_RegisterClass. * include/jvm.h (void_signature, clinit_name, init_name, finit_name): Declare in namespace gcj. * java/lang/Class.h (Class): Remove initialization for primitive types. (friend void _Jv_InitPrimClass): This is in prims.cc. * prims.cc (_Jv_InitPrimClass): Do primitive type initialization here instead. (void_signature, clinit_name, init_name, finit_name): Define in namespace gcj. (_Jv_CreateJavaVM): Call _Jv_InitThreads, _Jv_InitGC, and _Jv_InitializeSyncMutex from here. Initialize Utf8 constants. Initialize primitive types. * java/lang/natClassLoader.cc (_Jv_RegisterClasses): Don't call initialization routines. Don't synchronize. * java/lang/natRuntime.cc (_load): Synchronize on java.lang.Class across dlopen call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46282 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-10-04 Martin Kahlert <martin.kahlert@infineon.com>tromey2001-10-051-1/+1
| | | | | | | * jni.cc (_Jv_JNI_DeleteLocalRef): Use correct frame size git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46034 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (array_from_valist): Use promoted types for va_arg.aj2001-09-171-14/+14
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45650 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (nathash, nathash_count, nathash_size): New globals.tromey2001-08-201-21/+152
| | | | | | | | | | | | | | | | (DELETED_ENTRY): New define. (hash): New function. (nathash_find_slot): Likewise. (natrehash): Likewise. (nathash_add): Likewise. (_Jv_JNI_RegisterNatives): No longer interpreter-specific. Use nathash_add. (nathash_find): New function. (_Jv_LookupJNIMethod): Use it. Synchronize body. (call): Synchronize around assignment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45060 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc: Include IdentityHashMap.h, not Hashtable.h.tromey2001-08-151-7/+7
| | | | | | | | | | | | | | (local_ref_table, global_ref_table): Now IdentityHashMap. (_Jv_JNI_Init): Updated for new types. (mark_for_gc): Likewise. (unmark_for_gc): Likewise. * gcj/javaprims.h: Rebuilt class list. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added new file. * java/util/IdentityHashMap.java: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44929 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-08-02 Martin Kahlert <martin.kahlert@infineon.com>tromey2001-08-021-0/+3
| | | | | | | | * jni.cc (JNI_CreateJavaVM): Call _Jv_JNI_Init in order to initialize global_ref_table/local_ref_table. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44583 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_NewLocalRef): Search other frames.tromey2001-06-151-8/+15
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43415 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (ClassClass): Removed; updated all users.tromey2001-06-151-30/+28
| | | | | | | | | | | | | | | | | | | | | | | | | (ObjectClass): Likewise. (ThrowableClass): Likewise. (MethodClass): Likewise. (ThreadGroupClass): Likewise. (local_ref_table): Renamed from `ref_table'. (global_ref_table): New global. (_Jv_JNI_Init): Initialize both ref tables. (mark_for_gc): Added `ref_table' parameter. (unmark_for_gc): Likewise. Also, fail if we unreferenced too many times. (_Jv_JNI_NewGlobalRef): Updated for new mark function. (_Jv_JNI_DeleteGlobalRef): Likewise. (_Jv_JNI_DeleteLocalRef): Likewise. (_Jv_JNI_NewLocalRef): Likewise. (_Jv_JNI_PopLocalFrame): Likewise. (_Jv_JNI_GetStringChars): Likewise. (_Jv_JNI_ReleaseStringChars): Likewise. (_Jv_JNI_GetPrimitiveArrayElements): Likewise. (_Jv_JNI_ReleasePrimitiveArrayElements): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43409 138bc75d-0d04-0410-961f-82ee72b054a4
* Implement invocation interface; don't create new thread for main.bothner2001-05-221-23/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42428 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-05-03 Martin Kahlert <martin.kahlert@infineon.com>tromey2001-05-031-2/+2
| | | | | | | | | * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds checking. (_Jv_JNI_SetPrimitiveArrayRegion): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41795 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed boundstromey2001-04-271-4/+10
| | | | | | | | checking. (_Jv_JNI_SetPrimitiveArrayRegion): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41634 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (wrap_value<jobject>, wrap_value<jclass>): Removed.tromey2001-04-061-11/+9
| | | | | | | | (wrap_value<T*>): New specialization. (_Jv_JNI_PopLocalFrame): Update env->locals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41157 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-04-02 Marcus G. Daniels <mgd@swarm.org>tromey2001-04-021-0/+9
| | | | | | | * jni.cc (wrap_value<jclass>): New specialization. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41021 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (add_char): Correctly encode non-ascii characters.tromey2001-04-021-5/+5
| | | | | | | | | | (add_char): Define even when INTERPRETER not defined. (mangled_name): Likewise. (_Jv_GetJNIEnvNewFrame): Likewise. (_Jv_LookupJNIMethod): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41010 138bc75d-0d04-0410-961f-82ee72b054a4
* * exception.cc (java_eh_info): Make value type jthrowable.rth2001-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (_Jv_type_matcher): Remove now unneeded cast. (_Jv_Throw): Make argument type jthrowable. Munge name for SJLJ_EXCEPTIONS here ... * gcj/cni.h: ... not here. (JvThrow): Remove. * gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations. * defineclass.cc, interpret.cc, jni.cc, posix-threads.cc, prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc, gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc, gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc, gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc, java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc, java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc, java/lang/natClass.cc, java/lang/natClassLoader.cc, java/lang/natDouble.cc, java/lang/natObject.cc, java/lang/natPosixProcess.cc, java/lang/natRuntime.cc, java/lang/natString.cc, java/lang/natSystem.cc, java/lang/natThread.cc, java/lang/reflect/natArray.cc, java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc, java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc, java/util/zip/natInflater.cc: Use throw, not JvThrow or _Jv_Throw. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40838 138bc75d-0d04-0410-961f-82ee72b054a4
* * jni.cc (_Jv_JNI_GetAnyFieldID): Handle unresolved fields.tromey2001-03-231-4/+8
| | | | | | | | | | | | * java/lang/reflect/natField.cc (getType): Use _Jv_ResolveField unconditionally. * include/jvm.h (_Jv_ResolveField): Declare. * include/java-interp.h (_Jv_ResolveField): Don't declare. * resolve.cc (_Jv_ResolveField): No longer conditional on INTERPRETER. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40785 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-03-22 Marcus G. Daniels <mgd@swarm.org>tromey2001-03-221-1/+4
| | | | | | | * jni.cc (add_char): Handle `.' like `/'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40748 138bc75d-0d04-0410-961f-82ee72b054a4