aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang
AgeCommit message (Collapse)AuthorFilesLines
2003-07-28natString.cc (init(gnu.gcj.runtime.StringBuffer)): New method.Tom Tromey2-1/+9
* 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-27Win32Process.java (ConcreteProcess): Surround a command line element with ↵Ranjit Mathew2-3/+9
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-25+ * java/lang/natRuntime.cc (_load): Add library name toMark Wielaard1-1/+2
+ UnsatisfiedLinkError when thrown. From-SVN: r69786
2003-07-23* java/lang/natSystem.cc (arraycopy): Check for overflow.Tom Tromey1-2/+4
From-SVN: r69706
2003-07-21Runtime.java: Comment fix.Tom Tromey10-126/+204
* 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-08cni.h: CNI now expands to Compiled Native Interface.Mark Wielaard2-2/+2
* 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-06-18natVMSecurityManager.cc (getClassContext): Use maxlen instead of len for ↵Matt Kraai1-2/+2
loop bound. * java/lang/natVMSecurityManager.cc (getClassContext): Use maxlen instead of len for loop bound. From-SVN: r68153
2003-06-12jni.cc (_Jv_JNI_check_types): New.Andrew Haley1-4/+4
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-12ClassLoader.java (loadClass): Not deprecated.Tom Tromey1-1/+0
* java/lang/ClassLoader.java (loadClass): Not deprecated. * java/io/PrintStream.java: Not deprecated. From-SVN: r67811
2003-06-07re PR libgcj/8738 (java.io.CharArrayWriter's write methods erroneously throw ↵Mark Wielaard1-6/+6
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-06w_exp.c (o_threshold, [...]): Define only if _IEEE_LIBM is undefined.Matt Kraai1-0/+4
* java/lang/w_exp.c (o_threshold, u_threshold): Define only if _IEEE_LIBM is undefined. From-SVN: r67526
2003-05-27System.java: Explicitely import needed classes.Michael Koch1-1/+8
2003-05-27 Michael Koch <konqueror@gmx.de> * java/lang/System.java: Explicitely import needed classes. From-SVN: r67182
2003-05-01re PR libgcj/10582 (array assignment fails in some situations)Tom Tromey1-16/+24
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-04-28natString.cc (_Jv_AllocString): Initialize cachedHashCode.Tom Tromey1-0/+2
* java/lang/natString.cc (_Jv_AllocString): Initialize cachedHashCode. (init): Likewise. (_Jv_NewStringUtf8Const): Likewise. From-SVN: r66180
2003-04-25jvm.h: (_Jv_GetNbArgs) added (_Jv_GetSafeArg) added (_Jv_SetArgs) addedMohan Embar1-5/+1
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-16ieeefp.h: Handle ARM platforms that have pure-endian floating point.Richard Earnshaw1-2/+12
* java/lang/ieeefp.h: Handle ARM platforms that have pure-endian floating point. From-SVN: r65693
2003-03-31String.java (data, [...]): Documented.Tom Tromey1-9/+30
* 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-30String.java: Miscellaneous minor formatting changes to match Classpath more ↵Tom Tromey1-72/+72
closely. * java/lang/String.java: Miscellaneous minor formatting changes to match Classpath more closely. From-SVN: r65055
2003-03-30natString.cc (hashCode): Use cachedHashCode.Eric Blake2-15/+167
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-30String.java: Reordered to follow Classpath; merged in javadoc.Tom Tromey1-128/+809
* java/lang/String.java: Reordered to follow Classpath; merged in javadoc. From-SVN: r65036
2003-03-29natClass.cc (newInstance): Put method name in exception.Tom Tromey1-6/+6
* java/lang/natClass.cc (newInstance): Put method name in exception. (getConstructor): Likewise. (getDeclaredConstructor): Likewise. (getPrivateMethod): Likewise. From-SVN: r65021
2003-03-29Proxy.java: New version from Classpath.Tom Tromey2-13/+6
* java/lang/reflect/Proxy.java: New version from Classpath. * java/lang/Package.java: New version from Classpath. From-SVN: r65007
2003-03-26natRuntime.cc (insertSystemProperties): Set gnu.classpath.home.url.Tom Tromey1-0/+6
* java/lang/natRuntime.cc (insertSystemProperties): Set gnu.classpath.home.url. * Makefile.in: Rebuilt. * Makefile.am: Define LIBDIR. From-SVN: r64905
2003-03-24natStringBuffer.cc (regionMatches): New function.Eric Blake3-505/+690
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-19Process.java: Merged from classpath.Michael Koch1-2/+2
2003-03-19 Michael Koch <konqueror@gmx.de> * java/lang/Process.java: Merged from classpath. From-SVN: r64575
2003-03-17resolve.cc (ncode): Use _Jv_platform_ffi_abi.Tom Tromey1-24/+15
* 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-15* java/lang/natObject.cc (JV_SYNC_HASH): replace signed % by &.Hans Boehm1-3/+3
From-SVN: r64386
2003-03-10[multiple changes]Andrew Haley1-1/+5
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-02Package.java: Remerged from classpath.Michael Koch1-78/+104
2003-03-02 Michael Koch <konqueror@gmx.de> * java/lang/Package.java: Remerged from classpath. From-SVN: r63689
2003-03-02natObject.cc: Don't include assert.h.Tom Tromey1-25/+24
* 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-01natWin32Process.cc (startProcess): Double-quote each program array element ↵Mohan Embar1-8/+9
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-02-28natMethod.cc (_Jv_CallAnyMethodA): Allocate a full jvalue for each argument.Hans Boehm1-28/+19
* 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-24ClassLoader.java (defineClass(byte[],int,int)): Deprecate.Tom Tromey2-1/+4
* 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-24natRuntime.cc (libraries_size, [...]): Removed.Tom Tromey1-42/+17
* 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-22New docs for Thread.java, and little tweaks identified by japi.Anthony Green2-14/+554
From-SVN: r63284
2003-02-19natStackTrace.cc: Include platform.h immediately after config.h.Rainer Orth3-8/+5
* 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-14System.java (properties): Use Properties.clone.Tom Tromey1-3/+9
* java/lang/System.java (properties): Use Properties.clone. (setProperties): Likewise. From-SVN: r62903
2003-02-10Win32Process.java (destroy): Declare as native.Ranjit Mathew2-20/+326
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-03natRuntime.cc (java::lang::Runtime::_load)): Take care of the fact that on ↵Ranjit Mathew1-2/+15
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-01-30natClass.cc (initializeClass): Check tables when (state == ↵Jeff Sturm2-10/+22
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-24ClassLoader.java (findLoadedClass): Removed erroneous comment.Tom Tromey1-3/+2
* java/lang/ClassLoader.java (findLoadedClass): Removed erroneous comment. From-SVN: r61725
2003-01-20Makefile.am (core_java_source_files): Add VMObjectStreamClass.java.Mark Wielaard1-1/+2
* 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-14natRuntime.cc (_load): StackTrace access needs to be in a try block.Andrew Haley1-8/+16
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
2002-12-31re PR libgcj/7416 (java.security startup refs "GNU libgcj.security")Tom Tromey1-6/+27
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-31re PR libgcj/8997 (spin() calls Thread.sleep)Tom Tromey1-2/+4
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-30StringBuffer.java (getChars): Remove wrong dstOffset check against count.Mark Wielaard1-19/+20
* java/lang/StringBuffer.java (getChars): Remove wrong dstOffset check against count. From-SVN: r60616
2002-12-28boehm.cc: Remove stray semicolon.Mark Mitchell1-0/+3
* 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-23exception.cc (PERSONALITY_FUNCTION): Clear least-significant-bit of catch_type.Jeff Sturm2-10/+29
* 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-19natClassLoader.cc (defineClass0): Removed erroneous comment.Tom Tromey5-60/+89
* 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-13ClassLoader.java (resolveClass0): Transform ClassNotFoundException to ↵Mark Wielaard1-6/+12
NoClassDefFoundError. * java/lang/ClassLoader.java (resolveClass0): Transform ClassNotFoundException to NoClassDefFoundError. Transform all other throwables to LinkageError. From-SVN: r60097