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-01 Mohan Embar <gnustuff@thisiscool.com>
* java/lang/natWin32Process.cc (startProcess): Double-quote each
program array element passed to CreateProcess.
From-SVN: r63633
* 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-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
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
* 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
* 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
* java/lang/ClassLoader.java (resolveClass0): Transform
ClassNotFoundException to NoClassDefFoundError. Transform all other
throwables to LinkageError.
From-SVN: r60097
* 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
* 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
* 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
* 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-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 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
* 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-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
(_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
* 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
* 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
* 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-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
* 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
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-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-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-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
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-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-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-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
* 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-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
* 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
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
* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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-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
* 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
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
* 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
* 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-05 Corey Minyard <minyard@acm.org>
Tom Tromey <tromey@redhat.com>
* java/lang/natClassLoader.cc: Include VirtualMachineError.h
(_Jv_RegisterClassHookDefault): Throw error if a class is
registered twice.
Co-Authored-By: Tom Tromey <tromey@redhat.com>
From-SVN: r45418
* java/lang/ClassLoader.java (system): Remove static field.
(getSystemClassLoader): Get gnu.gcj.runtime.VMClassLoader.instance
directly instead of using it to set the system field.
(loadClass): Use VMClassLoader.instance instead of system field.
(findSystemClass): Similar.
* prims.cc (_Jv_RunMain): Clear VMClassLoader::instance rather
than ClassLoader::system which no longer exists.
* java/lang/natClassLoader.java (_Jv_FindClass): Simplify.
From-SVN: r45343
* Makefile.am: New friends for java/lang/Thread.h.
* prims.cc (runFirst): Removed.
(JvRunMain): Merged into _Jv_RunMain. Now just calls that.
(_Jv_RunMain): Now takes either a klass or class name parameter.
Create a gnu.gcj.runtime.FirstThread and attach the native thread
to that, then run it using _Jv_ThreadRun. Remove special handling of
jar files, instead pass is_jar parameter through to FirstThread.
* gcj/javaprims.h: Add prototypes for _Jv_ThreadRun and new variant
of _Jv_AttachCurrentThread.
* gnu/gcj/runtime/FirstThread.java (FirstThread): Now extends Thread.
(run): New method. Take care of looking up main class manifest
attribute and calling forName if neccessary. Then call call_main.
(call_main): New native method.
* gnu/gcj/runtime/natFirstThread.cc (call_main): New function, code
relocated from prims.cc. Look up and call main method.
* java/lang/Thread.java (run_): Removed.
* java/lang/natThread.cc (run_): Renamed to...
(_Jv_ThreadRun): this. JVMPI notification code moved to ...
(_Jv_NotifyThreadStart): here. New function.
(countStackFrames, destroy, resume, suspend, stop): Throw
UnsupportedOperationExceptions rather than JvFail'ing.
(_Jv_AttachCurrentThread): New variant takes a Thread argument.
Existing version wraps new variant.
From-SVN: r45182
* java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return
NULL if no library on the list has the symbol.
(init): Call add_library on the program itself.
* prims.cc (JvRunMain): Initialize Runtime before searching for
`main'.
(_Jv_RunMain): Likewise.
From-SVN: r43413
2001-06-05 Martin Kahlert <martin.kahlert@infineon.com>
Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/lang/natClass.cc (_Jv_IsAssignableFrom): Ensure that ancestors
table index is within allowed bounds. Ensure that we dont try to access
class itable at a negative offset. Avoid an ancestor table lookup if
source is a primitive type class.
(isInstance): Remove redundant isPrimitive() check.
Co-Authored-By: Bryce McKinlay <bryce@waitaki.otago.ac.nz>
From-SVN: r42898
* configure.in: Only allow hash synchronization when POSIX threads
are enabled.
* java/lang/natObject.cc (alloc_heavy): Properly find `init' field
of sync info object.
From-SVN: r42530
* gcj/javaprims.h (_Jv_FormatInt): New declaration.
* java/lang/natString.cc (_JvFormatInt): New primitive, with logic
taken from old Integer.toString code.
(Integer::valueOf): Use _Jv_FormatInt.
* java/lang/Integer.java (toString): Just use call String.valueOf.
* java/lang/Long.java (toString): Fix typo in comment.
* java/lang/String.java (valueOf(int)): Make native.
* java/lang/StringBuffer.java (append(int)): Make native.
* java/lang/natStringBuffer.cc: New file, for append(jint).
* Makefile.am (ant_source_files): Add java/lang/natStringBuffer.cc.
From-SVN: r42419
* java/lang/Class.h (_Jv_Self): New union type.
(Class): Manipulate vtable pointer via _Jv_Self union. Thanks to
Jeff Sturm and Fergus Henderson.
* java/lang/ClassLoader.java: Remove dead code fragment.
From-SVN: r41876
* java/lang/natString.cc (_Jv_NewStringUtf8Const): Register finalizer.
Recalculate hash, since Utf8Const's hash is only 16 bits.
* java/lang/natString.cc (_Jv_StringFindSlot, rehash): Use high-order
bits of hash to calculate step for chaining.
* java/lang/natString.cc (intern, _Jv_NewStringUtf8Const): Rehash
when 2/3 full, rather than 3/4 full.
From-SVN: r41233
* java/lang/natString.cc (intern): If string's data does not point to
this String, make a fresh String that does.
* java/lang/natString.cc (unintern): Replace by static function.
* java/lang/String.java (unintern): Remove method.
From-SVN: r40990
* java/lang/natSystem.cc (init_properties): Get "file.separator",
"path.separator", and "java.io.tmpdir" from the File class, instead
of setting them explicitly.
* java/io/File.java: Do not canonicalize paths for security manager
checks. Call init_native() from static initializer. Do not pass path
argument to native methods. New native method declarations. Some
security manager checks moved to checkWrite().
(equals): Check file system case sensitivity and act appropriatly.
(hashCode): Likewise.
(isHidden): New method implemented.
(performList): Changed prototype. Now takes a class argument specifying
the class of the returned array: Strings or File objects. Also added
FileFilter argument.
(listFiles): New variants with "File" return type implemented.
(createTempFile): Use createNewFile(). Use maxPathLen.
(setReadOnly): New method implemented.
(listRoots): Likewise.
(compareTo): Likewise.
(setLastModified): Likewise.
(checkWrite): New method.
(setPath): Removed.
* java/io/natFile.cc: Various functions no longer take canonical path
argument.
(stat): Handle ISHIDDEN query.
(isAbsolute): Remove WIN32 cruft.
(performList): New arguments. Handle returning either File[] or
String[] arrays. Check with FileFilter or FilenameFilter arguments as
appropriate. Use an ArrayList, not a Vector, for the temporary list.
(performSetReadOnly): New method implemented.
(performListRoots): Likewise.
(performSetLastModified): Likewise.
(performCreate): Likewise.
(init_native): New initialization function.
* java/io/natFileWin32.cc: Various functions no longer take canonical
path argument.
(stat): Add FIXME about ISHIDDEN query.
(performList): New arguments. Handle returning either File[] or String[]
arrays. Check with FileFilter or FilenameFilter arguments as
appropriate. Use an ArrayList, not a Vector, for the temporary list.
(performSetReadOnly): New. Stubbed.
(performListRoots): Likewise.
(performSetLastModified): Likewise.
(performCreate): Likewise.
(init_native) New initialization function.
* configure.in: Check for utime() and chmod().
* configure: Rebuilt.
* include/config.h.in: Rebuilt.
Resolves PR libgcj/1759.
From-SVN: r40985
* java/lang/natDouble.cc (parseDouble): Cannot use errno to
check for errors, since we don't want to throw exception on
overflow/underflow. Instead, trim whitespace, and then check that
_strtod_r uses up all the rest of the string.
From-SVN: r40800
* java/lang/natClass.cc (_Jv_IsAssignableFrom): Checking the
ancestors array is invalid for interfaces, so do that *after*
check that the target type is not an interface.
From-SVN: r40797
* java/lang/natClass.cc (_Jv_CheckCast): add class names to exception
* gnu/gcj/runtime/FirstThread.java (main): replace / with . in jarMainClassName
From-SVN: r40604
* java/lang/natString.cc (rehash): Don't bother with memset;
_Jv_AllocBytes returns zero'd memory. Use _Jv_AllocBytesChecked.
Use UNMASK_PTR.
(UNMASK_PTR): New macro.
(intern): Unmask pointer before returning it. Register finalizer
for the string.
(unintern): Handle case where
(MASK_PTR): New macro.
(PTR_MAKSED): Likewise.
(_Jv_NewStringUtf8Const): Use UNMASK_PTR.
From-SVN: r40593
2001-03-01 Andrew Haley <aph@redhat.com>
* java/lang/natThrowable.cc (printRawStackTrace): Copy the
stackTrace buffer to a correctly aligned pointer array.
From-SVN: r40456
* java/lang/ExceptionInInitializerError.java (printStackTrace):
Only try to print the subordinate stack trace if "exception" is set.
Print our class name first.
From-SVN: r40404
2001-03-12 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/Runtime.java (_exit): Declare new package-private native.
* java/lang/natRuntime.cc (_exit): Implemented. Same as exit() but
without a security manager check.
(exit): Call _exit after security check.
* prims.cc (JvRunMain): Call Runtime._exit to shutdown the runtime
"naturally".
* java/lang/System.java (setSecurityManager): If a security manager
is already in place, call checkPermission.
* java/lang/ThreadGroup.java (uncaughtException): If printStackTrace()
throws an exception, try to deal with it gracefully.
* java/lang/ExceptionInInitializerError.java (printStackTrace):
Only try to print the subordinate stack trace if "exception" is set.
Print our class name first.
From-SVN: r40401
* java/io/DataInputStream.java: update copyright notice
* java/io/PrintWriter.java: idem
* java/io/Reader.java: idem
* java/io/StreamTokenizer.java: idem
* java/io/StringReader.java: idem
* java/lang/reflect/ReflectPermission.java: idem
From-SVN: r39798
* java/lang/natClass.cc (getSignature): Don't try to dereference
param_types if it is null. Instead, take this to mean "no parameters".
* java/lang/TreeMap.java (TreeIterator.next): Throw
NoSuchElementException in preference to
ConcurrentModificationException.
(TreeIterator.remove): Throw IllegalStateException in preference to
ConcurrentModificationException.
(SubMap.firstKey): Do a better check for empty SubMap, and if it is,
throw a NoSuchElementException.
(SubMap.lastKey): Likewise.
From-SVN: r39658
* java/lang/Class.h (isInterface): Move implementation from
natClass.cc. Declare inline.
(Class): Add default constructor.
* java/lang/Object.h: Update comments.
* java/lang/natClass.cc (initializeClass): Use _Jv_InitClass to
initialize superclass, saving a call if super is already initialized.
From-SVN: r39091
2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
All files with updated copyright.
* prims.cc (class _Jv_PrimClass): Removed.
(init_prim_class): New function.
(DECLARE_PRIM_TYPE): Rewritten. `java::lang::Class' replaces
`_Jv_PrimClass' in primitive type declarations. Assign to the
value returned by `init_prim_class.'
* gcj/array.h: `java::lang::Class' replaces `_Jv_PrimClass' in
primitive type declarations.
(JvPrimClass): Cast to `jclass' removed.
* java/lang/Class.h (Class): New constructor.
(Class): New copy constructor.
(initializePrim): New prototype.
(_Jv_PrimClass): Field removed.
* java/lang/Object.h (struct _JvObjectPrefix): New virtuals
nacd_1 and nacd_2 (for compatibility with the new C++ ABI.)
(class java::lang::Object): `finalize' moved up front.
* java/lang/natClass.cc
(isAssignableFrom): Turned outline.
(isInstance): Likewise.
(isInterface): Likewise, fixed indentation.
(initializePrim): New function.
(New C++ ABI compatibility patch:
http://sources.redhat.com/ml/java-patches/2001-q1/msg00065.html)
From-SVN: r39032
* class.c (make_class_data): Push initial value for "arrayclass".
* decl.c (init_decl_processing): Add new class field "arrayclass".
In libjava:
* java/lang/Class.h (_Jv_InitClass): Use __builtin_expect.
(_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass.
(_Jv_GetArrayClass): New inline function.
(arrayclass): New field.
* prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayClass. Don't use
_Jv_GetArrayElementFromElementType.
(_Jv_NewPrimArray): Ditto.
(_Jv_PrimClass constructor): Initialize "depth", "ancestors", and
"idt" for completeness. Initialze "arrayclass" using _Jv_NewArrayClass.
Set Modifier::ABSTRACT.
* java/lang/natClassLoader.cc (_Jv_NewClass): Initialize "arrayclass".
(_Jv_NewArrayClass): Renamed from _Jv_FindArrayClass. Now void.
Now synchronized. Array classes are now referenced from
elementClass->arrayclass. Don't use _Jv_FindClassInCache.
Set array classes' accessibility flags correctly. Optimize so that
all array classes share the same IDT.
* java/lang/reflect/natArray.cc (newInstance): Use _Jv_GetArrayClass.
* java/lang/reflect/natMethod.cc (_Jv_GetTypesFromSignature): Ditto.
* java/lang/natClass.cc (_getFields): Increment offset. Prevent fields
in superclasses from overwriting classes own fields.
(_Jv_IsAssignableFrom): Check for NULL source idt instead of calling
Modifier::isAbstract().
(null_idt): New static field.
(_Jv_PrepareConstantTimeTables): Optimize case where class implements
no interfaces.
(_Jv_IndexOf): Made inline.
* boehm.cc (_Jv_MarkObj): Mark "arrayclass" field.
From-SVN: r38808
* configure.in: Rename THREADLIB to THREADLIBS.
* Makefile.am (LINK): Add $(THREADLIBS) to libtool command line. This
ensures that we link the correct version of the linuxthreads semaphore
functions.
* Makefile.in: Rebuilt.
* configure: Rebuilt.
* linux_thread.c (GC_thr_init, GC_suspend_handler): Add SIGABRT to the
list of signals which are not blocked during suspend in the NO_SIGNALS
case.
For libjava:
* Makefile.am (libgcj_la_LIBADD): Add $(THREADLIBS). This ensures that
the correct versions of various linuxthreads functions get linked.
* Makefile.in: Rebuilt.
* java/lang/natThread.cc (finalize_native): New static function. Call
_Jv_ThreadDestroyData.
(initialize_native): Register finalizer for "data".
* include/posix-threads.h (_Jv_ThreadInitData): New simpler prototype.
(_Jv_ThreadDestroyData): New prototype.
* include/win32-threads.h: Ditto.
* include/no-threads.h: Ditto.
* posix-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): New function. Free native thread "data" and
move mutex and condition variable destroy code from:
(really_start): ...here.
(_Jv_ThreadStart): Set PTHREAD_CREATE_DETACHED.
* win32-threads.cc (_Jv_ThreadInitData): Implement new prototype.
(_Jv_ThreadDestroyData): Implemented.
* nogc.cc (_Jv_AllocObject): Use "void *" not "ptr_t".
(_Jv_AllocArray): Ditto.
From-SVN: r38557
Fix for PR libgcj/1358:
* java/lang/System.java: Update Copyright date properly.
* java/util/Calendar.java: Fix typo in comment.
(set): Set 24-hour clock hour instead of 12-hour clock hour.
* java/util/GregorianCalendar.java (GregorianCalendar): Properly
initialize times. Spec says to set H:M:S values to zero only if
a date is given.
* java/util/TimeZone.java (getDefaultDisplayName): Casts to char
needed for evaluating numbers '0' to '9' in printouts of GMT offsets.
* java/util/natGregorianCalendar.cc (computeTime): Properly handle
timezones and GMT offsets, being careful to account for units of
milliseconds vs. seconds.
From-SVN: r38508