Minor clean up and bug fix.
[gcc.git] / libjava / ChangeLog
1 2000-02-26 Anthony Green <green@cygnus.com>
2
3 * gnu/gcj/io/MimeTypes.java: Test for null.
4
5 * jni.cc (_Jv_JNI_AttachCurrentThread): Minor cleanup.
6 (JNI_GetCreatedJavaVMs): Remove compiler warning.
7
8 * java/net/URLConnection.java: Update copyright notice.
9
10 2000-02-25 Tom Tromey <tromey@cygnus.com>
11
12 * jni.cc (_Jv_JNI_RegisterNatives): Conditionalize body on
13 `INTERPRETER'.
14
15 2000-02-25 Bryce McKinlay <bryce@albatross.co.nz>
16
17 * java/net/URLConnection.java (initializeDateFormats): New
18 private method.
19 (getHeaderFieldDate): Call initializeDateFormats if required.
20 locale, dateFormat1, dateFormat2, dateFormat3: Don't initialize
21 these.
22 Fix for PR libgcj/38.
23
24 2000-02-24 Warren Levy <warrenl@cygnus.com>
25
26 * java/math/BigInteger.java(ival): Made private.
27 (words): Ditto.
28 (neg): Ditto.
29
30 2000-02-20 Anthony Green <green@cygnus.com>
31
32 * Makefile.in: Rebuilt.
33 * Makefile.am (ordinary_java_source_files): Add
34 gnu/gcj/io/DefaultMimeTypes.java and gnu/gcj/io/MimeTypes.java
35
36 * scripts/MakeDefaultMimeTypes.java: New file.
37 * scripts/mime.types: New file.
38 * scripts/classes.pl: Moved from top level.
39 * classes.pl: Moved to scripts directory.
40
41 * java/net/URLConnection.java: Implement guessContentTypeFromName.
42
43 * gnu/gcj/io/MimeTypes.java: New file.
44 * gnu/gcj/io/DefaultMimeTypes.java: New file.
45
46 2000-02-20 Tom Tromey <tromey@cygnus.com>
47
48 * boehm.cc (_Jv_AllocBytes): Clear returned memory.
49
50 2000-02-19 Bryce McKinlay <bryce@albatross.co.nz>
51
52 * java/util/zip/ZipEntry.java (setCrc): Fix overflow.
53 (setSize): ditto.
54
55 2000-02-18 Tom Tromey <tromey@cygnus.com>
56
57 * include/jvm.h (_Jv_GetJavaVM): Declare.
58 * include/java-interp.h (_Jv_GetFirstMethod): New function.
59 (_Jv_MethodBase::get_method): New method.
60 (_Jv_JNIMethod::set_function): New method.
61 * jni.cc (_Jv_JNI_UnregisterNatives): New function.
62 (_Jv_JNI_RegisterNatives): New function.
63 (_Jv_JNIFunctions): Updated for new functions.
64 (_Jv_GetJavaVM): New function.
65 (_Jv_JNI_GetJavaVM): Use it. Now static.
66 (_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread
67 is already a Java thread but does not have a JNIEnv yet.
68
69 * java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload
70 function.
71
72 2000-02-17 Tom Tromey <tromey@cygnus.com>
73
74 * gcj/field.h (_Jv_Field::getClass): Don't use JvAssert.
75 Fixes PR gcj/152.
76
77 2000-02-16 Tom Tromey <tromey@cygnus.com>
78
79 * jni.cc (_Jv_JNI_CallStaticMethodV): Added some assertions.
80
81 * jni.cc (_Jv_JNI_NewObjectV): Corrected assertion.
82 (_Jv_JNI_NewObject): Likewise.
83 (_Jv_JNI_NewObjectA): Likewise.
84 (_Jv_JNI_CallAnyMethodV): In constructor case, pass correct value
85 as "return" type to _Jv_CallAnyMethodA.
86 (_Jv_JNI_CallAnyMethodA): Likewise.
87 (_Jv_JNI_CallAnyVoidMethodV): Likewise.
88
89 * jni.cc (_Jv_JNI_FindClass): Use ClassLoader.loadClass, not
90 findClass.
91
92 2000-02-15 Tom Tromey <tromey@cygnus.com>
93
94 * resolve.cc (ncode): Set args_raw_size. Compute jni_cif and
95 jni_arg_types.
96 (init_cif): Added `rtype_p' argument.
97 * include/java-interp.h (class _Jv_MethodBase): Added
98 args_raw_size.
99 (class _Jv_InterpMethod): Removed args_raw_size.
100 (class _Jv_JNIMethod): Added jni_cif and jni_arg_types fields.
101 * jni.cc (call): Pass JNIEnv and (for static methods only) the
102 class pointer as well as the ordinary arguments.
103
104 * jni.cc (mangled_name): Skip leading `(' in signature.
105
106 * jni.cc (add_char): Added missing `else'.
107
108 * jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc
109 fails.
110
111 2000-02-15 Bryce McKinlay <bryce@albatross.co.nz>
112
113 * NEWS: Updated.
114
115 * java/lang/natRuntime.cc (_load): Include library path with
116 exception message.
117
118 * java/lang/natSystem.cc (init_properties): set java.lang.classpath
119 property.
120
121 * java/lang/natThread.cc (dumpStack): Removed.
122 * java/lang/Thread.java (dumpStack): Implemented.
123
124 2000-02-15 Tom Tromey <tromey@cygnus.com>
125
126 * java/lang/natRuntime.cc (_load): On Unix, prefix library name
127 with `lib' for loadLibrary. Fixes PR gcj/150.
128
129 2000-02-14 Warren Levy <warrenl@cygnus.com>
130
131 * gnu/gcj/math/MPN.java(findLowestBit): Made methods public.
132
133 * java/math/BigInteger.java(BigInteger(int,int,java.util.Random):
134 New constructor.
135 (min): Implemented.
136 (max): Implemented.
137 (modPow): Rewritten to not use the naive, slow, brute force approach.
138 (isProbablePrime): Implemented.
139 (testBit): Implemented.
140 (flipBit): Implemented.
141 (getLowestSetBit): Implemented.
142
143 2000-02-16 Anthony Green <green@redhat.com>
144
145 * configure.host: Use the same options for i386 and i486 as we do
146 for i586 and i686.
147
148 2000-02-12 Tom Tromey <tromey@cygnus.com>
149
150 * java/io/File.java (createTempFile): Use low bits from counter,
151 not high bits.
152
153 Fri Feb 11 19:48:08 2000 Anthony Green <green@cygnus.com>
154
155 * THANKS: More thanks.
156
157 2000-02-11 Tom Tromey <tromey@cygnus.com>
158
159 * interpret.cc (continue1): Use STOREA, not STOREI, to implement
160 astore instruction. From Hans Boehm.
161
162 2000-02-11 Warren Levy <warrenl@cygnus.com>
163
164 * java/math/BigInteger.java(BigInteger(String, int)): New constructor.
165 (BigInteger(String)): New constructor.
166 (not): Rewritten using version from Kawa's BitOps class.
167 (valueOf): New private methods from Kawa's BitOps class.
168 (swappedOp): ditto.
169 (bitOp): ditto.
170 (setBitOp): ditto.
171 (and): Implemented.
172 (or): Implemented.
173 (xor): Implemented.
174 (andNot): Implemented.
175 (clearBit): Implemented.
176 (setBit): Implemented.
177 (bitCount): Implemented.
178 (toByteArray): Implemented.
179
180 2000-02-11 Tom Tromey <tromey@cygnus.com>
181
182 * java/io/File.java (nextValue): Now synchronized.
183
184 2000-02-10 Tom Tromey <tromey@cygnus.com>
185
186 * java/io/natFileDescriptorPosix.cc (open): Recognize EXCL flag.
187 * java/io/FileDescriptor.java (EXCL): New static field.
188 * java/io/File.java (tmpdir): New static field.
189 (createTempFile): New method.
190 (nextValue): New method.
191 * java/lang/natSystem.cc (init_properties): Set java.io.tmpdir
192 property.
193
194 * include/jni.h (JNI_FALSE): Renamed from JNI_TRUE; oops.
195 (jboolean): Declare as an attributed int, not a bool.
196 (_Jv_func): Declare differently for C.
197
198 * gnu/gcj/jni/natNativeThread.cc: New file.
199 * gnu/gcj/jni/NativeThread.java: New file.
200 * java/lang/Thread.java (data): Now a RawData.
201 * include/jvm.h (_Jv_GetCurrentJNIEnv, _Jv_SetCurrentJNIEnv):
202 Declare.
203 * Makefile.in: Rebuilt.
204 * Makefile.am (java/lang/Thread.h): New target.
205 (ordinary_java_source_files): Added NativeThread.java.
206 (nat_source_files): Added natNativeThread.cc.
207 * java/lang/natThread.cc: Include <jni.h>
208 (struct natThread): Added `jni_env' field.
209 (_Jv_GetCurrentJNIEnv): New function.
210 (_Jv_SetCurrentJNIEnv): Likewise.
211 (initialize_native): Initialize jni_env.
212 Include RawData.h.
213 * jni.cc (ThreadGroupClass): New define.
214 (_Jv_JNI_InvokeFunctions): New structure.
215 (JNI_GetCreatedJavaVMs): New function.
216 (the_vm): New global.
217 (JNI_GetDefaultJavaVMInitArgs): New function.
218 Include NativeThread.h.
219 (NativeThreadClass): New define.
220 (_Jv_JNI_EnsureLocalCapacity): Return JNI_ERR, not -1.
221 (_Jv_JNI_DestroyJavaVM): New function.
222 (_Jv_JNI_AttachCurrentThread): New function.
223 (_Jv_JNI_DetachCurrentThread): New function.
224 (_Jv_JNI_GetEnv): New function.
225 (JNI_CreateJavaVM): New function.
226 (_Jv_JNI_GetJavaVM): New function.
227 (_Jv_JNIFunctions): Added entry for GetJavaVM.
228 * include/jni.h (JavaVMAttachArgs): New structure.
229 (JNI_EDETACHED): New define.
230 (JNI_EVERSION): Likewise.
231 (JavaVM): Define properly.
232 (struct JNIInvokeInterface): New structure.
233 (class _Jv_JavaVM): New class.
234 (JNI_OnLoad, JNI_OnUnload): Declare.
235 (JNI_GetDefaultJavaVMInitArgs, JNI_CreateJavaVM,
236 JNI_GetCreatedJavaVMs): Declare.
237 (JavaVMInitArgs): New typedef.
238 (JavaVMOption): Likewise.
239 (JNI_ERR): New define.
240 (JNI_OK): Likewise.
241
242 2000-02-10 Andrew Haley <aph@cygnus.com>
243
244 * interpret.cc: Don't include fdlibm.h.
245 Replace #if with #ifdef throughout.
246 Declare extern __ieee754_fmod.
247 (continue1): Remove op_getfield, op_getstatic, op_putfield,
248 op_putstatic insns.
249 * resolve.cc (_Jv_PrepareClass): Use imeth as method pointer.
250 Search class hierarchy for superclass vtable.
251
252 * java/lang/natClassLoader.cc (_Jv_UnregisterClass): Don't fall
253 off the end of a pointer list.
254
255 * java/lang/natThread.cc (stop): Don't abort, throw an exception
256 instead.
257 (suspend): Ditto.
258
259 2000-02-09 Tom Tromey <tromey@cygnus.com>
260
261 * java/lang/natRuntime.cc (_load): Call add_library.
262 (loadLibraryInternal): Likewise.
263
264 * gnu/gcj/convert/natIconv.cc (Input_iconv::finalize): Call
265 iconv_close when handle is not NULL. Thanks to Andrew Haley.
266 (Output_iconv::finalize): Likewise.
267
268 2000-02-08 Tom Tromey <tromey@cygnus.com>
269
270 * java/util/Properties.java (setProperty): New method.
271 (store): New method.
272
273 2000-02-07 Tom Tromey <tromey@cygnus.com>
274
275 * java/lang/Runtime.java (_load): Declare.
276 (load, loadLibrary): Wrote in terms of _load.
277 * java/lang/natRuntime.cc (load): Call JNI_OnLoad if it appears in
278 library.
279 (loadLibrary): Likewise.
280 Include <jni.h>.
281 (_load): New method.
282 (loadLibrary, load): Removed.
283
284 * jni.cc (ThrowableClass): New define.
285 (_Jv_JNI_Throw): Check argument.
286 (_Jv_JNI_ThrowNew): Likewise.
287 (wrap_value): Don't wrap object if it is NULL.
288 (_Jv_JNI_DefineClass): Use wrap_value.
289 (_Jv_JNI_FindClass): Likewise.
290 (_Jv_JNI_GetSuperclass): Likewise.
291 (_Jv_JNI_ExceptionOccurred): Likewise.
292 (_Jv_JNI_AllocObject): Likewise.
293 (_Jv_JNI_GetObjectClass): Likewise.
294 (_Jv_JNI_NewString): Likewise.
295 (_Jv_JNI_NewStringUTF): Likewise.
296 (_Jv_JNI_NewObjectArray): Likewise.
297 (_Jv_JNI_GetObjectArrayElement): Likewise.
298 (_Jv_JNI_NewPrimitiveArray): Likewise.
299 (_Jv_JNI_ToReflectedField): Likewise.
300 (_Jv_JNI_ToReflectedMethod): Likewise.
301 (_Jv_JNI_AllocObject): Check argument.
302 (_Jv_JNI_NewObjectV): Likewise.
303 (_Jv_JNI_NewObject): Likewise.
304 (_Jv_JNI_NewObjectA): Likewise.
305 (_Jv_JNI_GetObjectClass): Likewise.
306 (_Jv_JNI_GetField): Likewise.
307 (_Jv_JNI_SetField): Likewise.
308
309 * interpret.cc (PUSHL): Don't use expression statement.
310 (PUSHD): Likewise.
311 (LOADL): Likewise.
312 (STOREL): Likewise.
313
314 * jni.cc (add_char): Conditional on INTERPRETER.
315 (mangled_name): Likewise.
316 (call): Likewise.
317 * include/java-interp.h (class _Jv_MethodBase): Conditional on
318 INTERPRETER.
319 (class _Jv_JNIMethod): Likewise.
320
321 2000-02-04 Warren Levy <warrenl@cygnus.com>
322
323 * Makefile.am: Added MPN.java and BigInteger.java.
324 * Makefile.in: Rebuilt.
325 * gnu/gcj/math/MPN.java: New file. From Kawa by Per Bothner
326 <per@bothner.com>.
327 * java/math/BigInteger.java: New file. Based primarily on
328 Kawa's IntNum.java by Per Bothner <per@bothner.com>.
329
330 2000-02-04 Tom Tromey <tromey@cygnus.com>
331
332 * defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase
333 pointers.
334 (handleMethodsEnd): Fixed error messages. Create a _Jv_JNIMethod
335 if the method is native.
336 * resolve.cc (ncode): Don't handle native methods.
337 (_Jv_JNIMethod::ncode): New method.
338 (_Jv_PrepareClass): Handle native methods.
339 * jni.cc (call): Renamed from _Jv_JNI_conversion_call.
340 Include AbstractMethodError.h.
341 (add_char): New function.
342 (mangled_name): Likewise.
343 * include/java-interp.h (class _Jv_JNIMethod): New class.
344 (class _Jv_MethodBase): New class.
345 (class _Jv_InterpMethod): Derive from _Jv_MethodBase.
346 (_Jv_InterpClass): Changed `interpreted_methods' field to type
347 `_Jv_MethodBase'.
348
349 * include/jvm.h (_Jv_FindSymbolInExecutable): Declare.
350 * java/lang/natRuntime.cc (libraries_size, libraries_count,
351 libraries): New globals.
352 (add_library): New function.
353 (_Jv_FindSymbolInExecutable): New function.
354
355 * java/lang/natClassLoader.cc (initiated_classes, loaded_classes):
356 Now static.
357
358 2000-02-04 Andrew Haley <aph@cygnus.com>
359
360 * java/lang/Throwable.java (CPlusPlusDemangler): New class.
361 (printStackTrace): Use a CPlusPlusDemangler to demangle names.
362 * java/lang/natThrowable.cc (printRawStackTrace): Rename
363 printStackTrace to printRawStackTrace.
364
365 2000-02-03 Tom Tromey <tromey@cygnus.com>
366
367 * java/util/Calendar.java (toString): New method.
368 * java/util/SimpleTimeZone.java (clone): New method.
369 (toString): New method.
370 * java/util/TimeZone.java (clone): New method.
371 * java/text/SimpleDateFormat.java (clone): New method.
372 * java/text/NumberFormat.java (clone): New method.
373 (equals): New method.
374 * java/text/Format.java (clone): New method.
375 * java/text/DateFormatSymbols.java (DateFormatSymbols): New
376 constructor.
377 (clone): New method.
378 * java/text/DateFormat.java (clone): New method.
379 * java/text/Collator.java (clone): New method.
380
381 2000-02-03 Tom Tromey <tromey@cygnus.com>
382
383 * java/io/PipedOutputStream.java (write(byte[], int, int)): New
384 method.
385
386 2000-02-01 Tom Tromey <tromey@cygnus.com>
387
388 * include/java-interp.h (_Jv_JNI_conversion_call): Declare.
389 * resolve.cc (ncode): Use _Jv_JNI_conversion_call when
390 constructing the closure if the function is native.
391 * jni.cc (_Jv_JNI_conversion_call): Now returns `void'. No longer
392 a template function, #if'd out, or static.
393 Include <java-interp.h>.
394
395 * include/jni.h (class _Jv_JNIEnv): Corrected calls using `...'.
396
397 * include/jni.h (class _Jv_JNIEnv): Added all C++ inline methods.
398
399 * jni.cc (_Jv_JNI_PopLocalFrame): Leave loop when `n == NULL'.
400 (_Jv_JNI_conversion_call): _Jv_JNI_PopLocalFrame will never leave
401 `locals == NULL'.
402 (wrap_value): New function.
403 (_Jv_JNI_CallAnyMethodV): Use it.
404 (_Jv_JNI_CallAnyMethodA): Likewise.
405 (_Jv_JNI_GetField): Use wrap_value; removed specialized version.
406 (_Jv_JNI_GetStaticField): Likewise.
407
408 * jni.cc (_Jv_JNI_GetField): Specialize for jobject.
409 (_Jv_JNI_GetStaticField): Likewise.
410
411 2000-01-31 Tom Tromey <tromey@cygnus.com>
412
413 * prims.cc (_Jv_MallocUnchecked): New function.
414 (main_init): Call _Jv_JNI_Init.
415 * include/jvm.h (_Jv_MallocUnchecked): Declare.
416 (_Jv_JNI_Init): Declare.
417 * jni.cc: Include Hashtable.h, OutOfMemoryError.h, Integer.h,
418 <string.h>.
419 (_Jv_JNI_NewGlobalRef): New function.
420 (_Jv_JNI_DeleteGlobalRef): New function.
421 (_Jv_JNI_DeleteLocalRef): New function.
422 (_Jv_JNI_conversion_call): Initialize and clear local reference
423 frame.
424 (_Jv_JNI_NewLocalRef): New function.
425 (struct _Jv_JNI_LocalFrame): New structure.
426 (_Jv_JNI_PushLocalFrame): New function.
427 (_Jv_JNI_EnsureLocalCapacity): New function.
428 (FRAME_SIZE): New define.
429 (_Jv_JNI_GetStringChars): Mark string, not characters.
430 (_Jv_JNI_ReleaseStringChars): Unmark string, not characters.
431 (_Jv_JNI_GetPrimitiveArrayElements): Mark array, not elements.
432 (_Jv_JNI_ReleasePrimitiveArrayElements): Unmark array, not
433 elements.
434 (_Jv_JNI_DefineClass): Make return value a local ref.
435 (_Jv_JNI_FindClass): Likewise.
436 (_Jv_JNI_GetSuperclass): Likewise.
437 (_Jv_JNI_ExceptionOccurred): Likewise.
438 (_Jv_JNI_AllocObject): Likewise.
439 (_Jv_JNI_GetObjectClass): Likewise.
440 (_Jv_JNI_CallAnyMethodV): Likewise.
441 (_Jv_JNI_NewString): Likewise.
442 (_Jv_JNI_NewStringUTF): Likewise.
443 (_Jv_JNI_NewObjectArray): Likewise.
444 (_Jv_JNI_GetObjectArrayElement): Likewise.
445 (_Jv_JNI_ToReflectedField): Likewise.
446 (_Jv_JNI_ToReflectedMethod): Likewise.
447 (_Jv_JNIFunctions): Updated table for new functions.
448 (_Jv_JNI_Init): New function.
449 (mark_for_gc): Wrote.
450 (unmark_for_gc): Wrote.
451 * include/jni.h (struct JNINativeInterface): Removed name from
452 PopLocalFrame parameter.
453 (class _Jv_JNIEnv): Added `locals' field.
454
455 Mon Jan 31 00:43:15 2000 Anthony Green <green@redhat.com>
456
457 * gnu/gcj/convert/natIconv.cc (read): Minor fixes.
458 (write): Ditto.
459
460 2000-01-30 Tom Tromey <tromey@cygnus.com>
461
462 * include/config.h.in: Rebuilt.
463 * acconfig.h (HAVE_ICONV): Define.
464 * configure: Rebuilt.
465 * configure.in: Check for `iconv' function.
466 * gnu/gcj/convert/BytesToUnicode.java (getDecoder): Try iconv if
467 no specific encoder exists.
468 * gnu/gcj/convert/UnicodeToBytes.java (getEncoder): Try iconv if
469 no specific encoder exists.
470 * Makefile.in: Rebuilt.
471 * Makefile.am (convert_source_files): Mention Input_iconv.java and
472 Output_iconv.java.
473 (nat_source_files): Added natIconv.cc.
474 * gnu/gcj/convert/natIconv.cc: New file.
475 * gnu/gcj/convert/Input_iconv.java: New file.
476 * gnu/gcj/convert/Output_iconv.java: New file.
477
478 2000-01-28 Tom Tromey <tromey@cygnus.com>
479
480 * Makefile.in: Rebuilt.
481 * Makefile.am (LIBFFIINCS): Added MULTIBUILDTOP.
482
483 2000-01-26 Tom Tromey <tromey@cygnus.com>
484
485 * gcj/method.h (JvNumMethods): Moved from Class.h.
486 (JvGetFirstMethod): Likewise.
487 * java/lang/Class.h (Object): Updated decl of
488 _Jv_JNI_ToReflectedField.
489 (Object): Added _Jv_JNI_ToReflectedMethod as a friend.
490 * Makefile.in: Rebuilt.
491 * Makefile.am (java/lang/reflect/Field.h): Added `jboolean'
492 argument of _Jv_JNI_ToReflectedField.
493 (java/lang/reflect/Constructor.h): Added _Jv_JNI_ToReflectedMethod
494 as a friend.
495 (java/lang/reflect/Method.h): Likewise.
496 * include/jni.h (class _Jv_JNIEnv): Added `klass' member. Use
497 __GCJ_JNI_IMPL__.
498 (jweak): New typedef.
499 (struct JNINativeInterface): Correctly declare remaining entries.
500 * jni.cc: Include Class.h, ClassLoader.h.
501 (_Jv_JNI_FindClass): New function.
502 (_Jv_JNI_DefineClass): New function.
503 (_Jv_JNI_conversion_call): New function.
504 (_Jv_JNI_FindClass): Use current class loader to find class.
505 (_Jv_JNI_ExceptionCheck): New function.
506 (_Jv_JNI_FromReflectedField): Now static.
507 (MethodClass): New define.
508 (_Jv_JNI_FromReflectedMethod): New function.
509 (_Jv_JNI_ToReflectedMethod): Likewise.
510 Include Method.h.
511 (_Jv_JNI_IsAssignableFrom): Renamed.
512 (_Jv_JNI_GetStringRegion): New function.
513 Include StringIndexOutOfBoundsException.h.
514 (_Jv_JNI_GetStringUTFRegion): New function.
515 (_Jv_JNIFunctions): Updated for new functions.
516 (_Jv_JNI_GetPrimitiveArrayCritical): New function
517 (_Jv_JNI_ReleasePrimitiveArrayCritical): Likewise.
518 (_Jv_JNI_GetStringCritical): New function.
519 (_Jv_JNI_ReleaseStringCritical): Likewise.
520 (get_throwable): Removed.
521 (GCJ_JV_JNIENV_FRIEND): Removed.
522 (__GCJ_JNI_IMPL__): Define.
523 Include method.h.
524
525 * resolve.cc (get_ffi_type_from_signature): Handle case where
526 boolean is an int.
527
528 Tue Jan 25 08:51:16 2000 Tom Tromey <tromey@ferrule.cygnus.com>
529
530 * interpret.cc (run): Don't call println.
531 Don't include PrintStream.h.
532
533 * gcj/field.h (struct _Jv_Field): Use "jshort" as type for
534 nameIndex. Use "jint" as type for boffset.
535 * java/lang/Class.h (struct _Jv_Method): Made accflags a
536 _Jv_ushort.
537 (Class): Likewise. Also changed type of method_count,
538 vtable_method_count, size_in_bytes, field_count,
539 static_field_count, interface_count.
540 * gcj/array.h (__JArray): Made `length' a const jsize, not an
541 int.
542
543 2000-01-21 Tom Tromey <tromey@cygnus.com>
544
545 * java/lang/reflect/natConstructor.cc (newInstance): Use
546 _Jv_CallAnyMethodA.
547 * include/jvm.h: Declare _Jv_CallAnyMethodA.
548 * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Renamed
549 from _Jv_CallNonvirtualMethodA. Changed interface; overloaded.
550 Include <jni.h>.
551 (COPY): Removed.
552 (invoke): Use _Jv_CallAnyMethodA.
553 (VAL): Redefined.
554 * java/lang/Class.h (Class): Declare JvGetFirstStaticField,
555 JvNumStaticFields, JvNumMethods, and JvGetFirstMethod as friend
556 functions.
557 (struct _Jv_Method): Added getNextMethod method.
558 (JvNumMethods): New function.
559 (JvGetFirstMethod): Likewise.
560 * gcj/field.h (JvGetFirstStaticField): New function.
561 (JvNumStaticFields): Likewise.
562 (getNextField): Renamed from getNextInstanceField.
563 (struct _Jv_Field): New method getClass.
564 * jni.cc: Wrote many new functions.
565 * include/jni.h (JNI_TRUE): Define.
566 (JNI_FALSE): Likewise.
567 (jobject, jclass, jstring, jarray, jthrowable, jobjectArray,
568 jbyteArray, jshortArray, jintArray, jlongArray, jbooleanArray,
569 jcharArray, jfloatArray, jdoubleArray): New typedefs.
570 (jfieldID, jmethodID): Likewise.
571 (JNI_COMMIT, JNI_ABORT): New defines.
572 (JNINativeMethod): New struct.
573 (struct JNINativeInterface): Correctly declared more entries.
574 (class _Jv_JNIEnv): Added `ex' member.
575 (JNI_VERSION_1_1): New define.
576 (JNI_VERSION_1_2): Likewise.
577
578 * boehm.cc (_Jv_MarkObj): Use getNextField, not
579 getNextInstanceField.
580
581 2000-01-20 Tom Tromey <tromey@cygnus.com>
582
583 * resolve.cc (StringClass): Removed.
584 * defineclass.cc (StringClass): Removed.
585
586 2000-01-19 Bryce McKinlay <bryce@albatross.co.nz>
587
588 * NEWS: updated.
589
590 2000-01-19 Tom Tromey <tromey@cygnus.com>
591
592 * interpret.cc (PC_REGISTER_ASM): Removed.
593
594 * java/lang/natThrowable.cc: Don't use `#pragma implementation'.
595 From Bryce McKinlay.
596
597 * All files: Updated copyright to reflect Cygnus purchase.
598
599 2000-01-18 Bryce McKinlay <bryce@albatross.co.nz>
600
601 * configure: Rebuilt.
602 * configure.in: Recognize --disable-interpreter.
603
604 2000-01-18 Andrew Haley <aph@cygnus.com>
605
606 * name-finder.cc (lookup): Check for dladdr function.
607 acconfig.h (HAVE_DLADDR): Add.
608 configure.in: Check for HAVE_DLADDR
609 configure: Rebuilt.
610 include/config.h.in: Rebuilt.
611
612 2000-01-17 Andrew Haley <aph@cygnus.com>
613
614 * prims.cc (_Jv_RunMain): Set the name of this executable.
615
616 2000-01-17 Tom Tromey <tromey@cygnus.com>
617
618 * java/lang/natThrowable.cc (fillInStackTrace): Return `this' even
619 when backtrace can't be computed.
620
621 * configure: Rebuilt.
622 * configure.in: Fixed typo in AC_CONFIG_SUBDIRS call.
623
624 * java/lang/Runtime.java (loadLibraryInternal): Declare.
625 * java/lang/natClassLoader.cc (_Jv_FindClass): Removed dead copy.
626 (_Jv_FindClassInCache): Likewise.
627 (_Jv_FindClass): Don't conditionalize body on INTERPRETER.
628 (findSystemClass): Try to load class from compiled module.
629 Include Runtime.h.
630 * java/lang/natRuntime.cc (load): Use UTF-8 copy of filename.
631 (loadLibrary): Likewise.
632 (lt_preloaded_symbols): Define.
633 (loadLibraryInternal): New method.
634 * include/config.h.in: Rebuilt.
635 * acconfig.h (USE_LTDL): Added.
636 * Makefile.am (SUBDIRS): Added $(DIRLTDL).
637 (INCLUDES): Added $(INCLTDL).
638 (libgcj_la_DEPENDENCIES): Added $(LIBLTDL).
639 (libgcj_la_LIBADD): Likewise.
640 * aclocal.m4, configure: Rebuilt.
641 * configure.in: Added libltdl support.
642
643 2000-01-15 Tom Tromey <tromey@cygnus.com>
644
645 * prims.cc (_Jv_PrimClass): Use `JV_STATE_NOTHING', not `0'.
646
647 2000-01-14 Andrew Haley <aph@cygnus.com>
648
649 * java/lang/natThrowable.cc: New file.
650
651 * java/lang/Throwable.java (fillInStackTrace): Make native.
652 (printStackTrace): Call native method to do this.
653 (Throwable): Call fillInStackTrace.
654 (stackTrace): New variable.
655
656 * include/jvm.h: Add _Jv_ThisExecutable functions.
657
658 * prims.cc: (_Jv_execName): New variable.
659 (catch_segv): Call fillInStackTrace.
660 (catch_fpe): Ditto.
661 (_Jv_ThisExecutable): New functions.
662 (JvRunMain): Set the name of this executable.
663
664 * Makefile.am: Add java/lang/natThrowable.cc.
665 Add name-finder.cc.
666 * Makefile.in: Rebuilt.
667
668 * acconfig.h: Add HAVE_PROC_SELF_EXE.
669
670 * configure.in: Force link with __frame_state_for in
671 FORCELIBGCCSPEC. Add new checks for backtrace.
672 * include/config.h.in: Rebuilt.
673
674 * name-finder.cc: New file.
675 * include/name-finder.h: New file.
676
677 2000-01-16 Anthony Green <green@cygnus.com>
678
679 * java/lang/StringBuffer.java (StringBuffer): Don't special case
680 null argument.
681
682 2000-01-16 Jeff Sturm <jsturm@sigma6.com>
683
684 * java/io/StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).
685
686 2000-01-13 Tom Tromey <tromey@cygnus.com>
687
688 * java/lang/natClassLoader.cc (_Jv_FindClass): Register `loader',
689 not system loader, as initiating loader.
690
691 2000-01-11 Tom Tromey <tromey@cygnus.com>
692
693 * java/lang/natSystem.cc (getpwuid_adaptor): New adaptor for
694 HP/UX. From David Scott Urban.
695
696 2000-01-10 Jeff Sturm <jsturm@sigma6.com>
697
698 * java/lang/natMath.cc (pow): Cast args to `double', not
699 `jdouble'.
700 (atan2): Likewise.
701 (IEEEremainder): Likewise.
702 * java/lang/mprec.h: Don't wrap includes in `extern "C"'.
703 * java/lang/fdlibm.h: Don't wrap includes in `extern "C"'.
704
705 2000-01-09 Anthony Green <green@cygnus.com>
706
707 * java/lang/natString.cc (init): Test for overflow condition
708 during out of bounds check.
709 (getChars): Throw StringIndexOutOfBoundsException, not
710 ArrayIndexOutOfBoundsException.
711 (getBytes): Ditto.
712 (regionMatches): Obey case option during string comparison.
713
714 * configure.host (ligcj_interpreter): New variable. Enable
715 interpreter by default on IA-32.
716 * configure.in: Examine libgcj_interpreter.
717 * configure: Rebuilt.
718
719 2000-01-07 Tom Tromey <tromey@cygnus.com>
720
721 * mauve-libgcj: Don't disable ClassTest.
722
723 * java/lang/natClass.cc (getClasses): Wrote.
724
725 2000-01-06 Tom Tromey <tromey@cygnus.com>
726
727 * java/lang/natClass.cc (_getConstructors): Correctly check
728 whether method name is the init name.
729 (getMethod): Look at accflags on method in `klass', not `this'.
730
731 2000-01-05 Tom Tromey <tromey@cygnus.com>
732
733 * java/lang/natClass.cc (getMethod): Compute offset relative to
734 `klass's methods table, not `this's table.
735
736 * java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA):
737 In unwrapping/widening case, check whether `k' is null, not
738 whether it is primitive. Initialize `num' from `argelts', not
739 `paramelts'. Correct create and pass arguments to ffi_call.
740 Don't let presence of `this' argument affect index used to look in
741 argument arrays.
742 (COPY): Set appropriate element in `values' vector.
743
744 * java/lang/natClass.cc: Include <gcj/method.h>.
745
746 * java/lang/Class.h (_getMethods): Correctly declare as private,
747 not public.
748
749 * java/lang/Class.h (_getMethods): Declare.
750 * java/lang/Class.java (_getMethods): Declare.
751 * java/lang/natClass.cc (getDeclaringClass): Always return NULL.
752 (getDeclaredClasses): Always return empty array.
753 (_getMethods): New method.
754 (getMethods): Wrote.
755 (getDeclaredMethod): Return `rmethod'.
756 (finit_name): New global.
757 (getDeclaredMethods): Check for finit_name.
758 (_getMethods): Likewise.
759 (getMethod): Only return public methods.
760
761 * java/lang/reflect/natMethod.cc (get_ffi_type): Test size of
762 jboolean and select correct ffi type on that basis.
763 (_Jv_CallNonvirtualMethodA): Handle `void' return type.
764 Constructor call always has `void' return type.
765
766 2000-01-04 Tom Tromey <tromey@cygnus.com>
767
768 * java/lang/Class.h (getSignature): Updated.
769 * java/lang/Class.java (getSignature): Updated.
770 * java/lang/natClass.cc (getSignature): Added `is_constructor'
771 argument.
772 (getConstructor): Ensure constructor is public.
773 (_getConstructors): Check for public-ness of constructor when
774 `declared' is false, not when it is true.
775
776 2000-01-04 Warren Levy <warrenl@cygnus.com>
777
778 * java/net/natPlainDatagramSocketImpl.cc (peek): Removed unnecesary
779 comment.
780 (receive): Set the sender's address in the DatagramPacket.
781
782 2000-01-04 Tom Tromey <tromey@cygnus.com>
783
784 * java/lang/reflect/natConstructor.cc (newInstance): Pass
785 declaring class as return_type argument to
786 _Jv_CallNonvirtualMethodA.
787 * java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA): In
788 constructor case, create object and use it as `this' argument.
789 * java/lang/Class.h (_getConstructors): Declare.
790 (_getFields): Declare.
791 * java/lang/Class.java (getConstructors): Wrote.
792 (_getConstructors): New native method.
793 (getDeclaredConstructors): Wrote.
794 (_getFields): Declare new native method.
795 * java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Removed
796 incorrect comment.
797 (getMethod): Work correctly when class is primitive.
798 (getDeclaredMethods): Likewise. Compute offset using `method',
799 not `mptr'.
800 (getDeclaredMethod): Likewise.
801 (getConstructor): Wrote.
802 (ConstructorClass): New define.
803 (getDeclaredConstructor): Wrote.
804 (_getConstructors): New method.
805 (_getFields): New method.
806 (getFields): Wrote.
807
808 * Makefile.in: Rebuilt.
809 * Makefile.am (AM_CXXFLAGS): Added -D_GNU_SOURCE.
810
811 * prims.cc: Remove `#pragma implementation'.
812 * gcj/array.h: Remove `#pragma interface'.
813
814 * prims.cc (_Jv_equaln): New function.
815 * java/lang/Class.java (getSignature): Declare.
816 * resolve.cc (_Jv_LookupDeclaredMethod): Moved to natClass.cc.
817 * java/lang/natClass.cc (_Jv_LookupDeclaredMethod): Moved from
818 resolve.cc.
819 (getSignature): New method.
820 (getDeclaredMethod): Wrote.
821 (getMethod): Wrote.
822 Include StringBuffer.h.
823 * java/lang/Class.h (Class): Added _Jv_FromReflectedConstructor
824 as a friend. Unconditionally declare _Jv_LookupDeclaredMethod as
825 a friend.
826 (getSignature): Declare.
827 * include/jvm.h (_Jv_GetTypesFromSignature): Declare.
828 (_Jv_equaln): Declare.
829 (_Jv_CallNonvirtualMethodA): Declare.
830 * Makefile.in: Rebuilt.
831 * Makefile.am (nat_source_files): Added natConstructor.cc.
832 (java/lang/reflect/Constructor.h): New target.
833 * java/lang/reflect/natConstructor.cc: New file.
834 * java/lang/reflect/Constructor.java (newInstance): Now native.
835 (declaringClass): Renamed from decl_class.
836 (offset): Renamed from index.
837 (getType): New native method.
838 (getModifiers): Now native.
839 (getParameterTypes): Call getType if required.
840 (hashCode): Include hash code from declaring class.
841 (modifiers): Removed.
842 (toString): Call getType if required.
843 * gcj/method.h (_Jv_FromReflectedConstructor): New function.
844 * java/lang/reflect/natMethod.cc (hack_call): New method.
845 Removed `#if 0' around FFI code.
846 Include <gnu/gcj/RawData.h>.
847 (invoke): Use _Jv_CallNonvirtualMethodA. Throw
848 IllegalArgumentException when argument object and class disagree.
849 (_Jv_GetTypesFromSignature): New function.
850 (getType): Use it.
851 (ObjectClass): New define.
852 (_Jv_CallNonvirtualMethodA): New function.
853 * java/lang/reflect/Method.java (hack_trampoline): New method.
854 (hack_call): New native method.