2000-01-14 Andrew Haley <aph@cygnus.com>
* java/lang/natThrowable.cc: New file.
* java/lang/Throwable.java (fillInStackTrace): Make native.
(printStackTrace): Call native method to do this.
(Throwable): Call fillInStackTrace.
(stackTrace): New variable.
* include/jvm.h: Add _Jv_ThisExecutable functions.
* prims.cc: (_Jv_execName): New variable.
(catch_segv): Call fillInStackTrace.
(catch_fpe): Ditto.
(_Jv_ThisExecutable): New functions.
(JvRunMain): Set the name of this executable.
* Makefile.am: Add java/lang/natThrowable.cc.
Add name-finder.cc.
* Makefile.in: Rebuilt.
* acconfig.h: Add HAVE_PROC_SELF_EXE.
* configure.in: Force link with __frame_state_for in
FORCELIBGCCSPEC. Add new checks for backtrace.
* include/config.h.in: Rebuilt.
* name-finder.cc: New file.
* include/name-finder.h: New file.
From-SVN: r31460
* libjava.lang/pr83.out: New file.
* libjava.lang/pr83.java: New file.
* libjava.lang/pr109.out: New file.
* libjava.lang/pr109.java: New file.
From-SVN: r31446
2000-01-10 Jeff Sturm <jsturm@sigma6.com>
* java/lang/natMath.cc (pow): Cast args to `double', not
`jdouble'.
(atan2): Likewise.
(IEEEremainder): Likewise.
* java/lang/mprec.h: Don't wrap includes in `extern "C"'.
* java/lang/fdlibm.h: Don't wrap includes in `extern "C"'.
From-SVN: r31305
2000-01-09 Anthony Green <green@cygnus.com>
* java/lang/natString.cc (init): Test for overflow condition
during out of bounds check.
(getChars): Throw StringIndexOutOfBoundsException, not
ArrayIndexOutOfBoundsException.
(getBytes): Ditto.
(regionMatches): Obey case option during string comparison.
* configure.host (ligcj_interpreter): New variable. Enable
interpreter by default on IA-32.
* configure.in: Examine libgcj_interpreter.
* configure: Rebuilt.
From-SVN: r31300
* java/lang/natClass.cc (_getConstructors): Correctly check
whether method name is the init name.
(getMethod): Look at accflags on method in `klass', not `this'.
From-SVN: r31258
* java/lang/natClass.cc (getMethod): Compute offset relative to
`klass's methods table, not `this's table.
* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA):
In unwrapping/widening case, check whether `k' is null, not
whether it is primitive. Initialize `num' from `argelts', not
`paramelts'. Correct create and pass arguments to ffi_call.
Don't let presence of `this' argument affect index used to look in
argument arrays.
(COPY): Set appropriate element in `values' vector.
From-SVN: r31253
* java/lang/reflect/natMethod.cc (get_ffi_type): Test size of
jboolean and select correct ffi type on that basis.
(_Jv_CallNonvirtualMethodA): Handle `void' return type.
Constructor call always has `void' return type.
From-SVN: r31242
* java/lang/Class.h (getSignature): Updated.
* java/lang/Class.java (getSignature): Updated.
* java/lang/natClass.cc (getSignature): Added `is_constructor'
argument.
(getConstructor): Ensure constructor is public.
(_getConstructors): Check for public-ness of constructor when
`declared' is false, not when it is true.
From-SVN: r31241
* java/net/natPlainDatagramSocketImpl.cc (peek): Removed unnecesary
comment.
(receive): Set the sender's address in the DatagramPacket.
From-SVN: r31218
2000-01-04 Tom Tromey <tromey@cygnus.com>
* java/lang/reflect/natConstructor.cc (newInstance): Pass
declaring class as return_type argument to
_Jv_CallNonvirtualMethodA.
* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA): In
constructor case, create object and use it as `this' argument.
* java/lang/Class.h (_getConstructors): Declare.
(_getFields): Declare.
* java/lang/Class.java (getConstructors): Wrote.
(_getConstructors): New native method.
(getDeclaredConstructors): Wrote.
(_getFields): Declare new native method.
* java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Removed
incorrect comment.
(getMethod): Work correctly when class is primitive.
(getDeclaredMethods): Likewise. Compute offset using `method',
not `mptr'.
(getDeclaredMethod): Likewise.
(getConstructor): Wrote.
(ConstructorClass): New define.
(getDeclaredConstructor): Wrote.
(_getConstructors): New method.
(_getFields): New method.
(getFields): Wrote.
* Makefile.in: Rebuilt.
* Makefile.am (AM_CXXFLAGS): Added -D_GNU_SOURCE.
* prims.cc: Remove `#pragma implementation'.
* gcj/array.h: Remove `#pragma interface'.
* prims.cc (_Jv_equaln): New function.
* java/lang/Class.java (getSignature): Declare.
* resolve.cc (_Jv_LookupDeclaredMethod): Moved to natClass.cc.
* java/lang/natClass.cc (_Jv_LookupDeclaredMethod): Moved from
resolve.cc.
(getSignature): New method.
(getDeclaredMethod): Wrote.
(getMethod): Wrote.
Include StringBuffer.h.
* java/lang/Class.h (Class): Added _Jv_FromReflectedConstructor
as a friend. Unconditionally declare _Jv_LookupDeclaredMethod as
a friend.
(getSignature): Declare.
* include/jvm.h (_Jv_GetTypesFromSignature): Declare.
(_Jv_equaln): Declare.
(_Jv_CallNonvirtualMethodA): Declare.
* Makefile.in: Rebuilt.
* Makefile.am (nat_source_files): Added natConstructor.cc.
(java/lang/reflect/Constructor.h): New target.
* java/lang/reflect/natConstructor.cc: New file.
* java/lang/reflect/Constructor.java (newInstance): Now native.
(declaringClass): Renamed from decl_class.
(offset): Renamed from index.
(getType): New native method.
(getModifiers): Now native.
(getParameterTypes): Call getType if required.
(hashCode): Include hash code from declaring class.
(modifiers): Removed.
(toString): Call getType if required.
* gcj/method.h (_Jv_FromReflectedConstructor): New function.
* java/lang/reflect/natMethod.cc (hack_call): New method.
Removed `#if 0' around FFI code.
Include <gnu/gcj/RawData.h>.
(invoke): Use _Jv_CallNonvirtualMethodA. Throw
IllegalArgumentException when argument object and class disagree.
(_Jv_GetTypesFromSignature): New function.
(getType): Use it.
(ObjectClass): New define.
(_Jv_CallNonvirtualMethodA): New function.
* java/lang/reflect/Method.java (hack_trampoline): New method.
(hack_call): New native method.
1999-12-21 Per Bothner <per@bothner.com>
* java/lang/natClass.cc (getDeclaredMethods): Correctly compute
offset in new Method.
From-SVN: r31199
1999-12-22 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/natObject.cc (notify): Throw message with
IllegalMonitorStateException.
(notifyAll): Ditto.
(wait): Ditto.
* java/lang/Thread.java (isInterrupted): Don't clear interrupt_flag.
(isInterrupted_): New function, which does clear interrupt_flag.
(interrupt): Use `isInterrupted_'.
* java/lang/natThread.cc (interrupt): Add comment.
(join): Set `Prev' in joiner loop.
Change various calls to `isInterrupted' to use `isInterrupted_'.
* posix-threads.cc (_Jv_CondWait): Allways use pthread_cond_timedwait
on linux. Set result to 0 on an interrupt. Test interrupted status
of java Thread object directly.
FLAG_INTERRUPTED: removed.
(_Jv_ThreadStart): Throw OutOfMemoryError if pthread_create fails.
(_Jv_ThreadInterrupt): Don't set FLAG_INTERRUPTED.
(_Jv_InitThreads): Don't block SIGINT.
(_Jv_ThreadWait): Don't configure SIGINT handler.
From-SVN: r31082
1999-12-19 Anthony Green <green@cygnus.com>
* libgcjdata.c: New file.
* libgcj.spec.in: Use @LIBDATASTARTSPEC@ in startfile.
* configure: Rebuilt.
* configure.in (LIBDATASTARTSPEC): Force data with a known name
into the program.
* Makefile.in: Rebuilt.
* Makefile.am: Build libgcjdata.a.
* libgcj.spec.in: Use @FORCELIBGCCSPEC@ in startfile.
* configure: Rebuilt.
* configure.in (FORCELIBGCCSPEC): Force important parts of libgcc
into every program.
From-SVN: r31027
1999-12-16 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/Boolean.java (Boolean(String)): Set Value' to false on a
null String constructor parameter.
* java/net/natPlainSocketImpl.cc: Remove unneccessary sprintf calls
for exception messages.
BooleanClass: declare.
(setOption): Use BooleanClass instead of Class.forName() for
instanceof test.
(bind): Cast 4th parameter of setsockopt to char *' for
compatibility with older Solaris headers.
* java/net/natPlainDatagramSocketImpl.cc: Remove unneccessary
sprintf calls for exception messages.
BooleanClass, IntegerClass: declare.
(setOption): Use BooleanClass and IntegerClass, not Class.forName()
for instanceof test.
From-SVN: r30988
* java/lang/natSystem.cc (init_properties): Don't set user.name or
user.home if NO_GETUID defined. Only set user.dir if getcwd
exists.
* include/config.h.in: Rebuilt.
* acconfig.h (NO_GETUID): New define.
* configure.in: Rebuilt.
* configure.in: Define NO_GETUID in cross case. Check for getcwd
in native case.
From-SVN: r30964
* java/lang/natString.cc (equalsIgnoreCase): return false if
anotherString is null.
* java/lang/Boolean.java (valueOf): return FALSE if argument is
null.
From-SVN: r30763
1999-12-02 Bryce McKinlay <bryce@albatross.co.nz>
* libjava/java/net/ServerSocket.java (ServerSocket): Bind to any
interface if bindAddr is null.
From-SVN: r30755
* posix-threads.cc (_Jv_MutexInit): Use _Jv_PthreadGetMutex to get
mutex to initialize. Initialize `count' if required.
Fixes PR libgcj/98.
From-SVN: r30725
1999-11-27 Per Bothner <per@bothner.com>
* exception.cc: Remove prototype declarations for malloc and free.
These clash with recent versions of glibc, which specifies `throws ()'
when __cplusplus is defined. Instead, #include <stdlib.h>.
From-SVN: r30709
1999-11-05 Jeff Sturm <jsturm@sigma6.com>
* boehm.cc (_Jv_GCSetInitialHeapSize): Swapped size & current.
* prims.cc (parse_heap_size): Use end, not spec. Use 1024
multipler for `k'.
From-SVN: r30418