Commit Graph

198 Commits

Author SHA1 Message Date
Bryce McKinlay 12e7d63aec natSystem.cc (init_properties): set java.lang.classpath property.
* java/lang/natSystem.cc (init_properties): set java.lang.classpath
        property.

From-SVN: r31981
2000-02-15 08:52:03 +00:00
Bryce McKinlay 1733ad7f10 natRuntime.cc (_load): Include library path with exception message.
* java/lang/natRuntime.cc (_load): Include library path with
        exception message.

From-SVN: r31979
2000-02-15 08:51:04 +00:00
Bryce McKinlay 83379befc0 natThread.cc (dumpStack): Removed.
* java/lang/natThread.cc (dumpStack): Removed.
        * java/lang/Thread.java (dumpStack): Implemented.

From-SVN: r31978
2000-02-15 08:47:16 +00:00
Tom Tromey 26c3229c0b re GNATS gcj/150 (System.loadLibrary() semantics arn't the same as in the JDK)
* java/lang/natRuntime.cc (_load): On Unix, prefix library name
	with `lib' for loadLibrary.  Fixes PR gcj/150.

From-SVN: r31976
2000-02-15 07:53:11 +00:00
Tom Tromey 304ccb1075 natFileDescriptorPosix.cc (open): Recognize EXCL flag.
* java/io/natFileDescriptorPosix.cc (open): Recognize EXCL flag.
	* java/io/FileDescriptor.java (EXCL): New static field.
	* java/io/File.java (tmpdir): New static field.
	(createTempFile): New method.
	(nextValue): New method.
	* java/lang/natSystem.cc (init_properties): Set java.io.tmpdir
	property.

From-SVN: r31922
2000-02-11 17:32:52 +00:00
Tom Tromey aaf0766e9f natNativeThread.cc: New file.
* gnu/gcj/jni/natNativeThread.cc: New file.
	* gnu/gcj/jni/NativeThread.java: New file.
	* java/lang/Thread.java (data): Now a RawData.
	* include/jvm.h (_Jv_GetCurrentJNIEnv, _Jv_SetCurrentJNIEnv):
	Declare.
	* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/Thread.h): New target.
	(ordinary_java_source_files): Added NativeThread.java.
	(nat_source_files): Added natNativeThread.cc.
	* java/lang/natThread.cc: Include <jni.h>
	(struct natThread): Added `jni_env' field.
	(_Jv_GetCurrentJNIEnv): New function.
	(_Jv_SetCurrentJNIEnv): Likewise.
	(initialize_native): Initialize jni_env.
	Include RawData.h.
	* jni.cc (ThreadGroupClass): New define.
	(_Jv_JNI_InvokeFunctions): New structure.
	(JNI_GetCreatedJavaVMs): New function.
	(the_vm): New global.
	(JNI_GetDefaultJavaVMInitArgs): New function.
	Include NativeThread.h.
	(NativeThreadClass): New define.
	(_Jv_JNI_EnsureLocalCapacity): Return JNI_ERR, not -1.
	(_Jv_JNI_DestroyJavaVM): New function.
	(_Jv_JNI_AttachCurrentThread): New function.
	(_Jv_JNI_DetachCurrentThread): New function.
	(_Jv_JNI_GetEnv): New function.
	(JNI_CreateJavaVM): New function.
	(_Jv_JNI_GetJavaVM): New function.
	(_Jv_JNIFunctions): Added entry for GetJavaVM.
	* include/jni.h (JavaVMAttachArgs): New structure.
	(JNI_EDETACHED): New define.
	(JNI_EVERSION): Likewise.
	(JavaVM): Define properly.
	(struct JNIInvokeInterface): New structure.
	(class _Jv_JavaVM): New class.
	(JNI_OnLoad, JNI_OnUnload): Declare.
	(JNI_GetDefaultJavaVMInitArgs, JNI_CreateJavaVM,
	JNI_GetCreatedJavaVMs): Declare.
	(JavaVMInitArgs): New typedef.
	(JavaVMOption): Likewise.
	(JNI_ERR): New define.
	(JNI_OK): Likewise.

From-SVN: r31901
2000-02-10 20:31:48 +00:00
Andrew Haley 715bdd8117 interpret.cc: Don't include fdlibm.h.
2000-02-10  Andrew Haley  <aph@cygnus.com>

	* interpret.cc: Don't include fdlibm.h.
	Replace #if with #ifdef throughout.
	Declare extern __ieee754_fmod.
	(continue1): Remove op_getfield, op_getstatic, op_putfield,
	op_putstatic insns.
	* resolve.cc (_Jv_PrepareClass): Use imeth as method pointer.
	Search class hierarchy for superclass vtable.

	* java/lang/natClassLoader.cc (_Jv_UnregisterClass): Don't fall
	off the end of a pointer list.

	* java/lang/natThread.cc (stop): Don't abort, throw an exception
	instead.
	(suspend): Ditto.

From-SVN: r31897
2000-02-10 17:16:30 +00:00
Tom Tromey 7e3b6e312a natRuntime.cc (_load): Call add_library.
* java/lang/natRuntime.cc (_load): Call add_library.
	(loadLibraryInternal): Likewise.

From-SVN: r31877
2000-02-10 00:17:10 +00:00
Tom Tromey 3fd64b5a09 Runtime.java (_load): Declare.
* java/lang/Runtime.java (_load): Declare.
	(load, loadLibrary): Wrote in terms of _load.
	* java/lang/natRuntime.cc (load): Call JNI_OnLoad if it appears in
	library.
	(loadLibrary): Likewise.
	Include <jni.h>.
	(_load): New method.
	(loadLibrary, load): Removed.

From-SVN: r31846
2000-02-08 00:26:58 +00:00
Tom Tromey facc279fc1 defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase pointers.
* defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase
	pointers.
	(handleMethodsEnd): Fixed error messages.  Create a _Jv_JNIMethod
	if the method is native.
	* resolve.cc (ncode): Don't handle native methods.
	(_Jv_JNIMethod::ncode): New method.
	(_Jv_PrepareClass): Handle native methods.
	* jni.cc (call): Renamed from _Jv_JNI_conversion_call.
	Include AbstractMethodError.h.
	(add_char): New function.
	(mangled_name): Likewise.
	* include/java-interp.h (class _Jv_JNIMethod): New class.
	(class _Jv_MethodBase): New class.
	(class _Jv_InterpMethod): Derive from _Jv_MethodBase.
	(_Jv_InterpClass): Changed `interpreted_methods' field to type
	`_Jv_MethodBase'.

	* include/jvm.h (_Jv_FindSymbolInExecutable): Declare.
	* java/lang/natRuntime.cc (libraries_size, libraries_count,
	libraries): New globals.
	(add_library): New function.
	(_Jv_FindSymbolInExecutable): New function.

	* java/lang/natClassLoader.cc (initiated_classes, loaded_classes):
	Now static.

From-SVN: r31790
2000-02-04 20:49:27 +00:00
Andrew Haley 43c5c8a630 Throwable.java (CPlusPlusDemangler): New class.
2000-02-04  Andrew Haley  <aph@cygnus.com>

        * java/lang/Throwable.java (CPlusPlusDemangler): New class.
        (printStackTrace): Use a CPlusPlusDemangler to demangle names.
        * java/lang/natThrowable.cc (printRawStackTrace): Rename
        printStackTrace to printRawStackTrace.

From-SVN: r31785
2000-02-04 16:59:35 +00:00
Tom Tromey 355dff4cef method.h (JvNumMethods): Moved from Class.h.
* gcj/method.h (JvNumMethods): Moved from Class.h.
	(JvGetFirstMethod): Likewise.
	* java/lang/Class.h (Object): Updated decl of
	_Jv_JNI_ToReflectedField.
	(Object): Added _Jv_JNI_ToReflectedMethod as a friend.
	* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/reflect/Field.h): Added `jboolean'
	argument of _Jv_JNI_ToReflectedField.
	(java/lang/reflect/Constructor.h): Added _Jv_JNI_ToReflectedMethod
	as a friend.
	(java/lang/reflect/Method.h): Likewise.
	* include/jni.h (class _Jv_JNIEnv): Added `klass' member.  Use
	__GCJ_JNI_IMPL__.
	(jweak): New typedef.
	(struct JNINativeInterface): Correctly declare remaining entries.
	* jni.cc: Include Class.h, ClassLoader.h.
	(_Jv_JNI_FindClass): New function.
	(_Jv_JNI_DefineClass): New function.
	(_Jv_JNI_conversion_call): New function.
	(_Jv_JNI_FindClass): Use current class loader to find class.
	(_Jv_JNI_ExceptionCheck): New function.
	(_Jv_JNI_FromReflectedField): Now static.
	(MethodClass): New define.
	(_Jv_JNI_FromReflectedMethod): New function.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	Include Method.h.
	(_Jv_JNI_IsAssignableFrom): Renamed.
	(_Jv_JNI_GetStringRegion): New function.
	Include StringIndexOutOfBoundsException.h.
	(_Jv_JNI_GetStringUTFRegion): New function.
	(_Jv_JNIFunctions): Updated for new functions.
	(_Jv_JNI_GetPrimitiveArrayCritical): New function
	(_Jv_JNI_ReleasePrimitiveArrayCritical): Likewise.
	(_Jv_JNI_GetStringCritical): New function.
	(_Jv_JNI_ReleaseStringCritical): Likewise.
	(get_throwable): Removed.
	(GCJ_JV_JNIENV_FRIEND): Removed.
	(__GCJ_JNI_IMPL__): Define.
	Include method.h.

From-SVN: r31638
2000-01-26 23:56:36 +00:00
Tom Tromey 0507a9b19f field.h (struct _Jv_Field): Use "jshort" as type for nameIndex.
* gcj/field.h (struct _Jv_Field): Use "jshort" as type for
	nameIndex.  Use "jint" as type for boffset.
	* java/lang/Class.h (struct _Jv_Method): Made accflags a
	_Jv_ushort.
	(Class): Likewise.  Also changed type of method_count,
	vtable_method_count, size_in_bytes, field_count,
	static_field_count, interface_count.
	* gcj/array.h (__JArray): Made `length' a const jsize, not an
	int.

From-SVN: r31621
2000-01-26 00:55:50 +00:00
Tom Tromey 8a9220959f natConstructor.cc (newInstance): Use _Jv_CallAnyMethodA.
* java/lang/reflect/natConstructor.cc (newInstance): Use
	_Jv_CallAnyMethodA.
	* include/jvm.h: Declare _Jv_CallAnyMethodA.
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Renamed
	from _Jv_CallNonvirtualMethodA.  Changed interface; overloaded.
	Include <jni.h>.
	(COPY): Removed.
	(invoke): Use _Jv_CallAnyMethodA.
	(VAL): Redefined.
	* java/lang/Class.h (Class): Declare JvGetFirstStaticField,
	JvNumStaticFields, JvNumMethods, and JvGetFirstMethod as friend
	functions.
	(struct _Jv_Method): Added getNextMethod method.
	(JvNumMethods): New function.
	(JvGetFirstMethod): Likewise.
	* gcj/field.h (JvGetFirstStaticField): New function.
	(JvNumStaticFields): Likewise.
	(getNextField): Renamed from getNextInstanceField.
	(struct _Jv_Field): New method getClass.
	* jni.cc: Wrote many new functions.
	* include/jni.h (JNI_TRUE): Define.
	(JNI_FALSE): Likewise.
	(jobject, jclass, jstring, jarray, jthrowable, jobjectArray,
	jbyteArray, jshortArray, jintArray, jlongArray, jbooleanArray,
	jcharArray, jfloatArray, jdoubleArray): New typedefs.
	(jfieldID, jmethodID): Likewise.
	(JNI_COMMIT, JNI_ABORT): New defines.
	(JNINativeMethod): New struct.
	(struct JNINativeInterface): Correctly declared more entries.
	(class _Jv_JNIEnv): Added `ex' member.
	(JNI_VERSION_1_1): New define.
	(JNI_VERSION_1_2): Likewise.

	* boehm.cc (_Jv_MarkObj): Use getNextField, not
	getNextInstanceField.

From-SVN: r31553
2000-01-21 23:50:31 +00:00
Tom Tromey db70b4bd91 natThrowable.cc: Don't use `#pragma implementation'.
* java/lang/natThrowable.cc: Don't use `#pragma implementation'.
	From Bryce McKinlay.

From-SVN: r31505
2000-01-19 18:59:27 +00:00
Tom Tromey 7c734b1758 * All files: Updated copyright to reflect Cygnus purchase.
From-SVN: r31504
2000-01-19 18:39:27 +00:00
Tom Tromey d269d25cd3 natThrowable.cc (fillInStackTrace): Return `this' even when backtrace can't be computed.
* java/lang/natThrowable.cc (fillInStackTrace): Return `this' even
	when backtrace can't be computed.

From-SVN: r31483
2000-01-18 06:22:13 +00:00
Tom Tromey 7af8555855 Runtime.java (loadLibraryInternal): Declare.
* java/lang/Runtime.java (loadLibraryInternal): Declare.
	* java/lang/natClassLoader.cc (_Jv_FindClass): Removed dead copy.
	(_Jv_FindClassInCache): Likewise.
	(_Jv_FindClass): Don't conditionalize body on INTERPRETER.
	(findSystemClass): Try to load class from compiled module.
	Include Runtime.h.
	* java/lang/natRuntime.cc (load): Use UTF-8 copy of filename.
	(loadLibrary): Likewise.
	(lt_preloaded_symbols): Define.
	(loadLibraryInternal): New method.
	* include/config.h.in: Rebuilt.
	* acconfig.h (USE_LTDL): Added.
	* Makefile.am (SUBDIRS): Added $(DIRLTDL).
	(INCLUDES): Added $(INCLTDL).b
	(libgcj_la_DEPENDENCIES): Added $(LIBLTDL).
	(libgcj_la_LIBADD): Likewise.
	* aclocal.m4, configure: Rebuilt.
	* configure.in: Added libltdl support.

From-SVN: r31472
2000-01-17 19:22:20 +00:00
Andrew Haley 283a159fe3 natThrowable.cc: New file.
2000-01-14  Andrew Haley  <aph@cygnus.com>

	* java/lang/natThrowable.cc: New file.

	* java/lang/Throwable.java (fillInStackTrace): Make native.
	(printStackTrace): Call native method to do this.
	(Throwable): Call fillInStackTrace.
	(stackTrace): New variable.

	* include/jvm.h: Add _Jv_ThisExecutable functions.

	* prims.cc: (_Jv_execName): New variable.
	(catch_segv): Call fillInStackTrace.
	(catch_fpe): Ditto.
	(_Jv_ThisExecutable): New functions.
	(JvRunMain): Set the name of this executable.

	* Makefile.am: Add java/lang/natThrowable.cc.
	Add name-finder.cc.
	* Makefile.in: Rebuilt.

	* acconfig.h: Add HAVE_PROC_SELF_EXE.

	* configure.in: Force link with __frame_state_for in
	FORCELIBGCCSPEC.  Add new checks for backtrace.
	* include/config.h.in: Rebuilt.

	* name-finder.cc: New file.
	* include/name-finder.h: New file.

From-SVN: r31460
2000-01-17 15:45:24 +00:00
Anthony Green 2a198bc4bf StringBuffer.java (StringBuffer): Don't special case null argument.
2000-01-16  Anthony Green  <green@cygnus.com>

	* java/lang/StringBuffer.java (StringBuffer): Don't special case
	null argument.

From-SVN: r31451
2000-01-17 00:00:43 +00:00
Tom Tromey 357100a3ef natClassLoader.cc (_Jv_FindClass): Register `loader', not system loader, as initiating loader.
* java/lang/natClassLoader.cc (_Jv_FindClass): Register `loader',
	not system loader, as initiating loader.

From-SVN: r31395
2000-01-13 18:13:31 +00:00
Tom Tromey 6baee4c5c3 natSystem.cc (getpwuid_adaptor): New adaptor for HP/UX.
* java/lang/natSystem.cc (getpwuid_adaptor): New adaptor for
	HP/UX.  From David Scott Urban.

From-SVN: r31332
2000-01-11 18:58:13 +00:00
Jeff Sturm 0cf69affdd natMath.cc (pow): Cast args to `double', not `jdouble'.
2000-01-10  Jeff Sturm  <jsturm@sigma6.com>

	* java/lang/natMath.cc (pow): Cast args to `double', not
	`jdouble'.
	(atan2): Likewise.
	(IEEEremainder): Likewise.
	* java/lang/mprec.h: Don't wrap includes in `extern "C"'.
	* java/lang/fdlibm.h: Don't wrap includes in `extern "C"'.

From-SVN: r31305
2000-01-10 20:02:47 +00:00
Anthony Green b11f64301a natString.cc (init): Test for overflow condition during out of bounds check.
2000-01-09  Anthony Green  <green@cygnus.com>

	* java/lang/natString.cc (init): Test for overflow condition
	during out of bounds check.
	(getChars): Throw StringIndexOutOfBoundsException, not
	ArrayIndexOutOfBoundsException.
	(getBytes): Ditto.
	(regionMatches): Obey case option during string comparison.

	* configure.host (ligcj_interpreter): New variable.  Enable
	interpreter by default on IA-32.
	* configure.in:  Examine libgcj_interpreter.
	* configure: Rebuilt.

From-SVN: r31300
2000-01-09 22:25:54 +00:00
Tom Tromey bd3a924b10 * java/lang/natClass.cc (getClasses): Wrote.
From-SVN: r31276
2000-01-07 20:23:01 +00:00
Tom Tromey 55ff3de705 natClass.cc (_getConstructors): Correctly check whether method name is the init name.
* java/lang/natClass.cc (_getConstructors): Correctly check
	whether method name is the init name.
	(getMethod): Look at accflags on method in `klass', not `this'.

From-SVN: r31258
2000-01-06 18:18:15 +00:00
Tom Tromey 41ecf9300e natClass.cc (getMethod): Compute offset relative to `klass's methods table, not `this's table.
* java/lang/natClass.cc (getMethod): Compute offset relative to
	`klass's methods table, not `this's table.

	* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA):
	In unwrapping/widening case, check whether `k' is null, not
	whether it is primitive.  Initialize `num' from `argelts', not
	`paramelts'.  Correct create and pass arguments to ffi_call.
	Don't let presence of `this' argument affect index used to look in
	argument arrays.
	(COPY): Set appropriate element in `values' vector.

From-SVN: r31253
2000-01-06 00:56:21 +00:00
Tom Tromey d6ab24c514 * java/lang/natClass.cc: Include <gcj/method.h>.
From-SVN: r31249
2000-01-05 22:52:54 +00:00
Tom Tromey 1258cadadc Class.h (_getMethods): Correctly declare as private, not public.
* java/lang/Class.h (_getMethods): Correctly declare as private,
	not public.

From-SVN: r31246
2000-01-05 22:29:27 +00:00
Tom Tromey 6f2b93eb2f Class.h (_getMethods): Declare.
* java/lang/Class.h (_getMethods): Declare.
	* java/lang/Class.java (_getMethods): Declare.
	* java/lang/natClass.cc (getDeclaringClass): Always return NULL.
	(getDeclaredClasses): Always return empty array.
	(_getMethods): New method.
	(getMethods): Wrote.
	(getDeclaredMethod): Return `rmethod'.
	(finit_name): New global.
	(getDeclaredMethods): Check for finit_name.
	(_getMethods): Likewise.
	(getMethod): Only return public methods.

From-SVN: r31245
2000-01-05 22:22:10 +00:00
Tom Tromey 5dab1948f6 natMethod.cc (get_ffi_type): Test size of jboolean and select correct ffi type on that basis.
* java/lang/reflect/natMethod.cc (get_ffi_type): Test size of
	jboolean and select correct ffi type on that basis.
	(_Jv_CallNonvirtualMethodA): Handle `void' return type.
	Constructor call always has `void' return type.

From-SVN: r31242
2000-01-05 17:23:34 +00:00
Tom Tromey 95c6cc0ab5 Class.h (getSignature): Updated.
* java/lang/Class.h (getSignature): Updated.
	* java/lang/Class.java (getSignature): Updated.
	* java/lang/natClass.cc (getSignature): Added `is_constructor'
	argument.
	(getConstructor): Ensure constructor is public.
	(_getConstructors): Check for public-ness of constructor when
	`declared' is false, not when it is true.

From-SVN: r31241
2000-01-05 16:35:20 +00:00
Tom Tromey 0f918fea8b [multiple changes]
2000-01-04  Tom Tromey  <tromey@cygnus.com>

	* java/lang/reflect/natConstructor.cc (newInstance): Pass
	declaring class as return_type argument to
	_Jv_CallNonvirtualMethodA.
	* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA): In
	constructor case, create object and use it as `this' argument.
	* java/lang/Class.h (_getConstructors): Declare.
	(_getFields): Declare.
	* java/lang/Class.java (getConstructors): Wrote.
	(_getConstructors): New native method.
	(getDeclaredConstructors): Wrote.
	(_getFields): Declare new native method.
	* java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Removed
	incorrect comment.
	(getMethod): Work correctly when class is primitive.
	(getDeclaredMethods): Likewise.  Compute offset using `method',
	not `mptr'.
	(getDeclaredMethod): Likewise.
	(getConstructor): Wrote.
	(ConstructorClass): New define.
	(getDeclaredConstructor): Wrote.
	(_getConstructors): New method.
	(_getFields): New method.
	(getFields): Wrote.

	* Makefile.in: Rebuilt.
	* Makefile.am (AM_CXXFLAGS): Added -D_GNU_SOURCE.

	* prims.cc: Remove `#pragma implementation'.
	* gcj/array.h: Remove `#pragma interface'.

	* prims.cc (_Jv_equaln): New function.
	* java/lang/Class.java (getSignature): Declare.
	* resolve.cc (_Jv_LookupDeclaredMethod): Moved to natClass.cc.
	* java/lang/natClass.cc (_Jv_LookupDeclaredMethod): Moved from
	resolve.cc.
	(getSignature): New method.
	(getDeclaredMethod): Wrote.
	(getMethod): Wrote.
	Include StringBuffer.h.
	* java/lang/Class.h (Class): Added _Jv_FromReflectedConstructor
	as a friend.  Unconditionally declare _Jv_LookupDeclaredMethod as
	a friend.
	(getSignature): Declare.
	* include/jvm.h (_Jv_GetTypesFromSignature): Declare.
	(_Jv_equaln): Declare.
	(_Jv_CallNonvirtualMethodA): Declare.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natConstructor.cc.
	(java/lang/reflect/Constructor.h): New target.
	* java/lang/reflect/natConstructor.cc: New file.
	* java/lang/reflect/Constructor.java (newInstance): Now native.
	(declaringClass): Renamed from decl_class.
	(offset): Renamed from index.
	(getType): New native method.
	(getModifiers): Now native.
	(getParameterTypes): Call getType if required.
	(hashCode): Include hash code from declaring class.
	(modifiers): Removed.
	(toString): Call getType if required.
	* gcj/method.h (_Jv_FromReflectedConstructor): New function.
	* java/lang/reflect/natMethod.cc (hack_call): New method.
	Removed `#if 0' around FFI code.
	Include <gnu/gcj/RawData.h>.
	(invoke): Use _Jv_CallNonvirtualMethodA.  Throw
	IllegalArgumentException when argument object and class disagree.
	(_Jv_GetTypesFromSignature): New function.
	(getType): Use it.
	(ObjectClass): New define.
	(_Jv_CallNonvirtualMethodA): New function.
	* java/lang/reflect/Method.java (hack_trampoline): New method.
	(hack_call): New native method.

1999-12-21  Per Bothner  <per@bothner.com>

	* java/lang/natClass.cc (getDeclaredMethods): Correctly compute
	offset in new Method.

From-SVN: r31199
2000-01-04 08:46:52 +00:00
Bryce McKinlay 9310f1eb4c Commit forgotten Thread.java patch.
From-SVN: r31094
1999-12-27 07:33:22 +00:00
Bryce McKinlay 43cbc9430d natObject.cc (notify): Throw message with IllegalMonitorStateException.
1999-12-22  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/natObject.cc (notify): Throw message with
        IllegalMonitorStateException.
        (notifyAll): Ditto.
        (wait): Ditto.
        * java/lang/Thread.java (isInterrupted): Don't clear interrupt_flag.
        (isInterrupted_): New function, which does clear interrupt_flag.
        (interrupt): Use `isInterrupted_'.
        * java/lang/natThread.cc (interrupt): Add comment.
        (join): Set `Prev' in joiner loop.
        Change various calls to `isInterrupted' to use `isInterrupted_'.
        * posix-threads.cc (_Jv_CondWait): Allways use pthread_cond_timedwait
        on linux. Set result to 0 on an interrupt. Test interrupted status
        of java Thread object directly.
        FLAG_INTERRUPTED: removed.
        (_Jv_ThreadStart): Throw OutOfMemoryError if pthread_create fails.
        (_Jv_ThreadInterrupt): Don't set FLAG_INTERRUPTED.
        (_Jv_InitThreads): Don't block SIGINT.
        (_Jv_ThreadWait): Don't configure SIGINT handler.

From-SVN: r31082
1999-12-24 01:00:46 +00:00
Tom Tromey bcc7684092 Modifier.java (STRICT): New constant.
* java/lang/reflect/Modifier.java (STRICT): New constant.
	(isStrict): New method.
	(toString): Added `strict'.

From-SVN: r31040
1999-12-20 23:05:21 +00:00
Tom Tromey ccfe7d0a0d re GNATS libgcj/111 (bug in reflection code)
* java/lang/reflect/Method.java (toString): Call getType if
	required.  Partial fix for PR libgcj/111.  From Per Bothner.

From-SVN: r31002
1999-12-18 00:44:00 +00:00
Tom Tromey ce63fdce90 * java/lang/natPosixProcess.cc (startProcess): Don't use sprintf.
From-SVN: r30996
1999-12-17 16:06:17 +00:00
Bryce McKinlay 5ac99d9adc Boolean.java (Boolean(String)): Set Value' to false on a null String constructor parameter.
1999-12-16  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/Boolean.java (Boolean(String)): Set Value' to false on a
        null String constructor parameter.
        * java/net/natPlainSocketImpl.cc: Remove unneccessary sprintf calls
        for exception messages.
        BooleanClass: declare.
        (setOption): Use BooleanClass instead of Class.forName() for
        instanceof test.
        (bind): Cast 4th parameter of setsockopt to char *' for
        compatibility with older Solaris headers.
        * java/net/natPlainDatagramSocketImpl.cc: Remove unneccessary
        sprintf calls for exception messages.
        BooleanClass, IntegerClass: declare.
        (setOption): Use BooleanClass and IntegerClass, not Class.forName()
        for instanceof test.

From-SVN: r30988
1999-12-17 05:11:28 +00:00
Tom Tromey 6150df627a natSystem.cc (init_properties): Don't set user.name or user.home if NO_GETUID defined.
* java/lang/natSystem.cc (init_properties): Don't set user.name or
	user.home if NO_GETUID defined.  Only set user.dir if getcwd
	exists.

	* include/config.h.in: Rebuilt.
	* acconfig.h (NO_GETUID): New define.
	* configure.in: Rebuilt.
	* configure.in: Define NO_GETUID in cross case.  Check for getcwd
	in native case.

From-SVN: r30964
1999-12-15 22:38:56 +00:00
Bryce McKinlay aa620e4294 natString.cc (equalsIgnoreCase): return false if anotherString is null.
* java/lang/natString.cc (equalsIgnoreCase): return false if
        anotherString is null.
        * java/lang/Boolean.java (valueOf): return FALSE if argument is
        null.

From-SVN: r30763
1999-12-02 19:59:30 +00:00
Tom Tromey 93d4556218 prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayElementFromElementType.
* prims.cc (_Jv_NewObjectArray): Use
	_Jv_GetArrayElementFromElementType.
	(_Jv_NewPrimArray): Likewise.
	* java/lang/natObject.cc (clone): Use
	_Jv_GetArrayElementFromElementType instead of sizeof.
	* java/lang/natSystem.cc (arraycopy): Use
	_Jv_GetArrayElementFromElementType.
	* include/jvm.h (_Jv_GetArrayElementFromElementType): New
	function.

From-SVN: r30655
1999-11-25 00:36:51 +00:00
Tom Tromey 3cf88fb4e8 sjlj jumbo patch
From-SVN: r30591
1999-11-19 19:13:42 +00:00
Tom Tromey 5b8c39e0aa natClass.cc (MCACHE_SIZE): Define as a power of 2 minus 1.
* java/lang/natClass.cc (MCACHE_SIZE): Define as a power of 2
	minus 1.
	(method_cache): Made larger.

From-SVN: r30568
1999-11-18 07:19:00 +00:00
Tom Tromey e4c4f09a1e * java/lang/natThread.cc (destroy): Removed incorrect comment.
From-SVN: r30423
1999-11-05 20:59:40 +00:00
Tom Tromey ea638d6c94 natThread.cc (stop): Removed argument name.
* java/lang/natThread.cc (stop): Removed argument name.

	* java/lang/ThreadGroup.java (ThreadGroup(int)): No longer
	`private'; now has default access.
	* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/ThreadGroup.h): Removed.

From-SVN: r30417
1999-11-05 17:10:17 +00:00
Tom Tromey 397f674e7f natClass.cc (method_cache_count): Removed.
* java/lang/natClass.cc (method_cache_count): Removed.
	(_Jv_FindMethodInCache): Don't loop looking for the hash entry.
	(_Jv_AddMethodToCache): Don't loop.

From-SVN: r30397
1999-11-04 19:47:01 +00:00
Tom Tromey 16f39e241a quick-threads.h (_Jv_ThreadCancel): Removed.
* include/quick-threads.h (_Jv_ThreadCancel): Removed.
	(_Jv_ThreadDestroy): Likewise.
	* include/no-threads.h (_Jv_ThreadCancel): Removed.
	(_Jv_ThreadDestroy): Likewise.
	* include/posix-threads.h (struct _Jv_Thread_t): Removed
	`exception' field.
	(_Jv_ThreadCancel): Removed decl.
	(_Jv_ThreadDestroy): Removed.
	* posix-threads.cc (_Jv_ThreadCancel): Removed.
	(throw_cleanup): Removed.
	(really_start): Don't push or pop cleanup.
	(_Jv_ThreadInitData): Don't initialize `exception' field.
	* java/lang/Thread.java (stop): Officially unimplemented.
	* java/lang/natThread.cc (stop): Officially unimplemented.

From-SVN: r30392
1999-11-04 16:45:11 +00:00
Tom Tromey b8c3c4f014 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/ClassLoader.h): New target.
	* java/lang/natClassLoader.cc (_Jv_FindClass): Removed reference
	to `redirect'.

	* include/java-props.h (_Jv_Compiler_Properties): Changed
	declaration.
	* gcj/array.h (JvRunMain, _Jv_RunMain): Don't declare.
	* include/jvm.h (_Jv_GCSetInitialHeapSize,
	_Jv_GCSetMaximumHeapSize): Declare.
	(JvRunMain, _Jv_RunMain): Declare.
	(_Jv_SetMaximumHeapSize, _Jv_SetInitialHeapSize): Declare.
	* nogc.cc (_Jv_GCSetInitialHeapSize): New function.
	(_Jv_GCSetMaximumHeapSize): Likewise.
	* boehm.cc (_Jv_GCSetInitialHeapSize): New function.
	(_Jv_GCSetMaximumHeapSize): Likewise.
	* prims.cc (parse_heap_size): New function.
	(_Jv_SetInitialHeapSize): Likewise.
	(_Jv_SetMaximumHeapSize): Likewise.
	(_Jv_Compiler_Properties): New global.
	* gij.cc (help): New function.
	(version): Likewise.
	(heap_size): Likewise.
	(heap_max_size): Likewise.
	(main): Parse arguments.  Set _Jv_Compiler_Properties.
	Include <config.h>, <java-props.h>.
	(_Jv_Compiler_Properties): Removed.

From-SVN: r30133
1999-10-22 19:43:41 +00:00
Tom Tromey 4b84737d47 VMClassLoader.java (getVMClassLoader): New method.
* gnu/gcj/runtime/VMClassLoader.java (getVMClassLoader): New
	method.
	(redirect): New static field.
	* java/lang/ClassLoader.java (getSystemClassLoader): Now
	native
	(getVMClassLoader0): Removed.
	* java/lang/natClassLoader.cc (getVMClassLoader0): Removed.
	(redirect): Removed.
	(getSystemClassLoader): Implemented.

From-SVN: r30075
1999-10-18 22:57:07 +00:00
Anthony Green 6c413a50e6 ClassLoader.java (getSystemResource): Use getSystemClassLoader instead of ClassLoader.system.
* java/lang/ClassLoader.java (getSystemResource): Use
        getSystemClassLoader instead of ClassLoader.system.
        (getSystemResourceAsStream): Ditto.

        * java/lang/natClassLoader.cc (redirect): Make static and
        remove #ifdef INTERPRETER so it is always defined.
        (getVMClassLoader0): Remove #ifdef INTERPRETER so it always
        returns a VMClassLoader.

        * java/util/ResourceBundle.java (trySomeGetBundle): Create a
        PropertyResourceBundle if a properties file is found before a
        ResourceBundle class.

From-SVN: r30048
1999-10-17 03:11:50 +00:00
Tom Tromey 76ed0c0a4b gij.cc (main): Formatting fixes.
* gij.cc (main): Formatting fixes.
	(_Jv_Compiler_Properties): Define.
	* java/lang/natSystem.cc (_Jv_Environment_Properties): Don't
	declare.
	(init_properties): Set properites from _Jv_Compiler_Properties.
	* include/java-props.h (_Jv_Compiler_Properties,
	_Jv_Environment_Properties): Declare.

From-SVN: r30020
1999-10-15 16:53:41 +00:00
Anthony Green ffccc6bee2 libtool-version: Catch up by incrementing current.
* libtool-version: Catch up by incrementing current.

        * configure.host: Disable use of GCJ_PROPERTIES for mips-tx39.
        * configure, include/config.h.in: Rebuilt.
        * acconfig.h (DISABLE_GETENV_PROPERTIES): Undefine.
        * configure.in: Added --disable-getenv-properties and new define
        `DISABLE_GETENV_PROPERTIES'.

        * prims.cc (PROCESS_GCJ_PROPERTIES): Define.
        (next_property_key): New function.
        (next_property_value): New function.
        (process_gcj_properties): New function.
        (JvRunMain): Call process_gcj_properties.
        (_JvRunMain): Ditto.

        * java/lang/natSystem.cc (init_properties): Set properties defined
        in GCJ_PROPERTIES.  Also add 1.2 style versioning properties.

        * include/java-props.h: New file.

        * java/lang/natSystem.cc (init_properties): Add new properties to
        conform with Java Product Versioning Specification.

From-SVN: r30007
1999-10-15 06:07:41 +00:00
Steve Chamberlain 9a480d6923 The following patches include a couple of fixes for cross toolchains,
and endian bits for the picojava port.  I am committing this (and the
rebuilt Makefile.in/configure files).

From-SVN: r29765
1999-10-02 15:44:24 +00:00
Tom Tromey f08113ce11 natFirstThread.cc (run): Renamed from `run0'.
* java/lang/natFirstThread.cc (run): Renamed from `run0'.  Removed
	dead code.
	* java/lang/FirstThread.java (run0): Renamed to `run'.
	(run): Removed.

From-SVN: r29626
1999-09-23 19:05:50 +00:00
Tom Tromey 27e934d8ba configure: Rebuilt.
* configure: Rebuilt.
	* configure.in: Build include/Makefile.
	* Makefile.in: Rebuilt.
	* Makefile.am (SUBDIRS): Added gcj and include.
	(install-data-local): New target.
	(extra_headers): New macro.
	* include/Makefile.in: New file.
	* include/Makefile.am: New file.

	* interpret.cc: Don't include gcj/field.h or gcj/cni.h.
	* java/lang/reflect/natField.cc: Don't include gcj/field.h or
	gcj/cni.h.
	* boehm.cc: Don't include java-threads.h or gcj/field.h.
	* resolve.cc: Include config.h.
	* defineclass.cc: Include config.h.
	* include/java-interp.h: Don't include config.h.
	* include/jvm.h: Include java-threads.h, Object.h, java-gc.h,
	cni.h.

	* gcj/javaprims.h: Regenerated namespace decls.
	* classes.pl (scan): Don't put `;' after closing brace.

	* Makefile.in: Rebuilt.
	* Makefile.am (INCLUDES): Added -I for top_srcdir.
	* configure.in: Create gcj/Makefile.
	* gcj/Makefile.in: New file.
	* gcj/Makefile.am: New file.
	* java/lang/Object.h: Don't include any other headers.
	* gcj/array.h: Renamed from include/java-array.h.
	* gcj/field.h: Renamed from include/java-field.h.
	* gcj/method.h: Renamed from include/java-method.h.
	* gcj/cni.h, gcj/javaprims.h: Moved from include/.
	Updated all files to reflect new include structure.

From-SVN: r29278
1999-09-10 22:03:10 +00:00
Tom Tromey 773c6f0076 natClassLoader.cc (_Jv_WaitForState): Call _Jv_PrepareCompiledClass while holding class mutex.
* java/lang/natClassLoader.cc (_Jv_WaitForState): Call
	_Jv_PrepareCompiledClass while holding class mutex.

From-SVN: r29063
1999-09-02 19:33:50 +00:00
Matt Welsh a41cb705f6 natClass.cc: Fixed notification of threads when class initialization is complete.
* java/lang/natClass.cc: Fixed notification of threads
	when class initialization is complete.

From-SVN: r29043
1999-09-02 03:46:35 +00:00
Tom Tromey e409a2c8f4 Modifier.java (ALL_FLAGS): New constant.
* java/lang/reflect/Modifier.java (ALL_FLAGS): New constant.
	* resolve.cc: Removed constants defined by
	java.lang.reflect.Modifier.
	Include <java/lang/reflect/Modifier.h>.
	(_Jv_ResolvePoolEntry): Use values from Modifier.
	(_Jv_DetermineVTableIndex): Likewise.
	(_Jv_PrepareClass): Likewise.
	(ncode): Likewise.
	* defineclass.cc (_Jv_ClassReader): Removed constants defined by
	java.lang.reflect.Modifier.
	Include <java/lang/reflect/Modifier.h>.
	(checkExtends): Use values from Modifier.
	(checkImplements): Likewise.
	(handleField): Likewise.
	(handleConstantValueAttribute): Likewise.
	(handleFieldsEnd): Likewise.
	(handleMethod ): Likewise.
	(handleMethodsEnd): Likewise.
	(handleClassBegin): Likewise.
	* interpret.cc: Removed constants defined by
	java.lang.reflect.Modifier.
	(continue1): Use values from Modifier.
	* java/lang/natClassLoader.cc: Removed constants defined by
	java.lang.reflect.Modifier.

From-SVN: r29037
1999-09-01 22:02:20 +00:00
Tom Tromey 6c2a11802a natClassLoader.cc (_Jv_NewClass): Use JV_STATE_NOTHING, not `0'.
* java/lang/natClassLoader.cc (_Jv_NewClass): Use
	JV_STATE_NOTHING, not `0'.
	* java/lang/Class.h: Replaced JV_STATE_ defines with enum.

From-SVN: r29033
1999-09-01 21:05:17 +00:00
Tom Tromey 6e87747b6d posix-threads.cc (_Jv_CondWait): Call _Jv_PthreadCheckMonitor.
* posix-threads.cc (_Jv_CondWait): Call _Jv_PthreadCheckMonitor.
	* include/posix-threads.h (_Jv_PthreadCheckMonitor): New
	function.
	(_Jv_CondNotify): Use it.
	(_Jv_CondNotifyAll): Likewise.

	* java/lang/Class.h (JV_STATE_NOTHING): Correct misspelling.

From-SVN: r29030
1999-09-01 18:29:39 +00:00
Alexandre Oliva b78639f6f2 Added missing whitespace in function calls within adaptors
Pointed out by Tom

From-SVN: r28803
1999-08-22 16:19:31 +00:00
Alexandre Oliva fb82082db3 natSystem.cc (getpwuid_adaptor): New overloaded function that detects the signature of getpwuid_r.
* java/lang/natSystem.cc (getpwuid_adaptor): New overloaded
function that detects the signature of getpwuid_r.
(init_properties): Use it.
* java/util/natDate.cc (ctime_adaptor): Likewise for ctime_r.
(toString): Use it.

From-SVN: r28790
1999-08-21 11:56:24 +00:00
Kresten Krab Thorup f7b4fb110a interpret.cc (continue1): Implement explicit dispatch table.
* interpret.cc (continue1): Implement explicit dispatch table.
	insn_target: Explicit interpreter switch table.
	SAVE_PC: New macro, moves pc saving code into instructions that
	require so.
	NEXT_INSN: New macro, replaces `goto next_insn' in all insns.
	PC_REGISTER_ASM: New macro.
	INLINE_SWITCH: New macro.  Constrols dispatching strategy.
	opcode: Remove local variable.
	{i,l,f,d}{load,store}_{0,1,2,3}: Expand definitions.
	(POKEI): Use _Jv_word.
	(iinc): Use _Jv_word.
	(dupx): Change reference argument (sp) to pointer.
	(jvdump): Remove

	* interpret.cc: Remove instruction timing instrumentation.

	* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Changed
	comment.  Don't use _Jv_ClassNameSamePackage.

	* gnu/gcj/util/path/{SearchPath,ZipFileEntry,DirectoryPathEntry,
	URLPathEntry, CacheEntry}: Removed.

	* Makefile.am (ordinary_java_source_files): Remove gnu/gcj/util/path
	package.
	(.java.lo): Rule removed.

	* Makefile.in: Rebuilt.

From-SVN: r28777
1999-08-20 11:40:35 +00:00
Tom Tromey bd30fa53ca natThread.cc (class locker): New class.
* java/lang/natThread.cc (class locker): New class.
	(join): Use a locker around _Jv_CondWait.
	(sleep): Likewise.

From-SVN: r28770
1999-08-19 22:58:27 +00:00
Tom Tromey 5a0eb8326f ThreadGroup.java: Fixed now-erroneous comment.
* java/lang/ThreadGroup.java: Fixed now-erroneous comment.
	* java/lang/natThread.cc (finish_): Call ThreadGroup.remove.

From-SVN: r28753
1999-08-18 19:51:23 +00:00
Kresten Krab Thorup eb4534a636 natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed from _Jv_InternClassStrings.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed
	from _Jv_InternClassStrings.

	* prims.cc (_Jv_RunMain): New function.
	(JvRunMain): Remove gij-support.

	* gij.cc (main): Use _Jv_RunMain.

	* java/util/zip/ZipFile.java: Call readDirectory in constructor.

	* interpret.cc (PUSHA, PUSHI, PUSHF, PUSHL, PUSHD): Don't store
	argument in temp variable.
	(continue1): For all op_x2y insns, use temp variable for
	intermediate value.  Also remove some comments.

	* java/lang/natClass.cc (newInstance): Call _Jv_InitClass.
	(forName): Don't call _Jv_InitClass.

	* java/lang/Class.java (getResource,getResourceAsStream): Implement.

	* java/util/zip/ZipEntry.java (ZipEntry(ZipEntry)): New construcor.

	* java/util/jar/JarInputStream.java: New file.

	* java/util/jar/JarEntry.java: New file.

	* java/util/jar/JarFile.java: New file.

	* java/net/URLClassLoader.java: New file.

	* java/net/JarURLConnection.java: New file.

	* gnu/gcj/protocol/jar/Handler.java: New file.

	* gnu/gcj/protocol/jar/Connection.java: New file.

	* java/security/SecureClassLoader.java: New file.

	* java/lang/ClassLoader.java (parent): New variable.
	(ClassLoader (ClassLoader)): new constructor.
	(findClass): New method.
	(loadClass): Add default 1.2 implementation.
	(getSystemResourceAsBytes, getResourceAsBytes): Removed.
	(readfully): Removed.

	* gnu/gcj/runtime/VMClassLoader.java: Moved from java/lang.
	(findSystemClass): New method.
	(VMClassLoader): Constructor rewritten.
	(init): New method.
	All other methods removed.

	* java/lang/natClassLoader.cc: Change use of java::lang::VMClassLoader
	to gnu::gcj::runtime::VMClassLoader.
	(_Jv_InternClassStrings): Use _Jv_ResolvePoolEntry.  Also handle
	class entries.
	(VMClassLoader::findSystemClass): renamed from findBootClass.

	* Makefile.am: Add new files.
	(FirstThread.h, ThreadGroup.h): Add _Jv_Main friend.

	* Makefile.in: Rebuilt.

From-SVN: r28748
1999-08-18 14:16:42 +00:00
Tom Tromey 212f5d3026 natThread.cc (sleep): Turn 0 millis and 0 nanos into 1 nano.
* java/lang/natThread.cc (sleep): Turn 0 millis and 0 nanos into 1
	nano.
	* include/quick-threads.h (_Jv_CondWait): Don't round to 0
	inappropriately.

From-SVN: r28742
1999-08-18 03:48:37 +00:00
Per Bothner efc3b511cb resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0.
1999-08-14  Per Bothner  <per@bothner.com>

	* resolve.cc (_Jv_PrepareClass): Use ClassLoader::resolveClass0.
	* java/lang/natClass.cc (initializeClass): Likewise.
	* java/lang/ClassLoader.java (resolveClass0): New static method.
	(resolveClass): Call resolveClass0.
	(findSystemClass): No longer static.

From-SVN: r28711
1999-08-14 19:49:06 +00:00
Anthony Green 7941ceabf0 [multiple changes]
Mon Aug  9 18:33:38 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

        * Makefile: Rebuilt.
	* Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native
	builds.

	* java/net/natPlainSocketImpl.cc: Include <sys/select.h> only if
	present.

	* configure: Rebuilt.
	* configure.in: Properly align --help output, fix capitalization
	and punctuation.
	* acinclude.m4: Likewise.

1999-08-09  Kresten Krab Thorup  <krab@gnu.org>

	* include/javaprims.h (_Jv_word, _Jv_word2): New types.

	* include/java-interp.h (_Jv_InterpMethodInvocation): Use _Jv_word.
	(_Jv_callInterpretedMethod): Unused. Remove.
	(_Jv_InterpMethod::run,run_normal,run_synch_object,run_synch_class):
	Use ffi_raw.
	* include/java-cpool.h (_Jv_get, _Jv_put): Remove.
	(_Jv_{store,load}{Indexes,Int,Float,Long,Double}): Use _Jv_word.
	* boehm.cc (_Jv_MarkObj): Use _Jv_word.
	* interpret.cc: use _Jv_word.
	* defineclass.cc: use_Jv_word.
	* resolve.cc: Use _Jv_word.
	(_Jv_ResolvePoolEntry): Return _Jv_word.
	* java/lang/Class.h (_Jv_Constants): Use _Jv_word for cpool.
	* java/lang/natClassLoader.cc (_Jv_InternClassStrings): Use _Jv_word.

	* interpret.cc (gnu::gcj::runtime::MethodInvocation::continue1):
	Change comment.

From-SVN: r28641
1999-08-10 05:32:23 +00:00
Anthony Green 58eb6e7cef [multiple changes]
1999-08-09  Anthony Green  <green@cygnus.com>

        * gij.cc: New file.

        * include/config.h.in: Rebuilt.
        * acconfig.h: Add INTERPRETER.

        * configure: Rebuilt.

        * Makefile.in: Rebuilt.
        * Makefile.am (libffi_files): Identify the libffi object files for
        inclusion in libgcj.
        (LIBFFIINCS): Define.

        * interpret.cc (gnu::gcj::runtime::MethodInvocation::continue1):
        Dummy definition for configurations without an interpreter.

        * java/net/natPlainSocketImpl.cc (getOption): Disamiguate call to
        java::lang::Boolean constructor.

        * include/java-interp.h: Always include java-cpool.h.

        * java/lang/natClassLoader.cc (getVMClassLoader0): Always return 0
        when INTERPRETER not defined.

        * java/lang/Class.h (finalize): Define.

        * gnu/gcj/util/path/DirectoryPathEntry.java (getURL): Catch
        IOException from File.getCanonicalPath.
        (getStream): Likewise.

        * NEWS: More news.
        * THANKS: More thanks.

1999-08-09  Kresten Krab Thorup  <krab@gnu.org>

        * resolve.cc (get_ffi_type_from_signature): Generate uint16 for
        jchar type.
        (_Jv_PrepareClass): Allow non-abstract classes to
        have abstract subclasses.
        (_Jv_ResolvePoolEntry): Revert subclass check for protected
        fields and methods.
        * interpret.cc (continue1/perform_invoke): Don't sign extend
        uint16 return val.
        (continue1/lshl,lshr): Push long, not int.
        (continue1/ulshr): Use UINT64, not long long.
        * defineclass.cc (handleFieldsEnd): Handle case when all fields
        are static.
        * java/lang/natClass.cc (forName): Add call to _Jv_InitClass.
        * java/lang/FirstThread.java (run): Add top-level exception
        handler.
        (run0): Renamed from run.

1999-08-08  Kresten Krab Thorup  <krab@gnu.org>

        * configure.in (--with-interpreter): Added.
        * include/config.h.in (INTERPRETER): Added.

        * java/lang/ClassLoader.java: File replaced.
        * java/lang/VMClassLoader.java: New file.
        * java/lang/natClassLoader.cc: New file.
        * gnu/gcj/runtime/MethodInvocation.java: New file.
        * gnu/gcj/util/path/SearchPath.java: New file.
        * gnu/gcj/util/path/PathEntry.java: New file.
        * gnu/gcj/util/path/DirectoryPathEntry.java: New file.
        * gnu/gcj/util/path/ZipPathEntry.java: New file.
        * gnu/gcj/util/path/URLPathEntry.java: New file.
        * gnu/gcj/util/path/CacheEntry.java: New file.
        * include/java-interp.h: New file.
        * include/java-cpool.h: New file.
        * include/java-insns.h: New file.
        * defineclass.cc: New file.
        * interpret.cc: New file.
        * resolve.cc: New file.

        * java/lang/natClass.cc (loaded_classes, _Jv_RegisterClass,
        _Jv_RegisterClasses, _Jv_FindClassInCache, _Jv_FindClass,
        _Jv_NewClass, _Jv_FindArrayClass): Moved to natClassLoader.cc.
        (finalize): New.
        (STATE_NOTHING, STATE_RESOLVED, STATE_IN_PROGRESS, STATE_DONE,
        STATE_ERROR): Moved to java/lang/Class.h and renamed with JV_
        prefix.
        (initializeClass): Use new JV_ prefixed names.  Also, call
        ClassLoader::resolveClass instead of _Jv_ResolveClass.

        * java/lang/Class.h (JV_STATE_PRELOADING, JV_STATE_LOADING,
        JV_STATE_LOADED, JV_STATE_COMPILED, JV_STATE_PREPARED,
        JV_STATE_LINKED): New.
        (_Jv_WaitForState, _Jv_RegisterInitiatingLoader,
        _Jv_UnregisterClass, _Jv_InternClassStrings): New friends.
        (_Jv_IsInterpretedClass, _Jv_InitField, _Jv_LookupDeclaredMethod,
        _Jv_DetermineVTableIndex, _Jv_ResolvePoolEntry, _Jv_PrepareClass,
        _Jv_ClassReader, _Jv_InterpClass, _Jv_InterpMethod,
        _Jv_InterpMethodInvocation): New friends for interpreter.
        (finalize): New.
        (CONSTANT_Class, CONSTANT_String, etc.): Moved to
        include/java-cpool.h and renamed with JV_ prefix.

        * include/jvm.h (_Jv_makeUtf8Const, _Jv_makeUtf8TypeConst): New
        decls.
        (_Jv_UnregisterClass): New decl.

        * java/lang/natClassLoader.cc (_Jv_FindArrayClass): Added
        class loader argument.
        (_Jv_FindClass): Use class loader.

        * prims.cc (_Jv_makeUtf8Const): New function.
        (_Jv_NewObjectArray): Change use of _Jv_FindArrayClass.
        (_Jv_NewPrimArray): Ditto.
        (_Jv_FindClassFromSignature): Ditto.
        * java/lang/reflect/natArray.cc (newInstance): Ditto.
        * java/lang/reflect/natMethod.cc (getType): Ditto.

        * include/java-field.h (_Jv_Field::isRef): Make robust for
        non-resolved contexts.

        * boehm.cc (_Jv_MarkObj): Mark interpreter-related fields.
        Also, don't mark class->next field.

        * java/lang/VirtualMachineError.java: Added FIXME note.

        * configure.in (INTERPSPEC): New spec.
        * libgcj.spec.in: Added INTERPSPEC.
        * Makefile.am: Added gcjh friends for java/lang/VMClassLoader and
        gnu/gcj/runtime/MethodInvocation.
        (libgcj_la_SOURCES): Added resolve.cc defineclass.cc interpret.cc.
        (ordinary_java_source_files): Added above mentioned java classes.

        * configure: Rebuilt.
        * Makefile.in: Rebuilt.

From-SVN: r28597
1999-08-08 14:06:23 +00:00
Alexandre Oliva 138607df84 natSystem.cc (arraycopy): Use bcopy if memmove is not available.
1999-07-31  Alexandre Oliva  <oliva@dcc.unicamp.br>

	* java/lang/natSystem.cc (arraycopy): Use bcopy if memmove is not
	available.  Don't cast memmove args to (void*).
	* configure.in: Do not abort if memmove is not available.

From-SVN: r28360
1999-07-31 23:41:15 +00:00
Bryce McKinlay 41296e2a23 natString.cc (substring): optimize where substring is entire String.
1999-07-22  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natString.cc (substring): optimize where substring is
	entire String.
	* java/io/File.java (getName): don't return separator with file name.
	* java/io/natFile.cc (attr): fix overflow.

From-SVN: r28246
1999-07-26 03:51:44 +01:00
Tom Tromey d4a8b6a2f3 mprec.h: Protect definition of uint32_t with #ifndef _UINT32_T.
* java/lang/mprec.h: Protect definition of uint32_t with #ifndef
	_UINT32_T.

From-SVN: r28065
1999-07-12 09:40:07 +00:00
Bryce McKinlay 659c26fc49 String.java (toString): Check for this == null and throw NullPointerException.
1999-07-01  Bryce McKinlay  <bryce@albatross.co.nz>
        * java/lang/String.java (toString): Check for this == null and throw
        NullPointerException.

From-SVN: r27895
1999-07-01 20:58:04 +01:00
Tom Tromey 2dc130a72e [multiple changes]
1999-06-24  Tom Tromey  <tromey@cygnus.com>
	* java/lang/e_asin.c: Don't use __int32_t or __uint32_t.
	* java/lang/fdlibm.h (HUGE): Conditionally define.
Fri May 28 22:20:03 1999  Anthony Green  <green@cygnus.com>
	* java/lang/fdlibm.h: Don't use __uint32_t.  Include mprec.h.
	* java/lang/e_log.c: Don't use __uint32_t.

From-SVN: r27733
1999-06-24 20:41:47 +00:00
Tom Tromey 0d16618c58 [multiple changes]
Fri May 28 22:20:03 1999  Anthony Green  <green@cygnus.com>
	* java/lang/fdlibm.h: Don't use __uint32_t.  Include mprec.h.
	* java/lang/e_log.c: Don't use __uint32_t.
1999-05-27  Eric Christopher <echristo@cygnus.com>
	* configure: Rebuilt
	* configure.in: Fixed ISO C9X and namespace collision with __uint32_t
	* acconfig.h: Rebuilt
	* include/config.h.in: Rebuilt
	* java/lang/mprec.h, java/lang/e_acos.c, java/lang/e_asin.c,
 	java/lang/e_atan2.c, java/lang/e_exp.c, java/lang/e_fmod.c,
 	e_log.c, java/lang/e_pow.c, java/lang/e_rem_pio2.c,
 	java/lang/e_remainder.c, java/lang/e_sqrt.c, java/lang/fdlibm.h,
 	k_tan.c, java/lang/mprec.h, java/lang/s_atan.c,
 	java/lang/s_ceil.c, java/lang/s_copysign.c, java/lang/s_fabs.c,
 	s_floor.c, java/lang/s_rint.c, java/lang/sf_rint.c: Fixed ISO C9X
 	and namespace collision with __uint32_t

From-SVN: r27729
1999-06-24 20:06:09 +00:00
Tom Tromey e8d49b5b5e ieeefp.h (__IEEE_LITTLE_ENDIAN): Define for alpha.
* java/lang/ieeefp.h (__IEEE_LITTLE_ENDIAN): Define for alpha.
	From Jeff Sturm.

From-SVN: r27671
1999-06-21 15:42:12 +00:00
Bryce McKinlay 1e45a14105 Runtime.java (exec): Convert prog name and arguments to string array.
* java/lang/Runtime.java (exec): Convert prog name and arguments
	to string array.
	* java/lang/natPosixProcess.cc (startProcess): Fix typo in
	environment array conversion. Preserve current environment if envp
	not passed. Preserve PATH unless explicitly specified.
	* java/io/DataInputStream.java (readLine): Fix case where '\r' is
	followed by EOF. Set a flag when a line is terminated by '\r' and
	ignore following '\n' if set.

From-SVN: r27458
1999-06-09 18:42:26 +01:00
Tom Tromey a1b7f572ce natSystem.cc (init_properties): URL now points to sourceware.
* java/lang/natSystem.cc (init_properties): URL now points to
	sourceware.

From-SVN: r26974
1999-05-17 13:24:59 +00:00
Tom Tromey 42962a480a javaprims.h: Updated namespace declarations.
* include/javaprims.h: Updated namespace declarations.
	* classes.pl (scan): Uniquify class list.
	* Makefile.in, configure: Rebuilt.
	* Makefile.am (nat_source_files): Added natConcreteProcess.cc.
	(built_java_source_files): New macro.
	(nat_headers): Added built_java_source_files.
	(javao_files): Likewise.
	(EXTRA_libgcj_la_SOURCES): Likewise.
	(libgcj.zip): Create built class files.
	($(built_java_source_files:.java=.class)): New target.
	(jv_convert_LDADD): Added -L$(here)/.libs.
	* configure.in: Create links for ConcreteProcess.java and
	natConcreteProcess.cc.
	* java/lang/Runtime.java (exec): Create a ConcreteProcess.
	* java/lang/natEcosProcess.cc: New file.
	* java/lang/EcosProcess.java: New file.
	* java/lang/PosixProcess.java: New file.
	* java/lang/natPosixProcess.cc: New file.

From-SVN: r26901
1999-05-12 11:23:44 +00:00
Tom Tromey a619dc1e20 * java/lang/natObject.cc (sync_init): Use _Jv_AllocBytesChecked.
From-SVN: r26858
1999-05-10 09:28:54 +00:00
Tom Tromey 01b02b11de acconfig.h (GCJVERSION): New undef.
* acconfig.h (GCJVERSION): New undef.
	* java/lang/natSystem.cc (init_properties): Define java.version,
	java.class.version, os.name, os.arch, os.version.
	Include <sys/utsname.h> if required.
	* configure: Rebuilt.
	* configure.in: Compute and define GCJVERSION.
	* java/lang/natSystem.cc (default_file_encoding): Now static.

From-SVN: r26830
1999-05-07 18:44:38 +00:00
Tom Tromey c59c5e9a65 * java/lang/natCharacter.cc (isLowerCase): Use a binary search.
From-SVN: r26829
1999-05-07 17:39:52 +00:00
Per Bothner 11a606ebaf natSystem.cc (DEFAULT_FILE_ENCODING): New macro.
�
	* java/lang/natSystem.cc (DEFAULT_FILE_ENCODING):  New macro.
	(default_file_encoding):  New global, initial value is above macro.
	(init_properties):  Default file.encoding to default_file_encoding.

From-SVN: r26797
1999-05-05 17:24:08 -07:00
Tom Tromey 9096b279c2 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (CLEANFILES): Don't mention $(class_files).
	(clean-local): New target
	* java/lang/natRuntime.cc: Include <ltdl.h> if required.
	(load, loadLibrary): Now native.
	(init): New method.
	* java/lang/Runtime.java (load, loadLibrary): Now native.
	(init): New native method.
	(Runtime): Use init.
	* prims.cc: Include <ltdl.h> if required.
	(JvRunMain): Call LTDL_SET_PRELOADED_SYMBOLS.

From-SVN: r26785
1999-05-05 14:19:24 +00:00
Tom Tromey a0e894a8cc StringBuffer.java (ensureCapacity): Don't resize vector when shared.
* java/lang/StringBuffer.java (ensureCapacity): Don't resize
	vector when shared.
	* java/util/Locale.java (Locale(String,String)): Implement in
	terms of 3-argument version; variant now defaults to empty
	string.
	(toString): Assume variant is not null.
	(equals): Assume all strings are not null.
	(Locale): Throw NullPointerException if any argument is null.
	* java/util/ResourceBundle.java (getBundle): Don't try the base
	name; now implicit in partialGetBundle call.
	(trySomeGetBundle): Search for parent bundles and call setParent
	as required.
	(partialGetBundle): Added `langStop' argument.  Use
	`Locale.toString' to compute bundleName.
	(resource_cache): New static field.
	(partialGetBundle): Cache the returned resource bundle.  Now
	synchronized.
	* gnu/gcj/text/LocaleData_en.java (contents): [collatorRule] Added
	missing `<'.
	* mauve-libgcj: Enable Collator and RuleBasedCollator.
	* java/text/natCollator.cc (decomposeCharacter): `base' now
	`const'.
	* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added
	CollationElementIterator, CollationKey, Collator,
	RuleBasedCollator.
	(nat_source_files): Added natCollator.cc.
	* java/text/RuleBasedCollator.java (ceiNext): No longer static.
	(compare): Pass `this' to CollationElementIterator constructor.
	(getCollationElementIterator): Likewise.
	(ceiNext): Fix off-by-one error when finding initial substring.
	(next): Correctly mask off bits when computing return value.
	Fixed return values when one string is shorter than the other.
	* java/text/CollationElementIterator.java (collator): New field.
	(CollationElementIterator): Added collator argument.
	(next): Call ceiNext on collator object.

From-SVN: r26707
1999-04-30 09:31:00 +00:00
Tom Tromey baa288f308 natString.cc (getBytes): Reverted earlier change and applied correct fix from Per Bothner.
* java/lang/natString.cc (getBytes): Reverted earlier change and
	applied correct fix from Per Bothner.

From-SVN: r26579
1999-04-21 13:50:39 +00:00
Tom Tromey 9d9cf1661d String.java: Don't throw UnsupportedEncodingException.
* java/lang/String.java: Don't throw
	UnsupportedEncodingException.

From-SVN: r26577
1999-04-21 12:12:39 +00:00
Tom Tromey 47e2610954 natString.cc (getBytes): Correctly size result buffer.
* java/lang/natString.cc (getBytes): Correctly size result
	buffer.  From Bryce McKinlay <bryce@albatross.co.nz>.

From-SVN: r26575
1999-04-21 11:49:39 +00:00
Tom Tromey 3d79e10b31 natSystem.cc (init_properties): Only declare pwd_entry once.
* java/lang/natSystem.cc (init_properties): Only declare pwd_entry
	once.  From Anthony Green.

From-SVN: r26545
1999-04-19 09:43:18 +00:00
Per Bothner a99ce7cae5 InputStreamReader.java (<init>): Set super.in correctly.
�
	* java/io/InputStreamReader.java (<init>):  Set super.in correctly.
	* java/io/OutputStreamWriter.java (<init>):  Set super.in correctly.
	(writeChars):  Don't be quite so eager to flush.
	* java/io/PrintStream.java:  Rewrite.  Now more similar to
	OutputStreamWriter, using explicit UnicodeToBytes converter.
	Also, autoflush does not need to flush so often.
	* java/lang/natString.cc (getBytes):  More efficient algorithm.
 	(init(jbyteArray,jint,jint,jstring)):  More efficient.

From-SVN: r26508
1999-04-16 11:34:58 -07:00
Andrew Haley 2b37afcb36 natDouble.java (doubleToLongBits): ensure that all NaNs are always converted to the same long value.
1999-04-14  Andrew Haley  <aph@cygnus.com>
        * java/lang/natDouble.java (doubleToLongBits): ensure that all
        NaNs are always converted to the same long value.
        * java/lang/natFloat.java (floatToIntBits): ditto, but for float
        converted to int.

From-SVN: r26439
1999-04-14 07:10:22 +00:00
Tom Tromey b81194219b natSystem.cc (arraycopy): Don't always use jbyteArray; instead switch on actual element type.
* java/lang/natSystem.cc (arraycopy): Don't always use jbyteArray;
	instead switch on actual element type.

From-SVN: r26405
1999-04-13 12:16:41 +00:00
Tom Tromey 69d5914bd0 natSystem.cc (SystemClass): New define.
* java/lang/natSystem.cc (SystemClass): New define.
	(init_properties): Synchronize.

From-SVN: r26372
1999-04-12 12:34:41 +00:00
Tom Tromey c86e69b2f9 Long.java (parseLong): Corrected overflow detection code.
* java/lang/Long.java (parseLong): Corrected overflow detection
	code.
	* java/lang/Integer.java (parseInt): Corrected overflow detection
	code.

From-SVN: r26295
1999-04-08 11:57:28 +00:00
Warren Levy 9a566c0926 natString.cc (init(jbyteArray,jint,jint,jstring)): Set count to 0 when InputStreamReader returns -1 for EOF.
* java/lang/natString.cc (init(jbyteArray,jint,jint,jstring)):
	Set count to 0 when InputStreamReader returns -1 for EOF.

From-SVN: r26273
1999-04-07 19:31:01 +00:00
Tom Tromey ee9dd3721b Initial revision
From-SVN: r26263
1999-04-07 14:42:40 +00:00