aboutsummaryrefslogtreecommitdiff
path: root/libjava/jni.cc
AgeCommit message (Collapse)AuthorFilesLines
2004-11-25* Merged gcj-abi-2-dev-branch to trunk.Tom Tromey1-3/+4
(Actual changes too large to list in the commit message; see ChangeLog.) From-SVN: r91270
2004-11-242004-11-24 Michael Koch <konqueror@gmx.de>Michael Koch1-2/+3
* java/nio/DirectByteBufferImpl.java (ReadWrite.ReadWrite): New constructor. (DirectByteBufferImpl): Likewise. * jni.cc (_Jv_JNI_NewDirectByteBuffer): Use DirectByteBufferImpl.ReadWrite. * Makefile.am: Generate java/nio/DirectByteBufferImpl$ReadWrite.h. * Makefile.in: Rgenerated. From-SVN: r91150
2004-11-03jni.cc (_Jv_JNI_NewObjectArray): Fixed return type.Tom Tromey1-2/+2
* jni.cc (_Jv_JNI_NewObjectArray): Fixed return type. * include/jni.h (struct JNINativeInterface) <NewObjectArray>: Now returns jobjectArray. (_Jv_JNIEnv::NewObjectArray): Likewise. From-SVN: r90041
2004-10-14jni.cc (_Jv_JNIMethod::call): Use ffi_java_raw_call instead of ffi_raw_call ↵Ulrich Weigand1-0/+5
if FFI_NATIVE_RAW_API is not defined. * jni.cc (_Jv_JNIMethod::call): Use ffi_java_raw_call instead of ffi_raw_call if FFI_NATIVE_RAW_API is not defined. From-SVN: r89051
2004-09-28* jni.cc (_Jv_JNI_RegisterNatives): Formatting fixlets.Tom Tromey1-3/+2
From-SVN: r88255
2004-08-11javaprims.h (_Jv_Utf8Const): Change struct to a class, with private fields ↵Per Bothner1-13/+15
and access methods. * gcj/javaprims.h (_Jv_Utf8Const): Change struct to a class, 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. From-SVN: r85854
2004-08-03* jni.cc: Reindented.Tom Tromey1-37/+37
From-SVN: r85491
2004-06-29jni.cc (_Jv_JNI_NewGlobalRef, [...]): Remove needless parenthesis...Per Bothner1-186/+186
* jni.cc (_Jv_JNI_NewGlobalRef, JNICALL _Jv_JNI_DeleteGlobalRef, etc etc): Remove needless parenthesis, which causes __stdcall__ attribute on MinGW to get ignored. From-SVN: r83892
2004-06-11jni.cc (_Jv_JNI_GetAnyMethodID): Add name and signature to NoSuchMethodError.Mark Wielaard1-2/+7
* jni.cc (_Jv_JNI_GetAnyMethodID): Add name and signature to NoSuchMethodError. From-SVN: r82972
2004-04-20class.c (make_class_data): Add new field aux_info.Bryce McKinlay1-1/+1
2004-04-19 Bryce McKinlay <mckinlay@redhat.com> * 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. From-SVN: r80875
2004-02-01jvm.h (MAYBE_UNUSED): New macro tp mark probably unused arguments.Michael Koch1-1/+1
2004-02-01 Michael Koch <konqueror@gmx.de> * 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. From-SVN: r77079
2003-11-18jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if string is null.Tom Tromey1-2/+4
* jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if string is null. From-SVN: r73707
2003-11-14jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to ↵Tom Tromey1-1/+1
JvGetStringUTFRegion. * jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to 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. From-SVN: r73571
2003-11-12jni.cc (JNI_CreateJavaVM): Remove JNIEXPORT.Danny Smith1-3/+3
* jni.cc (JNI_CreateJavaVM): Remove JNIEXPORT. (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__. From-SVN: r73484
2003-10-26Constructor.java (toString): Avoid extra whitespace on constructor with no ↵Bryce McKinlay1-12/+4
modifiers. 2003-10-26 Bryce McKinlay <bryce@mckinlay.net.nz> * 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. From-SVN: r72942
2003-09-22jni.cc (_Jv_LookupJNIMethod): Remove workaround that should hide a compiler ↵Michael Koch1-3/+1
warning but produces a different... 2003-09-22 Michael Koch <konqueror@gmx.de> * jni.cc (_Jv_LookupJNIMethod): Remove workaround that should hide a compiler warning but produces a different one now. From-SVN: r71650
2003-08-20jni.cc: Replace "cheating" pointer-casting code with extract_from_jvalue<> ↵Graydon Hoare1-5/+15
template. 2003-08-20 Graydon Hoare <graydon@redhat.com> * jni.cc: Replace "cheating" pointer-casting code with extract_from_jvalue<> template. From-SVN: r70613
2003-08-18re PR libgcj/11951 (natMethod.cc (_Jv_CallAnyMethodA) should clear ↵Tom Tromey1-24/+12
ffi_result before ffi_call) PR libgcj/11951: * 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. From-SVN: r70544
2003-07-21Runtime.java: Comment fix.Tom Tromey1-2/+2
* java/lang/Runtime.java: Comment fix. * 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. From-SVN: r69621
2003-06-172003-06-17 Michael Koch <konqueror@gmx.de>Michael Koch1-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. From-SVN: r68105
2003-06-12jni.cc (_Jv_JNI_check_types): New.Andrew Haley1-38/+94
2003-06-11 Andrew Haley <aph@redhat.com> * 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. From-SVN: r67835
2003-02-12jni.cc (_Jv_LookupJNIMethod): Modify to accept the size of the arguments for ↵Ranjit Mathew1-12/+75
a JNI function. 2003-02-12 Ranjit Mathew <rmathew@hotmail.com> * 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. From-SVN: r62796
2003-01-31jni.cc (_Jv_JNI_NewObjectArray): Check that initializer can be cast to ↵Tom Tromey1-1/+6
element type. * jni.cc (_Jv_JNI_NewObjectArray): Check that initializer can be cast to element type. (_Jv_JNI_SetObjectArrayElement): Check array bounds. (_Jv_JNI_GetObjectArrayElement): Likewise. From-SVN: r62210
2002-12-03jni.cc: Added `name' argument.Tom Tromey1-2/+3
* jni.cc: Added `name' argument. * include/jni.h (struct JNINativeInterface) [DefineClass]: Added `const char *' argument. (class _Jv_JNIEnv) [DefineClass]: Likewise. From-SVN: r59756
2002-11-19jni.h: Add missing JNICALL and JNIEXPORT attributes to function and function ↵Ranjit Mathew1-124/+133
pointer... 2002-11-19 Ranjit Mathew <rmathew@hotmail.com> * 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. From-SVN: r59277
2002-11-10* jni.cc (_Jv_GetJNIEnvNewFrame): Set env->ex in all cases.Tom Tromey1-2/+4
From-SVN: r58971
2002-11-06jni.cc (array_from_valist): Assume that jlong won't be promoted.Tom Tromey1-2/+8
* jni.cc (array_from_valist): Assume that jlong won't be promoted. From-SVN: r58859
2002-10-23jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment.Tom Tromey1-8/+8
* jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment. (array_from_valist): Correctly handle promotion for jint, jlong, jfloat, and jdouble. From-SVN: r58476
2002-05-10* jni.cc (_Jv_JNIFunctions): Fixed typo.Tom Tromey1-1/+1
From-SVN: r53353
2002-04-10Makefile.in: Rebuilt.Tom Tromey1-16/+57
* Makefile.in: Rebuilt. * 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. From-SVN: r52144
2002-03-05jni.cc (_Jv_LookupJNIMethod): Throw UnsatisfiedLinkError, not ↵Tom Tromey1-2/+2
AbstractMethodError. * jni.cc (_Jv_LookupJNIMethod): Throw UnsatisfiedLinkError, not AbstractMethodError. From-SVN: r50337
2002-02-13jni.cc (_Jv_JNI_AttachCurrentThread): env->locals assigned correctly.Martin Kahlert1-2/+1
2002-02-13 Martin Kahlert <martin.kahlert@infineon.com> * jni.cc (_Jv_JNI_AttachCurrentThread): env->locals assigned correctly. From-SVN: r49737
2002-02-08jni.cc (_Jv_JNI_NewLocalRef): Make sure, that NULL frame is not dereferenced.Martin Kahlert1-2/+11
2002-02-08 Martin Kahlert <martin.kahlert@infineon.com> * jni.cc (_Jv_JNI_NewLocalRef): Make sure, that NULL frame is not dereferenced. (_Jv_JNI_AttachCurrentThread): Produce full featured env->locals frame. From-SVN: r49615
2001-12-16For PR libgcj/5103:Tom Tromey1-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. From-SVN: r48082
2001-12-12* jni.cc (call): Synchronize if required.Tom Tromey1-0/+14
From-SVN: r47949
2001-11-17Obvious jni weak reference fixAnthony Green1-1/+1
From-SVN: r47128
2001-11-13Makefile.in: Rebuilt.Tom Tromey1-20/+151
* Makefile.in: Rebuilt. * 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. From-SVN: r46990
2001-10-30jni.cc (JNI_CreateJavaVM): Call _Jv_CreateJavaVM.Bryce McKinlay1-2/+3
* jni.cc (JNI_CreateJavaVM): Call _Jv_CreateJavaVM. Don't call _Jv_JNI_Init. From-SVN: r46633
2001-10-16Eliminate use of C++ static constructors.Bryce McKinlay1-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. From-SVN: r46282
2001-10-05jni.cc (_Jv_JNI_DeleteLocalRef): Use correct frame sizeMartin Kahlert1-1/+1
2001-10-04 Martin Kahlert <martin.kahlert@infineon.com> * jni.cc (_Jv_JNI_DeleteLocalRef): Use correct frame size From-SVN: r46034
2001-09-17* jni.cc (array_from_valist): Use promoted types for va_arg.Andreas Jaeger1-14/+14
From-SVN: r45650
2001-08-20jni.cc (nathash, [...]): New globals.Tom Tromey1-21/+152
* jni.cc (nathash, nathash_count, nathash_size): New globals. (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. From-SVN: r45060
2001-08-15jni.cc: Include IdentityHashMap.h, not Hashtable.h.Tom Tromey1-7/+7
* jni.cc: Include IdentityHashMap.h, not Hashtable.h. (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. From-SVN: r44929
2001-08-02jni.cc (JNI_CreateJavaVM): Call _Jv_JNI_Init in order to initialize ↵Martin Kahlert1-0/+3
global_ref_table/local_ref_table. 2001-08-02 Martin Kahlert <martin.kahlert@infineon.com> * jni.cc (JNI_CreateJavaVM): Call _Jv_JNI_Init in order to initialize global_ref_table/local_ref_table. From-SVN: r44583
2001-06-15* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.Tom Tromey1-8/+15
From-SVN: r43415
2001-06-15jni.cc (ClassClass): Removed; updated all users.Tom Tromey1-30/+28
* jni.cc (ClassClass): Removed; updated all users. (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. From-SVN: r43409
2001-05-21Implement invocation interface; don't create new thread for main.Per Bothner1-23/+6
From-SVN: r42428
2001-05-03jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds checking.Martin Kahlert1-2/+2
2001-05-03 Martin Kahlert <martin.kahlert@infineon.com> * jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds checking. (_Jv_JNI_SetPrimitiveArrayRegion): Likewise. From-SVN: r41795
2001-04-27jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds checking.Tom Tromey1-4/+10
* jni.cc (_Jv_JNI_GetPrimitiveArrayRegion): Fixed bounds checking. (_Jv_JNI_SetPrimitiveArrayRegion): Likewise. From-SVN: r41634
2001-04-06jni.cc (wrap_value<jobject>, [...]): Removed.Tom Tromey1-11/+9
* jni.cc (wrap_value<jobject>, wrap_value<jclass>): Removed. (wrap_value<T*>): New specialization. (_Jv_JNI_PopLocalFrame): Update env->locals. From-SVN: r41157