Commit Graph

715 Commits

Author SHA1 Message Date
Michael Koch 0791cb20bc VMClassLoader.java: Reworked imports.
2004-01-23  Michael Koch  <konqueror@gmx.de>

	* java/lang/VMClassLoader.java: Reworked imports.

From-SVN: r76426
2004-01-23 15:29:38 +00:00
Michael Koch 834d51fe49 Class.java, [...]: Merged copyright with classpath.
2004-01-23  Michael Koch  <konqueror@gmx.de>

	* java/lang/Class.java,
	java/lang/Object.java,
	java/lang/Thread.java: Merged copyright with classpath.

From-SVN: r76409
2004-01-23 11:56:48 +00:00
Tom Tromey b54a271561 natClassLoader.cc: Moved VMClassLoader methods...
* java/lang/natClassLoader.cc: Moved VMClassLoader methods...
	* java/lang/natVMClassLoader.cc: ...here.  New file.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natVMClassLoader.cc.

From-SVN: r76003
2004-01-16 23:54:22 +00:00
Andrew Haley d55d97f163 natClassLoader.cc (_Jv_PrepareCompiledClass): Resolve a Utf8Const field before looking at its class.
2004-01-09  Andrew Haley  <aph@redhat.com>

	* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Resolve
	a Utf8Const field before looking at its class.

From-SVN: r75591
2004-01-09 17:10:43 +00:00
Michael Koch 40f8ee2d8d Array.java: Merged documentation with classpath.
2004-01-07  Michael Koch  <konqueror@gmx.de>

	* java/lang/reflect/Array.java: Merged documentation with classpath.

From-SVN: r75512
2004-01-07 18:46:18 +00:00
Michael Koch 907cdc7fad 2004-01-06 Michael Koch <konqueror@gmx.de>
* java/lang/Package.java
	(getPackage): Get the current class loader directly.
	* java/lang/SecurityManager.java
	(currentLoadedClass): Dont iterate over class contexts.
	(classLoaderDepth): Don't check class loaders if everything is allowed.

From-SVN: r75465
2004-01-06 08:34:58 +00:00
Michael Koch 9e129d901c re PR libgcj/13056 (import new libltdl)
2003-12-16  Michael Koch  <konqueror@gmx.de>

	Fix for PR libgcj/13056.
	* libltdl/configure.in,
	libltdl/config.h.in: Removed.
	* libltdl/configure.ac,
	libltdl/config-h.in,
	libltdl/install-sh,
	libltdl/config.guess,
	libltdl/config.sub,
	libltdl/missing,
	libltdl/mkinstalldirs,
	libltdl/ltmain.sh: New files.
	* libltdl/Makefile.am,
	libltdl/acinclude.m4,
	libltdl/aclocal.m4,
	libltdl/ltdl.c,
	libltdl/ltdl.h,
	libltdl/README: Update to versions from libtool 1.5.
	libltdl/configure,
	* libltdl/Makefile.in: Regenerated.
	* java/lang/natRuntime.cc (find_symbol):
	Use type 'lt_ptr' instead of 'lt_ptr_t'.

From-SVN: r74711
2003-12-16 21:48:25 +00:00
Michael Koch b7e0ff4538 Class.h (hack_signers): Renamed signers to hack_signers.
2003-12-03  Michael Koch  <konqueror@gmx.de>

	* java/lang/Class.h (hack_signers): Renamed signers to hack_signers.
	* java/lang/natClass.cc (getSigners): Likewise.
	(setSigners): Likewise.

From-SVN: r74247
2003-12-03 21:26:59 +00:00
Mohan Embar 83c02e38a3 configure.in: Added new MinGW-specific configure flag --with-win32-nlsapi.
* configure.in: Added new MinGW-specific configure flag
	--with-win32-nlsapi.
	Added new AC_DEFINE MINGW_LIBGCJ_UNICODE.
	Add -lunicows to MinGW SYSTEMSPEC if --with-win32-nlsapi
	is set to unicows.
	* configure: Rebuilt.
	* include/config.h.in: Rebuilt.
	* win32.cc (_Jv_Win32NewString): Implemented.
	(nativeToUnicode): New helper function defined only for
	non-UNICODE builds.
	(unicodeToNative): Likewise.
	(_Jv_Win32TempString): Implemented.
	(lots): Refactored using tchar.h macros.
	(WSAEventWrapper): Use _Jv_Win32NewString.
	(_Jv_platform_initialize): Use GetModuleFileNameA instead
	of GetModuleFileName.
	(_Jv_platform_initProperties): Use _Jv_Win32NewString.
	Use temporary stack buffer instead of a heap buffer.
	* include/win32.h
	Added defines for UNICODE and _UNICODE if MINGW_LIBGCJ_UNICODE is
	defined; added tchar.h include.
	(_Jv_Win32TempString): Declared new helper class.
	(JV_TEMP_STRING_WIN32): New helper macro.
	(_Jv_Win32NewString): Declared new helper method.
	* java/io/natFileDescriptorWin32.cc (open): Use
	JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
	(write): Reformatted slightly.
	* java/io/natFileWin32.cc (lots): Use tchar.h macros;
	use JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
	(getCanonicalPath): Use _Jv_Win32NewString instead of
	JvNewStringUTF.
	(performList): Likewise.
	* java/lang/natWin32Process.cc (ChildProcessPipe):
	Use tchar.h macros.
	(startProcess): Use tchar.h macros, JV_TEMP_STRING_WIN32,
	and UNICODE environment flag for CreateProcess.
	* java/net/natNetworkInterfaceWin32.cc
	(winsock2GetRealNetworkInterfaces): Use tchar.h macros and
	_Jv_Win32NewString.

From-SVN: r74201
2003-12-02 22:26:50 +00:00
Tom Tromey f627fd15aa natDouble.cc (parseDouble): Reverted patch of 2003-11-13.
* java/lang/natDouble.cc (parseDouble): Reverted patch of
	2003-11-13.

From-SVN: r73956
2003-11-26 18:02:34 +00:00
Mark Wielaard 4716418ffe * java/lang/Float.java (static): Removed.
From-SVN: r73805
2003-11-21 13:24:28 +00:00
Tom Tromey b86ca9a2dc jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to JvGetStringUTFRegion.
* jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to
	JvGetStringUTFRegion.
	* java/lang/natPosixProcess.cc (new_string): Pass length of string
	to JvGetStringUTFRegion.
	* java/lang/natDouble.cc (parseDouble): Pass length of string to
	JvGetStringUTFRegion.
	* java/lang/natWin32Process.cc (startProcess): Pass length of
	string to JvGetStringUTFRegion.
	* java/lang/natClass.cc (forName): Pass length of string to
	JvGetStringUTFRegion.
	* gnu/gcj/runtime/natNameFinder.cc (getExternalLabel): Pass length
	of string to JvGetStringUTFRegion.
	* gnu/gcj/convert/natIconv.cc (init): Pass length of string to
	JvGetStringUTFRegion.
	* gnu/awt/gtk/natGtkLabelPeer.cc (setText): Pass length of string
	to JvGetStringUTFRegion.
	* gnu/awt/gtk/natGtkButtonPeer.cc (setLabel): Pass length of
	string to JvGetStringUTFRegion.

From-SVN: r73571
2003-11-14 01:48:30 +00:00
Mohan Embar cafa50327c re PR libgcj/12231 ([win32] Console applications spawned via Runtime.exec( ) in a GUI application flash console window)
PR libgcj/12231
	* java/lang/Win32Process.java (hasExited) Changed from
	public to private.
	(startProcess): Likewise.
	(cleanup): Likewise.
	* java/lang/natWin32Process.cc (cleanup) Don't close
	input, output and error streams.
	(ChildProcessPipe): New helper class.
	(startProcess): Refactored to use ChildProcessPipe.
	Use CREATE_NO_WINDOW when launching child process.

From-SVN: r73326
2003-11-07 03:16:49 +00:00
Bryce McKinlay 99f8b2501d natClass.cc (newInstance): Throw InstantiationException if class has no null-argument constructor.
* java/lang/natClass.cc (newInstance): Throw InstantiationException
        if class has no null-argument constructor.

From-SVN: r73244
2003-11-04 05:27:10 +00:00
Bryce McKinlay f56228e73f natMethod.cc (_Jv_CallAnyMethodA): Don't use vtable dispatch for final methods.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Don't use
	vtable dispatch for final methods.

From-SVN: r73101
2003-10-30 21:09:45 +00:00
Bryce McKinlay 6ac8b2b187 natClass.cc (_Jv_LayoutVTableMethods): Always assign a vtable slot for final methods.
* java/lang/natClass.cc (_Jv_LayoutVTableMethods): Always assign a
	vtable slot for final methods. Add FIXME comment.

From-SVN: r73023
2003-10-28 22:45:57 +00:00
Bryce McKinlay e0f23fcd49 AccessibleObject.java (secureSetAccessible): Don't check for AccessibleObject.
* java/lang/reflect/AccessibleObject.java (secureSetAccessible):
	Don't check for AccessibleObject. Update javadocs.

From-SVN: r72943
2003-10-26 02:28:45 +00:00
Bryce McKinlay b9b5672b49 Constructor.java (toString): Avoid extra whitespace on constructor with no modifiers.
2003-10-26  Bryce McKinlay  <bryce@mckinlay.net.nz>

	* java/lang/reflect/Constructor.java (toString): Avoid extra
	whitespace on constructor with no modifiers.
	* java/lang/reflect/natConstructor.java (newInstance): Look up
	caller and perform accessibility check only if constructor is
	non-public and accessible flag is not set.

2003-10-26  Bryce McKinlay  <bryce@mckinlay.net.nz>

	* jni.cc (_Jv_JNI_CallAnyMethodV, _Jv_JNI_CallAnyMethodA,
	_Jv_JNI_CallAnyVoidMethodV, _Jv_JNI_CallAnyVoidMethodA): Don't
	use _Jv_LookupDeclaredMethod(). Call _Jv_CallAnyMethodA with
	is_virtual_call argument.
	* include/jvm.h (_Jv_isVirtualMethod): Moved and renamed from
	natClass.cc.
	* java/lang/natClass.cc (_Jv_LayoutVTableMethods): Use
	_Jv_isVirtualMethod.
	* java/lang/reflect/natMethod.cc (invoke): Don't use
	_Jv_LookupDeclaredMethod.
	(_Jv_CallAnyMethodA): New is_virtual_call argument. If specified,
	look up method in target object's vtable.

From-SVN: r72942
2003-10-26 02:25:42 +00:00
Bryce McKinlay 8822f4aaf9 Method.java (toString): Avoid extra whitespace on method with no modifiers.
* java/lang/reflect/Method.java (toString): Avoid extra whitespace
	on method with no modifiers.

From-SVN: r72919
2003-10-25 07:55:21 +01:00
Bryce McKinlay a10fd35601 re PR libgcj/11780 (Method.invoke() is slow)
PR libgcj/11780:
	* java/lang/reflect/natMethod.cc (invoke): Look up caller and
	perform accessibility check only if target is non-public and
	accessible flag is not set.
	* java/lang/reflect/natField.cc (getAddr): Likewise.

From-SVN: r72918
2003-10-25 07:49:20 +01:00
Anthony Green fe8738988d Obvious fix for systems with no interpreter.
From-SVN: r72903
2003-10-24 18:27:29 +00:00
Andrew Haley 904715853c lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
2003-10-22  Andrew Haley  <aph@redhat.com>

        * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
        (java_get_callee_fndecl): New.

        * jcf-parse.c (java_parse_file): Call emit_catch_table().

        * java-tree.h (ctable_decl): New.
        (catch_classes):  New.
        (java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.

        * decl.c (java_init_decl_processing): Add catch_class_type.
        Add ctable_decl.
        Add catch_classes field.

        * class.c (build_indirect_class_ref): Break out from
        build_class_ref.
        (make_field_value): Check flag_indirect_dispatch.
        (make_class_data): Ditto.
        Tidy uses of PUSH_FIELD_VALUE.
        Add field catch_classes.
        (make_catch_class_record): New.

        * java-tree.h (PUSH_FIELD_VALUE): Tidy.

2003-10-22  Andrew Haley  <aph@redhat.com>

        * java/lang/natClass.cc (initializeClass): Call
        _Jv_linkExceptionClassTable.
        (_Jv_LinkSymbolTable): Call )_Jv_ThrowNoSuchMethodError.  Call
        _Jv_Defer_Resolution on a method whose ncode is NULL.
        (_Jv_linkExceptionClassTable): New function.
        (_Jv_LayoutVTableMethods): If superclass looks like a constant pool
        entry, look it up.
        * java/lang/Class.h (struct _Jv_CatchClass): New.
        (_Jv_linkExceptionClassTable): New friend.
        (_Jv_Defer_Resolution): New friend.
        (class Class.catch_classes): New field.
        * include/java-interp.h (Jv_Defer_Resolution): New method.
        (_Jv_PrepareClass): Make a friend of _Jv_MethodBase.
        (_Jv_MethodBase.deferred): New field.
        (_Jv_Defer_Resolution): New function.
        * resolve.cc (_Jv_PrepareClass): Resolve deferred handlers.
        * exception.cc (get_ttype_entry): Change return type to void**.
        (PERSONALITY_FUNCTION): Remove all code related to using a
        Utf8Const* for a match type.  Change match type to be a pointer to
        a pointer, rather than a pointer to a Class.
        * defineclass.cc (handleCodeAttribute): Initialize
        method->deferred.
        (handleMethodsEnd): Likewise.

From-SVN: r72886
2003-10-24 09:29:43 +00:00
Rainer Orth 59407b8361 natObject.cc (_Jv_ObjectCheckMonitor): Use _Jv_MutexCheckMonitor instead of accessing mutex.owner directly.
* java/lang/natObject.cc (_Jv_ObjectCheckMonitor): Use
	_Jv_MutexCheckMonitor instead of accessing mutex.owner directly.

From-SVN: r72872
2003-10-23 21:48:36 +00:00
Tom Tromey eab09cdf1a re PR libgcj/12416 (java.lang.Class.getFields returns duplicate entries.)
PR libgcj/12416:
	* java/lang/Class.h: Updated.
	* java/lang/natClass.cc (_getFields): Removed.
	(getFields): Likewise.
	(getDeclaredFields): Added `public_only' parameter.
	* java/lang/Class.java (getFields): Now implemented in java; from
	Classpath.
	(getDeclaredFields): Likewise.
	(getDeclaredFields(boolean)): Declare.
	(_getFields): Removed.
	(internalGetFields): New method, from Classpath.

From-SVN: r72818
2003-10-22 19:29:27 +00:00
Jerry Quinn 16a10fb6fc posix-threads.cc (_Jv_CondNotify,_Jv_CondNotifyAll): Rename _Jv_PthreadCheckMonitor to _Jv_MutexCheckMonitor.
2003-10-21  Jerry Quinn  <jlquinn@optonline.net>

        * posix-threads.cc (_Jv_CondNotify,_Jv_CondNotifyAll): Rename
        _Jv_PthreadCheckMonitor to _Jv_MutexCheckMonitor.
	* include/no-threads.h (_Jv_MutexCheckMonitor): New.
	* include/posix-threads.h (_Jv_MutexCheckMonitor): Rename from
        _Jv_PthreadCheckMonitor.  Simplify code.
	(_Jv_MutexUnlock): Use _Jv_MutexCheckMonitor.
	* include/win32-threads.h (_Jv_MutexCheckMonitor): New.
	* java/lang/Object.h (_Jv_ObjectCheckMonitor): Declare.
	* java/lang/Thread.java (holdsLock): New.
	* java/lang/natObject.cc (_Jv_ObjectCheckMonitor): New, with and
        without JV_HASH_SYNCHRONIZATION.
	* java/lang/natThread.cc (java::lang::Thread::holdsLock): New.

From-SVN: r72741
2003-10-21 04:46:19 +00:00
Ralph Loader 35e1369c77 StringBuffer.java (getChars): Fix array index checks.
* java/lang/StringBuffer.java (getChars): Fix array index checks.
	(append, substring, insert): Likewise.
	* testsuite/libjava.lang/StringBuffer_overflow.java: New file.
	* testsuite/libjava.lang/StringBuffer_overflow.out: New file.

From-SVN: r72579
2003-10-16 21:35:42 +00:00
Ralph Loader 2488a51e82 natString.cc (getChars): Fix validation of array indexes.
* java/lang/natString.cc (getChars):
	Fix validation of array indexes.
	(getBytes, regionMatches, startsWith, valueOf): Likewise.
	* testsuite/libjava.lang/String_overflow.java: New file.
	* testsuite/libjava.lang/String_overflow.out: New file.

From-SVN: r72578
2003-10-16 21:28:23 +00:00
Tom Tromey b71d486c40 natClassLoader.cc (_Jv_InitNewClassFields): Removed.
* java/lang/natClassLoader.cc (_Jv_InitNewClassFields): Removed.
	(defineClass): Updated.
	(_Jv_NewClass): Likewise.
	* prims.cc (_Jv_InitPrimClass): Don't call
	_Jv_InitNewClassFields.

From-SVN: r72444
2003-10-13 22:08:51 +00:00
Tom Tromey b379e7b0e9 ClassLoader.java (setSigners): Implemented.
* java/lang/ClassLoader.java (setSigners): Implemented.
	* boehm.cc (_Jv_MarkObj): Mark `signers' field.
	* java/lang/natClassLoader.cc (_Jv_InitNewClassFields):
	Initialize new fields.
	* java/lang/Class.java (getSigners): Now native.
	(setSigners): Declare.
	* java/lang/natClass.cc (getSigners): New method.
	(getSigners): Likewise.
	* java/lang/Class.h (Class::signers): New field.
	(Class::setSigners): New method.

From-SVN: r72271
2003-10-09 16:24:55 +00:00
Tom Tromey d791274435 StrictMath.java (toDegrees): Multiply before dividing.
* java/lang/StrictMath.java (toDegrees): Multiply before
	dividing.
	(toRadians): Likewise.

2003-10-08  C. Brian Jones  <cbj@gnu.org>

	* java/lang/Math.java
	(toRadians): multiply before dividing to reduce decimal error
	(toDegrees): ditto

From-SVN: r72238
2003-10-08 19:00:21 +00:00
Tom Tromey d801e245eb VMClassLoader.java (loadClass): Now native.
* java/lang/VMClassLoader.java (loadClass): Now native.
	* java/lang/natClassLoader.cc (loadClass): Implement.
	* prims.cc (_Jv_RunMain): Initialize ClassLoader.

From-SVN: r72038
2003-10-02 15:34:28 +00:00
Andrew Haley 9dfc2ec225 jcf-parse.c (java_parse_file): Write otable and atable.
2003-10-01  Andrew Haley  <aph@redhat.com>

        * jcf-parse.c (java_parse_file): Write otable and atable.
        * java-tree.h (atable_methods): New.
        (atable_decl): New.
        (atable_syms_decl): New.
        (enum java_tree_index): Add JTI_ATABLE_METHODS, JTI_ATABLE_DECL,
        JTI_ATABLE_SYMS_DECL.  Rename JTI_METHOD_SYMBOL* to JTI_SYMBOL*.
        (symbol_*type): Rename method_symbol* to symbol*type.
        (emit_offset_symbol_table): Delete.
        (emit_symbol_table): New.
        (get_symbol_table_index): New.
        (atable_type): New.
        * expr.c (build_field_ref): Handle flag_indirect_dispatch.
        (build_known_method_ref): Likewise.
        (get_symbol_table_index): Rename from get_offset_table_index.
        Parameterize to allow re-use by differing types of symbol table.
        (build_invokevirtual): Pass table to get_offset_table_index.
        * decl.c (java_init_decl_processing): Push types and decls for
        atable and atable_syyms.
        * class.c (build_static_field_ref): Handle flag_indirect_dispatch.
        (make_class_data): Add new fields atable and atable_syms.
        (emit_symbol_table): Rename from emit_offset_symbol_table.
        Parameterize to allow re-use by different types of symbol table.
        (build_symbol_entry): Renamed from build_method_symbols_entry.

2003-10-01  Andrew Haley  <aph@redhat.com>

        * java/lang/natClass.cc (initializeClass): Check for otable and
        atable.
        (_Jv_LinkOffsetTable): Check for existence of atable.  Rewrite
        loops using for().  Search superinterfaces.  Check for fields as
        well as methods.  Initialize atable as well as otable: check for
        static methods as well as virtual methods.
        * java/lang/Class.h (struct _Jv_AddressTable): New.
        (atable): New.
        (atable_syms): New.
        * include/jvm.h (_Jv_equalUtf8Consts): constify.
        * prims.cc (_Jv_equalUtf8Consts): constify.

From-SVN: r71979
2003-10-01 16:22:13 +00:00
Tom Tromey 2cd5614273 re PR libgcj/10596 (Reference and String.intern don't work together)
PR libgcj/10596:
	* include/jvm.h (_Jv_FinalizeString,
	_Jv_RegisterStringFinalizer): Declare.
	* java/lang/natString.cc (_Jv_FinalizeString): Renamed from
	unintern.
	(intern): Updated.
	(_Jv_NewStringUtf8Const): Likewise.
	* java/lang/ref/natReference.cc (finalize_referred_to_object):
	Add special case when finalizing a String.
	(in_hash): New function.
	(_Jv_RegisterStringFinalizer): Likewise.
	(maybe_add_finalize): Likewise.

From-SVN: r71915
2003-09-29 21:13:55 +00:00
Michael Koch 73a1415eb4 2003-09-25 Michael Koch <konqueror@gmx.de>
* java/lang/reflect/Proxy.java
	(getProxyClass): Remove workaround for gcj 3.0.x.

From-SVN: r71796
2003-09-25 20:46:14 +00:00
Tom Tromey b9f42bb060 Proxy.java (generate): Uncomment protection domain code.
* java/lang/reflect/Proxy.java (generate): Uncomment protection
	domain code.
	* java/lang/natClassLoader.cc (defineClass): Added `loader'
	argument.
	(linkClass0): Now in VMClassLoader.
	(markClassErrorState0): Likewise.
	(getSystemClassLoaderInternal): New method.
	* java/lang/natClass.cc (initializeClass): Use
	VMClassLoader::resolveClass.
	* java/lang/ClassLoader.java: New version, from Classpath.
	* java/lang/Class.java (getProtectionDomain):
	protectionDomainPermission and unknownProtectionDomain now in
	VMClassLoader.
	* java/lang/Class.h: VMClassLoader now a friend class.
	* gnu/gcj/runtime/VMClassLoader.java (instance): Now
	package-private.
	* gcj/javaprims.h: Regenerated class list.
	* resolve.cc (_Jv_PrepareClass): Use VMClassLoader::resolveClass.
	* java/lang/VMClassLoader.java: New version from Classpath;
	modified for libgcj use.

From-SVN: r71765
2003-09-25 07:46:19 +00:00
Bryce McKinlay afa1ee5e6f StringBuffer.java (substring): Don't set `shared' on small Strings, even if buffer is already shared.
* java/lang/StringBuffer.java (substring): Don't set `shared' on
	small Strings, even if buffer is already shared.

From-SVN: r71726
2003-09-24 07:19:24 +01:00
Nathanael Nerode d0010eed54 * java/lang/System.java: Add GCJ LOCAL note about encoding aliases.
From-SVN: r71710
2003-09-24 01:56:56 +00:00
Nathanael Nerode da64f72ecd Float.java, [...]: Add GCJ LOCAL markers.
* java/lang/Float.java, java/lang/Double.java: Add GCJ LOCAL
	markers.

From-SVN: r71699
2003-09-23 21:42:40 +00:00
Ralph Loader 88962108fc re PR libgcj/12350 (StringBuffer.substring handles shared flag incorrected.)
2003-09-21  Ralph Loader  <suckfish@ihug.co.nz>

        PR java/12350:
        * java/lang/StringBuffer.java (substring): Fix handling of shared
        flag.

2003-09-21  Ralph Loader  <suckfish@ihug.co.nz>

        PR java/12350
        * libjava.lang/PR12350.java: New file.
        * libjava.lang/PR12350.out: New file.

From-SVN: r71651
2003-09-22 09:17:49 +01:00
David Daney 2f54a73fc1 Reference.java (clear): Set referent to null and synchronize.
2003-09-19  David Daney <ddaney@avtrex.com>

	* java/lang/ref/Reference.java (clear): Set referent to null and
	synchronize.

From-SVN: r71597
2003-09-20 02:57:07 +00:00
Mohan Embar b90e0e3cdb win32-threads.cc: (ensure_interrupt_event_initialized) New function for lazy initialization of an...
* win32-threads.cc: (ensure_interrupt_event_initialized) New
	function for lazy initialization of an auto-reset event.
	(_Jv_CondWait) Added thread interrupt support.
	(_Jv_ThreadInitData) Added initialization of interrupt support
	members.
	(_Jv_ThreadDestroyData) Added cleanup of interrupt support members.
	(_Jv_ThreadStart) Removed unused code.
	(_Jv_Win32GetInterruptEvent) New method for returning interrupt event
	to an external caller.
	(_Jv_ThreadInterrupt) Implemented.
	* include/win32-threads.h: (_Jv_Thread_t) Added a Win32 auto-reset
	event for interrupt support as well as a mutex which regulates
	access to this.
	(_Jv_Win32GetInterruptEvent) Declared new method for returning interrupt
	event to an external caller.
	* java/lang/natWin32Process.cc: (cleanup) Close handle to spawned
	process.
	(waitFor) Added interrupt support.

From-SVN: r71562
2003-09-19 08:28:43 +00:00
Mohan Embar 5c14415811 win32.cc: fixed tab...
* win32.cc: fixed tab, indentation and whitespace
	inconsistencies
	removed jvm.h include
	added includes java/lang/UnsupportedOperationException.h,
	java/io/IOException.h, java/net/SocketException.h
	(WSAEventWrapper): class implementation
	(_Jv_WinStrError): implemented both overloads
	(_Jv_ThrowIOException): implemented both overloads
	(_Jv_ThrowSocketException): implemented both overloads
	(_Jv_select): implemented
	* include/win32.h: fixed tab, indentation and whitespace
	inconsistencies
	wrapped <windows.h> include with  #define WIN32_LEAN_AND_MEAN
	added jvm.h include
	(WSAEventWrapper): added class declaration
	(_Jv_WinStrError): added both overload declarations
	(_Jv_ThrowIOException): added both overload declarations
	(_Jv_ThrowSocketException): added both overload declarations
	removed ENOTCONN, ECONNRESET and ENOPROTOOPT defines
	(_Jv_select): added declaration
	(_Jv_socket): removed
	(_Jv_connect): removed
	(_Jv_close): removed
	(_Jv_bind): removed
	(_Jv_accept): removed
	(_Jv_listen): removed
	(_Jv_write): removed
	(_Jv_read): removed
	* java/io/natFileDescriptorWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	(testCanUseGetHandleInfo): new function which tests whether Win32
	GetHandleInformation() call can be used with console buffer handles
	(only supported on >=WinNT 5.0)
	(winerr): removed (superseded by _Jv_WinStrError in include/win32.h)
	(valid): rewrote implementation using GetHandleInformation()
	(sync): 	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(open): likewise
	(write): likewise
	(setLength): likewise
	(close): likewise
	(seek): likewise
	(getFilePointer): likewise
	(read): likewise
	* java/io/natFileWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	(_access): use JV_TEMP_UTF_STRING
	(_stat): likewise
	(performMkDir): use JV_TEMP_UTF_STRING
	(performRenameTo): likewise
	(performDelete): likewise
	(performCreate): likewise
	(performSetReadOnly): likewise
	(performSetLastModified): likewise
	* java/lang/natWin32Process.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed includes gcj/cni.h, jvm.h
	(new_string): removed
	(startProcess): use JV_TEMP_UTF_STRING,
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	* java/net/natInetAddressWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	(aton): use JV_TEMP_UTF_STRING
	removed POSIX conditional code not relevant to Win32
	(lookup): likewise
	(getLocalHostName): likewise
	* java/net/natNetworkInterfaceWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed unnecessary windows.h, winsock.h and gcj/cni.h includes
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	(winsock2GetRealNetworkInterfaces): new function to compute network
	interfaces via Winsock2 API
	(determineGetRealNetworkInterfacesFN): new function for returning
	a function pointer to the function used to compute network interfaces.
	(getRealNetworkInterfaces): implemented
	* java/net/natPlainDatagramSocketImplWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed gcj/cni.h include
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	changed net POSIXisms to Win32isms
	replaced _Jv socket-related calls with their real Win32 equivalents
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(peekData): implemented timeout support
	(receive): likewise
	* java/net/natPlainSocketImplWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed gcj/cni.h and gcj/javaprims.h includes
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	changed net POSIXisms to Win32isms
	replaced _Jv socket-related calls with their real Win32
	equivalents
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(throwConnectException): helper function for connect()
	(connect): implemented timeout support
	(accept): likewise
	(doRead): new helper function common to both read() method overloads,
	includes timeout support
	(read): implemented both overloads in terms of doRead()
	(available): implemented using ioctlsocket()

From-SVN: r70904
2003-08-29 04:21:01 +00:00
Tom Tromey 91edd042ff Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added new files.
	* java/lang/Class.h (_Jv_sharedlib_register_hook): Declare as
	friend.
	* java/net/URLClassLoader.java (findClass): Don't use
	findURLResource.  Use loader's getClass method.
	(URLLoader.getClass): New method.
	(addURL): Handle `gcjlib' URLs.
	(SoURLLoader): New class.
	(SoResource): Likewise.
	* gnu/gcj/protocol/gcjlib/Connection.java: New file.
	* gnu/gcj/protocol/gcjlib/Handler.java: New file.
	* include/jvm.h (struct _Jv_core_chain): Moved from natCore.cc.
	(_Jv_RegisterCoreHook): Declare.
	(_Jv_FindCore): Declare.
	* gnu/gcj/runtime/SharedLibHelper.java: New file.
	* gnu/gcj/runtime/natSharedLibLoader.cc (CoreHookFunc): New
	typedef.
	(core_hook): New function.
	(struct SharedLibDummy) [saved_core]: New field.
	(init): Set _Jv_RegisterCoreHook.  Throw exception on failure.
	(register_hook): Set protection domain and class loader on new
	class.
	(finalize): Free core chain.
	* gnu/gcj/Core.java (Core): New constructor.
	* gnu/gcj/runtime/SharedLibLoader.java: Rewrote to use
	SharedLibHelper.
	* gnu/gcj/natCore.cc (_Jv_RegisterResource): Indentation fixlet.
	(_Jv_create_core): New function.
	(create): Use it.
	(default_register_resource): New function.
	(_Jv_RegisterCoreHook): New global.
	(_Jv_RegisterResource): Use it.
	(core_chain_struct): Removed.
	(_Jv_FindCore): New function.
	(_Jv_FreeCoreChain): New function.

From-SVN: r70892
2003-08-28 22:17:37 +00:00
Tom Tromey 777bb1d438 StrictMath.java: Typo fix.
* java/lang/StrictMath.java: Typo fix.
	* java/lang/Math.java: Typo fix.

2003-08-26  Stephen Crawley  <crawley@dstc.edu.au>

	* java/lang/ThreadGroup.java (removeThread): null the 'group' field
	of the removed Thread.

2003-08-26  Mark Wielaard  <mark@klomp.org>

	Reported by David Holmes <dholmes@dltech.com.au>.
	* java/lang/InheritableThreadLocal.java (threadMap): Wrap inside
	Collections.synchronizedMap.
	* java/lang/ThreadLocal.java (valueMap): Likewise.

From-SVN: r70828
2003-08-26 23:14:07 +00:00
Tom Tromey a638cfb0fc Reference.java (get): Indentation fix.
* java/lang/ref/Reference.java (get): Indentation fix.
	(clear): Comment fix.
	(enqueue): Likewise.
	(lock): Likewise.
	(referent): Likewise.

From-SVN: r70814
2003-08-26 16:31:12 +00:00
Tom Tromey 0f56e0cc56 re PR libgcj/12058 (java.lang.reflect.Array.set(Object, int, Object) throws java.lang.IllegalArgumentException)
PR java/12058:
	* java/lang/reflect/natArray.cc (set): Allow null as argument.

From-SVN: r70813
2003-08-26 14:55:30 +00:00
Tom Tromey 6077db9114 Proxy.java (ProxyData): `pack' now a String.
* java/lang/reflect/Proxy.java (ProxyData): `pack' now a String.
	(ProxyData.getPackage): New method.
	(ProxyData.getProxyData): Use package name, not Package.
	(ClassFactory.ClassFactory): Updated.

From-SVN: r70809
2003-08-26 14:37:10 +00:00
David Daney c9a61d5aa7 re PR libgcj/12013 (Calling Reference.clear() can cause runtime to crash.)
2003-08-21  David Daney  <ddaney@avtrex.com>

	Fix for PR libgcj/12013:
	* java/lang/ref/natReference.cc (finalize_referred_to_object):
	Check `cleared' field.
	* java/lang/ref/Reference.java (copy): Updated comments.
	(cleared): New field.
	(clear): Rewrote.

From-SVN: r70668
2003-08-21 22:08:09 +00:00
Tom Tromey 9c6f74cd3f natReference.cc (finalize_referred_to_object): Set `list->reference' to DELETED_REFERENCE when removing dead object.
* java/lang/ref/natReference.cc (finalize_referred_to_object):
	Set `list->reference' to DELETED_REFERENCE when removing dead
	object.
	(find_slot): Added an assert.
	(DELETED_REFERENCE): New define.
	(add_to_hash): Check for DELETED_REFERENCE.
	(remove_from_hash): Just return if found slot isn't ours.

From-SVN: r70599
2003-08-20 15:30:04 +00:00
Tom Tromey 0da021f5cc re PR libgcj/11951 (natMethod.cc (_Jv_CallAnyMethodA) should clear ffi_result before ffi_call)
PR libgcj/11951:
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Returns
	void.  Throw VirtualMachineError if ffi fails.  Initialize return
	value.  Added is_jni_call argument; only wrap exception if not a
	JNI call.  Use descriptive message if operation not supported.
	(_Jv_GetTypesFromSignature): Use declaring class' loader to find
	array class.
	* include/jvm.h (_Jv_CallAnyMethodA): Updated declaration.
	* jni.cc (_Jv_JNI_CallAnyMethodV): Updated for new form of
	_Jv_CallAnyMethodA.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_CallAnyVoidMethodV): Likewise.
	(_Jv_JNI_CallAnyVoidMethodA): Likewise.

From-SVN: r70544
2003-08-18 14:36:07 +00:00
Andrew Haley fcbe85cdfe [multiple changes]
2003-08-08  Andrew Haley  <aph@redhat.com>

        * Makefile.am (AM_CXXFLAGS): Define BOOT_CLASS_PATH.
        * Makefile.in: Rebuild.
        * java/lang/natRuntime.cc (insertSystemProperties): Add
        "sun.boot.class.path".

2003-08-07  Andrew Haley  <aph@redhat.com>

        * java/io/PrintStream.java: Don't crash on a null string.

From-SVN: r70250
2003-08-08 16:26:00 +00:00
Bryce McKinlay 6eac0ef54e Thread.java (Thread): Check for null "name" from start of private constructor...
* java/lang/Thread.java (Thread): Check for null "name" from
	start of private constructor, not after calling the private
	constructor.

From-SVN: r70216
2003-08-07 02:12:27 +01:00
Tom Tromey 0196f4e0a5 re PR libgcj/11779 (Field reflection incorrectly throws IllegalAccessException)
Fix for PR libgcj/11779:
	* java/lang/reflect/natField.cc (getAddr): Skip frames in Field
	class.

From-SVN: r70185
2003-08-05 20:06:57 +00:00
Tom Tromey 0d4d227907 Method.java: Updated status comment.
* java/lang/reflect/Method.java: Updated status comment.
	Imported javadoc from Classpath and re-ordered methods.
	* java/lang/reflect/Constructor.java: Reindented.  Updated
	status comment.  Imported javadoc from Classpath and re-ordered
	methods.

From-SVN: r70184
2003-08-05 19:50:54 +00:00
Tom Tromey 651bed366a natString.cc (init(gnu.gcj.runtime.StringBuffer)): New method.
* java/lang/natString.cc (init(gnu.gcj.runtime.StringBuffer)):
	New method.
	Include gnu/gcj/runtime/StringBuffer.h.
	* java/lang/String.java (init(gnu.gcj.runtime.StringBuffer)): New
	native method.
	(String(gnu.gcj.runtime.StringBuffer)): Use it.

From-SVN: r69890
2003-07-28 16:12:00 +00:00
Ranjit Mathew cc33095ccf Win32Process.java (ConcreteProcess): Surround a command line element with quotes if it contains an embedded space or tab.
2003-07-26  Ranjit Mathew  <rmathew@hotmail.com>

	* java/lang/Win32Process.java (ConcreteProcess): Surround
	a command line element with quotes if it contains an
	embedded space or tab.
	* java/lang/natWin32Process.cc (startProcess): Do not
	surround command line elements with quotes here.

From-SVN: r69844
2003-07-27 04:13:03 +00:00
Mark Wielaard 337ecadfd0 + * java/lang/natRuntime.cc (_load): Add library name to
+       UnsatisfiedLinkError when thrown.

From-SVN: r69786
2003-07-25 13:04:15 +00:00
Tom Tromey ed6d741317 * java/lang/natSystem.cc (arraycopy): Check for overflow.
From-SVN: r69706
2003-07-23 15:31:43 +00:00
Tom Tromey ffd94572f4 Runtime.java: Comment fix.
* java/lang/Runtime.java: Comment fix.
	* java/lang/ClassLoader.java (isAncestorOf): New method.
	(getParent): Uncommented security check.  Use isAncestorOf.
	* include/jvm.h (_Jv_CheckAccess): Declare.
	* java/lang/reflect/natConstructor.cc (newInstance): Perform
	access check.
	Include IllegalAccessException.h, ArrayIndexOutOfBoundsException.h.
	* java/lang/reflect/natArray.cc (newInstance): Pass caller's
	class loader to _Jv_GetArrayClass.
	Include ArrayIndexOutOfBoundsException.h.
	* java/lang/reflect/Field.java: Update comment to reflect status.
	(equals): Fixed indentation.
	* java/lang/Class.h (Class): Declare memberAccessCheck, not
	checkMemberAccess.  Make _Jv_CheckAccess a friend.
	* java/lang/Class.java (memberAccessCheck): New method from
	Classpath.
	(checkMemberAccess): Removed.
	(getDeclaredMethod): Use memberAccessCheck.
	(getField): Likewise.
	(getMethod): Likewise.
	* resolve.cc (_Jv_ResolvePoolEntry): Use _Jv_CheckAccess.
	(_Jv_SearchMethodInClass): Likewise.
	* prims.cc (_Jv_CheckAccess): New function.
	* jni.cc (_Jv_JNI_FindClass): Use getClassLoaderInternal.
	(_Jv_JNI_GetAnyFieldID): Likewise.
	* java/lang/natClass.cc (forName): Use getClassLoaderInternal.
	(getClassLoader): Added security check.
	(getConstructor): Call memberAccessCheck.
	(getDeclaredClasses): Likewise.
	(getDeclaredField): Likewise.
	(getDeclaredFields): Likewise.
	(_getConstructors): Likewise.
	(getDeclaredConstructor): Likewise.
	(getDeclaredMethods): Likewise.
	(getFields): Likewise.
	(getMethods): Likewise.
	(newInstance): Likewise.
	(_Jv_MakeVTable): Put method name in exception.
	* java/lang/reflect/natMethod.cc (getType): Use
	getClassLoaderInternal.
	(_Jv_GetTypesFromSignature): Likewise.
	(invoke): Perform access check.
	(_Jv_CallAnyMethodA): Removed old FIXME comments.
	Include ArrayIndexOutOfBoundsException.h.
	* java/lang/reflect/natField.cc (getType): Use
	getClassLoaderInternal.
	(_Jv_CheckFieldAccessibility): Removed.
	(getAddr): Use _Jv_CheckAccess; find caller.
	Include ArrayIndexOutOfBoundsException.h.

From-SVN: r69621
2003-07-21 01:54:06 +00:00
Mark Wielaard 5be0088e45 cni.h: CNI now expands to Compiled Native Interface.
* gcj/cni.h: CNI now expands to Compiled Native Interface.

       * java/lang/e_pow.c: CYGNUS LOCAL should be GCJ LOCAL.
       * java/lang/fdlibm.h: Likewise.

From-SVN: r69104
2003-07-08 21:27:37 +00:00
Matt Kraai 7b4a4fceef natVMSecurityManager.cc (getClassContext): Use maxlen instead of len for loop bound.
* java/lang/natVMSecurityManager.cc (getClassContext):
	Use maxlen instead of len for loop bound.

From-SVN: r68153
2003-06-18 14:13:59 +00:00
Andrew Haley e976ed37ef jni.cc (_Jv_JNI_check_types): New.
2003-06-11  Andrew Haley  <aph@redhat.com>

        * jni.cc (_Jv_JNI_check_types): New.
        (_Jv_JNI_SetPrimgitiveArrayRegion): Check array type.
        (_Jv_JNI_GetPrimitiveArrayRegion): Ditto.
        (_Jv_JNI_GetPrimitiveArrayElements): Ditto.
        (_Jv_JNI_ReleasePrimitiveArrayElements): Ditto.

        * java/lang/natVMSecurityManager.cc (getClassContext): Fix
        infinite loop.

From-SVN: r67835
2003-06-12 15:39:17 +00:00
Tom Tromey 3ad93a3475 ClassLoader.java (loadClass): Not deprecated.
* java/lang/ClassLoader.java (loadClass): Not deprecated.
	* java/io/PrintStream.java: Not deprecated.

From-SVN: r67811
2003-06-12 03:13:14 +00:00
Mark Wielaard 60e9f0d726 re PR libgcj/8738 (java.io.CharArrayWriter's write methods erroneously throw IOExceptions)
2002-06-06  James Clark  <jjc@jclark.com>

       Fix for PR libgcj/8738:
       * gnu/gcj/convert/UnicodeToBytes.java (havePendingBytes): New method.
       * gnu/gcj/convert/Output_SJIS.java (havePendingBytes): Likewise.
       * gnu/gcj/convert/Output_EUCJIS.java (havePendingBytes): Likewise.
       * gnu/gcj/convert/Output_UTF8.java (havePendingBytes): Likewise.
       (write): Always decrease avail when count is increased.
       * java/lang/natString.cc (getBytes): Check converter havePendingBytes()
       and whether output buffer is full before increasing size.

2002-06-06  Mark Wielaard  <mark@klomp dot org>

       * java/io/PrintStream.java (writeChars(char[],int, int)):
       Check converter.havePendingBytes().
       (writeChars(String,int,int)): Likewise.
       * java/io/OutputStreamWriter.java (writeChars(char[], int, int)):
       Check converter.havePendingBytes() and flush buffer when stalled.

From-SVN: r67595
2003-06-07 18:35:00 +00:00
Matt Kraai 86fb951d4c w_exp.c (o_threshold, [...]): Define only if _IEEE_LIBM is undefined.
* java/lang/w_exp.c (o_threshold, u_threshold): Define only
	if _IEEE_LIBM is undefined.

From-SVN: r67526
2003-06-06 03:34:36 +00:00
Michael Koch 91adbcf731 System.java: Explicitely import needed classes.
2003-05-27  Michael Koch  <konqueror@gmx.de>

	* java/lang/System.java:
	Explicitely import needed classes.

From-SVN: r67182
2003-05-27 06:03:14 +00:00
Tom Tromey 06b021af7b re PR libgcj/10582 (array assignment fails in some situations)
PR libgcj/10582:
	* verify.cc (_Jv_BytecodeVerifier::is_assignable_from_slow):
	Removed.
	(type::compatible): Use _Jv_IsAssignableFrom.
	* java/lang/natClass.cc (iindex_mutex_initialized): Now static.
	(_Jv_IsAssignableFrom): Work even when source or target class is
	not prepared.

From-SVN: r66348
2003-05-01 21:36:18 +00:00
Tom Tromey 62a3446bb8 natString.cc (_Jv_AllocString): Initialize cachedHashCode.
* java/lang/natString.cc (_Jv_AllocString): Initialize
	cachedHashCode.
	(init): Likewise.
	(_Jv_NewStringUtf8Const): Likewise.

From-SVN: r66180
2003-04-28 18:19:23 +00:00
Mohan Embar c4519773ca jvm.h: (_Jv_GetNbArgs) added (_Jv_GetSafeArg) added (_Jv_SetArgs) added
2003-03-29  Mohan Embar  <gnustuff@thisiscool.com>

        * include/jvm.h: (_Jv_GetNbArgs) added
        (_Jv_GetSafeArg) added
        (_Jv_SetArgs) added
        * prims.cc: (_Jv_GetNbArgs) implemented
        (_Jv_GetSafeArg) implemented
        (_Jv_SetArgs) implemented
        (_Jv_RunMain) use _Jv_SetArgs() instead of explicitly
        setting _Jv_argc and _Jv_argv
        * posix.cc: (_Jv_ThisExecutable) use _Jv_GetSafeArg()
        instead of _Jv_argv
        * java/lang/natRuntime.cc: (insertSystemProperties) use
        _Jv_GetSafeArg() instead of _Jv_argv

From-SVN: r66067
2003-04-25 16:48:13 +00:00
Richard Earnshaw bc617f8a48 ieeefp.h: Handle ARM platforms that have pure-endian floating point.
* java/lang/ieeefp.h: Handle ARM platforms that have pure-endian
floating point.

From-SVN: r65693
2003-04-16 18:32:06 +00:00
Tom Tromey 6a76da08a3 String.java (data, [...]): Documented.
* java/lang/String.java (data, boffset, count): Documented.
	(String(byte[],String)): Reformatted.
	(String(byte[])): Likewise.
	(lastIndexOf(int)): Likewise.
	(lastIndexOf(String)): Likewise.
	(substring(int)): Renamed argument to match Classpath.
	(String(StringBuffer)): Don't share buffer if it is nearly empty.

From-SVN: r65070
2003-03-31 01:03:21 +00:00
Tom Tromey 6a8873a754 String.java: Miscellaneous minor formatting changes to match Classpath more closely.
* java/lang/String.java: Miscellaneous minor formatting changes
	to match Classpath more closely.

From-SVN: r65055
2003-03-30 21:14:32 +00:00
Eric Blake 7270451f19 natString.cc (hashCode): Use cachedHashCode.
2003-03-29  Eric Blake  <ebb9@email.byu.edu>
	    Tom Tromey  <tromey@redhat.com>

	* java/lang/natString.cc (hashCode): Use cachedHashCode.
	(init()): Removed.
	(charAt): Put index in exception.
	(contentEquals): New method.
	Include StringBuffer.h.
	* java/lang/String.java (cachedHashCode): New field.
	(String()): Follow classpath implementation.
	(init()): Removed.
	(contentEquals): Declare.
	(subSequence): Don't declare IndexOutIfBoundsException in throws
	clause.
	(matches, replaceFirst, replaceAll, split): New methods from
	Classpath.

Co-Authored-By: Tom Tromey <tromey@redhat.com>

From-SVN: r65037
2003-03-30 06:43:45 +00:00
Tom Tromey 9ba99c63ab String.java: Reordered to follow Classpath; merged in javadoc.
* java/lang/String.java: Reordered to follow Classpath; merged in
	javadoc.

From-SVN: r65036
2003-03-30 05:38:28 +00:00
Tom Tromey 44fc3a6f54 natClass.cc (newInstance): Put method name in exception.
* java/lang/natClass.cc (newInstance): Put method name in
	exception.
	(getConstructor): Likewise.
	(getDeclaredConstructor): Likewise.
	(getPrivateMethod): Likewise.

From-SVN: r65021
2003-03-29 20:17:02 +00:00
Tom Tromey 4544c3f387 Proxy.java: New version from Classpath.
* java/lang/reflect/Proxy.java: New version from Classpath.
	* java/lang/Package.java: New version from Classpath.

From-SVN: r65007
2003-03-29 01:34:23 +00:00
Tom Tromey 1c81e34352 natRuntime.cc (insertSystemProperties): Set gnu.classpath.home.url.
* java/lang/natRuntime.cc (insertSystemProperties): Set
	gnu.classpath.home.url.
	* Makefile.in: Rebuilt.
	* Makefile.am: Define LIBDIR.

From-SVN: r64905
2003-03-26 22:31:52 +00:00
Eric Blake ce1bb3bbba natStringBuffer.cc (regionMatches): New function.
2003-03-23  Eric Blake  <ebb9@email.byu.edu>

	* java/lang/natStringBuffer.cc (regionMatches): New function.
	* java/lang/String.java (count): Now package-private.
	* java/lang/StringBuffer.java: Merged with Classpath.

From-SVN: r64770
2003-03-24 00:50:18 +00:00
Michael Koch a37f82190d Process.java: Merged from classpath.
2003-03-19  Michael Koch  <konqueror@gmx.de>

	* java/lang/Process.java:
	Merged from classpath.

From-SVN: r64575
2003-03-19 12:15:04 +00:00
Tom Tromey 2b7f1f8f41 resolve.cc (ncode): Use _Jv_platform_ffi_abi.
* resolve.cc (ncode): Use _Jv_platform_ffi_abi.
	Include platform.h.
	* java/lang/natRuntime.cc (insertSystemProperties): Use
	_Jv_platform_path_separator.
	(nativeGetLibname): Use _Jv_platform_file_separator.
	(_load): Use _Jv_platform_onload_names.
	(onload_names): New global.
	* include/win32.h (_Jv_platform_file_separator): New define.
	(_Jv_platform_path_separator): Likewise.
	(_Jv_platform_onload_names): Likewise.
	(_Jv_platform_ffi_abi): Likewise.
	* include/posix.h (_Jv_platform_file_separator): New define.
	(_Jv_platform_path_separator): Likewise.
	(_Jv_platform_onload_names): Likewise.
	(_Jv_platform_ffi_abi): Likewise.

From-SVN: r64461
2003-03-17 00:45:37 +00:00
Hans Boehm adf936a606 * java/lang/natObject.cc (JV_SYNC_HASH): replace signed % by &.
From-SVN: r64386
2003-03-15 01:04:08 +00:00
Andrew Haley c068c63834 [multiple changes]
2003-03-10  2003-02-27  Mohan Embar  <gnustuff@thisiscool.com>

        * include/jvm.h: removed declaration of _Jv_ThisExecutable()
        setter; made return value of getter const char* instead of char*
        * prims.cc: removed all references to _Jv_ThisExecutable().
        These are in the platform-specific sections now.
        * posix.cc: define platform-specific _Jv_ThisExecutable().
        Handle DISABLE_MAIN_ARGS and HAVE_PROC_SELF_EXE cases
        * win32.cc: define platform-specific _Jv_ThisExecutable()
        using GetModuleFilename()
        * java/lang/natRuntime.cc: set gnu.gcj.progname property
        to argv[0] instead of _Jv_ThisExecutable()

2003-03-10  Ranjit Mathew  <rmathew@hotmail.com>

        * gnu/gcj/runtime/NameFinder.java (usingAddr2name): New flag
        that is set if we are using addr2name.awk instead of addr2line.
        (NameFinder): Set usingAddr2name if using addr2name.awk.
        (getExternalLabel): New native method to convert a method
        name to an external label.
        (lookup): Convert name given by addr2line to an external label
        before demangling.

        * gnu/gcj/runtime/natNameFinder.cc (LABEL_PREFIX): New string
        constant representing the prefix attached to method names to
        convert them to an external label.
        (gnu::gcj::runtime::NameFinder::getExternalLabel): Define
        using LABEL_PREFIX.

From-SVN: r64111
2003-03-10 19:45:30 +00:00
Michael Koch 40590c5231 Package.java: Remerged from classpath.
2003-03-02  Michael Koch  <konqueror@gmx.de>

	* java/lang/Package.java:
	Remerged from classpath.

From-SVN: r63689
2003-03-02 21:20:26 +00:00
Tom Tromey 5168f1cfb2 natObject.cc: Don't include assert.h.
* java/lang/natObject.cc: Don't include assert.h.
	(heavy_lock_obj_finalization_proc): Use JvAssert.
	(remove_all_heavy): Likewise.
	(_Jv_MonitorEnter): Likewise.
	(_Jv_MonitorExit): Likewise.
	(wait): Likewise.

From-SVN: r63636
2003-03-02 00:02:52 +00:00
Mohan Embar 73058ef68c natWin32Process.cc (startProcess): Double-quote each program array element passed to CreateProcess.
2003-03-01  Mohan Embar  <gnustuff@thisiscool.com>

	* java/lang/natWin32Process.cc (startProcess): Double-quote each
	program array element passed to CreateProcess.

From-SVN: r63633
2003-03-01 23:02:18 +00:00
Hans Boehm a6fdf2d3bf natMethod.cc (_Jv_CallAnyMethodA): Allocate a full jvalue for each argument.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Allocate a full
        jvalue for each argument. Simplify.
	* testsuite/libjava.jni/calls.c (docall),
	testsuite/libjava.jni/calls.java (longpb_f): check for argument
	misalignment.

From-SVN: r63563
2003-02-28 17:26:29 +00:00
Tom Tromey d99c7b11c5 ClassLoader.java (defineClass(byte[],int,int)): Deprecate.
* java/lang/ClassLoader.java (defineClass(byte[],int,int)):
	Deprecate.
	* java/lang/Thread.java (resume): Deprecate.
	* java/io/ByteArrayOutputStream.java (toString(int)): Fixed typo
	in @deprecated.

From-SVN: r63364
2003-02-24 16:47:58 +00:00
Tom Tromey 804b2c48ea natRuntime.cc (libraries_size, [...]): Removed.
* java/lang/natRuntime.cc (libraries_size, libraries_count,
	libraries): Removed.
	(add_library): Removed.
	(_load): Don't call add_library.
	(loadLibraryInternal): Likewise.
	(init): Likewise.
	(lookup_data): New struct.
	(find_symbol): New function.
	(_Jv_FindSymbolInExecutable): Use it.

From-SVN: r63348
2003-02-24 00:53:21 +00:00
Anthony Green 514e19c9fb New docs for Thread.java, and little tweaks identified by japi.
From-SVN: r63284
2003-02-22 14:16:29 +00:00
Rainer Orth a191802c42 natStackTrace.cc: Include platform.h immediately after config.h.
* gnu/gcj/runtime/natStackTrace.cc: Include platform.h immediately
	after config.h.  Use <> for consistency.
	* java/lang/natObject.cc: Likewise.
	* java/lang/natRuntime.cc: Likewise.
	* java/lang/natSystem.cc: Likewise.
	* java/util/natTimeZone.cc: Likewise.
	* win32.cc: Likewise.
	* include/posix.h (fcntl, socket, connect, close, bind, accept,
	listen, write, read): Undef to avoid interference from OS macros.

From-SVN: r63122
2003-02-19 16:28:37 +00:00
Tom Tromey b8c86c6d07 System.java (properties): Use Properties.clone.
* java/lang/System.java (properties): Use Properties.clone.
	(setProperties): Likewise.

From-SVN: r62903
2003-02-14 17:43:34 +00:00
Ranjit Mathew d6a2d36ee7 Win32Process.java (destroy): Declare as native.
2003-02-10  Ranjit Mathew  <rmathew@hotmail.com>

	* java/lang/Win32Process.java (destroy): Declare as native.
	(hasExited): New native method.
	(exitValue): Define.
	(getErrorStream): Likewise.
	(getInputStream): Likewise.
	(getOutputStream): Likewise.
	(waitFor): Declare as native.
	(startProcess): New native method.
	(cleanup): Likewise.
	(ConcreteProcess): Define.
	(outputStream, inputStream, errorStream): New members.
	(procHandle, exitCode): Likewise.

	* java/lang/natWin32Process.cc
	(java::lang::ConcreteProcess::cleanup): Define.
	(java::lang::ConcreteProcess::destroy): Likewise.
	(java::lang::ConcreteProcess::hasExited): Likewise.
	(java::lang::ConcreteProcess::waitFor): Likewise.
	(new_string): Likewise.
	(java::lang::ConcreteProcess::startProcess): Likewise.

From-SVN: r62657
2003-02-10 23:52:56 +00:00
Ranjit Mathew d074ed7c01 natRuntime.cc (java::lang::Runtime::_load)): Take care of the fact that on Win32...
2003-02-03  Ranjit Mathew <rmathew@hotmail.com>

	* java/lang/natRuntime.cc (java::lang::Runtime::_load)): Take care
	of the fact that on Win32, JNI_OnLoad is an "stdcall" function and
	could also have been exported as "JNI_OnLoad@8" (MinGW) or
	"_JNI_OnLoad@8" (MSVC).

From-SVN: r62348
2003-02-03 21:23:59 +00:00
Jeff Sturm ae724017fd natClass.cc (initializeClass): Check tables when (state == JV_STATE_IN_PROGRESS).
* java/lang/natClass.cc (initializeClass): Check tables when
(state == JV_STATE_IN_PROGRESS).
(_Jv_GetInterfaces): Use _Jv_WaitForState to link interface.
* java/lang/natClassLoader.cc (_Jv_WaitForState): Handle
interpreted classes.
(linkClass0): Use _Jv_WaitForState.

From-SVN: r62161
2003-01-30 23:20:45 +00:00
Tom Tromey d291503a67 ClassLoader.java (findLoadedClass): Removed erroneous comment.
* java/lang/ClassLoader.java (findLoadedClass): Removed erroneous
	comment.

From-SVN: r61725
2003-01-24 19:37:17 +00:00
Mark Wielaard 827452ae5c Makefile.am (core_java_source_files): Add VMObjectStreamClass.java.
* Makefile.am (core_java_source_files): Add VMObjectStreamClass.java.
       (nat_source_files): Add natVMObjectStreamClass.cc.
       * Makefile.in: Regenerated.
       * gcj/javaprims.h (namespace java): Regenerated.
       * java/io/ObjectStreamClass.java (getClassUID): Call
       VMObjectStreamClass.hasClassInitializer().
       (hasClassInitializer): Removed.
       * java/io/VMObjectStreamClass.java: New class.
       * java/io/natVMObjectStreamClass.cc: New file.
       * java/lang/Class.h: Make java::io::VMObjectStreamClass friend class.

From-SVN: r61501
2003-01-20 06:46:28 +00:00
Andrew Haley 4cf0d20fce natRuntime.cc (_load): StackTrace access needs to be in a try block.
2003-01-14  Andrew Haley  <aph@redhat.com>

        * java/lang/natRuntime.cc (_load): StackTrace access needs to be
        in a try block.

From-SVN: r61293
2003-01-14 19:26:21 +00:00
Tom Tromey 9f17a7afd2 re PR libgcj/7416 (java.security startup refs "GNU libgcj.security")
Fix for PR libgcj/7416:
	* javax/naming/InitialContext.java (init): Use
	gnu.classpath.home.url.
	* java/security/Security.java: Use new properties.
	(loadProviders): Accept base url; use it.
	* java/lang/System.java: Document gnu.classpath.vm.shortname, and
	gnu.classpath.home.url.
	(gnu.classpath.home.url): Define.
	(gnu.classpath.vm.shortname): Likewise.

From-SVN: r60722
2002-12-31 22:50:10 +00:00
Tom Tromey 35a94bdca8 re PR libgcj/8997 (spin() calls Thread.sleep)
2002-12-31  Tom Tromey  <tromey@redhat.com>
            Ranjit Mathew  <rmathew@hotmail.com>

	Fix for PR libgcj/8997:
	* java/lang/natObject.cc (spin): Use _Jv_platform_usleep.
	Include platform.h.
	* include/posix.h (_Jv_platform_usleep): New function.
	* include/win32.h (_Jv_platform_usleep): New function.

Co-Authored-By: Ranjit Mathew <rmathew@hotmail.com>

From-SVN: r60700
2002-12-31 17:43:47 +00:00
Mark Wielaard de2baf30bb StringBuffer.java (getChars): Remove wrong dstOffset check against count.
* java/lang/StringBuffer.java (getChars): Remove wrong dstOffset check
        against count.

From-SVN: r60616
2002-12-30 07:16:59 +00:00
Mark Mitchell dfe5a36e95 boehm.cc: Remove stray semicolon.
* boehm.cc: Remove stray semicolon.
	* interpret.cc: Likewise.
	* prims.cc: Likewise.
	* verify.cc (_Jv_BytecodeVerifier::verify_fail): Move definition
	earlier to ensure default arguments are processed.
	* gcj/array.h (JArray): Add forward declaration.
	(elements): Likewise.
	* gcj/javaprim.h: Remove stray semicolons.
	* include/bohm-gc.h: Likewise.
	* include/jni.h: Likewise.
	* include/jvm.h: Likewise.
	* java/lang/Class.h (_Jv_GetArrayClass): Declare _Jv_NewArrayClass.

From-SVN: r60556
2002-12-28 06:38:52 +00:00
Jeff Sturm 4017ae6e8b exception.cc (PERSONALITY_FUNCTION): Clear least-significant-bit of catch_type.
* exception.cc (PERSONALITY_FUNCTION): Clear least-significant-bit
of catch_type.
* java/lang/natClass.cc (initializeClass): Link vtable, otable,
idt tables after initializing superclass.
* java/lang/natClassLoader.cc (uaddr): New typedef.
(_Jv_PrepareCompiledClass): Resolve superclass, interfaces
if they are constant pool indicies.  Don't link vtable, otable yet.

From-SVN: r60450
2002-12-23 19:59:31 +00:00
Tom Tromey a1aba4f9a5 natClassLoader.cc (defineClass0): Removed erroneous comment.
* java/lang/natClassLoader.cc (defineClass0): Removed erroneous
	comment.
	* java/lang/ClassLoader.java (defineClass): Use chained
	exception when rethrowing.
	* defineclass.cc (handleClassBegin): Mark class as interpreted.
	* java/lang/reflect/Modifier.java (INVISIBLE, INTERPRETED): New
	constants.
	* resolve.cc (_Jv_PrepareMissingMethods): New function.
	(_Jv_PrepareClass): Use it.
	* include/java-interp.h (_Jv_IsInterpretedClass): Rewrote.
	(_Jv_InterpClass): _Jv_PrepareMissingMethods now friend.
	* java/lang/Class.h (Class::getModifiers): Mask with ALL_FLAGS.
	(Class): _Jv_PrepareMissingMethods now friend.
	* java/lang/natClassLoader.cc (defineClass0): Use JvSynchronize.
	Record `NULL' for system class loader.
	(_Jv_RegisterInitiatingLoader): Use JvSynchronize.  Special case
	system class loader.
	(_Jv_FindClassInCache): Likewise.
	(_Jv_UnregisterClass): Use JvSynchronize.  Free old loader info.
	(_Jv_FindClass): Special case system class loader.
	* java/lang/natClass.cc (_Jv_abstractMethodError): New function.
	(_Jv_SetVTableEntries): Put _Jv_abstractMethodError into empty
	vtable slots.
	(_Jv_LayoutVTableMethods): Don't generate vtable slot for a method
	in a final class.
	(_getDeclaredMethod): Don't return synthetic methods.
	(getDeclaredMethods): Likewise.
	(_getMethod): Likewise.
	(_getMethods): Likewise.

From-SVN: r60319
2002-12-19 19:31:55 +00:00
Mark Wielaard f0caaa23bf ClassLoader.java (resolveClass0): Transform ClassNotFoundException to NoClassDefFoundError.
* java/lang/ClassLoader.java (resolveClass0): Transform
	ClassNotFoundException to NoClassDefFoundError. Transform all other
	throwables to LinkageError.

From-SVN: r60097
2002-12-13 10:04:15 +00:00
Tom Tromey 70eec35875 * java/lang/ClassLoader.java (findLoadedClass): Now synchronized.
From-SVN: r60053
2002-12-12 00:58:39 +00:00
Tom Tromey f69bc49776 ClassLoader.java (loadedClasses): New field.
* java/lang/ClassLoader.java (loadedClasses): New field.
	(defineClass): Fixed indentation.  Put new class in
	loadedClasses.
	(findLoadedClass): Implement here.
	* java/lang/natClassLoader.cc (findLoadedClass): Removed.

From-SVN: r60043
2002-12-11 19:18:59 +00:00
Tom Tromey ad1121d10e Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natVMClassLoader.cc.
	* gnu/gcj/runtime/natVMClassLoader.cc: New file.
	(gnu::gcj::runtime::VMClassLoader::findClass): Moved here.
	* java/lang/natClassLoader.cc
	(gnu::gcj::runtime::VMClassLoader::findClass): Removed.

From-SVN: r60020
2002-12-11 03:15:14 +00:00
Tom Tromey 78bb0444d2 win32.h (_Jv_platform_solib_prefix): New define.
* include/win32.h (_Jv_platform_solib_prefix): New define.
	(_Jv_platform_solib_suffix): Likewise.
	* include/posix.h (_Jv_platform_solib_prefix): New define.
	(_Jv_platform_solib_suffix): Likewise.
	* java/lang/natRuntime.cc: Include StackTrace.h.
	(_load): Use findLibrary and new platform defines.
	(nativeGetLibname): Use new platform defines.

From-SVN: r59976
2002-12-10 01:39:32 +00:00
Mark Wielaard e825ca7ff5 Connection.java (getJarFile): download and cache remote jar files.
* gnu/gcj/protocol/jar/Connection.java (getJarFile): download and
	cache remote jar files.
	* gnu/gcj/runtime/VMClassLoader.java: Don't construct jar URL, only
	add File.separator to URL when it is a directory.
	* java/lang/ClassLoader.java: Add Classpath javadoc.
	(parent): final.
	(getParent): Add (disabled) security check.
	(findLibrary): New default method.
	* java/net/JarURLConnection.java (getManifest): Implement.
	(getInputStream): Only create InputStream when entry exists.
	(getHeaders): Only use jarFileURLConnection or JarEntry to set length
	when they exist.
	* java/net/URLClassLoader.java: New/Rewritten version from Classpath.

From-SVN: r59949
2002-12-09 00:04:00 +00:00
Tom Tromey eaa2834f9f Class.h (_Jv_SetVTableEntries): Updated declaration.
* java/lang/Class.h (_Jv_SetVTableEntries): Updated declaration.
	* resolve.cc: Don't include AbstractMethodError.h.
	(_Jv_abstractMethodError): Removed.
	* defineclass.cc (handleMethodsBegin): Initialize method index to
	-1.
	* java/lang/natClass.cc (_Jv_LayoutVTableMethods): Don't set
	method index for "new" final method.
	(_Jv_SetVTableEntries): Compare index against -1 instead of using
	isVirtualMethod.  Added `flags' argument.
	(_Jv_MakeVTable): Throw exception for abstract method in concrete
	class.

From-SVN: r59847
2002-12-05 07:43:45 +00:00
Tom Tromey 76508852a0 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natVMSecurityManager,
	natResourceBundle.
	* java/util/ResourceBundle.java (Security): Removed.
	(getCallingClassLoader): Now native.
	* java/util/natResourceBundle.cc: New file.
	* java/lang/natVMSecurityManager.cc: New file.
	* java/lang/VMSecurityManager.java (getClassContext): Now native.

From-SVN: r59840
2002-12-05 00:49:30 +00:00
Tom Tromey a50aa79993 * java/lang/Character.java (forDigit): Formatting fix.
From-SVN: r59781
2002-12-03 20:13:43 +00:00
Andrew Haley f3f110d5d1 natClassLoader.cc (_Jv_PrepareCompiledClass): Call _Jv_PushClass.
2002-12-03  Andrew Haley  <aph@redhat.com>

        * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
	_Jv_PushClass.
        (_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
        (_Jv_PopClass): New.
        (_Jv_PushClass): New.
        * java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
        discover the ClassLoader of our caller.
        (_Jv_CheckArrayStore): Don't check that a class is assignment
        compatible with Object.
        * java/lang/natVMTHrowable.cc: Delete.
        * gnu/gcj/runtime/StackTrace.java: New, partly copied from
	java.lang.VMThrowable.
        (StackTrace(), StackTrace(int)): New constructors.
        (classAt, methodAt, update, methodAtAddress): New methods.
        (map): New field.
	* java/lang/VMThrowable.java: Use StackTrace instead of
	natVMTHrowable.
	* java/lang/Class.h (getClassLoaderInternal): New.
        (class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
        Be friendly with gnu::gcj::runtime::StackTrace.
        (Object.chain): New field.
        * include/java-interp.h (class _Jv_InterpMethod): Be friendly with
        gnu::gcj::runtime::StackTrace.
        * prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
        instead of getClassLoader().
        * verify.cc (class _Jv_BytecodeVerifier): Likewise.
        java::lang::VMThrowable.
        * Makefile.am (core_java_source_files): Add MethodRef.java,
	StackTrace.java.
        (nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
        * Makefile.in: Rebuild.

From-SVN: r59770
2002-12-03 13:50:40 +00:00
Andrew Haley 421f9e6091 natClassLoader.cc (_Jv_PrepareCompiledClass): Call _Jv_PushClass.
2002-12-03  Andrew Haley  <aph@redhat.com>

        * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
	_Jv_PushClass.
        (_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
        (_Jv_PopClass): New.
        (_Jv_PushClass): New.
        * java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
        discover the ClassLoader of our caller.
        (_Jv_CheckArrayStore): Don't check that a class is assignment
        compatible with Object.
        * java/lang/natVMTHrowable.cc: Delete.
        * gnu/gcj/runtime/StackTrace.java: New, partly copied from
	java.lang.VMThrowable.
        (StackTrace(), StackTrace(int)): New constructors.
        (classAt, methodAt, update, methodAtAddress): New methods.
        (map): New field.
	* java/lang/VMThrowable.java: Use StackTrace instead of
	natVMTHrowable.
	* java/lang/Class.h (getClassLoaderInternal): New.
        (class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
        Be friendly with gnu::gcj::runtime::StackTrace.
        (Object.chain): New field.
        * include/java-interp.h (class _Jv_InterpMethod): Be friendly with
        gnu::gcj::runtime::StackTrace.
        * prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
        instead of getClassLoader().
        * verify.cc (class _Jv_BytecodeVerifier): Likewise.
        java::lang::VMThrowable.
        * Makefile.am (core_java_source_files): Add MethodRef.java,
	StackTrace.java.
        (nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
        * Makefile.in: Rebuild.

2002-12-03  Andrew Haley  <aph@redhat.com>

	* class.c (make_class_data): New field, "chain".
	* decl.c (java_init_decl_processing): Likewise.

From-SVN: r59769
2002-12-03 13:50:05 +00:00
Mark Wielaard c2bea6b06b SecurityManager.java: Remerge comments, indenting and checkXXX methods with Classpath.
* java/lang/SecurityManager.java: Remerge comments, indenting and
       checkXXX methods with Classpath.

From-SVN: r59685
2002-12-01 16:16:19 +00:00
Tom Tromey da98b11a83 natReference.cc (add_to_hash): Look at `copy', not `referent'.
* java/lang/ref/natReference.cc (add_to_hash): Look at `copy', not
	`referent'.
	(finalize_referred_to_object): Don't modify `referent' or `copy'
	fields.
	(add_to_hash): Correctly set `n->next' when updating list.
	* java/lang/ref/Reference.java (enqueue): Return false if already
	enqueued.

From-SVN: r59278
2002-11-19 21:59:41 +00:00
Tom Tromey 06fa6442a3 natRuntime.cc (insertSystemProperties): Set gnu.classpath.home.
* java/lang/natRuntime.cc (insertSystemProperties): Set
	gnu.classpath.home.

From-SVN: r59108
2002-11-14 18:28:07 +00:00
Mark Wielaard c0cd8f67f1 natClass.cc (initializeClass): Throw NoClassDefFoundError with getName() as message.
* java/lang/natClass.cc (initializeClass): Throw NoClassDefFoundError
	with getName() as message.
	(_Jv_CheckArrayStore): Throw ArrayStoreException with object and array
	type as message.

	* java/lang/natVMThrowable.cc: Don't declare parameter t, it is
	unused.

From-SVN: r58991
2002-11-10 21:07:27 +00:00
Mark Wielaard 396a80436c natField.cc (getBoolean): Use getType().
* java/lang/reflect/natField.cc (getBoolean): Use getType().
	(getByte): Likewise.
	(getShort): Likewise.
	(getInt): Likewise.
	(getLong): Likewise.
	(getFloat): Likewise.
	(getDouble): Likewise.
	(get): Likewise.
	(setChar): Likewise.
	(setByte): Likewise.
	(setShort): Likewise.
	(setInt): Likewise.
	(setLong): Likewise.
	(setFloat): Likewise.
	(setDouble): Likewise.

From-SVN: r58899
2002-11-07 17:57:09 +00:00
Tom Tromey 957e3aef4c ClassLoader.java (loadClass): Call loadClass on VMClassLoader, not findClass.
* java/lang/ClassLoader.java (loadClass): Call loadClass on
	VMClassLoader, not findClass.

From-SVN: r58786
2002-11-04 06:17:55 +00:00
Jeff Sturm a5db0683cb resolve.cc (METHOD_NOT_THERE, [...]): Remove.
* resolve.cc (METHOD_NOT_THERE, METHOD_INACCESSIBLE): Remove.
	(_Jv_ResolvePoolEntry): Use _Jv_Method.index, not
	_Jv_DetermineVTableIndex, to determine vtable offset.
	(_Jv_DetermineVTableIndex): Remove.
	(_Jv_PrepareClass): Don't layout vtable.  Use _Jv_MakeVTable instead.

	* java/lang/Class.h (friend int _Jv_DetermineVTableIndex): Remove.

From-SVN: r58780
2002-11-04 02:45:31 +00:00
Mark Wielaard de36f65dd1 GNU Classpath merge.
2002-10-31  Stephen Crawley  <crawley@dstc.edu.au>

	* java/lang/Double.java (valueOf): Return new Double(parseDouble(s)).

2002-10-31  Wu Gansha <gansha.wu@intel.com>:

        * java/util/ArrayList.java (readObject, writeObject): Only read/write
        size items.

2002-10-31  Wu Gansha <gansha.wu@intel.com>:

        * java/io/DataInputStream.java (convertFromUTF): Give StringBuffer an
        initial estimated size to avoid enlarge buffer frequently.

2002-10-31  Wu Gansha <gansha.wu@intel.com>:

	* java/lang/reflect/Proxy.java (ProxyType): Set loader to System
	ClassLoader when null.
	(ProxyType.hashCode): Loader null check no longer needed.
	(ProxyType.sameTypes): New method.
	(ProxyType.equals): Use new method.

2002-10-31  Mark Wielaard  <mark@klomp.org>

        * java/net/URLDecoder.java (decode): Initialize Stringbuffer size to
	length of String.
	* java/net/URLEncoder.java (encode): Likewise.

2002-10-31  Mark Wielaard  <mark@klomp.org>

	* java/util/zip/ZipInputStream.java (getNextEntry): Throw IOException
	when stream is closed.
	(closeEntry): Likewise.
	(read): Likewise.
	* java/util/zip/ZipOutputStream.java (putNextEntry): Throw
	ZipException when no entry active.
	(closeEntry): Likewise.
	(write): Likewise.

From-SVN: r58772
2002-11-03 20:27:31 +00:00
Tom Tromey afa54b4c09 Class.h: Move JV_STATE_ERROR before JV_STATE_DONE.
* java/lang/Class.h: Move JV_STATE_ERROR before JV_STATE_DONE.
	* java/lang/natClass.cc (initializeClass): Don't return just
	because self==thread.

From-SVN: r58763
2002-11-02 23:52:56 +00:00
Tom Tromey fead5eb589 For PR java/8415:
* java/lang/reflect/natMethod.cc (getType): Use _Jv_FindClass.
	* prims.cc (_Jv_FindClassFromSignature): Indentation fix.

From-SVN: r58757
2002-11-02 21:33:30 +00:00
Tom Tromey ca7c2b8529 natRuntime.cc (_Jv_SetDLLSearchPath): New function.
* java/lang/natRuntime.cc (_Jv_SetDLLSearchPath): New function.
	(_Jv_FindSymbolInExecutable): Removed argument name.
	(insertSystemProperties): Call _Jv_SetDLLSearchPath if
	java.library.path is set.

	* gij.cc (help): Document --showversion.
	(version): Don't exit.
	(main): Handle --showversion.  Exit if --version given.

From-SVN: r58520
2002-10-25 03:28:00 +00:00
Adam Megacz e2a450f6e8 aclocal.m4 (CHECK_FOR_BROKEN_MINGW_LD): added
2002-10-20  Adam Megacz <adam@xwt.org>

        * aclocal.m4 (CHECK_FOR_BROKEN_MINGW_LD): added
        * configure.in: enabled hash sync on Win32
        * include/win32-threads.h (_Jv_ThreadId_t): added.
        * java/lang/natObject.cc (_Jv_MonitorEnter, _Jv_MonitorExit,
        heavy_lock_obj_finalization_proc, wait, notify, notifyAll):
        removed some posix-isms, use Thread::sleep() instead of usleep,
        added code to clear bottom three bits if platform has a broken
        linker.  * include/win32-threads.h (_Jv_ThreadId_t): added.

From-SVN: r58344
2002-10-21 01:50:14 +00:00
Ranjit Mathew 6d0b22ecb0 natRuntime.cc (insertSystemProperties): Added GCJ runtime property "gnu.gcj.progname" containing the name used to...
2002-10-19  Ranjit Mathew <rmathew@hotmail.com>

	* java/lang/natRuntime.cc (insertSystemProperties): Added GCJ
	runtime property "gnu.gcj.progname" containing the name used to
	invoke the current Java program (similar to argv[0] for C
	programs).

From-SVN: r58343
2002-10-20 23:47:43 +00:00
Mark Wielaard 9dac635528 re PR libgcj/8142 ('$' in class names vs. dlopen 'dynamic string tokens')
Fix for PR libgcj/8142
	* java/lang/natClassLoader.cc (findClass): Skip inner classes when
	loading native modules.

From-SVN: r58066
2002-10-11 22:10:37 +00:00
Mark Wielaard 8086481ce6 Thread.java (setDaemon): Check startable_flag, not isAlive().
* java/lang/Thread.java (setDaemon): Check startable_flag,
	not isAlive().

From-SVN: r57906
2002-10-07 21:02:38 +00:00
Mark Wielaard 0a3fbe88bb * java/lang/Throwable.java: Remerge with Classpath.
From-SVN: r57823
2002-10-04 16:47:36 +00:00
Anthony Green d3cc3f10da Add Proxy support.
From-SVN: r57635
2002-09-30 05:19:09 +00:00
Tom Tromey 169f75f384 * java/lang/natClassLoader.cc:
(_Jv_PrepareCompiledClass): Throw NoClassDefFoundError, per spec.
	* resolve.cc: Include NoClassDefFoundError.h, not
	ClassNotFoundException.h.
	(_Jv_ResolvePoolEntry): Throw NoClassDefFoundError, per spec.
	* defineclass.cc: Don't include ClassNotFoundException.h.

From-SVN: r57516
2002-09-25 20:57:03 +00:00
Tom Tromey b5f4221e51 ClassLoader.java (resolveClass0): Set cause for newly-created exception.
* java/lang/ClassLoader.java (resolveClass0): Set cause for
	newly-created exception.

From-SVN: r57310
2002-09-19 17:44:49 +00:00
Michael Koch cf0f53eb6e AssertionError.java: Merge with classpath, fixes HTML.
2002-09-16  Michael Koch  <konqueror@gmx.de>

	* java/lang/AssertionError.java:
	Merge with classpath, fixes HTML.
	* java/rmi/server/LogStream.java:
	Merge with classpath, fixes some constants.
	* java/net/server/RemoteServer.java:
	Merge with classpath, adds serialVersionUID.
	* javax/naming/BinaryRefAddr.java:
	Merge with classpath, s/equal/equals/.
	* javax/naming/NamingException.java:
	Merge with classpath, fixed typo.
	* javax/naming/RefAddr.java:
	Merge with classpath, s/equal/equals/.
	* java/awt/Toolkit.java:
	s/gnu.java.awt.peer.gtk.GtkToolkit/gnu.awt.gtk.GtkToolkit/
	and typo fixed.

From-SVN: r57187
2002-09-16 09:46:37 +00:00
Tom Tromey f470196114 Class.h (_getDeclaredMethod): Declare.
* java/lang/Class.h (_getDeclaredMethod): Declare.
	(_getMethod): Now private.
	* java/lang/natClass.cc (_getDeclaredMethod): Renamed from
	getDeclaredMethod.  Now returns NULL on failure.
	* java/lang/Class.java (_getDeclaredMethod): Declare.
	(getDeclaredMethod): No longer native; implements access checks.

From-SVN: r56772
2002-09-03 21:33:46 +00:00
Mark Wielaard 4d5c703ec0 NameFinder.java (remove_interpreter): New field.
* gnu/gcj/runtime/NameFinder.java (remove_interpreter): New field.
       (sanitizeStack): Correctly reset unknown and interpreter counters,
       detect interpreter runtime frames.
       (demangleInterpreterMethod): New method.
       * gnu/gcj/runtime/natNameFinder.cc (lookupInterp): Use new method.
       * java/lang/natVMThrowable.cc (fillInStackTrace): Change order of
       filling in addrs[].

From-SVN: r56741
2002-09-02 15:55:57 +00:00
Tom Tromey 3308c46e47 jvm.h (struct _Jv_frame_info): New structure.
* include/jvm.h (struct _Jv_frame_info): New structure.
	* gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h,
	java-interp.h.
	(lookupInterp): New method.
	(getAddrAsString): Use _Jv_frame_info.
	(dladdrLookup): Likewise.
	* gnu/gcj/runtime/NameFinder.java (lookup): Try to look up
	interpreted frame.
	(lookupInterp): Declare.
	* java/lang/natVMThrowable.cc: Include Thread.h, java-interp.h.
	(fillInStackTrace): Collect information on interpreted frames.
	Use _Jv_frame_info.
	* interpret.cc: Include Thread.h.
	(run): Create and push _Jv_MethodChain object.
	(_Jv_EndOfInterpreter): New global.
	* java/lang/Thread.java (interp_frame): New field.
	* include/java-interp.h (struct _Jv_MethodChain): New structure.
	Include NameFinder.h.

From-SVN: r56657
2002-08-29 17:53:28 +00:00
Tom Tromey 97d8f7e7e7 Class.h: Include Package.h.
* java/lang/Class.h: Include Package.h.
	(Class::getProtectionDomain): Declare.
	(Class::getPackage): Declare.

From-SVN: r56640
2002-08-28 20:05:34 +00:00
Tom Tromey f87999337a natConstructor.cc (newInstance): Initialize class.
* java/lang/reflect/natConstructor.cc (newInstance): Initialize
	class.
	* java/lang/reflect/natMethod.cc (invoke): Initialize class.

From-SVN: r56624
2002-08-27 23:57:17 +00:00
Mark Wielaard 6e0532cdf6 Makefile.am (libgcj_la_SOURCES): Remove name-finder.cc.
* Makefile.am (libgcj_la_SOURCES): Remove name-finder.cc.
        (core_java_source_files): Add VMThrowable.java and NameFinder.java
        (nat_source_files): Remove natThrowable.cc, add natVMThrowable.cc
        and natNameFinder.cc.
        * Makefile.in: Regenerate.
        * prims.cc: Use trace_enabled from VMThrowable.
        * name-finder.cc: Removed.
        * gcj/javaprims.h: Add class VMThrowable.
        * gnu/gcj/runtime/NameFinder.java: New file.
        * gnu/gcj/runtime/natNameFinder.cc: Likewise.
        * include/name-finder.h: Removed.
        * java/lang/Throwable.java (printStackTrace (PrintStream)): Use new
        method stackTraceString().
        (printStackTrace (PrintWriter)): Likewise.
        (stackTraceString): Complete rewrite of old printStackTrace using
        StringBuffer.
        (stackTraceStringBuffer): New helper method for stackTraceString().
        (fillInStackTrace): Delegate to VMTrowable.
        (getStackTrace): Likewise.
        (getStackTrace0): Removed.
        (trace_enabled, stackTraceBytes): Moved to new VMThrowable.java.
        (setStackTrace): Copy given array.
        * java/lang/natThrowable.cc: Removed (replaced by natVMThrowable).
        * java/lang/VMThrowable.java: New class.
        * java/lang/natVMThrowable.cc: New file.

From-SVN: r56556
2002-08-24 22:46:19 +00:00
Jesse Rosenstock 093f02000f natPosixProcess.cc (cleanup): Added `path' argument.
2002-08-14  Jesse Rosenstock  <jmr@ugcs.caltech.edu>

	* java/lang/natPosixProcess.cc (cleanup): Added `path' argument.
	(startProcess): Allocate path for chdir in async-signal-safe way.

From-SVN: r56330
2002-08-14 19:53:54 +00:00
Jesse Rosenstock eb812b2c15 Fix for PR libgcj/7570 and PR libgcj/7578:
2002-08-13  Jesse Rosenstock  <jmr@ugcs.caltech.edu>

	Fix for PR libgcj/7570 and PR libgcj/7578:
	* java/lang/natPosixProcess.cc: Include java/io/File.h.
	(startProcess): Handle new `dir' argument.
	* java/lang/Win32Process.java (ConcreteProcess): Added `dir'
	argument.
	* java/lang/PosixProcess.java (ConcreteProcess): Added `dir'
	argument.
	(startProcess): Likewise.
	* java/lang/EcosProcess.java (ConcreteProcess): Added `dir'
	argument.
	* java/lang/Runtime.java (execInternal): Added `dir' argument.
	(exec): Don't create new environment if ENV==null.  Pass DIR to
	execInternal.
	* java/lang/natRuntime.cc: Include java/io/File.h.
	(execInternal): Added `dir' argument.

From-SVN: r56268
2002-08-14 01:07:59 +00:00
Bryce McKinlay 6ee4402c61 ClassLoader.java (getSystemClassLoader, [...]): Add javadoc from classpath.
2002-08-07  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* java/lang/ClassLoader.java (getSystemClassLoader, findClass,
	defineClass, setSigners, getSystemResource, getSystemResourceAsStream,
	findResource, getResources, findResources): Add javadoc from classpath.
	(getSystemResources): Implemented.

From-SVN: r56092
2002-08-07 06:28:24 +01:00
Tom Tromey 1efccea3b1 Runtime.java (loadLibrary): Pass `true' as search argument to _load.
* java/lang/Runtime.java (loadLibrary): Pass `true' as search
	argument to _load.

From-SVN: r55727
2002-07-24 23:17:39 +00:00
Mark Wielaard 5526ddf6fd [multiple changes]
2002-07-24  Mark Wielaard  <mark@klomp.org>

	* java/lang/reflect/natField.cc (setAddr): Check isAccessible().
	* java/io/ObjectInputStream.java (setBooleanField): Before setting
	field call setAccessible(true).
	(setByteField): Likewise.
	(setCharField): Likewise.
	(setDoubleField): Likewise.
	(setFloatField): Likewise.
	(setIntField): Likewise.
	(setLongField): Likewise.
	(setShortField): Likewise.
	(setObjectField): Likewise.

2002-07-24  Tom Tromey  <tromey@redhat.com>

	* java/io/ObjectInputStream.java (readObject) [TC_ARRAY]: Don't
	use toString() to format array element.

From-SVN: r55711
2002-07-24 16:05:34 +00:00
Bo Thorsen 7b20471292 ieeefp.h: Add x86-64 support.
2002-07-19  Bo Thorsen  <bo@berlioz.suse.de>

        * java/lang/ieeefp.h: Add x86-64 support.
        * configure.in: Likewise.
        * configure.host: Likewise.
        * configure: Regenerated.
        * sysdep/x86-64/locks.h: New file with x86-64 locks.

From-SVN: r55588
2002-07-19 16:41:15 +02:00
Jesse Rosenstock a5774acd55 For PR libgcj/7292:
2002-07-12  Jesse Rosenstock  <jmr@fulcrummicro.com>

	For PR libgcj/7292:
	* java/lang/Character.java (toString(char)): Now static.

From-SVN: r55427
2002-07-12 21:13:16 +00:00
Mark Wielaard dc7b1dda60 natThrowable.cc (printRawStackTrace): removed.
* java/lang/natThrowable.cc (printRawStackTrace): removed.
	(getStackTrace0): new method.
	* java/lang/Throwable.java (CPlusPlusDemangler): removed.
	(printStackTrace(PrintWriter)): replace with pure java implementation.
	(printRawStackTrace): removed.
	(getStackTrace0): new method.
	* java/lang/StackTraceElement.java (toString): add extra whitespace.
	* gcj/javaprims.h: regenerate class list.
	* include/name-finder.h (lookup): new returns StackTraceElement*.
	(method_name, file_name): fields removed.
	(pid2, f2_pipe, b2_pipe, b2_pipe_fd): new fields.
	(~_Jv_name_finder): close new descriptors.
	* name-finder.cc(_Jv_name_finder): setup c++filt helper process.
	(createStackTraceElement): new method.
	(lookup): returns StackTraceElement*, uses createStackTraceElement().

From-SVN: r55424
2002-07-12 12:52:44 +00:00
Tony Kimball 16da5ae295 natRuntime.cc (nativeGetLibname): Added missing `#'.
2002-07-05  Tony Kimball  <alk@pobox.com>

	* java/lang/natRuntime.cc (nativeGetLibname): Added missing `#'.

From-SVN: r55280
2002-07-06 05:11:53 +00:00
Tom Tromey 0d49ec1158 re PR libgcj/7060 (getMethod() doesn't search super interface)
2002-07-04  Tom Tromey  <tromey@redhat.com>
            Jeff Sturm  <jsturm@one-point.com>

	Fix for PR libgcj/7060:
	* java/lang/Class.h (_getMethod): Renamed from getMethod.
	* java/lang/natClass.cc (_getMethod): Renamed from getMethod.
	Recurse into superinterfaces.  Don't throw NoSuchMethodException.
	* java/lang/Class.java (getMethod): New Java implementation;
	complies with spec.
	(_getMethod): New native method.

Co-Authored-By: Jeff Sturm <jsturm@one-point.com>

From-SVN: r55266
2002-07-05 20:40:11 +00:00
Tom Tromey d74bba04e8 natPlainDatagramSocketImpl.cc (BooleanClass): Removed.
* java/net/natPlainDatagramSocketImpl.cc (BooleanClass): Removed.
	(IntegerClass): Likewise.
	* java/lang/natClass.cc (CloneableClass): Removed.
	(ObjectClass, ErrorClass, ClassClass, MethodClass, FieldClass,
	ConstructorClass): Likewise.
	* java/lang/natClassLoader.cc (CloneableClass): Removed.
	(ObjectClass, ClassClass, VMClassLoaderClass, ClassLoaderClass,
	SerializableClass): Likewise.
	* java/lang/reflect/natMethod.cc (BooleanClass): Removed.
	(VoidClass, ByteClass, ShortClass, CharacterClass, IntegerClass,
	LongClass, FloatClass, DoubleClass): Likewise.

From-SVN: r54977
2002-06-25 05:29:22 +00:00
Tom Tromey fdae83abe7 verify.cc (branch_prepass): Updated for change to exception handler type.
* verify.cc (branch_prepass): Updated for change to exception
	handler type.
	(verify_instructions_0): Likewise.
	* defineclass.cc (handleCodeAttribute): Initialize `prepared'.
	(handleExceptionTableEntry): Updated for change to exception
	handler type.
	* java/lang/Class.h (Class): Removed _Jv_InterpMethodInvocation.
	* include/java-interp.h (_Jv_InterpMethodInvocation): Removed.
	(union _Jv_InterpPC): New.
	(class _Jv_InterpException): Changed types to _Jv_InterpPC.
	(class _Jv_InterpMethod): Added new `prepared' field.
	(class _Jv_InterpMethod): Added `compile' method.  Removed
	`continue1' and `find_exception'.  Changed arguments to `run'.
	* interpret.cc (union insn_slot): New.
	(find_exception): Removed.
	(run_normal): Removed most logic.
	(run_synch_object): Likewise; also, use JvSynchronize.
	(run_synch_class): Likewise.
	(run): Removed.
	(continue1): Renamed as `run'.  Compile bytecode if required.
	Add new code to allow refinement of direct-threaded code at
	runtime.  Handle exceptions.
	(SAVE_PC): Removed.
	(compile): New method.
	(SET_ONE, SET_INSN, SET_INT, SET_DATUM): New defines.
	(NULLARRAYCHECK): Don't use SAVE_PC.
	(pc_t): New typedef.
	(TAKE_GOTO, GET1S, GET1U, GET2U, AVAL1U, AVAL2U, AVAL2UP,
	SKIP_GOTO, GOTO_VAL, PCVAL, AMPAMP): New macros.

From-SVN: r54968
2002-06-24 20:38:47 +00:00
Tom Tromey 3831381763 javaprims.h: Updated class declaration list.
* gcj/javaprims.h: Updated class declaration list.
	* Makefile.in: Rebuilt.
	* Makefile.am (core_java_source_files): Added
	PropertyPermissionCollection.java.
	* java/lang/Thread.java (group, name): Now package-private.
	* java/lang/ThreadGroup.java: Re-merge with Classpath.
	* java/util/AbstractList.java: Likewise.
	* java/util/AbstractMap.java: Likewise.
	* java/util/Calendar.java: Likewise.
	* java/util/Collections.java: Likewise.
	* java/util/HashMap.java: Likewise.
	* java/util/Hashtable.java: Likewise.
	* java/util/LinkedHashMap.java: Likewise.
	* java/util/LinkedList.java: Likewise.
	* java/util/List.java: Likewise.
	* java/util/ListResourceBundle.java: Likewise.
	* java/util/Map.java: Likewise.
	* java/util/Observable.java: Likewise.
	* java/util/Properties.java: Likewise.
	* java/util/PropertyPermission.java: Likewise.
	* java/util/PropertyPermissionCollection.java: Likewise.
	* java/util/PropertyResourceBundle.java: Likewise.
	* java/util/Random.java: Likewise.
	* java/util/SimpleTimeZone.java: Likewise.
	* java/util/StringTokenizer.java: Likewise.
	* java/util/TimerTask.java: Likewise.
	* java/util/TreeMap.java: Likewise.
	* java/util/WeakHashMap.java: Likewise.
	* java/util/jar/Attributes.java: Likewise.
	* java/util/jar/JarException.java: Likewise.
	* java/util/jar/Manifest.java: Likewise.

From-SVN: r54743
2002-06-18 15:40:16 +00:00
Nathanael Nerode 8f7dfb539f ClassNotFoundException.java: New Classpath version.
2002-06-17  Nathanael Nerode  <neroden@twcny.rr.com>

	* java/lang/ClassNotFoundException.java: New Classpath version.

From-SVN: r54713
2002-06-17 19:15:22 +00:00
Tom Tromey 548ce8be4a RuntimeException.java: Re-merge with Classpath.
* java/lang/RuntimeException.java: Re-merge with Classpath.
	* java/util/ArrayList.java: Likewise.
	* java/util/Arrays.java: Likewise.
	* java/util/BitSet.java: Likewise.
	* java/util/Dictionary.java: Likewise.
	* java/util/IdentityHashMap.java: Likewise.
	* java/util/MissingResourceException.java: Likewise.
	* java/util/Observer.java: Likewise.
	* java/util/TooManyListenersException.java: Likewise.
	* java/util/zip/DataFormatException.java: Likewise.
	* java/util/zip/ZipException.java: Likewise.

From-SVN: r54680
2002-06-16 21:15:44 +00:00
Tom Tromey 3e1b181a67 AbstractMethodError.java: Re-merged with Classpath.
* java/lang/AbstractMethodError.java: Re-merged with Classpath.
	* java/lang/ArithmeticException.java: Likewise.
	* java/lang/ArrayIndexOutOfBoundsException.java: Likewise.
	* java/lang/ArrayStoreException.java: Likewise.
	* java/lang/Byte.java: Likewise.
	* java/lang/CharSequence.java: Likewise.
	* java/lang/ClassCastException.java: Likewise.
	* java/lang/ClassCircularityError.java: Likewise.
	* java/lang/ClassFormatError.java: Likewise.
	* java/lang/CloneNotSupportedException.java: Likewise.
	* java/lang/Cloneable.java: Likewise.
	* java/lang/Comparable.java: Likewise.
	* java/lang/Compiler.java: Likewise.
	* java/lang/Error.java: Likewise.
	* java/lang/ExceptionInInitializerError.java: Likewise.
	* java/lang/IllegalAccessError.java: Likewise.
	* java/lang/IllegalAccessException.java: Likewise.
	* java/lang/IllegalArgumentException.java: Likewise.
	* java/lang/IllegalMonitorStateException.java: Likewise.
	* java/lang/IllegalStateException.java: Likewise.
	* java/lang/IllegalThreadStateException.java: Likewise.
	* java/lang/IncompatibleClassChangeError.java: Likewise.
	* java/lang/IndexOutOfBoundsException.java: Likewise.
	* java/lang/InheritableThreadLocal.java: Likewise.
	* java/lang/InstantiationError.java: Likewise.
	* java/lang/InstantiationException.java: Likewise.
	* java/lang/InternalError.java: Likewise.
	* java/lang/InterruptedException.java: Likewise.
	* java/lang/LinkageError.java: Likewise.
	* java/lang/NegativeArraySizeException.java: Likewise.
	* java/lang/NoClassDefFoundError.java: Likewise.
	* java/lang/NoSuchFieldError.java: Likewise.
	* java/lang/NoSuchFieldException.java: Likewise.
	* java/lang/NoSuchMethodError.java: Likewise.
	* java/lang/NoSuchMethodException.java: Likewise.
	* java/lang/NullPointerException.java: Likewise.
	* java/lang/NumberFormatException.java: Likewise.
	* java/lang/OutOfMemoryError.java: Likewise.
	* java/lang/Process.java: Likewise.
	* java/lang/Runnable.java: Likewise.
	* java/lang/RuntimePermission.java: Likewise.
	* java/lang/SecurityException.java: Likewise.
	* java/lang/Short.java: Likewise.
	* java/lang/StackOverflowError.java: Likewise.
	* java/lang/StringIndexOutOfBoundsException.java: Likewise.
	* java/lang/ThreadDeath.java: Likewise.
	* java/lang/ThreadLocal.java: Likewise.
	* java/lang/UnknownError.java: Likewise.
	* java/lang/UnsatisfiedLinkError.java: Likewise.
	* java/lang/UnsupportedClassVersionError.java: Likewise.
	* java/lang/UnsupportedOperationException.java: Likewise.
	* java/lang/VerifyError.java: Likewise.
	* java/lang/VirtualMachineError.java: Likewise.
	* java/lang/reflect/InvocationTargetException.java: Likewise.
	* java/net/BindException.java: Likewise.
	* java/net/ConnectException.java: Likewise.
	* java/net/MalformedURLException.java: Likewise.
	* java/net/NoRouteToHostException.java: Likewise.
	* java/net/ProtocolException.java: Likewise.
	* java/net/SocketException.java: Likewise.
	* java/net/UnknownHostException.java: Likewise.
	* java/net/UnknownServiceException.java: Likewise.

From-SVN: r54656
2002-06-15 19:45:34 +00:00
Tom Tromey 93f7aeea7a natString.cc (init): Handle case where DONT_COPY is true and OFFSET!=0.
* java/lang/natString.cc (init): Handle case where DONT_COPY is
	true and OFFSET!=0.
	* java/lang/String.java (String(char[],int,int,boolean): New
	constructor.
	* java/lang/Long.java: Imported new version from Classpath.
	* java/lang/Number.java: Likewise.
	* java/lang/Integer.java: Likewise.
	* java/lang/Long.java: Likewise.
	* java/lang/Float.java: Likewise.
	* java/lang/Boolean.java: Likewise.
	* java/lang/Double.java: Likewise.
	* java/lang/Void.java: Likewise.

From-SVN: r54595
2002-06-13 18:16:26 +00:00
Tom Tromey 419831367f Class.h (Class::desiredAssertionStatus): Declare.
* java/lang/Class.h (Class::desiredAssertionStatus): Declare.
	(Class::getPackagePortion): Likewise.
	* java/lang/Class.java (desiredAssertionStatus): New method from
	Classpath.
	(getPackagePortion): Likewise.
	* java/lang/VMClassLoader.java (defaultAssertionStatus,
	packageAssertionStatus, classAssertionStatus): New methods from
	Classpath.
	* java/lang/ClassLoader.java (defaultAssertionStatus,
	systemPackageAssertionStatus, packageAssertionStatus,
	systemClassAssertionStatus, classAssertionStatus): New fields from
	Classpath.
	(setDefaultAssertionStatus, setPackageAssertionStatus,
	setClassAssertionStatus, clearAssertionStatus): New methods from
	Classpath.
	* Makefile.in: Rebuilt.
	* Makefile.am (core_java_source_files): Added AssertionError.java.
	* java/lang/AssertionError.java: New from Classpath.

From-SVN: r54517
2002-06-11 17:33:22 +00:00
Bryce McKinlay f5fa9bc199 natThrowable.cc (fillInStackTrace): Use "stackTraceBytes", not "stackTrace".
* java/lang/natThrowable.cc (fillInStackTrace): Use "stackTraceBytes",
        not "stackTrace".

From-SVN: r53857
2002-05-24 23:31:23 +01:00
Bryce McKinlay 4fbecd2944 Merge JDK 1.4 exception chaining support from classpath.
* java/lang/Throwable.java: Merge 1.4 support from classpath.
	(stackTraceBytes): Rename from stackTrace.
	* java/lang/Exception.java: Merge from classpath.
	* java/lang/StackTraceElement: New file from classpath.
	* gcj/javaprims.h: Rebuild CNI namespace declarations.
	* Makefile.am: Add StackTraceElement.
	* Makefile.in: Rebuilt.

From-SVN: r53836
2002-05-24 11:40:47 +01:00
Tom Tromey e86c533b01 natRuntime.cc: Don't include sys/time.h and time.h.
* java/lang/natRuntime.cc: Don't include sys/time.h and time.h.
	* java/util/natTimeZone.cc: Include sys/time.h and time.h here.
	Include platform.h.

From-SVN: r53443
2002-05-14 05:29:30 +00:00
Tom Tromey 8639786815 re PR libgcj/6389 (System.getProperty("") should always throw an IllegalArgumentException)
Fixes PR libgcj/6389:
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natTimeZone.cc.
	* java/util/natTimeZone.cc: New file.
	* java/util/TimeZone.java (getDefaultTimeZoneId): New method.
	* java/lang/System.java: Merged with Classpath.
	* java/lang/Runtime.java: Merged with Classpath.
	* java/lang/natSystem.cc (setErr0): Renamed from setErr; don't run
	security check.
	(setIn0): Renamed from setIn; don't run security check.
	(setOut0): Renamed from setOut; don't run security check.
	(file_encoding, getpwuid_adaptor, getSystemTimeZone,
	init_properties): Moved to natRuntime.cc.
	Moved many includes to natRuntime.cc.
	(isWordsBigEndian): New method.
	* java/lang/natRuntime.cc: Include Long.h, also other includes
	previously in natSystem.cc.
	(maxMemory): New function.
	(exitInternal): Renamed from `_exit'.
	(exit): Removed.
	(init): Don't set finalize_on_exit.
	(exitInternal): Use `finalizeOnExit'.
	(file_encoding, getpwuid_adaptor): New functions from
	natSystem.cc.
	(insertSystemProperties): New method, renamed from
	System::init_properties.  Don't set user.timezone.
	(_load): Don't call checkLink.
	(execInternal): New method.
	(availableProcessors): Likewise.
	(nativeGetLibname): Likewise.

From-SVN: r53429
2002-05-13 20:10:37 +00:00
Tom Tromey 5d243e08b8 * java/lang/natString.cc (unintern): Fixed typo.
From-SVN: r53265
2002-05-07 19:07:07 +00:00
David Billinghurst 0659e0e3df natSystem.cc (getSystemTimeZone): Use HAVE_UNDERSCORE_TIMEZONE.
2002-05-03  David Billinghurst  <David.Billinghurst@riotinto.com>
	    Tom Tromey  <tromey@redhat.com>

	* java/lang/natSystem.cc (getSystemTimeZone): Use
	HAVE_UNDERSCORE_TIMEZONE.
	* include/config.h.in: Rebuilt.
	* acconfig.h (HAVE_UNDERSCORE_TIMEZONE, HAVE_BACKTRACE): Undef.
	* aclocal.m4, configure: Rebuilt.
	* acinclude.m4: Run AC_EXEEXT.
	* configure.in: Adjust test for `timezone' so it fails on Cygwin.
	Add test for `_timezone'.

Co-Authored-By: Tom Tromey <tromey@redhat.com>

From-SVN: r53117
2002-05-03 20:17:48 +00:00
Gerhard Tonn f736fd67c0 ieeefp.h: Define __IEEE_BIG_ENDIAN for S/390.
2002-04-29  Gerhard Tonn  <GerhardTonn@swol.de>

	* java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for S/390.

From-SVN: r52874
2002-04-29 05:15:57 +01:00
Adam King ddfb5e0b69 natDouble.cc (parseDouble): Allow a number to end with the f/F/d/D modifiers.
2002-04-13  Adam King <aking@dreammechanics.com>

        * java/lang/natDouble.cc (parseDouble): Allow a number to end with
        the f/F/d/D modifiers.

From-SVN: r52308
2002-04-15 03:11:12 +00:00
Tom Tromey 880f8c16ad Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/Thread.h): Mark
	_Jv_AttachCurrentThreadAsDaemon as friend.
	* gcj/javaprims.h (_Jv_AttachCurrentThreadAsDaemon): Declare.
	* gcj/cni.h (JvAttachCurrentThreadAsDaemon): New function.
	* java/lang/natThread.cc (_Jv_AttachCurrentThreadAsDaemon): New
	function.
	* java/lang/natRuntime.cc (_load): Recognize JNI_VERSION_1_4.
	* jni.cc (_Jv_JNI_GetVersion): Return JNI_VERSION_1_4.
	(_Jv_JNI_InvokeFunctions): Added
	_Jv_JNI_AttachCurrentThreadAsDaemon.
	(_Jv_JNI_GetEnv): Handle JNI_VERSION_1_4.
	(JNI_GetDefaultJavaVMInitArgs): Likewise.
	(JNI_CreateJavaVM): Likewise.
	(_Jv_JNI_AttachCurrentThread): Likewise.
	(_Jv_JNI_AttachCurrentThread): Added `is_daemon' argument.
	(_Jv_JNI_AttachCurrentThreadAsDaemon): New method.
	(_Jv_JNIFunctions): Initialize new fields.
	(_Jv_JNI_NewDirectByteBuffer): New function.
	(_Jv_JNI_GetDirectBufferAddress): Likewise.
	(_Jv_JNI_GetDirectBufferCapacity): Likewise.
	* include/jni.h (JNI_VERSION_1_4): New macro.
	(JNIInvokeInterface::AttachCurrentThreadAsDaemon): New field.
	(_Jv_JavaVM::AttachCurrentThreadAsDaemon): New method.
	(JNINativeInterface::NewDirectByteBuffer): New field.
	(JNINativeInterface::GetDirectBufferAddress): New field.
	(JNINativeInterface::GetDirectBufferCapacity): New field.
	(_Jv_JNIEnv::NewDirectByteBuffer): New method.
	(_Jv_JNIEnv::GetDirectBufferAddress): New method.
	(_Jv_JNIEnv::GetDirectBufferCapacity): New method.

From-SVN: r52144
2002-04-10 20:36:04 +00:00
Adam King 455cd615c2 natSystem.cc (init_properties): Call new function _Jv_platform_initProperties.
2002-04-07  Adam King <aking@dreammechanics.com>

	* java/lang/natSystem.cc (init_properties): Call new function
	_Jv_platform_initProperties.
	* win32 (_Jv_platform_initProperties): New function that adds Win32
	support for the System properties os.name, os.arch, os.version,
	user.name, user.home, and user.dir.
	* include/posix.h, include/win32.h, posix.cc: New function
	_Jv_platform_initProperties.

From-SVN: r51989
2002-04-07 12:27:00 +01:00
Mark Wielaard e45a3a5910 * java/lang/Character,java (isDefined): getType() != UNASSIGNED.
From-SVN: r51982
2002-04-07 07:45:06 +00:00
Mark Wielaard 2801df0ed6 Modifier.java (toString(int,StringBuffer)): Fix ordering.
* java/lang/reflect/Modifier.java (toString(int,StringBuffer)): Fix
        ordering.

From-SVN: r51848
2002-04-04 08:32:28 +00:00
Tom Tromey c544921cc0 natClassLoader.cc (findClass): Compare against `3', not `0'.
* java/lang/natClassLoader.cc (findClass): Compare against `3',
	not `0'.

From-SVN: r51764
2002-04-02 22:20:30 +00:00
Bryce McKinlay 1b5a2139c7 natSystem.cc (init_properties): Update VM version properties.
* java/lang/natSystem.cc (init_properties): Update VM version
	properties.
	* configure.in: Set GCJVERSION.
	* acconfig.h: Add GCJVERSION.
	* configure: Rebuilt.
	* include/config.h.in: Rebuilt.

From-SVN: r50944
2002-03-18 06:19:03 +00:00
Anthony Green a46ccd1b47 Add arm thumb support
From-SVN: r50920
2002-03-17 16:18:53 +00:00
Tom Tromey 0c1fcb02b1 Win32Process.java: Added comment.
* java/lang/Win32Process.java: Added comment.
	* include/posix.h (_Jv_platform_close_on_exec): New function.
	Include fcntl.h.
	* include/win32.h (_Jv_platform_close_on_exec): New function.
	* java/net/natPlainSocketImpl.cc (create): Set close-on-exec
	flag.
	(accept): Likewise.
	* java/net/natPlainDatagramSocketImpl.cc (create): Set
	close-on-exec flag.
	* java/io/natFileDescriptorPosix.cc (open): Set close-on-exec
	flag.

From-SVN: r50536
2002-03-10 17:59:23 +00:00
Bryce McKinlay 4559716751 Hashtable synchronization for PowerPC.
libjava:
	Hashtable synchronization for PowerPC.
	* configure.in: Define SLOW_PTHREAD_SELF if configure.host set
	slow_pthread_self. Set up symlink for sysdeps directory.
	* configure: Rebuild.
	* configure.host: Document more shell variables. Set sysdeps_dir
	for most platforms. Set slow_pthread_self for i686. Set
	enable_hash_synchronization_default and slow_pthread_self for PowerPC.
	* posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use release_set so
	that memory barrier is emitted where required.
	* prims.cc: 64-bit align static primitive class instances.
	* include/posix-threads.h (_Jv_ThreadSelf for SLOW_PTHREAD_SELF): Add
	read_barrier() to enforce ordering of reads.
	* sysdep/powerpc/locks.h: New file. Implementation of synchronization
	primitives for PowerPC.
	* sysdep/i386/locks.h: New file. Synchronization primitives for i386
	moved from natObject.cc.
	* sysdep/alpha/locks.h: Likewise.
	* sysdep/ia64/locks.h: Likewise.
	* sysdep/generic/locks.h: Likewise.
	* java/lang/natObject.cc: Move thread synchronization primitives to
	system-dependent headers.
gcc/java:
	* decl.c (java_init_decl_processing): Make sure class_type_node
	alignment is not less than 64 bits if hash synchronization isenabled.

boehm-gc:
	* include/gc_priv.h: Define ALIGN_DOUBLE on 32 bit targets if GCJ
	support is enabled, for hash synchronization.

From-SVN: r50523
2002-03-10 03:53:16 +00:00
Adam Megacz abfabb9850 Win32Process.java (ConcreteProcess): Now throws an IOException so that Throwable.printStackTrace fails correctly.
2002-03-09  Adam Megacz  <adam@xwt.org>

        * java/lang/Win32Process.java (ConcreteProcess): Now throws an
        IOException so that Throwable.printStackTrace fails correctly.

From-SVN: r50488
2002-03-09 08:47:40 +00:00
Adam Megacz 8eeda6e0e7 win32.cc (_Jv_platform_gettimeofday): Now takes no args, returns jlong.
2002-03-07  Adam Megacz  <adam@xwt.org>

        * win32.cc (_Jv_platform_gettimeofday): Now takes no args,
        returns jlong. Added implementation
        * posix.cc (_Jv_platform_gettimeofday): Now takes no args,
        returns jlong.
        * win32.h (_Jv_platform_gettimeofday): Now takes no args,
        returns jlong.
        * posix.h (_Jv_platform_gettimeofday): Now takes no args,
        returns jlong.
        * java/lang/natSystem.cc (currentTimeMillis): Now uses updated
        _Jv_platform_gettimeofday signature.

From-SVN: r50416
2002-03-08 01:03:56 +00:00
Eric Blake 1fa782725c unicode-decomp.pl: Move from chartables.pl...
2002-03-04  Eric Blake  <ebb9@email.byu.edu>

	* scripts/unicode-decomp.pl: Move from chartables.pl, and remove
	the code for generating include/java-chartables.h.
	* scripts/unicode-blocks.pl: Move from scripts/blocks.pl, and
	merge with Classpath.
	* scripts/unicode-muncher.pl: Copy from Classpath.
	* scritps/MakeCharTables.java: New file.
	* gnu/gcj/convert/Blocks-3.txt: New file.
	* gnu/gcj/convert/UnicodeData-3.0.0.txt: New file.
	* gnu/gcj/convert/UnicodeCharacterDatabase-3.0.0.html: New file.
	* gnu/java/lang/CharData.java: Copy from Classpath.
	* Makefile.am (ordinary_java_source_files): Add
	gnu/java/lang/CharData.java.
	* configure.in: Remove --enable-fast-character option.
	* java/lang/Character.java: Merge algorithms and Javadoc with
	Classpath.
	* java/lang/natCharacter.cc: Implement Unicode lookup table more
	efficiently.
	* include/java-chardecomp.h: Regenerate.
	* include/java-chartables.h: Regenerate.

From-SVN: r50368
2002-03-06 18:54:45 +00:00
Tom Tromey 355526af2b natPosixProcess.cc (fail): Removed.
* java/lang/natPosixProcess.cc (fail): Removed.
	(startProcess): Simplified error-handling.  Preserve
	LD_LIBRARY_PATH across exec.

From-SVN: r50342
2002-03-06 05:13:58 +00:00
Anthony Green 562ff1637f Add pointer support to the reflection code.
From-SVN: r50180
2002-03-01 05:36:31 +00:00
Tom Tromey fc04b455f9 natSystem.cc (init_properties): Use __VERSION__.
* java/lang/natSystem.cc (init_properties): Use __VERSION__.
	* gij.cc (version): Use __VERSION__.
	* include/config.h.in: Rebuilt.
	* acconfig.h (GCJVERSION): Removed.
	* configure: Rebuilt.
	* configure.in (GCJVERSION): Removed.

From-SVN: r50088
2002-02-27 05:32:29 +00:00
Tom Tromey 7fe4a89aed natPosixProcess.cc (startProcess): Use FD_CLOEXEC, not `1'.
* java/lang/natPosixProcess.cc (startProcess): Use FD_CLOEXEC, not
	`1'.

From-SVN: r50081
2002-02-27 01:39:30 +00:00
Adam Megacz f5d8c6600c Win32Process.java: Created a dummy class to allow build process to run to completion.
2002-02-24  Adam Megacz  <adam@xwt.org>

        * java/lang/Win32Process.java: Created a dummy class to allow
        build process to run to completion.

From-SVN: r50013
2002-02-24 23:17:26 +00:00
Jeff Sturm a7261b2da0 natMethod.cc (_Jv_CallAnyMethodA): Define ffi_result union for ffi_call result.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA):
        Define ffi_result union for ffi_call result.  Cast
        ffi_result members to jvalue.

From-SVN: r50007
2002-02-24 17:55:44 +00:00
Tom Tromey 1a77d3ba32 natSystem.cc (init_properties): Include the `Inc.' in java.vendor and java.vm.vendor.
* java/lang/natSystem.cc (init_properties): Include the `Inc.' in
	java.vendor and java.vm.vendor.
	* gnu/java/rmi/rmic/RMIC.java (parseOptions): Only print most
	recent copyright date.
	* gnu/gcj/convert/Convert.java (version): Print `Inc'.
	* gij.cc (version): Print `Inc'.

From-SVN: r49975
2002-02-22 23:24:45 +00:00
Bryce McKinlay 15b28697de Makefile.in: Rebuilt with Eric's change below.
* Makefile.in: Rebuilt with Eric's change below.

	* java/lang/natMath.cc (abs(jdouble), abs(jfloat), round(jfloat),
	round(jdouble), min(jfloat), max(jfloat), min(jdouble), min(jfloat)):
	Removed functions which are now implemented in Math.java.

From-SVN: r49782
2002-02-15 05:53:29 +00:00
Eric Blake 2f999d0fe7 javaprims.h (java::lang): Add java::lang::StrictMath.
2002-02-14  Eric Blake  <ebb9@email.byu.edu>

	* gcj/javaprims.h (java::lang): Add java::lang::StrictMath.
	* Makefile.am (core_java_source_files): Add
	java/lang/StrictMath.java.
	* java/lang/Math.java: Merge with Classpath.
	* java/lang/StrictMath.java: New file - merge with Classpath.

From-SVN: r49781
2002-02-15 03:21:47 +00:00
Tom Tromey 85ea93b38f natThrowable.cc: Updated copyright.
* java/lang/natThrowable.cc: Updated copyright.
	* java/io/natFileWin32.cc: Updated copyright.
	* java/io/natFileDescriptorWin32.cc: Updated copyright.
	* win32-threads.cc: Updated copyright.
	* name-finder.cc: Updated copyright.
	* include/name-finder.h: Updated copyright.

From-SVN: r49586
2002-02-07 19:26:06 +00:00
Tom Tromey 73272ce608 prims.cc (_Jv_CreateJavaVM): Call _Jv_platform_initialize.
* prims.cc (_Jv_CreateJavaVM): Call _Jv_platform_initialize.
	* win32.cc (win32_exception_handler): Now static.
	* include/win32.h (_Jv_platform_initialize): Declare.
	(win32_exception_handler): Don't declare.
	* java/lang/natSystem.cc (currentTimeMillis): Use
	_Jv_platform_gettimeofday.
	* posix.cc (_Jv_platform_gettimeofday): Renamed.
	(_Jv_select): Use new name.
	(_Jv_platform_initialize): New function.
	* include/posix.h (_Jv_platform_gettimeofday): Renamed from
	_Jv_gettimeofday.
	(_Jv_platform_initialize): Declare.

From-SVN: r49583
2002-02-07 18:59:52 +00:00
Anthony Green b5ee195f1e embedded updates
From-SVN: r49562
2002-02-07 03:24:12 +00:00
Bryce McKinlay 8c78e3a3cd configure.in: Set up PLATFORMOBJS not PLATFORM_SPECIFIC_SOURCES.
* configure.in: Set up PLATFORMOBJS not PLATFORM_SPECIFIC_SOURCES.
	Symlink PLATFORMH to platform.h.
	* Makefile.am (libgcj_la_DEPENDENCIES, libgcj_la_LIBADD): Add
	PLATFORMOBJS.
	* java/lang/natSystem.cc: #include platform.h not posix.h.
	* Makefile.in: Rebuilt with libgcj automake.
	* configure: Rebuilt.

From-SVN: r49534
2002-02-06 01:46:46 +00:00
Tom Tromey 0c91936e40 natPosixProcess.cc (myclose): New function.
* java/lang/natPosixProcess.cc (myclose): New function.
	(fail): Use it.
	(startProcess): Likewise.

From-SVN: r49433
2002-02-02 07:43:16 +00:00
Adam Megacz 54a190dd7b configure.in: Added support for mingw.
2002-02-01  Adam Megacz <adam@xwt.org>

        * configure.in: Added support for mingw.
        * java/lang/Win32Process.java: Created as empty file.
        * java/lang/natWin32Process.cc: Created as empty file.

From-SVN: r49425
2002-02-02 04:19:24 +00:00
Bryce McKinlay 9fa5237cb7 natObject.cc (X86 compare_and_swap): Use +m constraint.
2002-01-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* java/lang/natObject.cc (X86 compare_and_swap): Use +m constraint.

From-SVN: r49198
2002-01-25 02:53:37 +00:00
Per Bothner 033509daea natField.cc (setAddr): New function.
* java/lang/reflect/natField.cc (setAddr):  New function.
	Calls getAddr and then checks that the field isn't final.
	(setBoolean. setChar, setByte, setShort, setInt, setLong, setFloat,
	setDouble, set):  Use setAddr instead of getAddr, to check for FINAL.
	(set):  Call setAddr before check that new value has right type,
	to better match specified semantics.

From-SVN: r49153
2002-01-23 11:42:18 -08:00
Mark Wielaard 92aaa24628 Add license clarification.
From-SVN: r49104
2002-01-22 22:40:42 +00:00
Tom Tromey c342f12677 [multiple changes]
2002-01-15  Tom Tromey  <tromey@redhat.com>

	* java/lang/Float.java (equals): Preserve old code.
	* java/lang/Double.java (equals): Preserve old code.

2002-01-15  Eric Blake  <ebb9@email.byu.edu>

	* java/lang/Double.java (equals, compare): Fix 0.0 vs. -0.0 math.
	* java/lang/Float.java (equals, compare): Ditto.

From-SVN: r48895
2002-01-16 04:06:33 +00:00
Tom Tromey 999825b056 natSystem.cc (init_properties): Only look for default locale if LC_MESSAGES is defined.
* java/lang/natSystem.cc (init_properties): Only look for default
	locale if LC_MESSAGES is defined.
	* aclocal.m4, configure, include/config.h.in: Rebuilt.
	* configure.in: Call AM_LC_MESSAGES.
	* acinclude.m4 (AM_LC_MESSAGES): New macro.

From-SVN: r48781
2002-01-11 23:00:58 +00:00
Tom Tromey d9df09cce8 For PR libgcj/5031:
* java/lang/natSystem.cc (init_properties): Use LC_MESSAGES to
	choose default locale.

From-SVN: r48664
2002-01-08 21:59:32 +00:00
Andreas Tobler 66839ef65e natMethod.cc: Don't include alloca.h.
2002-01-07  Andreas Tobler <a.tobler@schweiz.ch>

	* java/lang/reflect/natMethod.cc: Don't include alloca.h.
	(_Jv_CallAnyMethodA): Convert alloca to __builtin_alloca.

From-SVN: r48656
2002-01-08 20:00:50 +00:00
Andreas Tobler ebecd56de9 configure, [...]: Rebuilt.
2002-01-06 Andreas Tobler <a.tobler@schweiz.ch>

	* configure, include/config.h.in: Rebuilt.
	* java/lang/natSystem.cc (getSystemTimeZone): Check HAVE_TM_ZONE.
	* configure.in: Call AC_STRUCT_TIMEZONE.

From-SVN: r48588
2002-01-06 21:38:15 +00:00
Tom Tromey 81550d0e5f Thread.java (stop): No longer synchronized.
* java/lang/Thread.java (stop): No longer synchronized.
	(start): Likewise.

From-SVN: r48540
2002-01-04 20:38:20 +00:00
Tom Tromey 95574a4c76 ieeefp.h: Fix bug in my hand-application of previous patch.
* java/lang/ieeefp.h: Fix bug in my hand-application of previous
	patch.

From-SVN: r48475
2002-01-02 15:58:39 +00:00
Andrew Pinski 0beb74f25c 2002-1-1 Andrew Pinski <pinskia@physics.uc.edu>
* libjava/java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for
	PPC Darwin, not for all of Darwin.

From-SVN: r48473
2002-01-02 15:07:16 +00:00
Andreas Tobler 6180abdb9d ieeefp.h: Define __IEEE_BIG_ENDIAN for Darwin.
2001-12-29 Andreas Tobler <a.tobler@schweiz.ch>

	* libjava/java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN for
	Darwin.

From-SVN: r48455
2002-01-01 23:36:11 +00:00
Tom Tromey d47eb5d3f2 re PR java/5165 (Loading class fields with a ConstantValue attribute)
Fix for PR java/5165:
	* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass):
	Convert any constant string field to a String; not just final
	fields.

From-SVN: r48255
2001-12-21 21:59:27 +00:00
Tom Tromey 83d9978859 re PR libgcj/2428 (Classloader is not set)
Fix for PR libgcj/2428:
	* java/lang/natClass.cc: Include RuntimePermission.h.
	(getClassLoader): Define.
	* java/lang/Class.h (Class.getClassLoader): Only declare.

From-SVN: r48253
2001-12-21 19:47:50 +00:00
Tom Tromey 68940f3f3c For PR java/5088:
* java/lang/natClassLoader.cc (_Jv_InitNewClassFields): New
	function.
	(_Jv_NewClass): Use it.
	(defineClass0): Use it.
	* prims.cc (_Jv_InitPrimClass): Adjust vtable here.
	(_Jv_InitPrimClass): Use _Jv_InitNewClassFields.
	(_Jv_NewArray): Don't abort; just throw exception.
	Include InternalError.h.
	* java/lang/Class.h (Class::Class): Declare, don't define.
	(Class): Declare _Jv_InitNewClassFields as a friend.
	(union _Jv_Self): Removed.

From-SVN: r48081
2001-12-16 22:28:35 +00:00
Bryce McKinlay 861ef92859 java-tree.h (otable_methods, [...]): New field/global tree definitions.
gcc/java:

	* java-tree.h (otable_methods, otable_decl, otable_syms_decl,
	otable_type, otable_ptr_type, method_symbol_type,
	method_symbols_array_type, method_symbols_array_ptr_type): New
	field/global tree definitions.
	(flag_indirect_dispatch): New flag.
	* decl.c (java_init_decl_processing): Initialize new otable and
	otable_syms type nodes and decls. Add new field "index" to
	method_type_node.
	* class.c (build_method_symbols_entry): New function.
	(make_method_value): Set "index" to to method's vtable index for
	virtual methods when indirect-dispatch is not used.
	(make_class_data): For indirect-dispatch, dont emit the dtable_decl,
	and set vtable_method_count to -1. Set otable and otable_syms field
	if indirect-dispatch is used and there was something to put in them.
	(build_method_symbols_entry): New function.
	(emit_offset_symbol_table): New function.
	* expr.c (get_offset_table_index): New function.
	(build_invokevirtual): Build array reference to otable at the index
	returned by get_offset_table_index, and use the result as the vtable
	offset.
	(build_invokeinterface): Similar.
	* jcf-parse.c (yyparse): If indirect-dispatch, call
	emit_offset_symbol_table at the end of compilation, after all classes
	have been generated.
	* jvspec.c: Don't pass findirect-dispatch to jvgenmain.
	* lang.c (flag_indirect_dispatch): Define.
	(lang_f_options): Add indirect-dispatch flag.

libjava:

	* include/jvm.h (_Jv_VTable::idx_to_offset): New method.
	* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
	_Jv_MakeVTable and _Jv_LinkOffsetTable if needed.
	* java/lang/Class.h (_Jv_Method): Add "index" field.
	(_Jv_MethodSymbol): New struct type.
	(_Jv_LinkOffsetTable, _Jv_LayoutVTableMethods, _Jv_SetVTableEntries,
	_Jv_MakeVTable): Friends.
	(otable, otable_syms): New Class fields.
	* java/lang/natClass.cc (_Jv_LinkOffsetTable): New function.
	(isVirtualMethod): New static function.
	(_Jv_LayoutVTableMethods): New function.
	(_Jv_SetVTableEntries): New function.
	(_Jv_MakeVTable): New function.

From-SVN: r48038
2001-12-15 08:31:49 +00:00
Hans Boehm 938f37772e prims.cc: Some old cleanups.
* libjava/prims.cc: Some old cleanups.  The collector now
	handles test for out of memory.
	* libjava/prims.cc, libjava/gcj/javaprims.h:
	(_Jv_AllocObjectNoInitNoFinalizer, _Jv_AllocObjectNoFinalizer):
	New functions for finalizer-free allocation.
	(jvmpi_notify_alloc): Became separate function.
	* libjava/java/lang/Object.h, libjava/include/jvm.h: Adjust for
	revised vtable layout on IA64.  With TARGET_VTABLE_USES_DESCRIPTORS,
	there is only one extra descriptor.

From-SVN: r48002
2001-12-14 18:43:55 +00:00
Tom Tromey 50cc5dd29b String.java (String): New constructor.
* java/lang/String.java (String): New constructor.
	* gnu/gcj/runtime/natStringBuffer.cc: New file.
	* gnu/gcj/runtime/StringBuffer.java: New file.
	* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added
	gnu/gcj/runtime/StringBuffer.java.
	(nat_source_files): Added gnu/gcj/runtime/natStringBuffer.cc.

From-SVN: r47883
2001-12-11 18:01:40 +00:00
Tom Tromey d12a187337 re PR libgcj/5064 (java/lang/natClassLoader.cc doesn't compile on systems without snprintf)
Fix for PR libgcj/5064.
	* java/lang/natClassLoader.cc: Don't include stdio.h.
	(_Jv_RegisterClassHookDefault): Don't use snprintf.

From-SVN: r47861
2001-12-11 03:58:40 +00:00
Tom Tromey 91c6dda6c7 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/reflect/Method.h): ObjectInputStream now
	a friend.
	* java/lang/natClass.cc (getSignature): Only look at elements of
	non-null parameters.
	(getPrivateMethod): Removed old FIXME comment.
	* java/io/natObjectInputStream.cc (allocateObject): Removed old
	FIXME comment.
	(callConstructor): Simply use `NULL' for value of parameters.
	(ObjectClass): Removed.
	(ClassClass): Likewise.
	* java/io/ObjectInputStream.java (readObject): Fixed typo.

From-SVN: r47800
2001-12-09 00:17:07 +00:00
Tom Tromey 941a878b35 ClassLoader.java (defineClass): Rethrow any LinkageError.
* java/lang/ClassLoader.java (defineClass): Rethrow any
	LinkageError.

From-SVN: r47780
2001-12-07 23:34:12 +00:00
Tom Tromey cb47fb054c ThreadGroup.java (uncaughtException): Print message to System.err.
* java/lang/ThreadGroup.java (uncaughtException): Print message to
	System.err.  Required by spec.

From-SVN: r47779
2001-12-07 23:32:24 +00:00
Tom Tromey bea31ffbcb Fix for PR libgcj/2024, plus other class name cleanups:
* include/jvm.h (_Jv_VerifyFieldSignature,
	_Jv_VerifyMethodSignature, _Jv_VerifyClassName,
	_Jv_VerifyIdentifier, _Jv_ClassNameSamePackage): Moved from ...
	* include/java-interp.h: ... here.
	* defineclass.cc (UTF8_PEEK): No longer conditional on
	interpreter.
	(_Jv_VerifyOne): Likewise.
	(_Jv_VerifyFieldSignature): Likewise.
	(_Jv_VerifyMethodSignature): Likewise.
	(is_identifier_start): Likewise.
	(is_identifier_part): Likewise.
	(_Jv_VerifyIdentifier): Likewise.
	(_Jv_VerifyClassName): Likewise.
	(_Jv_VerifyClassName): Likewise.
	(_Jv_ClassNameSamePackage): Likewise.
	(_Jv_VerifyClassName): Fail if class name is too long.
	* java/lang/natClassLoader.cc (_Jv_NewArrayClass): Disallow array
	of void.
	* java/lang/natClass.cc (forName): Check syntax of class name.
	Include IllegalArgumentException.h.

From-SVN: r47334
2001-11-26 06:40:06 +00:00
Tom Tromey 54b6b24152 Re-merge with Classpath, from Brian Jones:
* java/lang/Integer.java (getInteger): Attempt to decode the value
	of the system property instead of the name of the system property.
	(parseInt): Throw NumberFormatException explicitly in the case of
	a null argument in keeping with JDK 1.3.

From-SVN: r47095
2001-11-16 19:52:24 +00:00
Hans Boehm aa0149ff0c natString.cc: correct argument order for _Jv_AllocPtrFreeObj
* java/lang/natString.cc: correct argument order for
	_Jv_AllocPtrFreeObj

From-SVN: r47035
2001-11-15 02:22:52 +00:00
Tom Tromey 6d88e1c332 Constructor.java (toString): Use more efficient form of Modifier.toString().
* java/lang/reflect/Constructor.java (toString): Use more
	efficient form of Modifier.toString().

From-SVN: r47031
2001-11-14 23:42:38 +00:00
Tom Tromey 81bc01c265 Re-merges with Classpath, from various people:
* java/lang/reflect/Modifier.java: Reindented.
	(toString): Only trim trailing space if text was added to
	StringBuffer.
	* java/lang/reflect/ReflectPermission: Reindented.

From-SVN: r47028
2001-11-14 22:42:42 +00:00
Tom Tromey 852d3dad0d Re-merges with Classpath, from various people:
* java/lang/Double.java (parseDouble): Fixed ordering of
	modifiers.
	* java/lang/reflect/AccessibleObject.java: Javadoc, reindented.
	* java/lang/reflect/Member.java: Reindented.
	* java/lang/reflect/Modifier.java: Reindented.
	(toString): Only trim trailing space if text was added to
	StringBuffer.
	* java/util/ConcurrentModificationException.java: Javadoc
	updates.
	* java/util/EmptyStackException.java: Likewise.
	* java/util/NoSuchElementException.java: Likewise.

From-SVN: r47018
2001-11-14 19:11:52 +00:00
Tom Tromey a12fe13ddb Class.h (Class): Made _Jv_BytecodeVerifier a friend.
* java/lang/Class.h (Class): Made _Jv_BytecodeVerifier a friend.
	* Makefile.in: Rebuilt.
	* Makefile.am (libgcj_la_SOURCES): Added verify.cc.
	* verify.cc: New file.
	* include/java-interp.h (_Jv_count_arguments): Declare.
	(_Jv_VerifyMethod): Likewise.
	(class _Jv_InterpMethod): Made _Jv_BytecodeVerifier a friend.
	(class _Jv_InterpException): Likewise.
	* resolve.cc (_Jv_count_arguments): Renamed from count_arguments.
	No longer static.  Updated callers.
	* defineclass.cc (int_bits_to_float): Removed.
	(long_bits_to_double): Likewise.
	(prepare_pool_entry): Updated.
	(handleCodeAttribute): Verify method (commented out for now).

From-SVN: r46796
2001-11-05 23:39:54 +00:00
Joseph Myers 18e1f2bd67 HACKING, [...]: Fix spelling errors.
* HACKING, gnu/gcj/xlib/Pixmap.java, gnu/gcj/xlib/XException.java,
	gnu/java/rmi/rmic/RMIC.java, java/awt/Window.java,
	java/awt/AWTEvent.java, java/io/ByteArrayOutputStream.java,
	java/io/CharConversionException.java,
	java/io/PipedInputStream.java, java/io/PipedReader.java,
	java/io/PrintWriter.java, java/io/WriteAbortedException.java,
	java/io/natFileWin32.cc, java/lang/Class.h,
	java/lang/natClassLoader.cc, java/lang/natObject.cc,
	java/lang/Package.java, java/net/BindException.java,
	java/net/ConnectException.java, java/net/ProtocolException.java,
	java/net/SocketException.java,
	java/net/UnknownServiceException.java,
	java/security/cert/X509Certificate.java,
	java/security/interfaces/DSAKey.java,
	java/security/SecureRandom.java, java/security/SignedObject.java,
	java/sql/DatabaseMetaData.java,
	java/text/DecimalFormatSymbols.java,
	java/util/jar/Attributes.java, java/util/jar/JarEntry.java,
	java/util/jar/JarInputStream.java,
	java/util/jar/JarOutputStream.java, java/util/Calendar.java,
	java/util/Collections.java, java/util/GregorianCalendar.java,
	java/util/HashMap.java, java/util/List.java,
	java/util/Properties.java, java/util/Timer.java,
	java/util/Vector.java, java/util/WeakHashMap.java,
	javax/naming/NamingException.java,
	testsuite/libjava.lang/Thread_Wait.java,
	org/xml/sax/helpers/DefaultHandler.java,
	org/xml/sax/HandlerBase.java, org/xml/sax/SAXParseException.java,
	ChangeLog, acinclude.m4, aclocal.m4, posix-threads.cc: Fix
	spelling errors.
	* configure: Regenerate.

From-SVN: r46665
2001-10-31 00:48:17 +00:00
Bryce McKinlay 3b2a3c4c2a Oops!
From-SVN: r46526
2001-10-26 05:27:58 +01:00
Bryce McKinlay 839f820424 VMClassLoader.java (getPrimitiveClass): Now native.
* java/lang/VMClassLoader.java (getPrimitiveClass): Now native. Now
	takes a jchar type-code argument, not a string.
	* java/lang/natClassLoader.cc (VMClassLoader::getPrimitiveClass):
	New method. Just call _Jv_FindClassFromSignature.
	* java/lang/Boolean.java (TYPE): Initialize from
	VMClassLoader.getPrimitiveClass using type-code.
	* java/lang/Character.java (TYPE): Likewise.
	* java/lang/Double.java (TYPE): Likewise.
	* java/lang/Float.java (TYPE): Likewise.
	* java/lang/Integer.java (TYPE): Likewise.
	* java/lang/Long.java (TYPE): Likewise.
	* java/lang/Short.java (TYPE): Likewise.
	* java/lang/Void.java (TYPE): Likewise.

From-SVN: r46521
2001-10-26 02:51:04 +01:00
Bryce McKinlay 11598139d3 natClassLoader.cc (_Jv_RegisterClassHookDefault): Use snprintf, not asprintf.
2001-10-25  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Use
	snprintf, not asprintf.

From-SVN: r46482
2001-10-25 04:15:37 +01:00
Tom Tromey b8a5867e51 * java/lang/reflect/Field.java: Made many methods private.
From-SVN: r46467
2001-10-24 18:06:48 +00:00
Tom Tromey 0a3abdb238 Field.java (Field): New constructor.
* java/lang/reflect/Field.java (Field): New constructor.
	* java/lang/ClassLoader.java (defineClass(String,byte[],int,int)):
	Throw ClassFormatError.

From-SVN: r46458
2001-10-24 04:38:08 +00:00
Bryce McKinlay afb2dec526 prims.cc (_Jv_Abort): Always print error message using fprintf, don't try to allocate.
* prims.cc (_Jv_Abort): Always print error message using fprintf,
        don't try to allocate.
        (_Jv_CreateJavaVM): Set gcj::runTimeInitialized.
        * include/jvm.h (gcj::runTimeInitialized): New variable declaration.
        * java/lang/natClassLoader.cc (_Jv_RegisterClassHookDefault): Handle
        duplicate class registration with JvFail if the runtime hasn't been
        initialized yet.

From-SVN: r46424
2001-10-23 06:42:03 +01:00
Mark Wielaard f0fdd66ba4 Double.java: More Classpath merging
* java/lang/Double.java: More Classpath merging
	(isInfinite): Don't use doubleToLongBits
	(isNaN (Object)): return v != v
	(initIDs): make native
	* java/lang/Float.java: Ditto
	(isInfinite): Don't use floatToIntBits
	(isNaN (Object)): return v != v
	* java/lang/natDouble.cc: add empty initIDs()

From-SVN: r46370
2001-10-20 06:26:45 +00:00
Bryce McKinlay 5b0b42ed61 Forgot this file in last commit.
From-SVN: r46284
2001-10-16 12:18:03 +01:00
Bryce McKinlay 107abb2f61 Eliminate use of C++ static constructors.
* interpret.cc: Remove static Utf8Consts. Use namespace gcj.
	* jni.cc: Likewise.
	* resolve.cc: Likewise.
	* defineclass.cc: Likewise.
	(_Jv_ClassReader::handleClassBegin): Synchronize call to
	_Jv_RegisterClass.
	* include/jvm.h (void_signature, clinit_name, init_name, finit_name):
	Declare in namespace gcj.
	* java/lang/Class.h (Class): Remove initialization for primitive
	types.
	(friend void _Jv_InitPrimClass): This is in prims.cc.
	* prims.cc (_Jv_InitPrimClass): Do primitive type initialization
	here instead.
	(void_signature, clinit_name, init_name, finit_name): Define in
	namespace gcj.
	(_Jv_CreateJavaVM): Call _Jv_InitThreads, _Jv_InitGC, and
	_Jv_InitializeSyncMutex from here. Initialize Utf8 constants.
	Initialize primitive types.
	* java/lang/natClassLoader.cc (_Jv_RegisterClasses): Don't call
	initialization routines. Don't synchronize.
	* java/lang/natRuntime.cc (_load): Synchronize on java.lang.Class
	across dlopen call.

From-SVN: r46282
2001-10-16 09:35:17 +01:00
Tom Tromey 0e91d38470 AccessibleObject.java (checkPermission): Implemented.
* java/lang/reflect/AccessibleObject.java (checkPermission):
	Implemented.
	Updated copyright information.

From-SVN: r46272
2001-10-15 22:45:03 +00:00
Hans Boehm 3a8da0244a natObject.cc (heavy_lock): Moved fields old_client_data, old_finalization_proc near beginning.
2001-10-15  Hans Boehm <Hans_Boehm@hp.com>

	* java/lang/natObject.cc (heavy_lock): Moved fields
	old_client_data, old_finalization_proc near beginning.
	(heavy_lock_finalization_proc): Now inline; changed type of
	argument.
	(JV_SYNC_TABLE_SZ): Now 2048.
	(mp): New global.
	(spin): `mp' now global.
	(heavy_lock_obj_finalization_proc): Updated to correctly handle
	heavy lock finalization.
	(remove_all_heavy): New function.
	(maybe_remove_all_heavy): Likewise.
	(_Jv_MonitorEnter): Throw exception if object is NULL.
	(_Jv_MonitorExit): Likewise.  Also, clear long lists of unlocked
	heavy locks.
	* include/jvm.h (_Jv_AllocTraceTwo): Declare.
	* nogc.cc (_Jv_AllocTraceTwo): New function.
	* boehm.cc (trace_two_vtable): New global.
	(_Jv_AllocTraceTwo): New function.

From-SVN: r46271
2001-10-15 22:42:42 +00:00
Mark Wielaard 06c0908ba6 Double.java: Partial merge with Classpath
* java/lang/Double.java: Partial merge with Classpath
	(TYPE): initialized through VMClassLoader.getPrimitiveClass()
	(value): made final
	(static): new static block to load native libary (not used in libgcj)
	(Double (String)): call parseDouble()
	(byteValue): removed, already defined in superclass Number
	(shortValue): likewise
	(valueOf (String)): call new Double(String) directly
	(compare (double,double)): new 1.4 method
	(compareTo (Double)): call new compare(double,double) method
	(initIDs): new private method (not used in libgcj)
	* java/lang/Float.java: Partial merge with Classpath
	(TYPE): initialized through VMClassLoader.getPrimitiveClass()
	(value): made final
	(static): new static block to load native libary (not used in libgcj)
	(Float (String)): call parseFloat()
	(byteValue): removed, already defined in superclass Number
	(shortValue): likewise
	(valueOf (String)): call new Float(String) directly
	(compare (float,float)): new 1.4 method
	(compareTo (Float)): call new compare(double,double) method

From-SVN: r46263
2001-10-15 06:31:13 +00:00
Tom Tromey 48d24deb4e * java/lang/SecurityManager.java (SecurityManager): Now public.
From-SVN: r46247
2001-10-13 23:23:50 +00:00
Tom Tromey eeedeb5a17 natFinalizerThread.cc: New file.
* gnu/gcj/runtime/natFinalizerThread.cc: New file.
	* java/lang/natRuntime.cc: Include FinalizerThread.h.
	(runFinalization): Call finalizerReady.
	* nogc.cc (_Jv_GCInitializeFinalizers): New function.
	* prims.cc: Include VirtualMachineError.h, FinalizerThread.h.
	(_Jv_CreateJavaVM): Start the finalizer thread.
	* no-threads.cc: Include InternalError.h.
	(_Jv_ThreadStart): Throw InternalError.
	(_Jv_ThreadInitData): Don't throw error if this is not the first
	thread.
	* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added
	FinalizerThread.java.
	(nat_source_files): Added natFinalizerThread.cc.
	* include/jvm.h (_Jv_GCInitializeFinalizers): Declare.
	* boehm.cc (_Jv_GCInitializeFinalizers): New function.
	* gnu/gcj/runtime/FirstThread.java (run): Start finalizer thread.
	* gnu/gcj/runtime/FinalizerThread.java: New file.

From-SVN: r46163
2001-10-10 22:25:43 +00:00
Per Bothner d1d8ed9877 strtod.c (_strtod_r): Logic to check for missing digits after exponent had 'else' attached to wrong 'if'.
* strtod.c (_strtod_r):  Logic to check for missing digits
	after exponent had 'else' attached to wrong 'if'.

From-SVN: r46132
2001-10-09 15:54:26 -07:00
Joseph Myers cc712abf04 acinclude.m4: Fix spelling error of "separate" as "seperate".
config:
	* acinclude.m4: Fix spelling error of "separate" as "seperate".

gcc:
	* ChangeLog.2, c-decl.c, config/i386/i386.md, doc/gcc.texi, gcc.c,
	genmultilib, toplev.c: Fix spelling errors of "separate" as
	"seperate", and corresponding spelling errors of related words.

gcc/ada:
	* 5oosinte.adb: Fix spelling error of "separate" as "seperate".

gcc/testsuite:
	* gcc.c-torture/unsorted/unsorted.exp, lib/file-format.exp: Fix
	spelling errors of "separate" as "seperate".

libffi:
	* src/x86/ffi.c: Fix spelling error of "separate" as "seperate".

libjava:
	* defineclass.cc, java/awt/image/ColorModel.java,
	java/awt/image/SampleModel.java, java/lang/Package.java,
	java/security/cert/X509Extension.java: Fix spelling errors of
	"separate" as "seperate", and corresponding spelling errors of
	related words.

libstdc++-v3:
	* docs/html/22_locale/locale.html, docs/html/faq/index.html: Fix
	spelling errors of "separate" as "seperate", and corresponding
	spelling errors of related words.
	* docs/html/faq/index.txt: Regenerate.

From-SVN: r46063
2001-10-07 19:02:46 +01:00
Mark Wielaard ffb0e73a97 * java/lang/reflect/Modifier.java: Merge with Classpath
From-SVN: r46019
2001-10-05 00:16:03 +00:00
Tom Tromey b52a8930ff natReference.cc (add_to_hash): Set n->next before setting *link.
* java/lang/ref/natReference.cc (add_to_hash): Set n->next before
	setting *link.

From-SVN: r45996
2001-10-03 16:47:02 +00:00
Mark Wielaard d352477d45 Makefile.am (core_java_source_files): add InheritableThreadLocal
* Makefile.am (core_java_source_files): add InheritableThreadLocal
	* Makefile.in: regenerate
	* gcj/javaprims.h: ditto
	* java/lang/InheritableThreadLocal.java: new class from Classpath
	* java/lang/Thread.java Thread (Thread, ThreadGroup, Runnable, String):
	call InheritableThreadLocal.newChildThread()

From-SVN: r45979
2001-10-02 22:49:59 +00:00
Mark Wielaard 627a8b878e Makefile.am: Add new classes
* Makefile.am: Add new classes
	(core_java_source_files): CharSequence
	(ordinary_java_source_files): Authenticator, PasswordAuthentication
	* Makefile.in: regenerate
	* gcj/javaprims.h: ditto
	* java/lang/CharSequence: new class from Classpath
	* java/lang/String.java: implements CharSequence
	(subSequence (int,int)): new method
	* java/lang/SubString.java: implements CharSequence
	(subSequence (int,int)): new method
	remerge comments with Classpath
	* java/net/Authenticator.java: new class from Classpath
	* java/net/PasswordAuthentication.java: ditto

From-SVN: r45969
2001-10-02 20:59:31 +00:00
Tom Tromey 2b3d3db68d javaprims.h: Rebuilt class list.
* gcj/javaprims.h: Rebuilt class list.
	* boehm.cc (_Jv_GCRegisterDisappearingLink): New function.
	(_Jv_GCCanReclaimSoftReference): New function.
	* include/jvm.h (_Jv_GCRegisterDisappearingLink): Declare.
	(_Jv_GCCanReclaimSoftReference): Declare.
	* java/lang/ref/Reference.java (referent): Now a RawData.
	(create): Renamed from `created'.  Added object argument.
	(Reference): Don't initialize `referent' here.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added new file.
	* java/lang/ref/natReference.cc: New file.

From-SVN: r45958
2001-10-02 14:31:47 +00:00
Tom Tromey 62a040818a prims.cc (_Jv_NewMultiArrayUnchecked): New method.
* prims.cc (_Jv_NewMultiArrayUnchecked): New method.
	(_Jv_NewMultiArray): Use it.  Check each array dimension.
	(_Jv_NewMultiArray): Likewise.
	* java/lang/reflect/natMethod.cc (can_widen): Nothing promotes to
	`char'.
	* java/lang/reflect/natArray.cc (newInstance): Throw
	IllegalArgumentException if there are no dimensions.

From-SVN: r45951
2001-10-02 13:44:32 +00:00
Mark Wielaard 477946a63d FileWriter.java: Merge with Classpath.
* java/io/FileWriter.java: Merge with Classpath.
	* java/io/FilterInputStream.java: Ditto.
	(mark): no longer synchronized
	(reset): Likewise
	* java/io/FilterOutputStream.java: Merge with Classpath.
	* java/io/FilterReader.java: Ditto.
	(mark): no longer synchronized
	(reset): Likewise
	* java/io/FilterWriter.java: Merge with Classpath.
	* java/io/Writer.java: Ditto.
	* java/lang/Compiler.java: Ditto.
	* java/lang/Process.java: Ditto.
	* java/lang/Void.java: Ditto.
	* java/net/ContentHandler.java: Ditto.
	* java/net/DatagramPacket.java: Ditto.
	* java/net/MulticastSocket.java: Merge comments with Classpath.

From-SVN: r45930
2001-10-01 18:24:54 +00:00
Mark Wielaard cfcdbe5480 DataInput.java: Merge with Classpath.
* java/io/DataInput.java:  Merge with Classpath.
	* java/io/DataOutput.java:  Idem.
	* java/io/FilenameFilter.java:  Idem.
	* java/io/Serializable.java:  Idem.
	* java/lang/Cloneable.java:  Idem.
	* java/lang/Comparable.java:  Idem.
	* java/lang/Runnable.java:  Idem.
	* java/lang/reflect/Member.java:  Idem.
	* java/net/ContentHandlerFactory.java:  Idem.
	* java/net/FileNameMap.java:  Idem.
	* java/net/SocketImplFactory.java:  Idem.
	* java/net/SocketOptions.java:  Idem.
	* java/net/URLStreamHandlerFactory.java:  Idem.

From-SVN: r45910
2001-09-30 18:04:38 +00:00
Bryce McKinlay 8444766847 natClass.cc (_Jv_IsAssignableFrom): Handle the case of an uninitialized target class.
* java/lang/natClass.cc (_Jv_IsAssignableFrom): Handle the case of
        an uninitialized target class.

From-SVN: r45893
2001-09-30 03:41:54 +01:00
Bryce McKinlay 4f7279ab3e PosixProcess.java (exitValue): Implement here.
* java/lang/PosixProcess.java (exitValue): Implement here. Throw
	IllegalThreadStateException if process hasn't exited yet.
	* java/lang/natPosixProcess.cc (exitValue): Removed.
	(waitFor): Only check thread interrupted status if waitpid()
	returned an error. Use WIFEXITED and WEXITSTATUS to process process's
	exit value.

From-SVN: r45766
2001-09-24 05:51:50 +01:00
Richard Henderson f5ddf15465 jvm.h (_Jv_VTable): Handle function descriptors for ia64...
* include/jvm.h (_Jv_VTable): Handle function descriptors for ia64;
        add get_method, set_method, vtable_elt_size, new_vtable.
        (_Jv_ArrayVTable): Derive from _Jv_VTable.
        * resolve.cc (_Jv_PrepareClass): Use new _Jv_VTable methods.
        * interpret.cc (_Jv_InterpMethod::continue1): Likewise.
        * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Likewise.

From-SVN: r45734
2001-09-21 09:59:12 -07:00