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