1 2000-03-08 Warren Levy <warrenl@cygnus.com>
3 * java/math/BigInteger.java(signum): Handle zero properly.
5 2000-03-07 Tom Tromey <tromey@cygnus.com>
7 * All files: Updated copyright information.
9 * COPYING.LIB: Removed.
10 * LIBGCJ_LICENSE: We now use GPL + special exception.
12 2000-03-07 Bryce McKinlay <bryce@albatross.co.nz>
14 * resolve.cc (_Jv_SearchMethodInClass): New function.
15 (_Jv_ResolvePoolEntry): Search superinterfaces for interface methods.
16 * java/lang/Class.h (_Jv_SearchMethodInClass): New prototype.
18 2000-03-07 Bryce McKinlay <bryce@albatross.co.nz>
20 * java/lang/Class.h (union _Jv_IDispatchTable): New declaration.
21 (struct _Jv_ifaces): New declaration.
22 JV_CLASS: New macro definition.
23 (getComponentType): Relocate below isArray() for inlining.
24 (getModifiers): Declare `inline'.
25 (getSuperclass): Ditto.
28 (_Jv_IsAssignableFrom): New prototype.
29 (_Jv_LookupInterfaceMethodIdx): New prototype. Predeclare with "C"
31 (_Jv_InitClass): Move from natClass.cc. Declare `inline'.
32 Check for JV_STATE_DONE before invoking initializeClass().
33 (_Jv_PrepareConstantTimeTables): New prototype.
34 (_Jv_GetInterfaces): Ditto.
35 (_Jv_GenerateITable): Ditto.
36 (_Jv_GetMethodString): Ditto.
37 (_Jv_AppendPartialITable): Ditto.
38 (_Jv_FindIIndex): Ditto.
39 depth, ancestors, idt: New class fields.
41 * java/lang/natClass.cc (isAssignableFrom): Move functionality to
42 inline function `_Jv_IsAssignableFrom'. Use that function.
43 (isInstance): Declare `inline'.
44 (initializeClass): Get lock on class before checking `state'. Unlock
45 before calling resolveClass0. Call _Jv_PrepareConstantTimeTables with
47 (_Jv_LookupInterfaceMethod): Use _Jv_GetMessageString.
48 (_Jv_IsAssignableFrom): New inline function. Test assignability using
49 class->depth and ancestor table.
50 (_Jv_IsInstanceOf): Use _Jv_IsAssignableFrom.
51 (_Jv_CheckCast): Move from prims.cc. Use JV_CLASS and
53 (_Jv_CheckArrayStore): Ditto.
54 (_Jv_LookupInterfaceMethodIdx): New function.
55 INITIAL_IOFFSETS_LEN, INITIAL_IFACES_LEN: New #defines.
56 (_Jv_PrepareConstantTimeTables): New function.
58 (_Jv_GetInterfaces): Ditto.
59 (_Jv_GenerateITable): Ditto.
60 (_Jv_GetMethodString): Ditto.
61 (_Jv_AppendPartialITable): Ditto.
62 iindex_mutex, iindex_mutex_initialized: New static fields.
63 (_Jv_FindIIndex): New function.
65 * java/lang/natClassLoader.cc (_Jv_NewClass): Set new jclass fields.
67 * prims.cc (_Jv_CheckCast): Moved to natClass.cc.
68 (_Jv_CheckArrayStore): Ditto.
69 (JvNewCharArray, JvNewBooleanArray, JvNewByteArray, JvNewShortArray,
70 JvNewIntArray, JvNewLongArray, JvNewFloatArray, JvNewDoubleArray):
72 (_Jv_Realloc): New function.
74 * gcj/cni.h: Move _Jv_PrimClass definitions to gcj/array.h.
76 * gcj/array.h: _Jv_PrimClass definitions moved from gcj/cni.h.
77 (JvNewCharArray, JvNewBooleanArray, JvNewByteArray,
78 JvNewShortArray, JvNewIntArray, JvNewLongArray, JvNewFloatArray,
79 JvNewDoubleArray): Implementations moved from prims.cc and
82 * gcj/javaprims.h (_Jv_Realloc): Prototype.
84 * include/jvm.h (_Jv_LookupInterfaceMethodIdx): Prototype.
86 2000-03-06 Tom Tromey <tromey@cygnus.com>
88 * jni.cc (MARK_NONE): New define.
89 (MARK_USER): Likewise.
90 (MARK_SYSTEM): Likewise.
91 (struct _Jv_JNI_LocalFrame): Made `marker' bigger and `size'
93 (_Jv_JNI_DeleteLocalRef): Use MARK_NONE in assert.
94 (_Jv_JNI_EnsureLocalCapacity): Use MARK_NONE.
95 (_Jv_JNI_PushLocalFrame): Use MARK_USER.
96 (_Jv_JNI_PopLocalFrame): New version with additional `stop'
98 (call): Use MARK_SYSTEM.
99 (_Jv_GetJNIEnvNewFrame): New function.
100 (_Jv_LookupJNIMethod): New function.
101 (_Jv_JNI_PopSystemFrame): New function.
102 (call): Use _Jv_JNI_PopSystemFrame and _Jv_LookupJNIMethod.
104 2000-03-05 Tom Tromey <tromey@cygnus.com>
106 Fix for PR libgcj/43:
107 * include/Makefile.in: Rebuilt.
108 * include/Makefile.am (include_HEADERS): New define.
110 2000-03-05 Anthony Green <green@redhat.com>
112 * gcj/javaprims.h ("Java"): Remove FirstThread.
114 * configure.host: Fix __NO_MATH_INLNES botch.
116 * Makefile.in: Rebuilt.
117 * Makefile.am (nat_source_files): Move natFirstThread.cc.
118 (gnu/gcj/runtime/FirstThread.h): Moved.
119 (ordinary_java_source_files): Move FirstThread.java.
120 * prims.cc: Deal with FirstThread movement.
122 (_Jv_RunMain): Ditto.
124 * gnu/gcj/runtime/FirstThread.java: Moved from java/lang.
125 * gnu/gcj/runtime/natFirstThread.cc: Ditto.
127 2000-03-05 Warren Levy <warrenl@cygnus.com>
129 * java/net/DatagramSocket.java(DatagramSocket(int,InetAddress)):
130 Handle null addresses.
132 2000-03-04 Anthony Green <green@redhat.com>
134 * configure.host (libgcj_flags): Define __NO_MATH_INLINES.
137 2000-03-04 Anthony Green <green@redhat.com>
139 * configure: Rebuilt.
140 * configure.in (ZLIBTESTSPEC): New macro.
141 (GCTESTSPEC): New macro.
142 (LIBGCJTESTSPEC): New macro.
143 * libgcj-test.spec.in: New file.
145 2000-03-02 Tom Tromey <tromey@cygnus.com>
147 * include/java-interp.h: Don't include MethodInvocation.h.
148 (class _Jv_InterpMethod): Don't make MethodInvocation a friend.
149 * Makefile.in: Rebuilt.
150 * Makefile.am (gnu/gcj/runtime/MethodInvocation.h): Removed.
151 (ordinary_java_source_files): Don't mention
152 MethodInvocation.java.
153 * gnu/gcj/runtime/MethodInvocation.java: Removed.
154 * interpret.cc (MethodInvocation::continue1): Removed.
155 (run): Handle exceptions here.
156 * java/lang/ClassLoader.java (defineClass1, defineClass2):
158 * java/lang/natClassLoader.cc (defineClass0): Catch exceptions
160 (defineClass2): Removed.
162 * java/lang/reflect/Method.java (hack_trampoline, hack_call):
164 * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Catch
166 (hack_call): Removed.
168 * java/lang/Class.h (Class): Removed hackRunInitializers,
170 * java/lang/natClass.cc (hackRunInitializers): Removed.
171 (initializeClass): Catch exceptions here.
172 Include ExceptionInInitializerError.h.
173 * java/lang/Class.java (hackTrampoline, hackRunInitializers):
176 * java/lang/Object.h (Object): Don't mention hack12_6.
177 * java/lang/natObject.cc (_Jv_FinalizeObject): Catch exceptions
179 * java/lang/Object.java (hack12_6): Removed.
181 * java/lang/natThread.cc (run_): Renamed. Catch exceptions here.
182 (start): Use run_, not run__.
183 * java/lang/Thread.java (run_): Renamed from run__; old run_
186 * jni.cc (_Jv_JNI_FindClass): Handle exceptions.
187 (_Jv_JNI_EnsureLocalCapacity): Likewise.
188 (_Jv_JNI_DefineClass): Likewise.
189 (_Jv_JNI_ThrowNew): Likewise.
190 (_Jv_JNI_AllocObject): Likewise.
191 (_Jv_JNI_GetAnyMethodID): Likewise.
192 (_Jv_JNI_CallAnyMethodV): Likewise.
193 (_Jv_JNI_CallAnyMethodA): Likewise.
194 (_Jv_JNI_CallAnyVoidMethodV): Likewise.
195 (_Jv_JNI_CallAnyVoidMethodA): Likewise.
196 (_Jv_JNI_GetAnyFieldID): Likewise.
197 (_Jv_JNI_NewString): Likewise.
198 (_Jv_JNI_NewStringUTF): Likewise.
199 (_Jv_JNI_GetStringUTFChars): Likewise.
200 (_Jv_JNI_NewObjectArray): Likewise.
201 (_Jv_JNI_NewPrimitiveArray): Likewise.
202 (_Jv_JNI_GetPrimitiveArrayRegion): Likewise.
203 (_Jv_JNI_GetStringRegion): Likewise.
204 (_Jv_JNI_GetStringUTFRegion): Likewise.
205 (_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
206 (_Jv_JNI_MonitorEnter): Likewise.
207 (_Jv_JNI_MonitorExit): Likewise.
208 (_Jv_JNI_ToReflectedField): Likewise.
209 (_Jv_JNI_ToReflectedMethod): Likewise.
210 (_Jv_JNI_RegisterNatives): Likewise.
211 (_Jv_JNI_AttachCurrentThread): Likewise.
212 (_Jv_JNI_DestroyJavaVM): Likewise.
214 2000-02-28 Mo DeJong <mdejong@cygnus.com>
216 * java/util/zip/ZipOutputStream.java(closeEntry) : Fixed
217 error caused by the incorrect casting of a long to an int.
219 2000-02-28 Mo DeJong <mdejong@cygnus.com>
221 * java/util/zip/ZipOutputStream.java(write_entry) : Fixed
222 SIGSEV caused by use of the wrong instance variable.
224 2000-02-27 Bryce McKinlay <bryce@albatross.co.nz>
226 * java/io/File.java (File(String, String)): For dirPath, treat an
227 empty String the same as `null'.
229 2000-02-26 Anthony Green <green@cygnus.com>
231 * gnu/gcj/io/MimeTypes.java: Test for null.
233 * jni.cc (_Jv_JNI_AttachCurrentThread): Minor cleanup.
234 (JNI_GetCreatedJavaVMs): Remove compiler warning.
236 * java/net/URLConnection.java: Update copyright notice.
238 2000-02-25 Tom Tromey <tromey@cygnus.com>
240 * jni.cc (_Jv_JNI_RegisterNatives): Conditionalize body on
243 2000-02-25 Bryce McKinlay <bryce@albatross.co.nz>
245 * java/net/URLConnection.java (initializeDateFormats): New
247 (getHeaderFieldDate): Call initializeDateFormats if required.
248 locale, dateFormat1, dateFormat2, dateFormat3: Don't initialize
250 Fix for PR libgcj/38.
252 2000-02-24 Warren Levy <warrenl@cygnus.com>
254 * java/math/BigInteger.java(ival): Made private.
258 2000-02-20 Anthony Green <green@cygnus.com>
260 * Makefile.in: Rebuilt.
261 * Makefile.am (ordinary_java_source_files): Add
262 gnu/gcj/io/DefaultMimeTypes.java and gnu/gcj/io/MimeTypes.java
264 * scripts/MakeDefaultMimeTypes.java: New file.
265 * scripts/mime.types: New file.
266 * scripts/classes.pl: Moved from top level.
267 * classes.pl: Moved to scripts directory.
269 * java/net/URLConnection.java: Implement guessContentTypeFromName.
271 * gnu/gcj/io/MimeTypes.java: New file.
272 * gnu/gcj/io/DefaultMimeTypes.java: New file.
274 2000-02-20 Tom Tromey <tromey@cygnus.com>
276 * boehm.cc (_Jv_AllocBytes): Clear returned memory.
278 2000-02-19 Bryce McKinlay <bryce@albatross.co.nz>
280 * java/util/zip/ZipEntry.java (setCrc): Fix overflow.
283 2000-02-18 Tom Tromey <tromey@cygnus.com>
285 * include/jvm.h (_Jv_GetJavaVM): Declare.
286 * include/java-interp.h (_Jv_GetFirstMethod): New function.
287 (_Jv_MethodBase::get_method): New method.
288 (_Jv_JNIMethod::set_function): New method.
289 * jni.cc (_Jv_JNI_UnregisterNatives): New function.
290 (_Jv_JNI_RegisterNatives): New function.
291 (_Jv_JNIFunctions): Updated for new functions.
292 (_Jv_GetJavaVM): New function.
293 (_Jv_JNI_GetJavaVM): Use it. Now static.
294 (_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread
295 is already a Java thread but does not have a JNIEnv yet.
297 * java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload
300 2000-02-17 Tom Tromey <tromey@cygnus.com>
302 * gcj/field.h (_Jv_Field::getClass): Don't use JvAssert.
305 2000-02-16 Tom Tromey <tromey@cygnus.com>
307 * jni.cc (_Jv_JNI_CallStaticMethodV): Added some assertions.
309 * jni.cc (_Jv_JNI_NewObjectV): Corrected assertion.
310 (_Jv_JNI_NewObject): Likewise.
311 (_Jv_JNI_NewObjectA): Likewise.
312 (_Jv_JNI_CallAnyMethodV): In constructor case, pass correct value
313 as "return" type to _Jv_CallAnyMethodA.
314 (_Jv_JNI_CallAnyMethodA): Likewise.
315 (_Jv_JNI_CallAnyVoidMethodV): Likewise.
317 * jni.cc (_Jv_JNI_FindClass): Use ClassLoader.loadClass, not
320 2000-02-15 Tom Tromey <tromey@cygnus.com>
322 * resolve.cc (ncode): Set args_raw_size. Compute jni_cif and
324 (init_cif): Added `rtype_p' argument.
325 * include/java-interp.h (class _Jv_MethodBase): Added
327 (class _Jv_InterpMethod): Removed args_raw_size.
328 (class _Jv_JNIMethod): Added jni_cif and jni_arg_types fields.
329 * jni.cc (call): Pass JNIEnv and (for static methods only) the
330 class pointer as well as the ordinary arguments.
332 * jni.cc (mangled_name): Skip leading `(' in signature.
334 * jni.cc (add_char): Added missing `else'.
336 * jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc
339 2000-02-15 Bryce McKinlay <bryce@albatross.co.nz>
343 * java/lang/natRuntime.cc (_load): Include library path with
346 * java/lang/natSystem.cc (init_properties): set java.lang.classpath
349 * java/lang/natThread.cc (dumpStack): Removed.
350 * java/lang/Thread.java (dumpStack): Implemented.
352 2000-02-15 Tom Tromey <tromey@cygnus.com>
354 * java/lang/natRuntime.cc (_load): On Unix, prefix library name
355 with `lib' for loadLibrary. Fixes PR gcj/150.
357 2000-02-14 Warren Levy <warrenl@cygnus.com>
359 * gnu/gcj/math/MPN.java(findLowestBit): Made methods public.
361 * java/math/BigInteger.java(BigInteger(int,int,java.util.Random):
365 (modPow): Rewritten to not use the naive, slow, brute force approach.
366 (isProbablePrime): Implemented.
367 (testBit): Implemented.
368 (flipBit): Implemented.
369 (getLowestSetBit): Implemented.
371 2000-02-16 Anthony Green <green@redhat.com>
373 * configure.host: Use the same options for i386 and i486 as we do
376 2000-02-12 Tom Tromey <tromey@cygnus.com>
378 * java/io/File.java (createTempFile): Use low bits from counter,
381 Fri Feb 11 19:48:08 2000 Anthony Green <green@cygnus.com>
383 * THANKS: More thanks.
385 2000-02-11 Tom Tromey <tromey@cygnus.com>
387 * interpret.cc (continue1): Use STOREA, not STOREI, to implement
388 astore instruction. From Hans Boehm.
390 2000-02-11 Warren Levy <warrenl@cygnus.com>
392 * java/math/BigInteger.java(BigInteger(String, int)): New constructor.
393 (BigInteger(String)): New constructor.
394 (not): Rewritten using version from Kawa's BitOps class.
395 (valueOf): New private methods from Kawa's BitOps class.
402 (andNot): Implemented.
403 (clearBit): Implemented.
404 (setBit): Implemented.
405 (bitCount): Implemented.
406 (toByteArray): Implemented.
408 2000-02-11 Tom Tromey <tromey@cygnus.com>
410 * java/io/File.java (nextValue): Now synchronized.
412 2000-02-10 Tom Tromey <tromey@cygnus.com>
414 * java/io/natFileDescriptorPosix.cc (open): Recognize EXCL flag.
415 * java/io/FileDescriptor.java (EXCL): New static field.
416 * java/io/File.java (tmpdir): New static field.
417 (createTempFile): New method.
418 (nextValue): New method.
419 * java/lang/natSystem.cc (init_properties): Set java.io.tmpdir
422 * include/jni.h (JNI_FALSE): Renamed from JNI_TRUE; oops.
423 (jboolean): Declare as an attributed int, not a bool.
424 (_Jv_func): Declare differently for C.
426 * gnu/gcj/jni/natNativeThread.cc: New file.
427 * gnu/gcj/jni/NativeThread.java: New file.
428 * java/lang/Thread.java (data): Now a RawData.
429 * include/jvm.h (_Jv_GetCurrentJNIEnv, _Jv_SetCurrentJNIEnv):
431 * Makefile.in: Rebuilt.
432 * Makefile.am (java/lang/Thread.h): New target.
433 (ordinary_java_source_files): Added NativeThread.java.
434 (nat_source_files): Added natNativeThread.cc.
435 * java/lang/natThread.cc: Include <jni.h>
436 (struct natThread): Added `jni_env' field.
437 (_Jv_GetCurrentJNIEnv): New function.
438 (_Jv_SetCurrentJNIEnv): Likewise.
439 (initialize_native): Initialize jni_env.
441 * jni.cc (ThreadGroupClass): New define.
442 (_Jv_JNI_InvokeFunctions): New structure.
443 (JNI_GetCreatedJavaVMs): New function.
444 (the_vm): New global.
445 (JNI_GetDefaultJavaVMInitArgs): New function.
446 Include NativeThread.h.
447 (NativeThreadClass): New define.
448 (_Jv_JNI_EnsureLocalCapacity): Return JNI_ERR, not -1.
449 (_Jv_JNI_DestroyJavaVM): New function.
450 (_Jv_JNI_AttachCurrentThread): New function.
451 (_Jv_JNI_DetachCurrentThread): New function.
452 (_Jv_JNI_GetEnv): New function.
453 (JNI_CreateJavaVM): New function.
454 (_Jv_JNI_GetJavaVM): New function.
455 (_Jv_JNIFunctions): Added entry for GetJavaVM.
456 * include/jni.h (JavaVMAttachArgs): New structure.
457 (JNI_EDETACHED): New define.
458 (JNI_EVERSION): Likewise.
459 (JavaVM): Define properly.
460 (struct JNIInvokeInterface): New structure.
461 (class _Jv_JavaVM): New class.
462 (JNI_OnLoad, JNI_OnUnload): Declare.
463 (JNI_GetDefaultJavaVMInitArgs, JNI_CreateJavaVM,
464 JNI_GetCreatedJavaVMs): Declare.
465 (JavaVMInitArgs): New typedef.
466 (JavaVMOption): Likewise.
467 (JNI_ERR): New define.
470 2000-02-10 Andrew Haley <aph@cygnus.com>
472 * interpret.cc: Don't include fdlibm.h.
473 Replace #if with #ifdef throughout.
474 Declare extern __ieee754_fmod.
475 (continue1): Remove op_getfield, op_getstatic, op_putfield,
477 * resolve.cc (_Jv_PrepareClass): Use imeth as method pointer.
478 Search class hierarchy for superclass vtable.
480 * java/lang/natClassLoader.cc (_Jv_UnregisterClass): Don't fall
481 off the end of a pointer list.
483 * java/lang/natThread.cc (stop): Don't abort, throw an exception
487 2000-02-09 Tom Tromey <tromey@cygnus.com>
489 * java/lang/natRuntime.cc (_load): Call add_library.
490 (loadLibraryInternal): Likewise.
492 * gnu/gcj/convert/natIconv.cc (Input_iconv::finalize): Call
493 iconv_close when handle is not NULL. Thanks to Andrew Haley.
494 (Output_iconv::finalize): Likewise.
496 2000-02-08 Tom Tromey <tromey@cygnus.com>
498 * java/util/Properties.java (setProperty): New method.
501 2000-02-07 Tom Tromey <tromey@cygnus.com>
503 * java/lang/Runtime.java (_load): Declare.
504 (load, loadLibrary): Wrote in terms of _load.
505 * java/lang/natRuntime.cc (load): Call JNI_OnLoad if it appears in
507 (loadLibrary): Likewise.
510 (loadLibrary, load): Removed.
512 * jni.cc (ThrowableClass): New define.
513 (_Jv_JNI_Throw): Check argument.
514 (_Jv_JNI_ThrowNew): Likewise.
515 (wrap_value): Don't wrap object if it is NULL.
516 (_Jv_JNI_DefineClass): Use wrap_value.
517 (_Jv_JNI_FindClass): Likewise.
518 (_Jv_JNI_GetSuperclass): Likewise.
519 (_Jv_JNI_ExceptionOccurred): Likewise.
520 (_Jv_JNI_AllocObject): Likewise.
521 (_Jv_JNI_GetObjectClass): Likewise.
522 (_Jv_JNI_NewString): Likewise.
523 (_Jv_JNI_NewStringUTF): Likewise.
524 (_Jv_JNI_NewObjectArray): Likewise.
525 (_Jv_JNI_GetObjectArrayElement): Likewise.
526 (_Jv_JNI_NewPrimitiveArray): Likewise.
527 (_Jv_JNI_ToReflectedField): Likewise.
528 (_Jv_JNI_ToReflectedMethod): Likewise.
529 (_Jv_JNI_AllocObject): Check argument.
530 (_Jv_JNI_NewObjectV): Likewise.
531 (_Jv_JNI_NewObject): Likewise.
532 (_Jv_JNI_NewObjectA): Likewise.
533 (_Jv_JNI_GetObjectClass): Likewise.
534 (_Jv_JNI_GetField): Likewise.
535 (_Jv_JNI_SetField): Likewise.
537 * interpret.cc (PUSHL): Don't use expression statement.
542 * jni.cc (add_char): Conditional on INTERPRETER.
543 (mangled_name): Likewise.
545 * include/java-interp.h (class _Jv_MethodBase): Conditional on
547 (class _Jv_JNIMethod): Likewise.
549 2000-02-04 Warren Levy <warrenl@cygnus.com>
551 * Makefile.am: Added MPN.java and BigInteger.java.
552 * Makefile.in: Rebuilt.
553 * gnu/gcj/math/MPN.java: New file. From Kawa by Per Bothner
555 * java/math/BigInteger.java: New file. Based primarily on
556 Kawa's IntNum.java by Per Bothner <per@bothner.com>.
558 2000-02-04 Tom Tromey <tromey@cygnus.com>
560 * defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase
562 (handleMethodsEnd): Fixed error messages. Create a _Jv_JNIMethod
563 if the method is native.
564 * resolve.cc (ncode): Don't handle native methods.
565 (_Jv_JNIMethod::ncode): New method.
566 (_Jv_PrepareClass): Handle native methods.
567 * jni.cc (call): Renamed from _Jv_JNI_conversion_call.
568 Include AbstractMethodError.h.
569 (add_char): New function.
570 (mangled_name): Likewise.
571 * include/java-interp.h (class _Jv_JNIMethod): New class.
572 (class _Jv_MethodBase): New class.
573 (class _Jv_InterpMethod): Derive from _Jv_MethodBase.
574 (_Jv_InterpClass): Changed `interpreted_methods' field to type
577 * include/jvm.h (_Jv_FindSymbolInExecutable): Declare.
578 * java/lang/natRuntime.cc (libraries_size, libraries_count,
579 libraries): New globals.
580 (add_library): New function.
581 (_Jv_FindSymbolInExecutable): New function.
583 * java/lang/natClassLoader.cc (initiated_classes, loaded_classes):
586 2000-02-04 Andrew Haley <aph@cygnus.com>
588 * java/lang/Throwable.java (CPlusPlusDemangler): New class.
589 (printStackTrace): Use a CPlusPlusDemangler to demangle names.
590 * java/lang/natThrowable.cc (printRawStackTrace): Rename
591 printStackTrace to printRawStackTrace.
593 2000-02-03 Tom Tromey <tromey@cygnus.com>
595 * java/util/Calendar.java (toString): New method.
596 * java/util/SimpleTimeZone.java (clone): New method.
597 (toString): New method.
598 * java/util/TimeZone.java (clone): New method.
599 * java/text/SimpleDateFormat.java (clone): New method.
600 * java/text/NumberFormat.java (clone): New method.
601 (equals): New method.
602 * java/text/Format.java (clone): New method.
603 * java/text/DateFormatSymbols.java (DateFormatSymbols): New
606 * java/text/DateFormat.java (clone): New method.
607 * java/text/Collator.java (clone): New method.
609 2000-02-03 Tom Tromey <tromey@cygnus.com>
611 * java/io/PipedOutputStream.java (write(byte[], int, int)): New
614 2000-02-01 Tom Tromey <tromey@cygnus.com>
616 * include/java-interp.h (_Jv_JNI_conversion_call): Declare.
617 * resolve.cc (ncode): Use _Jv_JNI_conversion_call when
618 constructing the closure if the function is native.
619 * jni.cc (_Jv_JNI_conversion_call): Now returns `void'. No longer
620 a template function, #if'd out, or static.
621 Include <java-interp.h>.
623 * include/jni.h (class _Jv_JNIEnv): Corrected calls using `...'.
625 * include/jni.h (class _Jv_JNIEnv): Added all C++ inline methods.
627 * jni.cc (_Jv_JNI_PopLocalFrame): Leave loop when `n == NULL'.
628 (_Jv_JNI_conversion_call): _Jv_JNI_PopLocalFrame will never leave
630 (wrap_value): New function.
631 (_Jv_JNI_CallAnyMethodV): Use it.
632 (_Jv_JNI_CallAnyMethodA): Likewise.
633 (_Jv_JNI_GetField): Use wrap_value; removed specialized version.
634 (_Jv_JNI_GetStaticField): Likewise.
636 * jni.cc (_Jv_JNI_GetField): Specialize for jobject.
637 (_Jv_JNI_GetStaticField): Likewise.
639 2000-01-31 Tom Tromey <tromey@cygnus.com>
641 * prims.cc (_Jv_MallocUnchecked): New function.
642 (main_init): Call _Jv_JNI_Init.
643 * include/jvm.h (_Jv_MallocUnchecked): Declare.
644 (_Jv_JNI_Init): Declare.
645 * jni.cc: Include Hashtable.h, OutOfMemoryError.h, Integer.h,
647 (_Jv_JNI_NewGlobalRef): New function.
648 (_Jv_JNI_DeleteGlobalRef): New function.
649 (_Jv_JNI_DeleteLocalRef): New function.
650 (_Jv_JNI_conversion_call): Initialize and clear local reference
652 (_Jv_JNI_NewLocalRef): New function.
653 (struct _Jv_JNI_LocalFrame): New structure.
654 (_Jv_JNI_PushLocalFrame): New function.
655 (_Jv_JNI_EnsureLocalCapacity): New function.
656 (FRAME_SIZE): New define.
657 (_Jv_JNI_GetStringChars): Mark string, not characters.
658 (_Jv_JNI_ReleaseStringChars): Unmark string, not characters.
659 (_Jv_JNI_GetPrimitiveArrayElements): Mark array, not elements.
660 (_Jv_JNI_ReleasePrimitiveArrayElements): Unmark array, not
662 (_Jv_JNI_DefineClass): Make return value a local ref.
663 (_Jv_JNI_FindClass): Likewise.
664 (_Jv_JNI_GetSuperclass): Likewise.
665 (_Jv_JNI_ExceptionOccurred): Likewise.
666 (_Jv_JNI_AllocObject): Likewise.
667 (_Jv_JNI_GetObjectClass): Likewise.
668 (_Jv_JNI_CallAnyMethodV): Likewise.
669 (_Jv_JNI_NewString): Likewise.
670 (_Jv_JNI_NewStringUTF): Likewise.
671 (_Jv_JNI_NewObjectArray): Likewise.
672 (_Jv_JNI_GetObjectArrayElement): Likewise.
673 (_Jv_JNI_ToReflectedField): Likewise.
674 (_Jv_JNI_ToReflectedMethod): Likewise.
675 (_Jv_JNIFunctions): Updated table for new functions.
676 (_Jv_JNI_Init): New function.
677 (mark_for_gc): Wrote.
678 (unmark_for_gc): Wrote.
679 * include/jni.h (struct JNINativeInterface): Removed name from
680 PopLocalFrame parameter.
681 (class _Jv_JNIEnv): Added `locals' field.
683 Mon Jan 31 00:43:15 2000 Anthony Green <green@redhat.com>
685 * gnu/gcj/convert/natIconv.cc (read): Minor fixes.
688 2000-01-30 Tom Tromey <tromey@cygnus.com>
690 * include/config.h.in: Rebuilt.
691 * acconfig.h (HAVE_ICONV): Define.
692 * configure: Rebuilt.
693 * configure.in: Check for `iconv' function.
694 * gnu/gcj/convert/BytesToUnicode.java (getDecoder): Try iconv if
695 no specific encoder exists.
696 * gnu/gcj/convert/UnicodeToBytes.java (getEncoder): Try iconv if
697 no specific encoder exists.
698 * Makefile.in: Rebuilt.
699 * Makefile.am (convert_source_files): Mention Input_iconv.java and
701 (nat_source_files): Added natIconv.cc.
702 * gnu/gcj/convert/natIconv.cc: New file.
703 * gnu/gcj/convert/Input_iconv.java: New file.
704 * gnu/gcj/convert/Output_iconv.java: New file.
706 2000-01-28 Tom Tromey <tromey@cygnus.com>
708 * Makefile.in: Rebuilt.
709 * Makefile.am (LIBFFIINCS): Added MULTIBUILDTOP.
711 2000-01-26 Tom Tromey <tromey@cygnus.com>
713 * gcj/method.h (JvNumMethods): Moved from Class.h.
714 (JvGetFirstMethod): Likewise.
715 * java/lang/Class.h (Object): Updated decl of
716 _Jv_JNI_ToReflectedField.
717 (Object): Added _Jv_JNI_ToReflectedMethod as a friend.
718 * Makefile.in: Rebuilt.
719 * Makefile.am (java/lang/reflect/Field.h): Added `jboolean'
720 argument of _Jv_JNI_ToReflectedField.
721 (java/lang/reflect/Constructor.h): Added _Jv_JNI_ToReflectedMethod
723 (java/lang/reflect/Method.h): Likewise.
724 * include/jni.h (class _Jv_JNIEnv): Added `klass' member. Use
726 (jweak): New typedef.
727 (struct JNINativeInterface): Correctly declare remaining entries.
728 * jni.cc: Include Class.h, ClassLoader.h.
729 (_Jv_JNI_FindClass): New function.
730 (_Jv_JNI_DefineClass): New function.
731 (_Jv_JNI_conversion_call): New function.
732 (_Jv_JNI_FindClass): Use current class loader to find class.
733 (_Jv_JNI_ExceptionCheck): New function.
734 (_Jv_JNI_FromReflectedField): Now static.
735 (MethodClass): New define.
736 (_Jv_JNI_FromReflectedMethod): New function.
737 (_Jv_JNI_ToReflectedMethod): Likewise.
739 (_Jv_JNI_IsAssignableFrom): Renamed.
740 (_Jv_JNI_GetStringRegion): New function.
741 Include StringIndexOutOfBoundsException.h.
742 (_Jv_JNI_GetStringUTFRegion): New function.
743 (_Jv_JNIFunctions): Updated for new functions.
744 (_Jv_JNI_GetPrimitiveArrayCritical): New function
745 (_Jv_JNI_ReleasePrimitiveArrayCritical): Likewise.
746 (_Jv_JNI_GetStringCritical): New function.
747 (_Jv_JNI_ReleaseStringCritical): Likewise.
748 (get_throwable): Removed.
749 (GCJ_JV_JNIENV_FRIEND): Removed.
750 (__GCJ_JNI_IMPL__): Define.
753 * resolve.cc (get_ffi_type_from_signature): Handle case where
756 Tue Jan 25 08:51:16 2000 Tom Tromey <tromey@ferrule.cygnus.com>
758 * interpret.cc (run): Don't call println.
759 Don't include PrintStream.h.
761 * gcj/field.h (struct _Jv_Field): Use "jshort" as type for
762 nameIndex. Use "jint" as type for boffset.
763 * java/lang/Class.h (struct _Jv_Method): Made accflags a
765 (Class): Likewise. Also changed type of method_count,
766 vtable_method_count, size_in_bytes, field_count,
767 static_field_count, interface_count.
768 * gcj/array.h (__JArray): Made `length' a const jsize, not an
771 2000-01-21 Tom Tromey <tromey@cygnus.com>
773 * java/lang/reflect/natConstructor.cc (newInstance): Use
775 * include/jvm.h: Declare _Jv_CallAnyMethodA.
776 * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Renamed
777 from _Jv_CallNonvirtualMethodA. Changed interface; overloaded.
780 (invoke): Use _Jv_CallAnyMethodA.
782 * java/lang/Class.h (Class): Declare JvGetFirstStaticField,
783 JvNumStaticFields, JvNumMethods, and JvGetFirstMethod as friend
785 (struct _Jv_Method): Added getNextMethod method.
786 (JvNumMethods): New function.
787 (JvGetFirstMethod): Likewise.
788 * gcj/field.h (JvGetFirstStaticField): New function.
789 (JvNumStaticFields): Likewise.
790 (getNextField): Renamed from getNextInstanceField.
791 (struct _Jv_Field): New method getClass.
792 * jni.cc: Wrote many new functions.
793 * include/jni.h (JNI_TRUE): Define.
794 (JNI_FALSE): Likewise.
795 (jobject, jclass, jstring, jarray, jthrowable, jobjectArray,
796 jbyteArray, jshortArray, jintArray, jlongArray, jbooleanArray,
797 jcharArray, jfloatArray, jdoubleArray): New typedefs.
798 (jfieldID, jmethodID): Likewise.
799 (JNI_COMMIT, JNI_ABORT): New defines.
800 (JNINativeMethod): New struct.
801 (struct JNINativeInterface): Correctly declared more entries.
802 (class _Jv_JNIEnv): Added `ex' member.
803 (JNI_VERSION_1_1): New define.
804 (JNI_VERSION_1_2): Likewise.
806 * boehm.cc (_Jv_MarkObj): Use getNextField, not
807 getNextInstanceField.
809 2000-01-20 Tom Tromey <tromey@cygnus.com>
811 * resolve.cc (StringClass): Removed.
812 * defineclass.cc (StringClass): Removed.
814 2000-01-19 Bryce McKinlay <bryce@albatross.co.nz>
818 2000-01-19 Tom Tromey <tromey@cygnus.com>
820 * interpret.cc (PC_REGISTER_ASM): Removed.
822 * java/lang/natThrowable.cc: Don't use `#pragma implementation'.
825 * All files: Updated copyright to reflect Cygnus purchase.
827 2000-01-18 Bryce McKinlay <bryce@albatross.co.nz>
829 * configure: Rebuilt.
830 * configure.in: Recognize --disable-interpreter.
832 2000-01-18 Andrew Haley <aph@cygnus.com>
834 * name-finder.cc (lookup): Check for dladdr function.
835 acconfig.h (HAVE_DLADDR): Add.
836 configure.in: Check for HAVE_DLADDR
838 include/config.h.in: Rebuilt.
840 2000-01-17 Andrew Haley <aph@cygnus.com>
842 * prims.cc (_Jv_RunMain): Set the name of this executable.
844 2000-01-17 Tom Tromey <tromey@cygnus.com>
846 * java/lang/natThrowable.cc (fillInStackTrace): Return `this' even
847 when backtrace can't be computed.
849 * configure: Rebuilt.
850 * configure.in: Fixed typo in AC_CONFIG_SUBDIRS call.
852 * java/lang/Runtime.java (loadLibraryInternal): Declare.
853 * java/lang/natClassLoader.cc (_Jv_FindClass): Removed dead copy.
854 (_Jv_FindClassInCache): Likewise.
855 (_Jv_FindClass): Don't conditionalize body on INTERPRETER.
856 (findSystemClass): Try to load class from compiled module.
858 * java/lang/natRuntime.cc (load): Use UTF-8 copy of filename.
859 (loadLibrary): Likewise.
860 (lt_preloaded_symbols): Define.
861 (loadLibraryInternal): New method.
862 * include/config.h.in: Rebuilt.
863 * acconfig.h (USE_LTDL): Added.
864 * Makefile.am (SUBDIRS): Added $(DIRLTDL).
865 (INCLUDES): Added $(INCLTDL).
866 (libgcj_la_DEPENDENCIES): Added $(LIBLTDL).
867 (libgcj_la_LIBADD): Likewise.
868 * aclocal.m4, configure: Rebuilt.
869 * configure.in: Added libltdl support.
871 2000-01-15 Tom Tromey <tromey@cygnus.com>
873 * prims.cc (_Jv_PrimClass): Use `JV_STATE_NOTHING', not `0'.
875 2000-01-14 Andrew Haley <aph@cygnus.com>
877 * java/lang/natThrowable.cc: New file.
879 * java/lang/Throwable.java (fillInStackTrace): Make native.
880 (printStackTrace): Call native method to do this.
881 (Throwable): Call fillInStackTrace.
882 (stackTrace): New variable.
884 * include/jvm.h: Add _Jv_ThisExecutable functions.
886 * prims.cc: (_Jv_execName): New variable.
887 (catch_segv): Call fillInStackTrace.
889 (_Jv_ThisExecutable): New functions.
890 (JvRunMain): Set the name of this executable.
892 * Makefile.am: Add java/lang/natThrowable.cc.
894 * Makefile.in: Rebuilt.
896 * acconfig.h: Add HAVE_PROC_SELF_EXE.
898 * configure.in: Force link with __frame_state_for in
899 FORCELIBGCCSPEC. Add new checks for backtrace.
900 * include/config.h.in: Rebuilt.
902 * name-finder.cc: New file.
903 * include/name-finder.h: New file.
905 2000-01-16 Anthony Green <green@cygnus.com>
907 * java/lang/StringBuffer.java (StringBuffer): Don't special case
910 2000-01-16 Jeff Sturm <jsturm@sigma6.com>
912 * java/io/StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).
914 2000-01-13 Tom Tromey <tromey@cygnus.com>
916 * java/lang/natClassLoader.cc (_Jv_FindClass): Register `loader',
917 not system loader, as initiating loader.
919 2000-01-11 Tom Tromey <tromey@cygnus.com>
921 * java/lang/natSystem.cc (getpwuid_adaptor): New adaptor for
922 HP/UX. From David Scott Urban.
924 2000-01-10 Jeff Sturm <jsturm@sigma6.com>
926 * java/lang/natMath.cc (pow): Cast args to `double', not
929 (IEEEremainder): Likewise.
930 * java/lang/mprec.h: Don't wrap includes in `extern "C"'.
931 * java/lang/fdlibm.h: Don't wrap includes in `extern "C"'.
933 2000-01-09 Anthony Green <green@cygnus.com>
935 * java/lang/natString.cc (init): Test for overflow condition
936 during out of bounds check.
937 (getChars): Throw StringIndexOutOfBoundsException, not
938 ArrayIndexOutOfBoundsException.
940 (regionMatches): Obey case option during string comparison.
942 * configure.host (ligcj_interpreter): New variable. Enable
943 interpreter by default on IA-32.
944 * configure.in: Examine libgcj_interpreter.
945 * configure: Rebuilt.
947 2000-01-07 Tom Tromey <tromey@cygnus.com>
949 * mauve-libgcj: Don't disable ClassTest.
951 * java/lang/natClass.cc (getClasses): Wrote.
953 2000-01-06 Tom Tromey <tromey@cygnus.com>
955 * java/lang/natClass.cc (_getConstructors): Correctly check
956 whether method name is the init name.
957 (getMethod): Look at accflags on method in `klass', not `this'.
959 2000-01-05 Tom Tromey <tromey@cygnus.com>
961 * java/lang/natClass.cc (getMethod): Compute offset relative to
962 `klass's methods table, not `this's table.
964 * java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA):
965 In unwrapping/widening case, check whether `k' is null, not
966 whether it is primitive. Initialize `num' from `argelts', not
967 `paramelts'. Correct create and pass arguments to ffi_call.
968 Don't let presence of `this' argument affect index used to look in
970 (COPY): Set appropriate element in `values' vector.
972 * java/lang/natClass.cc: Include <gcj/method.h>.
974 * java/lang/Class.h (_getMethods): Correctly declare as private,
977 * java/lang/Class.h (_getMethods): Declare.
978 * java/lang/Class.java (_getMethods): Declare.
979 * java/lang/natClass.cc (getDeclaringClass): Always return NULL.
980 (getDeclaredClasses): Always return empty array.
981 (_getMethods): New method.
983 (getDeclaredMethod): Return `rmethod'.
984 (finit_name): New global.
985 (getDeclaredMethods): Check for finit_name.
986 (_getMethods): Likewise.
987 (getMethod): Only return public methods.
989 * java/lang/reflect/natMethod.cc (get_ffi_type): Test size of
990 jboolean and select correct ffi type on that basis.
991 (_Jv_CallNonvirtualMethodA): Handle `void' return type.
992 Constructor call always has `void' return type.
994 2000-01-04 Tom Tromey <tromey@cygnus.com>
996 * java/lang/Class.h (getSignature): Updated.
997 * java/lang/Class.java (getSignature): Updated.
998 * java/lang/natClass.cc (getSignature): Added `is_constructor'
1000 (getConstructor): Ensure constructor is public.
1001 (_getConstructors): Check for public-ness of constructor when
1002 `declared' is false, not when it is true.
1004 2000-01-04 Warren Levy <warrenl@cygnus.com>
1006 * java/net/natPlainDatagramSocketImpl.cc (peek): Removed unnecesary
1008 (receive): Set the sender's address in the DatagramPacket.
1010 2000-01-04 Tom Tromey <tromey@cygnus.com>
1012 * java/lang/reflect/natConstructor.cc (newInstance): Pass
1013 declaring class as return_type argument to
1014 _Jv_CallNonvirtualMethodA.
1015 * java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA): In
1016 constructor case, create object and use it as `this' argument.
1017 * java/lang/Class.h (_getConstructors): Declare.
1018 (_getFields): Declare.
1019 * java/lang/Class.java (getConstructors): Wrote.
1020 (_getConstructors): New native method.
1021 (getDeclaredConstructors): Wrote.
1022 (_getFields): Declare new native method.
1023 * java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Removed
1025 (getMethod): Work correctly when class is primitive.
1026 (getDeclaredMethods): Likewise. Compute offset using `method',
1028 (getDeclaredMethod): Likewise.
1029 (getConstructor): Wrote.
1030 (ConstructorClass): New define.
1031 (getDeclaredConstructor): Wrote.
1032 (_getConstructors): New method.
1033 (_getFields): New method.
1036 * Makefile.in: Rebuilt.
1037 * Makefile.am (AM_CXXFLAGS): Added -D_GNU_SOURCE.
1039 * prims.cc: Remove `#pragma implementation'.
1040 * gcj/array.h: Remove `#pragma interface'.
1042 * prims.cc (_Jv_equaln): New function.
1043 * java/lang/Class.java (getSignature): Declare.
1044 * resolve.cc (_Jv_LookupDeclaredMethod): Moved to natClass.cc.
1045 * java/lang/natClass.cc (_Jv_LookupDeclaredMethod): Moved from
1047 (getSignature): New method.
1048 (getDeclaredMethod): Wrote.
1050 Include StringBuffer.h.
1051 * java/lang/Class.h (Class): Added _Jv_FromReflectedConstructor
1052 as a friend. Unconditionally declare _Jv_LookupDeclaredMethod as
1054 (getSignature): Declare.
1055 * include/jvm.h (_Jv_GetTypesFromSignature): Declare.
1056 (_Jv_equaln): Declare.
1057 (_Jv_CallNonvirtualMethodA): Declare.
1058 * Makefile.in: Rebuilt.
1059 * Makefile.am (nat_source_files): Added natConstructor.cc.
1060 (java/lang/reflect/Constructor.h): New target.
1061 * java/lang/reflect/natConstructor.cc: New file.
1062 * java/lang/reflect/Constructor.java (newInstance): Now native.
1063 (declaringClass): Renamed from decl_class.
1064 (offset): Renamed from index.
1065 (getType): New native method.
1066 (getModifiers): Now native.
1067 (getParameterTypes): Call getType if required.
1068 (hashCode): Include hash code from declaring class.
1069 (modifiers): Removed.
1070 (toString): Call getType if required.
1071 * gcj/method.h (_Jv_FromReflectedConstructor): New function.
1072 * java/lang/reflect/natMethod.cc (hack_call): New method.
1073 Removed `#if 0' around FFI code.
1074 Include <gnu/gcj/RawData.h>.
1075 (invoke): Use _Jv_CallNonvirtualMethodA. Throw
1076 IllegalArgumentException when argument object and class disagree.
1077 (_Jv_GetTypesFromSignature): New function.
1079 (ObjectClass): New define.
1080 (_Jv_CallNonvirtualMethodA): New function.
1081 * java/lang/reflect/Method.java (hack_trampoline): New method.
1082 (hack_call): New native method.