Commit Graph

509 Commits

Author SHA1 Message Date
Anthony Green aa1e467f34 re GNATS gcj/151 (strange result on Math.sin(1e50))
* configure.host (libgcj_flags): Define __NO_MATH_INLINES.
	See PR gcj/151.

From-SVN: r32337
2000-03-05 08:32:51 +00:00
Anthony Green da1ee10da1 New test code.
From-SVN: r32336
2000-03-05 07:25:14 +00:00
Anthony Green 0f9c645ea5 configure: Rebuilt.
* configure: Rebuilt.
	      * configure.in (ZLIBTESTSPEC): New macro.
	      (GCTESTSPEC): New macro.
        (LIBGCJTESTSPEC): New macro.
        * libgcj-test.spec.in: New file.

From-SVN: r32330
2000-03-04 21:50:19 +00:00
Tom Tromey b099f07de9 java-interp.h: Don't include MethodInvocation.h.
* include/java-interp.h: Don't include MethodInvocation.h.
	(class _Jv_InterpMethod): Don't make MethodInvocation a friend.
	* Makefile.in: Rebuilt.
	* Makefile.am (gnu/gcj/runtime/MethodInvocation.h): Removed.
	(ordinary_java_source_files): Don't mention
	MethodInvocation.java.
	* gnu/gcj/runtime/MethodInvocation.java: Removed.
	* interpret.cc (MethodInvocation::continue1): Removed.
	(run): Handle exceptions here.
	* java/lang/ClassLoader.java (defineClass1, defineClass2):
	Removed.
	* java/lang/natClassLoader.cc (defineClass0): Catch exceptions
	here.
	(defineClass2): Removed.

	* java/lang/reflect/Method.java (hack_trampoline, hack_call):
	Removed.
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Catch
	exceptions here.
	(hack_call): Removed.

	* java/lang/Class.h (Class): Removed hackRunInitializers,
	hackTrampoline.
	* java/lang/natClass.cc (hackRunInitializers): Removed.
	(initializeClass): Catch exceptions here.
	Include ExceptionInInitializerError.h.
	* java/lang/Class.java (hackTrampoline, hackRunInitializers):
	Removed.

	* java/lang/Object.h (Object): Don't mention hack12_6.
	* java/lang/natObject.cc (_Jv_FinalizeObject): Catch exceptions
	here.
	* java/lang/Object.java (hack12_6): Removed.

	* java/lang/natThread.cc (run_): Renamed.  Catch exceptions here.
	(start): Use run_, not run__.
	* java/lang/Thread.java (run_): Renamed from run__; old run_
	removed.

	* jni.cc (_Jv_JNI_FindClass): Handle exceptions.
	(_Jv_JNI_EnsureLocalCapacity): Likewise.
	(_Jv_JNI_DefineClass): Likewise.
	(_Jv_JNI_ThrowNew): Likewise.
	(_Jv_JNI_AllocObject): Likewise.
	(_Jv_JNI_GetAnyMethodID): Likewise.
	(_Jv_JNI_CallAnyMethodV): Likewise.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_CallAnyVoidMethodV): Likewise.
	(_Jv_JNI_CallAnyVoidMethodA): Likewise.
	(_Jv_JNI_GetAnyFieldID): Likewise.
	(_Jv_JNI_NewString): Likewise.
	(_Jv_JNI_NewStringUTF): Likewise.
	(_Jv_JNI_GetStringUTFChars): Likewise.
	(_Jv_JNI_NewObjectArray): Likewise.
	(_Jv_JNI_NewPrimitiveArray): Likewise.
	(_Jv_JNI_GetPrimitiveArrayRegion): Likewise.
	(_Jv_JNI_GetStringRegion): Likewise.
	(_Jv_JNI_GetStringUTFRegion): Likewise.
	(_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
	(_Jv_JNI_MonitorEnter): Likewise.
	(_Jv_JNI_MonitorExit): Likewise.
	(_Jv_JNI_ToReflectedField): Likewise.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	(_Jv_JNI_RegisterNatives): Likewise.
	(_Jv_JNI_AttachCurrentThread): Likewise.
	(_Jv_JNI_DestroyJavaVM): Likewise.

From-SVN: r32294
2000-03-02 20:25:20 +00:00
Tom Tromey 84d59b7c5a THANKS updates
From-SVN: r32258
2000-02-29 17:11:46 +00:00
Mo DeJong fee2681f8a ZipOutputStream.java (closeEntry): Fixed error caused by the incorrect casting of a long to an int.
2000-02-28  Mo DeJong  <mdejong@cygnus.com>

	* java/util/zip/ZipOutputStream.java(closeEntry) : Fixed
	error caused by the incorrect casting of a long to an int.

From-SVN: r32257
2000-02-29 17:08:00 +00:00
Mo DeJong f8b7a5d26b ZipOutputStream.java (write_entry): Fixed SIGSEV caused by use of the wrong instance variable.
2000-02-28  Mo DeJong  <mdejong@cygnus.com>

	* java/util/zip/ZipOutputStream.java(write_entry) : Fixed
	SIGSEV caused by use of the wrong instance variable.

From-SVN: r32256
2000-02-29 17:04:35 +00:00
Mo DeJong 73bb4fe42a static_inner.java: New file.
2000-02-28  Mo DeJong <mdejong@cygnus.com>

	* libjava.compile/static_inner.java: New file.

From-SVN: r32250
2000-02-29 04:18:35 +00:00
Tom Tromey a51c1a1a0a noclass.c: New file.
* libjava.jni/noclass.c: New file.
	* libjava.jni/noclass.out: New file.
	* libjava.jni/noclass.java: New file.

From-SVN: r32226
2000-02-27 21:42:40 +00:00
Bryce McKinlay 91da35dbf2 File.java (File(String, String)): For dirPath, treat an empty String the same as `null'.
2000-02-27  Bryce McKinlay  <bryce@albatross.co.nz>

       * java/io/File.java (File(String, String)): For dirPath, treat an
       empty String the same as `null'.

From-SVN: r32217
2000-02-27 10:43:47 +00:00
Anthony Green e1b1511329 Minor clean up and bug fix.
From-SVN: r32196
2000-02-26 21:12:54 +00:00
Tom Tromey ac52f669c5 jni.cc (_Jv_JNI_RegisterNatives): Conditionalize body on `INTERPRETER'.
* jni.cc (_Jv_JNI_RegisterNatives): Conditionalize body on
	`INTERPRETER'.

From-SVN: r32156
2000-02-25 23:49:34 +00:00
Bryce McKinlay 4ae4a3c973 re GNATS libgcj/38 (Static initializer in DecimalFormat eventually depends on itself)
2000-02-25  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/net/URLConnection.java (initializeDateFormats): New
        private method.
        (getHeaderFieldDate): Call initializeDateFormats if required.
        locale, dateFormat1, dateFormat2, dateFormat3: Don't initialize
        these.
        Fix for PR libgcj/38.

From-SVN: r32153
2000-02-25 22:38:33 +00:00
Warren Levy 12b595c7c4 BigInteger.java (ival): Made private.
* java/math/BigInteger.java(ival): Made private.
	(words): Ditto.
	(neg): Ditto.

From-SVN: r32143
2000-02-25 04:00:09 +00:00
Anthony Green 9b90451bee Forgot to commit ChangeLog
From-SVN: r32087
2000-02-21 08:21:52 +00:00
Anthony Green 06440a12a2 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Add
        gnu/gcj/io/DefaultMimeTypes.java and gnu/gcj/io/MimeTypes.java

        * scripts/MakeDefaultMimeTypes.java: New file.
        * scripts/mime.types: New file.
	* scripts/classes.pl: Moved from top level.
        * classes.pl: Moved to scripts directory.

        * java/net/URLConnection.java: Implement guessContentTypeFromName.

        * gnu/gcj/io/MimeTypes.java: New file.
        * gnu/gcj/io/DefaultMimeTypes.java: New file.

From-SVN: r32086
2000-02-21 05:54:29 +00:00
Tom Tromey 38b3a2c089 * boehm.cc (_Jv_AllocBytes): Clear returned memory.
From-SVN: r32085
2000-02-21 05:14:06 +00:00
Bryce McKinlay a0e34aaae4 ZipEntry.java (setCrc): Fix overflow.
2000-02-19  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/util/zip/ZipEntry.java (setCrc): Fix overflow.
        (setSize): ditto.

From-SVN: r32062
2000-02-19 02:54:14 +00:00
Tom Tromey 8ade47715e jvm.h (_Jv_GetJavaVM): Declare.
* include/jvm.h (_Jv_GetJavaVM): Declare.
	* include/java-interp.h (_Jv_GetFirstMethod): New function.
	(_Jv_MethodBase::get_method): New method.
	(_Jv_JNIMethod::set_function): New method.
	* jni.cc (_Jv_JNI_UnregisterNatives): New function.
	(_Jv_JNI_RegisterNatives): New function.
	(_Jv_JNIFunctions): Updated for new functions.
	(_Jv_GetJavaVM): New function.
	(_Jv_JNI_GetJavaVM): Use it.  Now static.
	(_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread
	is already a Java thread but does not have a JNIEnv yet.

	* java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload
	function.

From-SVN: r32056
2000-02-18 21:22:06 +00:00
Tom Tromey 31e890f0f3 register.java: New file.
* libjava.jni/register.java: New file.
	* libjava.jni/register.c: New file.
	* libjava.jni/register.out: New file.

From-SVN: r32055
2000-02-18 21:15:32 +00:00
Tom Tromey 8dd8ff2e98 Rotated ChangeLogs
From-SVN: r32043
2000-02-17 22:57:30 +00:00
Tom Tromey de3cb4e4c1 re GNATS gcj/152 (Installation flaw)
* gcj/field.h (_Jv_Field::getClass): Don't use JvAssert.
	Fixes PR gcj/152.

From-SVN: r32036
2000-02-17 18:34:14 +00:00
Tom Tromey 5ef57049f9 * jni.cc (_Jv_JNI_CallStaticMethodV): Added some assertions.
From-SVN: r32021
2000-02-17 00:54:34 +00:00
Tom Tromey c082d01fa9 calls.c: New file.
* libjava.jni/calls.c: New file.
	* libjava.jni/calls.out: New file.
	* libjava.jni/calls.java: New file.

From-SVN: r32020
2000-02-17 00:49:27 +00:00
Tom Tromey 1adbc4d8be jni.cc (_Jv_JNI_NewObjectV): Corrected assertion.
* jni.cc (_Jv_JNI_NewObjectV): Corrected assertion.
	(_Jv_JNI_NewObject): Likewise.
	(_Jv_JNI_NewObjectA): Likewise.
	(_Jv_JNI_CallAnyMethodV): In constructor case, pass correct value
	as "return" type to _Jv_CallAnyMethodA.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_CallAnyVoidMethodV): Likewise.

From-SVN: r32017
2000-02-16 22:42:41 +00:00
Tom Tromey 5b0d59b4e7 throwit.java: New file.
* libjava.jni/throwit.java: New file.
	* libjava.jni/throwit.c: New file.
	* libjava.jni/throwit.out: New file.

From-SVN: r32016
2000-02-16 22:39:36 +00:00
Tom Tromey d77a164002 jni.cc (_Jv_JNI_FindClass): Use ClassLoader.loadClass, not findClass.
* jni.cc (_Jv_JNI_FindClass): Use ClassLoader.loadClass, not
	findClass.

From-SVN: r32013
2000-02-16 18:42:48 +00:00
Tom Tromey 5bdd3ac1ea findclass.java: New file
* libjava.jni/findclass.java: New file
	* libjava.jni/findclass.c: New file
	* libjava.jni/findclass.out: New file

From-SVN: r32012
2000-02-16 18:41:28 +00:00
Tom Tromey 04297fe74f findclass.java: New file
* libjava.jni/findclass.java: New file
	* libjava.jni/findclass.c: New file
	* libjava.jni/findclass.out: New file

From-SVN: r32011
2000-02-16 18:35:05 +00:00
Bryce McKinlay 432ba90f48 InterfaceDispatch.java: New file.
2000-02-16  Bryce McKinlay  <bryce@albatross.co.nz>

        * libjava.lang/InterfaceDispatch.java: New file.
        * libjava.lang/InterfaceDispatch.out: New file.

From-SVN: r32001
2000-02-16 05:13:46 +00:00
Tom Tromey 73d7c68909 virtual.java: New file.
* libjava.jni/virtual.java: New file.
	* libjava.jni/virtual.c: New file.
	* libjava.jni/virtual.out: New file.
	* libjava.jni/final_method.java: New file.
	* libjava.jni/final_method.c: New file.
	* libjava.jni/final_method.out: New file.
	* libjava.jni/overload.java: New file.
	* libjava.jni/overload.c: New file.
	* libjava.jni/overload.out: New file.
	* libjava.jni/simple_int.java: New file.
	* libjava.jni/simple_int.c: New file.
	* libjava.jni/simple_int.out: New file.
	* libjava.jni/invoke.out: New file.
	* libjava.jni/invoke.c: New file.
	* libjava.jni/invoke.java: New file.

From-SVN: r31996
2000-02-16 00:19:55 +00:00
Tom Tromey d348bda453 resolve.cc (ncode): Set args_raw_size.
* resolve.cc (ncode): Set args_raw_size.  Compute jni_cif and
	jni_arg_types.
	(init_cif): Added `rtype_p' argument.
	* include/java-interp.h (class _Jv_MethodBase): Added
	args_raw_size.
	(class _Jv_InterpMethod): Removed args_raw_size.
	(class _Jv_JNIMethod): Added jni_cif and jni_arg_types fields.
	* jni.cc (call): Pass JNIEnv and (for static methods only) the
	class pointer as well as the ordinary arguments.

From-SVN: r31995
2000-02-16 00:07:34 +00:00
Tom Tromey cdd59e7bdf * jni.cc (mangled_name): Skip leading `(' in signature.
From-SVN: r31993
2000-02-15 22:59:23 +00:00
Tom Tromey abfb784400 * jni.cc (add_char): Added missing `else'.
From-SVN: r31991
2000-02-15 22:42:10 +00:00
Tom Tromey 2d759f7165 jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc fails.
* jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc
	fails.

From-SVN: r31986
2000-02-15 20:39:36 +00:00
Bryce McKinlay 6ad91f8611 Updated the NEWS
From-SVN: r31983
2000-02-15 09:35:51 +00:00
Bryce McKinlay 2e5aca8386 Updated ChangeLog
From-SVN: r31982
2000-02-15 08:53:00 +00:00
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 b5f853e62b Updated the NEWS
From-SVN: r31980
2000-02-15 08:51:29 +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 77de5d85d0 ltdl.c: If HAVE_BOEHM_GC defined, includ gc.h.
* ltdl.c: If HAVE_BOEHM_GC defined, includ gc.h.
	* Makefile.in: Rebuilt.
	* Makefile.am (INCLUDES): New macro.
	* config.h.in, configure: Rebuilt.
	* acconfig.h (HAVE_BOEHM_GC): Define.
	* configure.in: Handle --enable-java-gc.

From-SVN: r31971
2000-02-14 21:59:58 +00:00
Warren Levy 34540fe35e MPN.java (findLowestBit): Made methods public.
* gnu/gcj/math/MPN.java(findLowestBit): Made methods public.

	* java/math/BigInteger.java(BigInteger(int,int,java.util.Random):
	  New constructor.
	(min): Implemented.
	(max): Implemented.
	(modPow): Rewritten to not use the naive, slow, brute force approach.
	(isProbablePrime): Implemented.
	(testBit): Implemented.
	(flipBit): Implemented.
	(getLowestSetBit): Implemented.

From-SVN: r31966
2000-02-14 10:23:29 +00:00
Anthony Green 97ce4a51fa gcj/142
i386 and i486 should configure the same as i586 and i686.

From-SVN: r31954
2000-02-13 18:07:09 +00:00
Anthony Green 6ab17fd868 New test code.
From-SVN: r31952
2000-02-12 23:43:51 +00:00
Anthony Green addcdfec59 New test case.
From-SVN: r31951
2000-02-12 23:09:34 +00:00
Anthony Green 762016bf0a New test case.
From-SVN: r31950
2000-02-12 22:57:18 +00:00
Anthony Green d6455b5baf New test case.
From-SVN: r31949
2000-02-12 22:45:06 +00:00
Tom Tromey dd16866663 File.java (createTempFile): Use low bits from counter, not high bits.
* java/io/File.java (createTempFile): Use low bits from counter,
	not high bits.

From-SVN: r31946
2000-02-12 20:13:42 +00:00
Alexandre Petit-Bianco e35b951f52 inner_interface.out: New file.
2000-02-12  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* libjava.lang/inner_interface.out: New file.
	* libjava.lang/inner_interface.java: New file.
	* libjava.lang/final_int.out: New file.
	* libjava.lang/final_int.java: New file.
	* libjava.lang/final_static_and_friend.out: New file.
	* libjava.lang/final_static_and_friend.java: New file.

From-SVN: r31944
2000-02-12 18:34:50 +00:00
Anthony Green 95311793fe More thanks.
From-SVN: r31942
2000-02-12 03:49:13 +00:00
Tom Tromey 28ec5077d7 interpret.cc (continue1): Use STOREA, not STOREI, to implement astore instruction.
* interpret.cc (continue1): Use STOREA, not STOREI, to implement
	astore instruction.  From Hans Boehm.

From-SVN: r31939
2000-02-11 23:24:28 +00:00
Warren Levy 136b5d77fc BigInteger.java (BigInteger(String, int)): New constructor.
* java/math/BigInteger.java(BigInteger(String, int)): New constructor.
	(BigInteger(String)): New constructor.
	(not): Rewritten using version from Kawa's BitOps class.
	(valueOf): New private methods from Kawa's BitOps class.
	(swappedOp): ditto.
	(bitOp): ditto.
	(setBitOp): ditto.
	(and): Implemented.
	(or): Implemented.
	(xor): Implemented.
	(andNot): Implemented.
	(clearBit): Implemented.
	(setBit): Implemented.
	(bitCount): Implemented.
	(toByteArray): Implemented.

From-SVN: r31926
2000-02-11 19:09:03 +00:00
Tom Tromey 9d381124d8 * java/io/File.java (nextValue): Now synchronized.
From-SVN: r31925
2000-02-11 18:44:37 +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 26439cc59c jni.h (JNI_FALSE): Renamed from JNI_TRUE; oops.
* include/jni.h (JNI_FALSE): Renamed from JNI_TRUE; oops.
	(jboolean): Declare as an attributed int, not a bool.
	(_Jv_func): Declare differently for C.

From-SVN: r31907
2000-02-10 23:44:05 +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 c56c8c43b9 natIconv.cc (Input_iconv::finalize): Call iconv_close when handle is not NULL.
* gnu/gcj/convert/natIconv.cc (Input_iconv::finalize): Call
	iconv_close when handle is not NULL.  Thanks to Andrew Haley.
	(Output_iconv::finalize): Likewise.

From-SVN: r31876
2000-02-10 00:14:54 +00:00
Alexandre Petit-Bianco d53cc71518 anonarray3.out: New file.
2000-02-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* libjava.lang/anonarray3.out: New file.
	* libjava.lang/anonarray3.java: New file.

From-SVN: r31871
2000-02-09 20:49:34 +00:00
Tom Tromey d38c8dab70 * libjava.compile/inner_priv.java: New file.
From-SVN: r31868
2000-02-09 20:33:33 +00:00
Tom Tromey bad196d78e Properties.java (setProperty): New method.
* java/util/Properties.java (setProperty): New method.
	(store): New method.

From-SVN: r31855
2000-02-08 21:30:45 +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 278abd2849 jni.cc (ThrowableClass): New define.
* jni.cc (ThrowableClass): New define.
	(_Jv_JNI_Throw): Check argument.
	(_Jv_JNI_ThrowNew): Likewise.
	(wrap_value): Don't wrap object if it is NULL.
	(_Jv_JNI_DefineClass): Use wrap_value.
	(_Jv_JNI_FindClass): Likewise.
	(_Jv_JNI_GetSuperclass): Likewise.
	(_Jv_JNI_ExceptionOccurred): Likewise.
	(_Jv_JNI_AllocObject): Likewise.
	(_Jv_JNI_GetObjectClass): Likewise.
	(_Jv_JNI_NewString): Likewise.
	(_Jv_JNI_NewStringUTF): Likewise.
	(_Jv_JNI_NewObjectArray): Likewise.
	(_Jv_JNI_GetObjectArrayElement): Likewise.
	(_Jv_JNI_NewPrimitiveArray): Likewise.
	(_Jv_JNI_ToReflectedField): Likewise.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	(_Jv_JNI_AllocObject): Check argument.
	(_Jv_JNI_NewObjectV): Likewise.
	(_Jv_JNI_NewObject): Likewise.
	(_Jv_JNI_NewObjectA): Likewise.
	(_Jv_JNI_GetObjectClass): Likewise.
	(_Jv_JNI_GetField): Likewise.
	(_Jv_JNI_SetField): Likewise.

From-SVN: r31845
2000-02-08 00:23:09 +00:00
Tom Tromey 7c51d9fb95 interpret.cc (PUSHL): Don't use expression statement.
* interpret.cc (PUSHL): Don't use expression statement.
	(PUSHD): Likewise.
	(LOADL): Likewise.
	(STOREL): Likewise.

From-SVN: r31844
2000-02-08 00:17:28 +00:00
Alexandre Petit-Bianco de9127c1b7 instinit2.out: New file.
* libjava.lang/instinit2.out: New file.
	* libjava.lang/instinit2.java: New file.
	* libjava.lang/instinit.out: New file.
	* libjava.lang/instinit.java: New file.
	* libjava.lang/anonarray2.out: New file.
	* libjava.lang/anonarray2.java: New file.
	* libjava.lang/anonarray.out: New file.
	* libjava.lang/anonarray.java: New file.
	* libjava.lang/nested_with_ctor.out: New file.
	* libjava.lang/nested_with_ctor.java: New file.
	* libjava.lang/anfi.out: New file.
	* libjava.lang/anfi.java: New file.
	* libjava.lang/stub.out: New file.
	* libjava.lang/stub.java: New file.

From-SVN: r31841
2000-02-07 21:40:18 +00:00
Tom Tromey f39b788a15 jni.cc (add_char): Conditional on INTERPRETER.
* jni.cc (add_char): Conditional on INTERPRETER.
	(mangled_name): Likewise.
	(call): Likewise.
	* include/java-interp.h (class _Jv_MethodBase): Conditional on
	INTERPRETER.
	(class _Jv_JNIMethod): Likewise.

From-SVN: r31839
2000-02-07 21:17:30 +00:00
Warren Levy 4f88416976 Added credits for Per Bothner's work on MPN.java and IntNum.java (for
BigInteger).

From-SVN: r31795
2000-02-04 22:11:07 +00:00
Warren Levy 25c449becf Makefile.am: Added MPN.java and BigInteger.java.
* Makefile.am: Added MPN.java and BigInteger.java.
	* Makefile.in: Rebuilt.
	* gnu/gcj/math/MPN.java: New file.
	* java/math/BigInteger.java: New file.

From-SVN: r31794
2000-02-04 22:00:36 +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 14447d9674 Calendar.java (toString): New method.
* java/util/Calendar.java (toString): New method.
	* java/util/SimpleTimeZone.java (clone): New method.
	(toString): New method.
	* java/util/TimeZone.java (clone): New method.
	* java/text/SimpleDateFormat.java (clone): New method.
	* java/text/NumberFormat.java (clone): New method.
	(equals): New method.
	* java/text/Format.java (clone): New method.
	* java/text/DateFormatSymbols.java (DateFormatSymbols): New
	constructor.
	(clone): New method.
	* java/text/DateFormat.java (clone): New method.
	* java/text/Collator.java (clone): New method.

From-SVN: r31775
2000-02-03 18:26:51 +00:00
Tom Tromey 7d3151e1c9 PipedOutputStream.java (write(byte[], int, int)): New method.
* java/io/PipedOutputStream.java (write(byte[], int, int)): New
	method.

From-SVN: r31774
2000-02-03 17:17:26 +00:00
Tom Tromey ee6713e782 java-interp.h (_Jv_JNI_conversion_call): Declare.
* include/java-interp.h (_Jv_JNI_conversion_call): Declare.
	* resolve.cc (ncode): Use _Jv_JNI_conversion_call when
	constructing the closure if the function is native.
	* jni.cc (_Jv_JNI_conversion_call): Now returns `void'.  No longer
	a template function, #if'd out, or static.
	Include <java-interp.h>.

From-SVN: r31746
2000-02-02 01:55:03 +00:00
Tom Tromey 8928191114 * include/jni.h (class _Jv_JNIEnv): Corrected calls using `...'.
From-SVN: r31745
2000-02-02 01:47:01 +00:00
Tom Tromey 7d34aa4cff * include/jni.h (class _Jv_JNIEnv): Added all C++ inline methods.
From-SVN: r31739
2000-02-01 21:04:44 +00:00
Tom Tromey ee7f72e41f jni.cc (_Jv_JNI_PopLocalFrame): Leave loop when `n == NULL'.
* jni.cc (_Jv_JNI_PopLocalFrame): Leave loop when `n == NULL'.
	(_Jv_JNI_conversion_call): _Jv_JNI_PopLocalFrame will never leave
	`locals == NULL'.
	(wrap_value): New function.
	(_Jv_JNI_CallAnyMethodV): Use it.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_GetField): Use wrap_value; removed specialized version.
	(_Jv_JNI_GetStaticField): Likewise.

From-SVN: r31736
2000-02-01 17:36:05 +00:00
Tom Tromey 5dc489c190 jni.cc (_Jv_JNI_GetField): Specialize for jobject.
* jni.cc (_Jv_JNI_GetField): Specialize for jobject.
	(_Jv_JNI_GetStaticField): Likewise.

From-SVN: r31735
2000-02-01 16:32:21 +00:00
Tom Tromey 7e648cf954 prims.cc (_Jv_MallocUnchecked): New function.
* prims.cc (_Jv_MallocUnchecked): New function.
	(main_init): Call _Jv_JNI_Init.
	* include/jvm.h (_Jv_MallocUnchecked): Declare.
	(_Jv_JNI_Init): Declare.
	* jni.cc: Include Hashtable.h, OutOfMemoryError.h, Integer.h,
	<string.h>.
	(_Jv_JNI_NewGlobalRef): New function.
	(_Jv_JNI_DeleteGlobalRef): New function.
	(_Jv_JNI_DeleteLocalRef): New function.
	(_Jv_JNI_conversion_call): Initialize and clear local reference
	frame.
	(_Jv_JNI_NewLocalRef): New function.
	(struct _Jv_JNI_LocalFrame): New structure.
	(_Jv_JNI_PushLocalFrame): New function.
	(_Jv_JNI_EnsureLocalCapacity): New function.
	(FRAME_SIZE): New define.
	(_Jv_JNI_GetStringChars): Mark string, not characters.
	(_Jv_JNI_ReleaseStringChars): Unmark string, not characters.
	(_Jv_JNI_GetPrimitiveArrayElements): Mark array, not elements.
	(_Jv_JNI_ReleasePrimitiveArrayElements): Unmark array, not
	elements.
	(_Jv_JNI_DefineClass): Make return value a local ref.
	(_Jv_JNI_FindClass): Likewise.
	(_Jv_JNI_GetSuperclass): Likewise.
	(_Jv_JNI_ExceptionOccurred): Likewise.
	(_Jv_JNI_AllocObject): Likewise.
	(_Jv_JNI_GetObjectClass): Likewise.
	(_Jv_JNI_CallAnyMethodV): Likewise.
	(_Jv_JNI_NewString): Likewise.
	(_Jv_JNI_NewStringUTF): Likewise.
	(_Jv_JNI_NewObjectArray): Likewise.
	(_Jv_JNI_GetObjectArrayElement): Likewise.
	(_Jv_JNI_ToReflectedField): Likewise.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	(_Jv_JNIFunctions): Updated table for new functions.
	(_Jv_JNI_Init): New function.
	(mark_for_gc): Wrote.
	(unmark_for_gc): Wrote.
	* include/jni.h (struct JNINativeInterface): Removed name from
	PopLocalFrame parameter.
	(class _Jv_JNIEnv): Added `locals' field.

From-SVN: r31730
2000-02-01 06:14:26 +00:00
Anthony Green ab5cffc5e8 natIconv.cc (read): Minor fixes.
* gnu/gcj/convert/natIconv.cc (read): Minor fixes.
    (write): Ditto.

From-SVN: r31712
2000-01-31 08:56:09 +00:00
Tom Tromey 946efde181 config.h.in: Rebuilt.
* include/config.h.in: Rebuilt.
	* acconfig.h (HAVE_ICONV): Define.
	* configure: Rebuilt.
	* configure.in: Check for `iconv' function.
	* gnu/gcj/convert/BytesToUnicode.java (getDecoder): Try iconv if
	no specific encoder exists.
	* gnu/gcj/convert/UnicodeToBytes.java (getEncoder): Try iconv if
	no specific encoder exists.
	* Makefile.in: Rebuilt.
	* Makefile.am (convert_source_files): Mention Input_iconv.java and
	Output_iconv.java.
	(nat_source_files): Added natIconv.cc.
	* gnu/gcj/convert/natIconv.cc: New file.
	* gnu/gcj/convert/Input_iconv.java: New file.
	* gnu/gcj/convert/Output_iconv.java: New file.

From-SVN: r31708
2000-01-31 04:53:47 +00:00
Alexandre Petit-Bianco 33ebdd95a8 final_inner.java: New file.
* libjava.lang/final_inner.java: New file.
	* libjava.lang/final_inner.out: Likewise.

From-SVN: r31704
2000-01-30 22:08:32 +00:00
Tom Tromey d0a844f86b Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (LIBFFIINCS): Added MULTIBUILDTOP.

From-SVN: r31672
2000-01-28 20:00:21 +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 673fdf6d77 resolve.cc (get_ffi_type_from_signature): Handle case where boolean is an int.
* resolve.cc (get_ffi_type_from_signature): Handle case where
	boolean is an int.

From-SVN: r31637
2000-01-26 23:44:40 +00:00
Tom Tromey 8de7c9a0eb interpret.cc (run): Don't call println.
* interpret.cc (run): Don't call println.
	Don't include PrintStream.h.

From-SVN: r31622
2000-01-26 00: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
Anthony Green 7bee4c4c0d config.h.in: Rebuilt.
* include/config.h.in: Rebuilt.
	* acconfig.h: Add undef for __NO_MATH_INLINES.
	* configure: Rebuilt.
	* configure.in: Add test for `g++ -O2 -ffloat-store' bug.

From-SVN: r31566
2000-01-22 21:15:58 +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 24823dcf49 * libjava.compile/BlankFinal.java: New file.
From-SVN: r31552
2000-01-21 21:12:47 +00:00
Tom Tromey 0b9309b6e4 resolve.cc (StringClass): Removed.
* resolve.cc (StringClass): Removed.
	* defineclass.cc (StringClass): Removed.

From-SVN: r31539
2000-01-20 17:32:26 +00:00
Bryce McKinlay dda482c1e4 Updated NEWS file.
From-SVN: r31522
2000-01-19 23:08:05 +00:00
Alexandre Petit-Bianco 5170877a05 anon.java, [...]: New files.
2000-01-19  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* libjava.lang/anon.java, libjava.lang/anon2.java,
	libjava.lang/anon3.java, libjava.lang/anon4.java,
	libjava.lang/direct_read.java, libjava.lang/direct_write.java,
	libjava.lang/indirect.java, libjava.lang/indirect_read.java,
	libjava.lang/indirect_write.java, libjava.lang/inner1.java,
	libjava.lang/inner2.java, libjava.lang/inner3.java,
	libjava.lang/inner4.java, libjava.lang/inner_array.java,
	libjava.lang/multiple_finit.java,
	libjava.lang/private_direct_read.java,
	libjava.lang/private_direct_write.java,
	libjava.lang/private_indirect_read.java,
	libjava.lang/private_indirect_write.java,
	libjava.lang/search_outer.java, libjava.lang/tmi.java,
	libjava.lang/tp.java, libjava.lang/update_outer.java: New files.

From-SVN: r31511
2000-01-19 21:38:43 +00:00
Tom Tromey 74436afa42 * interpret.cc (PC_REGISTER_ASM): Removed.
From-SVN: r31510
2000-01-19 21:08:03 +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 ec39b14af2 * libjava.compile/inner_pub.java: New file.
From-SVN: r31503
2000-01-19 17:28:32 +00:00
Bryce McKinlay f7ccaa38a7 configure: Rebuilt.
2000-01-18  Bryce McKinlay <bryce@albatross.co.nz>

	* configure: Rebuilt.
	* configure.in: Recognize --disable-interpreter.

From-SVN: r31496
2000-01-19 05:06:03 +00:00
Andrew Haley b9f243c201 name-finder.cc (lookup): Check for dladdr function.
2000-01-18  Andrew Haley  <aph@cygnus.com>

	* name-finder.cc (lookup): Check for dladdr function.
	acconfig.h (HAVE_DLADDR): Add.
	configure.in: Check for HAVE_DLADDR
	configure: Rebuilt.
	include/config.h.in:  Rebuilt.

From-SVN: r31487
2000-01-18 14:42:14 +00:00
Andrew Haley 0447654432 prims.cc (_Jv_RunMain): Set the name of this executable.
2000-01-17  Andrew Haley  <aph@cygnus.com>

	* prims.cc (_Jv_RunMain): Set the name of this executable.

From-SVN: r31486
2000-01-18 14:37:34 +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 4f5a5d5cdb configure: Rebuilt.
* configure: Rebuilt.
	* configure.in: Fixed typo in AC_CONFIG_SUBDIRS call.

From-SVN: r31482
2000-01-18 05:33:35 +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
Tom Tromey 06f5673716 Initial revision
From-SVN: r31468
2000-01-17 19:00:44 +00:00
Tom Tromey 451f21ef2d * prims.cc (_Jv_PrimClass): Use `JV_STATE_NOTHING', not `0'.
From-SVN: r31467
2000-01-17 18:56:43 +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
Jeff Sturm 2ce7461bd0 StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).
2000-01-16  Jeff Sturm  <jsturm@sigma6.com>

	* java/io/StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).

From-SVN: r31449
2000-01-16 21:33:46 +00:00
Anthony Green ed4c3661d5 *** empty log message ***
From-SVN: r31448
2000-01-16 21:01:25 +00:00
Anthony Green 31fcb1b9a9 pr83.out: New file.
* libjava.lang/pr83.out: New file.
	* libjava.lang/pr83.java: New file.

	* libjava.lang/pr109.out: New file.
	* libjava.lang/pr109.java: New file.

From-SVN: r31446
2000-01-16 19:55:09 +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 b5fba37d0f klass.out: New file.
* libjava.lang/klass.out: New file.
	* libjava.lang/klass.java: New file.

From-SVN: r31333
2000-01-11 18:58:49 +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 be63d11f60 * mauve-libgcj: Don't disable ClassTest.
From-SVN: r31278
2000-01-07 20:42:26 +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
Warren Levy 730ecdd3c3 natPlainDatagramSocketImpl.cc (peek): Removed unnecesary comment.
* java/net/natPlainDatagramSocketImpl.cc (peek): Removed unnecesary
	comment.
	(receive): Set the sender's address in the DatagramPacket.

From-SVN: r31218
2000-01-04 22:41:58 +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
Tom Tromey f540ec2448 mauve.exp (mauve_compute_uses): Let user select specific tests to run.
* libjava.mauve/mauve.exp (mauve_compute_uses): Let user select
	specific tests to run.

From-SVN: r31183
2000-01-03 20:18:19 +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 f9f1f4a651 * mauve-libgcj: Added java.lang.reflect.Modifier.toString12.
From-SVN: r31061
1999-12-21 23:50:01 +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
Anthony Green d352598f80 Alpha Linux changes.
From-SVN: r31030
1999-12-20 05:55:34 +00:00
Anthony Green 7013e7cda9 libgcjdata.c: New file.
1999-12-19  Anthony Green  <green@cygnus.com>

        * libgcjdata.c: New file.
        * libgcj.spec.in: Use @LIBDATASTARTSPEC@ in startfile.
        * configure: Rebuilt.
        * configure.in (LIBDATASTARTSPEC): Force data with a known name
        into the program.
        * Makefile.in: Rebuilt.
        * Makefile.am: Build libgcjdata.a.

        * libgcj.spec.in: Use @FORCELIBGCCSPEC@ in startfile.
        * configure: Rebuilt.
        * configure.in (FORCELIBGCCSPEC): Force important parts of libgcc
        into every program.

From-SVN: r31027
1999-12-20 02:18:11 +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
Tom Tromey c97e511d31 re GNATS libgcj/117 (_Jv_PthreadCheckMonitor test is not portable.)
* include/posix-threads.h (_Jv_PthreadCheckMonitor): Handle case
	where no recursive mutexes exist.  Fixes PR libgcj/117.

From-SVN: r30847
1999-12-09 16:57:27 +00:00
Anthony Green d3189ab7da jvm.h: Declare many functions with __attribute__((__malloc__)).
* include/jvm.h: Declare many functions with
	__attribute__((__malloc__)).
	* gcj/javaprims.h: Ditto.

From-SVN: r30794
1999-12-06 06:33:56 +00:00
Anthony Green 38a7fbac35 Updated the thanks list.
From-SVN: r30764
1999-12-03 03:00:39 +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
Bryce McKinlay c390b4a687 ServerSocket.java (ServerSocket): Bind to any interface if bindAddr is null.
1999-12-02  Bryce McKinlay  <bryce@albatross.co.nz>

        * libjava/java/net/ServerSocket.java (ServerSocket): Bind to any
        interface if bindAddr is null.

From-SVN: r30755
1999-12-02 10:09:24 +00:00
Tom Tromey 4cb74b7695 re GNATS libgcj/98 (pthread_mutex_init in libjava/posix-threads.cc)
* posix-threads.cc (_Jv_MutexInit): Use _Jv_PthreadGetMutex to get
	mutex to initialize.  Initialize `count' if required.
	Fixes PR libgcj/98.

From-SVN: r30725
1999-11-30 18:53:15 +00:00
Per Bothner 9b811d11de exception.cc: Remove prototype declarations for malloc and free.
1999-11-27  Per Bothner  <per@bothner.com>

	* exception.cc:  Remove prototype declarations for malloc and free.
	These clash with recent versions of glibc, which specifies `throws ()'
	when __cplusplus is defined.  Instead, #include <stdlib.h>.

From-SVN: r30709
1999-11-29 19:43:55 +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
Bryce McKinlay 429d7c746f re GNATS java.net/57 (potential buffer overruns)
1999-11-23  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/net/natPlainSocketImpl.cc: Fix potential buffer overruns in
        Exception messages. PR java.net/57.
        (bind): set SO_REUSEADDR before bind.
        * java/net/natPlainDatagramSocketImpl.cc: Fix potential buffer
        overruns. PR java.net/57.

From-SVN: r30637
1999-11-23 11:40:26 +00:00
Tom Tromey 3cf88fb4e8 sjlj jumbo patch
From-SVN: r30591
1999-11-19 19:13:42 +00:00
Tom Tromey 8cb9ab4b7e * no-threads.cc (_Jv_ThreadStart): Use JvFail and not JvAssert.
From-SVN: r30569
1999-11-18 07:32:50 +00:00