Commit Graph

642 Commits

Author SHA1 Message Date
Tom Tromey 1ed67a71e4 StreamTokenizer.java (TT_NONE): Now private.
* java/io/StreamTokenizer.java (TT_NONE): Now private.
	(nextToken): Handle backslashed newline.  From Oskar Liljeblad.
	For PR java.io/301.

From-SVN: r35511
2000-08-06 00:49:29 +00:00
Bryce McKinlay d31772ca70 Missing changelog entry
From-SVN: r35469
2000-08-04 02:15:51 +01:00
Warren Levy 9b4773cbba ObjectInputStream.java (readFields): Turn off readDataFromBlock while reading via GetField.
* java/io/ObjectInputStream.java (readFields): Turn off
	readDataFromBlock while reading via GetField.
	(GetField$1.get(String, Object)): Pass Class of default value to
	getField.
	(getField): Allow for null default values.

	* java/io/ObjectOutputStream.java: Fixed typo in comment.
	(PutField$1.put): Fixed calls of checkType in most of the put
	methods to pass the correct parameter.
	(PutField$1.put(String, Object)): Allow for null value arg.
	(PutField$1.write): Turn off writeDataAsBlocks while writing via
	PutField.

	* java/io/ObjectStreamClass.java (serialPersistentFields): Fixed
	typo in spec'ed field name.
	(getSerialPersistentFields): Changed spelling of method to match
	the correct spelling of the spec'ed field name.

More serialization fixes per Mauve errors.

From-SVN: r35468
2000-08-04 00:42:20 +00:00
Tom Tromey 57b59acb05 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added new files.

From-SVN: r35457
2000-08-03 17:56:02 +00:00
Bryce McKinlay af6ca671a6 Makefile.am: Make inner class CNI headers depend on libgcj.zip only.
2000-08-03  Bryce McKinlay  <bryce@albatross.co.nz>

	* Makefile.am: Make inner class CNI headers depend on libgcj.zip
	only.
	Fixes "make -j" builds.
	* Makefile.in: Rebuild.

From-SVN: r35441
2000-08-03 07:48:34 +01:00
Tom Tromey f536cd95fb Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (libgcj_la_SOURCES): Added posix.cc.
	* java/net/natPlainSocketImpl.cc: Include posix.h.
	(accept): Use _Jv_select.
	* java/net/natPlainDatagramSocketImpl.cc: Include posix.h.
	(receive): Use _Jv_select.
	* java/io/natFileDescriptorPosix.cc: Include posix.h.
	(available): Use _Jv_select.
	* java/lang/natSystem.cc: Include posix.h.
	(currentTimeMillis): Use _Jv_gettimeofday.
	* include/posix.h: New file.
	* posix.cc: New file.

From-SVN: r35435
2000-08-02 21:54:04 +00:00
Tom Tromey f9427d1704 encodings.pl: New file.
* scripts/encodings.pl: New file.
	* Makefile.in: Rebuilt.
	* Makefile.am (convert_source_files): Added IOConverter.java.
	* gnu/gcj/convert/UnicodeToBytes.java (UnicodeToBytes): Extend
	IOConverter.
	(getDefaultDecodingClass): Canonicalize default encoding name.
	(getEncoder): Likewise.
	* gnu/gcj/convert/BytesToUnicode.java (BytesToUnicode): Extend
	IOConverter.
	(getDefaultDecodingClass): Canonicalize default encoding name.
	(getDecoder): Likewise.
	* gnu/gcj/convert/IOConverter.java: New file.

From-SVN: r35432
2000-08-02 19:56:53 +00:00
Bryce McKinlay 79c2c6da2c [multiple changes]
2000-08-02  Bryce McKinlay  <bryce@albatross.co.nz>

        * interpret.cc (_Jv_InterpMethod::continue1): Type of `fun' changed
	to match C declaration in ffi.h.
	* Makefile.am: Add java/awt/Button.java.
	* Makefile.in: Rebuilt.

2000-07-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Type of the
        cast of the second argument to `ffi_raw_call' changed to match
        prototype.

2000-07-26  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * jni.cc (_Jv_JNIMethod::call): Type of the cast of the second
        argument to `ffi_raw_call' changed to match prototype.

From-SVN: r35418
2000-08-02 04:25:13 +01:00
Bryce McKinlay aa18e0c184 Component.java (toString): Implemented.
* java/awt/Component.java (toString): Implemented.
	* java/awt/Container.java (addImpl): Remove FIXME. Only call
	dispatchEvent() to dispatch the event.
	(removeImpl): Ditto.

From-SVN: r35363
2000-07-31 05:11:49 +01:00
Anthony Green b708c42c7a Component.java: Add treeLock object.
2000-07-30  Anthony Green  <green@redhat.com>

        * java/awt/Component.java: Add treeLock object.
        (getTreeLock): Implement.
        (isShowing): Implement.

From-SVN: r35362
2000-07-31 02:33:12 +00:00
Tom Tromey e0a339f785 BorderLayout.java (BorderLayout()): New constructor.
* java/awt/BorderLayout.java (BorderLayout()): New constructor.

	* java/awt/Frame.java (Frame): Pass `null' to Window constructor.

	* java/awt/Window.java (addNotify): Wrote.
	(addWindowListener): Wrote.
	(getLocale): Wrote.
	(getWarningString): Wrote.
	(processEvent): Wrote.
	(processWindowEvent): Wrote.
	(removeWindowListener): Wrote.
	(show): Call validate(), setVisible().
	(toBack): Wrote.
	(toFront): Wrote.

	* java/awt/Toolkit.java (createWindow): Declare.

	* java/awt/Frame.java (addNotify): Use getToolkit to find
	toolkit.

	* java/awt/Component.java (invalidate): Wrote.
	(isValid): Wrote.
	(getToolkit): Wrote.

	* java/awt/Container.java (addContainerListener): Removed
	unnecessary cast.
	(removeContainerListener): Likewise.
	(addImpl): Wrote.
	(add(Component)): Use it.
	(add(String,Component)): Likewise.
	(add(Component,int)): Likewise.
	(add(Component,Object)): Likewise.
	(add(Component,Object,int)): Likewise.
	(doLayout): Wrote.
	(getAlignmentX): Wrote.
	(getAlignmentY): Wrote.
	(getComponentAt): Wrote.
	(getMaximumSize): Wrote.
	(invalidate): Wrote.
	(list(PrintStream,int)): Wrote.
	(list(PrintWriter,int)): Wrote.
	(getMinimumSize): Wrote.
	(getPreferredSize): Wrote.
	(printComponents): Wrote.
	(processContainerEvent): Look at containerListener, not
	componentListener.
	(remove): Added event processing and peer destruction.
	(removeAll): Use remove.
	(removeNotify): Wrote.
	(validate): Wrote.
	(validateTree): Wrote.

	* java/awt/Scrollbar.java (addNotify): Do nothing if peer exists.
	* java/awt/Label.java (addNotify): Do nothing if peer exists.
	* java/awt/Container.java (addNotify): Don't create Container
	peer.
	* java/awt/Button.java (addNotify): Do nothing if peer exists.

From-SVN: r35361
2000-07-31 02:03:51 +00:00
Tom Tromey 4e07a9eadb Container.java (remove(int)): Wrote.
* java/awt/Container.java (remove(int)): Wrote.
	(remove(Component)): Wrote.
	(add(Component)): Wrote.
	(add(Component,int)): Wrote.
	(removeAll): Wrote.
	(addNotify): Set our own peer.
	* java/awt/Scrollbar.java (listeners): Changed type.
	(Scrollbar): Don't initialize listeners.
	(addNotify): Wrote.
	(setValue): Call setValues.
	(setMinimum): Likewise.
	(setMaxPriority): Likewise.
	(setVisibleAmount): Likewise.
	(setValues): Wrote.
	(setUnitIncrement): Forward to peer.
	(setLineIncrement): Call setUnitIncrement.
	(setPageIncrement): Call setBlockIncrement.
	(setBlockIncrement): Forward to peer.
	(addAdjustmentListener): Rewrote.
	(removeAdjustmentListener): Rewrote.
	(processAdjustmentEvent): Rewrote.
	(paramString): Wrote.
	* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added Button.java.
	* java/awt/Button.java: New file.
	* java/awt/Toolkit.java (createLabel): Declare.
	(createButton): Likewise.
	(createScrollbar): Likewise.
	(createContainer): Likewise.
	* java/awt/Label.java (addNotify): Wrote.
	(setAlignment): Call setAlignment in the peer.
	(setText): Call setText in the peer.

From-SVN: r35354
2000-07-30 23:19:57 +00:00
Warren Levy 2dacb3e9ce ObjectOutputStream.java (writeObject): Per spec, call NotSerializableException with just the class name.
* java/io/ObjectOutputStream.java (writeObject): Per spec, call
	NotSerializableException with just the class name.

From-SVN: r35325
2000-07-28 23:48:19 +00:00
Andrew Haley 99f7658d7c interpret.cc (continue1): Insert missing break into switch.
2000-07-26  Andrew Haley  <aph@cygnus.com>

        * interpret.cc (continue1): Insert missing break into switch.

From-SVN: r35316
2000-07-28 13:11:45 +00:00
Warren Levy 614ee7902b ObjectStreamException.java: Made constructors protected.
* java/io/ObjectStreamException.java: Made constructors protected.

Adjusts serialVersionUID.

From-SVN: r35315
2000-07-28 11:58:03 +00:00
Tom Tromey 8fec62b138 OutputStreamWriter.java (close): Only flush if not closed.
* java/io/OutputStreamWriter.java (close): Only flush if not
	closed.

From-SVN: r35309
2000-07-28 02:54:16 +00:00
Warren Levy 7db51521a0 mauve-libgcj: Activated serialization tests.
* mauve-libgcj: Activated serialization tests.
	* gcj/field.h (getModifiers): Mask off unknown flags.
	* gnu/java/security/provider/SHA.java (munch): Reset buffer to 0 so
	spurious bits don't cause discrepancies.
	* java/io/ObjectOutputStream.java: Fixed typo in comment.
	* java/io/ObjectStreamClass.java: Fixed typos in comments.
	(lookup): Applied patch from Brian Jones <cbj@gnu.org> to optimize.
	(hasClassInitializer): Call getDeclaredMethod instead of getMethod.
	* java/lang/Throwable.java (serialVersionUID): New field.
	* java/lang/reflect/Modifier.java (ALL_FLAGS): Preserve STRICT if used.
	* java/lang/reflect/natConstructor.cc (getModifiers): Mask off
	unknown flags.
	* java/lang/reflect/natMethod.cc: Ditto.
	* java/security/Key.java (serialVersionUID): Removed field for now.
	* java/security/interfaces/DSAPrivateKey.java (serialVersionUID): Ditto.
	* java/security/interfaces/DSAPublicKey.java (serialVersionUID): Ditto.

Serialization mods.

From-SVN: r35302
2000-07-27 23:57:07 +00:00
Tom Tromey 2d97a71922 RectangularShape.java (getPathIterator): Wrote.
* java/awt/geom/RectangularShape.java (getPathIterator):
	Wrote.

From-SVN: r35295
2000-07-27 16:27:42 +00:00
Rolf W. Rasmussen 69b1b29156 ColorModel.java: New file...
2000-07-23  Rolf W. Rasmussen  <rolfwr@ii.uib.no>

	* libjava/java/awt/image/ColorModel.java: New file, replaces the
	stub libjava/java/awt/ColorModel.java which was located in the
	wrong package.
	* libjava/java/awt/image/ComponentColorModel.java: New file.
	* libjava/java/awt/image/ComponentSampleModel.java: New file.
	* libjava/java/awt/image/DataBuffer.java: New file.
	* libjava/java/awt/image/DataBufferByte.java: New file.
	* libjava/java/awt/image/DataBufferInt.java: New file.
	* libjava/java/awt/image/DataBufferUShort.java: New file.
	* libjava/java/awt/image/DirectColorModel.java: New file.
	* libjava/java/awt/image/PackedColorModel.java: New file.
	* libjava/java/awt/image/Raster.java: New file.
	* libjava/java/awt/image/SampleModel.java: New file.
	* libjava/java/awt/image/SinglePixelPackedSampleModel.java: New
	file.
	* libjava/java/awt/image/IndexColorModel.java: New file.
	* libjava/java/awt/image/ImageConsumer.java: Removed import of
	java.awt.ColorModel stub.

	* gnu/gcj/util/BitMaskExtent.java: New file, utility class.
	* gnu/gcj/util/Buffers.java: New file, utility class.

	* libjava/Makefile.am: Updated to include new files.
	* libjava/Makefile.in: Rebuilt.

From-SVN: r35245
2000-07-25 17:53:30 +00:00
Oskar Liljeblad 05ae1c31cf StreamTokenizer.java: Merged with classpath.
2000-07-23  Oskar Liljeblad <osk@hem.passagen.se>

	* java/io/StreamTokenizer.java: Merged with classpath.

From-SVN: r35208
2000-07-23 17:52:13 +00:00
Tom Tromey 8039a4ea73 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Updated for new files.
	* java/awt/Adjustable.java (HORIZONTAL, VERTICAL): Set values.
	* java/awt/Label.java: New file.
	* java/awt/Rectangle.java (Rectangle): Extend Rectangle2D.
	(createIntersection, createUnion, getBounds2D): New methods.
	* java/awt/Scrollbar.java: New file.
	* java/awt/Shape.java: Updated to 1.2.
	* java/awt/geom/AffineTransform.java: New file.
	* java/awt/geom/Ellipse2D.java: New file.
	* java/awt/geom/NoninvertibleTransformException.java: New file.
	* java/awt/geom/PathIterator.java: New file.
	* java/awt/geom/Rectangle2D.java: New file.
	* java/awt/geom/RectangularShape.java: New file.
	* java/awt/geom/Point2D.java (Double, Float): New inner classes.
	* java/awt/geom/IllegalPathStateException.java: New file.

From-SVN: r35195
2000-07-23 00:24:14 +00:00
Tom Tromey 266a442034 * scripts/showval.java: New file.
From-SVN: r35152
2000-07-20 19:35:43 +00:00
Tom Tromey 7f8a07dbea classes.pl (scan): Print inner classes properly.
* scripts/classes.pl (scan): Print inner classes properly.
	* gcj/javaprims.h: Updated class list.

From-SVN: r35151
2000-07-20 19:34:29 +00:00
Tom Tromey 5e5c1371d3 natClassLoader.cc (_Jv_PrepareCompiledClass): Only initialize String fields for interpreted classes.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Only
	initialize String fields for interpreted classes.  Fixes bug
	reported by Hans Boehm.

From-SVN: r35150
2000-07-20 19:31:16 +00:00
Tom Tromey 373d3b1863 File.java (getParentFile): New method, from Classpath via Oskar Liljeblad.
* java/io/File.java (getParentFile): New method, from Classpath
	via Oskar Liljeblad.

From-SVN: r35149
2000-07-20 19:29:14 +00:00
Tom Tromey 75723df4d3 * java/util/Vector.java (remove(Object)): Implemented.
From-SVN: r35148
2000-07-20 19:27:57 +00:00
Jeff Sturm 5cc80caa27 natThrowable.cc (fillInStackTrace): Check for zero return from backtrace().
2000-07-19  Jeff Sturm  <jeff.sturm@appnet.com>

	* java/lang/natThrowable.cc (fillInStackTrace): Check for
	zero return from backtrace().

From-SVN: r35135
2000-07-19 14:37:56 +00:00
Bryce McKinlay c180a82d69 commit changelog
From-SVN: r35044
2000-07-15 06:12:47 +01:00
Bryce McKinlay 826b480791 Add missing files from last check-in:
* java/awt/image/ImageConsumer.java: New file.
	* java/awt/image/ImageProducer.java: New file.
	* java/awt/image/ImageObserver.java: New file.

From-SVN: r35000
2000-07-12 22:13:51 +01:00
Bryce McKinlay e98da3dcf5 backport: Applet.java: New file.
2000-07-12  Bryce McKinlay  <bryce@albatross.co.nz>

	Merged implementation of java.applet from classpath:
	* java/applet/Applet.java: New file.
	* java/applet/AppletContext.java: New file.
	* java/applet/AppletStub.java: New file.
	* java/applet/AudioClip.java: New file.

	* Makefile.am: Added new java.applet classes.
	* Makefile.in: Rebuilt.

From-SVN: r34981
2000-07-12 05:52:04 +01:00
Bryce McKinlay c7a136d3ef Big AWT patch.
From-SVN: r34976
2000-07-12 04:32:07 +01:00
Tom Tromey 4ea9cbf197 natClassLoader.cc (_Jv_PrepareCompiledClass): Initialize static final String fields.
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass):
	Initialize static final String fields.

From-SVN: r34910
2000-07-07 20:54:32 +00:00
Tom Tromey fa948ac381 PrintWriter.java (print): Call write(String), not print(String).
* java/io/PrintWriter.java (print): Call write(String), not
	print(String).  See PR libgcj/277.
	(print(String)): Use write, not out.write.

From-SVN: r34853
2000-07-03 21:03:52 +00:00
Tom Tromey e5858cc975 * include/jni.h: Include <gcj/array.h>. Fixes PR libgcj/270.
From-SVN: r34818
2000-06-30 23:09:44 +00:00
Andrew Haley 52fa9d82f4 re GNATS java.io/203 (File.createTempFile doesn't close descriptor)
2000-06-27  Andrew Haley  <aph@cygnus.com>

       * java/io/File.java (createTempFile): Close the FileDescriptor
       used to create a temp file.  Fixes some of PR 203.
       * java/io/natFileDescriptorPosix.cc (open): Call garbage
       collection if we run out of file handles.

From-SVN: r34755
2000-06-28 12:24:10 +00:00
Warren Levy 580ac50392 Removed extraneous conflict marker.
From-SVN: r34754
2000-06-28 11:26:42 +00:00
Warren Levy 2017da526c Gnu.java: New file.
* gnu/java/security/provider/Gnu.java: New file.
	* gnu/java/security/provider/SHA.java: New file.
	* gnu/java/security/provider/SHA1PRNG.java: New file.
	* Makefile.am: Added the above files.
	* Makefile.in: Rebuilt.

	* java/io/ObjectStreamClass.java (setUID): Use Gnu SHA instead of SHS.

From-SVN: r34753
2000-06-28 11:24:05 +00:00
Bryce McKinlay 06772c7d0e ThreadGroup.java: Added synchronized flag to many methods.
* ThreadGroup.java: Added synchronized flag to many methods.
	(destroyed_flag): Removed.
	(isDestroyed, removeGroup, removeThread): Test for parent == null.
	(activeCount): Added spec note.

From-SVN: r34750
2000-06-28 07:03:11 +01:00
Warren Levy d9984f96fc Principal.java: New file.
* java/security/Principal.java: New file.
	* Makefile.am: Added Principal.java.
	* Makefile.in: Rebuilt.

From-SVN: r34749
2000-06-28 01:31:42 +00:00
Rolf W. Rasmussen b32dabe5ed MouseEvent.java: Fixed coordinate space confusion.
2000-06-27  Rolf W. Rasmussen  <rolfwr@ii.uib.no>

	* java/awt/event/MouseEvent.java: Fixed coordinate space
	confusion.

From-SVN: r34746
2000-06-27 21:30:34 +00:00
Tom Tromey 56067b0077 PushbackInputStream.java (read): If there are characters in the buffer, don't also call super.read().
* java/io/PushbackInputStream.java (read): If there are characters
	in the buffer, don't also call super.read().
	* java/io/PushbackReader.java (read): If there are characters in
	the buffer, don't also call super.read().

From-SVN: r34745
2000-06-27 21:27:50 +00:00
Tom Tromey 260e1a2bb0 * java/lang/Double.java (valueOf): Call parseDouble().
From-SVN: r34737
2000-06-27 18:35:54 +00:00
Warren Levy 7b245d2461 PropertyChangeEvent.java (oldVal): Renamed to oldValue.
* java/beans/PropertyChangeEvent.java (oldVal): Renamed to oldValue.
	(newVal): Renamed to newValue.
	* java/beans/PropertyVetoException.java (changeEvent): Renamed to evt.
	* java/beans/beancontext/BeanContextServiceRevokedEvent.java
	(revokeNow): Renamed to invalidateRefs.
	* java/io/OptionalDataException.java: Updated FIXME.
	(eof): New placeholder field.
	(length); Ditto.
	* java/io/WriteAbortedException.java (message): Made transient.
	* java/lang/ClassNotFoundException.java: Updated comments for JDK 1.2.
	* java/lang/Throwable.java (stackTrace): Made transient.
	* java/net/InetAddress.java: Made Serializable.
	* java/security/KeyPair.java: Made Serializable.
	* java/security/Provider.java: Replaced with Classpath version that
	implements serialization and proper methods.
	* java/text/ChoiceFormat.java (strings): Renamed to choiceFormats.
	(limits): Renamed to choiceLimits.

Serialization changes per:
http://java.sun.com/products/jdk/1.2/docs/api/serialized-form.html

From-SVN: r34726
2000-06-27 05:10:03 +00:00
Tom Tromey cf036e712c natDouble.cc (parseDouble): Renamed from doubleValueOf.
* java/lang/natDouble.cc (parseDouble): Renamed from
	doubleValueOf.
	* java/lang/Double.java (parseDouble): Renamed from
	doubleValueOf.  Now public.

From-SVN: r34679
2000-06-24 18:11:01 +00:00
Andrew Haley 56e3dd2cea ieeefp.h: Handle ia64, fr30, mcore.
* java/lang/ieeefp.h: Handle ia64, fr30, mcore.
	* java/lang/natThrowable.cc: On IA-64, use __ia64_backtrace.

From-SVN: r34667
2000-06-23 19:53:33 +00:00
Tom Tromey 782c59d653 natMethod.cc: Include <alloca.h>.
* java/lang/reflect/natMethod.cc: Include <alloca.h>.
	* java/lang/natDouble.cc: Always include <alloca.h>.
	Fix for PR libgcj/267.

From-SVN: r34665
2000-06-23 17:39:00 +00:00
Bryce McKinlay 0ee935e162 ThreadGroup.java (add(Thread)): Rename to addThread() to comply with classpath VM spec.
2000-06-21  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/ThreadGroup.java (add(Thread)): Rename to addThread() to
	comply with classpath VM spec.
	(add(Group)): Rename to addGroup().
	* java/lang/Thread.java (Thread): Use addThread().
	* java/lang/natThread.cc (finish_): Use removeThread().

From-SVN: r34627
2000-06-21 04:55:35 +01:00
Bryce McKinlay 6dfd8a7790 ThreadGroup.java: Merged with classpath.
2000-06-20  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/ThreadGroup.java: Merged with classpath.
	* prims.cc (_Jv_RunMain): Don't use 
ain_group'.
	* gnu/gcj/runtime/FirstThread.java: Remove ThreadGroup constructor
	argument.
	* java/lang/Thread.java (Thread): Bootstrap initial thread from
	ThreadGroup.root if Thread.currentThread is null. Honour the
	ThreadGroup's max priority setting.

From-SVN: r34615
2000-06-20 14:30:14 +01:00
Tom Tromey d4d17e95f1 re GNATS gcj/260 ("Klass.class" expression should cause Klass to be initialized)
* java/lang/natClass.cc (forName): Removed dead code.  Initialize
	returned class.  For PR gcj/260.

From-SVN: r34590
2000-06-18 22:14:06 +00:00
Tom Tromey 3fff847575 re GNATS libgcj/261 (Macro-inconsistency)
Fix for PR libgcj/261:
	* include/win32-signal.h (MAKE_THROW_FRAME): Added `_exception'
	argument.
	* include/sparc-signal.h (MAKE_THROW_FRAME): Added `_exception'
	argument.  (This is a patch from long ago that somehow went
	missing.)

From-SVN: r34575
2000-06-16 15:52:24 +00:00
Tom Tromey ff1c0096a1 natIconv.cc (iconv_adapter): New function.
* gnu/gcj/convert/natIconv.cc (iconv_adapter): New function.
	(read): Use it.
	(write): Likewise.

From-SVN: r34570
2000-06-16 01:11:12 +00:00
Bryce McKinlay 1bf8972740 2000-06-15 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR java.lang/258:
	* prims.cc (_Jv_PrimClass): Set state of primitive class to
	JV_STATE_DONE, to prevent accidental initialization.
	* java/lang/natClass.cc (_Jv_IsAssignableFrom): Call
	_Jv_InterfaceAssignableFrom if target is an interface and source is
	an interface or an abstract class. Remove redundant initializeClass
	calls. Remove duplicate if_idt test.
	(_Jv_InterfaceAssignableFrom): New function.
	* java/lang/Class.h (_Jv_InterfaceAssignableFrom): Prototype.

From-SVN: r34563
2000-06-15 13:04:50 +01:00
Bryce McKinlay d655f87d6f 2000-06-15 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR java.lang/258:
	* prims.cc (_Jv_PrimClass): Set state of primitive class to
	JV_STATE_DONE, to prevent accidental initialization.
	* java/lang/natClass.cc (_Jv_IsAssignableFrom): Call
	_Jv_InterfaceAssignableFrom if target is an interface and source is
	an interface or an abstract class. Remove redundant initializeClass
	calls. Remove duplicate if_idt test.
	* java/lang/Class.h (_Jv_InterfaceAssignableFrom): New function.

From-SVN: r34562
2000-06-15 12:58:18 +01:00
Tom Tromey c74e221410 prims.cc (DECLARE_PRIM_TYPE): Define a vtable as well.
* prims.cc (DECLARE_PRIM_TYPE): Define a vtable as well.
	(_Jv_PrimClass): Set `methods' by calling _Jv_FindArrayClass.
	* include/jvm.h (struct _Jv_ArrayVTable): Declare.
	(NUM_OBJECT_METHODS): New define.
	* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Added
	`array_vtable' parameter.  Added assertion.
	* java/lang/Class.h (_Jv_FindArrayClass): Added `array_vtable'
	parameter.

From-SVN: r34312
2000-05-31 23:50:37 +00:00
Bryce McKinlay f1aa7a521a cni.h: Include <string.h>.
2000-05-31  Bryce McKinlay  <bryce@albatross.co.nz>

	* gcj/cni.h: Include <string.h>.
	* defineclass.cc: Include <alloca.h>.
	* interpret.cc: Ditto.
	* gij.cc: Include <stdlib.h>.

From-SVN: r34311
2000-05-31 23:49:19 +01:00
Tom Tromey efc7058478 name-finder.h: Include <sys/wait.h>.
* include/name-finder.h: Include <sys/wait.h>.
	(_Jv_name_finder::pid): Now of type `pid_t'.
	(_Jv_name_finder::~_Jv_name_finder): Call waitpid().
	* java/lang/Throwable.java (CPlusPlusDemangler.close): Call
	`proc.waitFor()'.

From-SVN: r34279
2000-05-30 23:26:02 +00:00
Warren Levy 0d0cd44169 ObjectOutputStream.java (writeObject): Use component type when writing arrays.
* java/io/ObjectOutputStream.java (writeObject): Use component type
	when writing arrays.
	Fixed typo.

From-SVN: r34142
2000-05-24 21:15:51 +00:00
Bryce McKinlay 1c02a3d964 re GNATS libgcj/226 (implicit __builtin_expect) and GNATS gcj/228 (compressed JAR files)
2000-05-20  Bryce McKinlay  <bryce@albatross.co.nz>

	Fix for PR libgcj/226:
	* java/lang/Class.h (_Jv_InitClass): Don't call __builtin_expect,
	since this is an installed header.

	Fix for PR libgcj/228:
	* java/util/zip/ZipFile (getInputStream): Create inflater with
	nowrapper option.

	* java/util/zip/natInflater.cc (inflate): Throw zlib's error message
	with DataFormatException.

From-SVN: r34064
2000-05-21 00:30:46 +01:00
Tom Tromey fa5b690ab6 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (hack1): Removed.
	(awto_files): Likewise.
	(libgcjawt_la_SOURCES): Likewise.
	(EXTRA_libgcjawt_la_SOURCES): Likewise.
	(libgcjawt_la_DEPENDENCIES): Likewise.
	(libgcjawt_la_LIBADD): Likewise.
	(libgcjawt_la_LDFLAGS): Likewise.
	(libgcjawt_la_LINK): Likewise.
	($(awt_java_source_files:.java=.class)): Likewise.
	(libgcj.zip): Don't depend on AWT files.
	(MOSTLYCLEANFILES): Don't include AWT files.
	($(awto_files)): Removed.
	(nat_headers): Removed AWT files.
	(cond_awt_java_source_files): Removed.
	(ordinary_java_source_files): Added awt_java_source_files.
	* libgcj.spec.in (*lib): Removed -lgcjawt.
	* configure: Rebuilt.
	* configure.in: Removed --enable-java-awt option.

From-SVN: r34058
2000-05-20 20:26:51 +00:00
Bryce McKinlay ee2f99a584 ZipEntry.java: Implement Cloneable, per JDK1.2 docs.
2000-05-20  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/util/zip/ZipEntry.java: Implement Cloneable, per JDK1.2 docs.
	(ZipEntry): Copy the Name' field.
	(clone): Implement JDK1.2 method.
	(setCompressedSize): ditto.
	(hashCode): ditto.

From-SVN: r34043
2000-05-20 06:46:20 +01:00
Tom Tromey ee7ea78d2a Removed duplicate ChangeLog entry
From-SVN: r34042
2000-05-20 01:17:57 +00:00
Tom Tromey 1dcc053603 BufferedWriter.java: Merged with Classpath.
* java/io/BufferedWriter.java: Merged with Classpath.
	* java/io/BufferedOutputStream.java: Merged with Classpath.

From-SVN: r34041
2000-05-19 23:35:34 +00:00
Tom Tromey 6c80c45e30 Jumbo patch:
* Imported beans and serialization
* Updated IA-64 port
* Miscellaneous bug fixes

From-SVN: r34028
2000-05-19 17:55:34 +00:00
Bryce McKinlay c1f76317e4 From Gregory R. Warnes <warnes@biostat.washington.edu>:
* gnu/gcj/protocol/jar/Connection.java (getJarFile): Test for null
	`jarFile', not `jarFileURL'.

From-SVN: r34005
2000-05-19 00:50:34 +01:00
Bryce McKinlay fc5b21380e Thread.java: Declare `data' as Object, not RawData.
2000-05-18  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/Thread.java: Declare `data' as Object, not RawData.
	* java/lang/natThread.java (initialize_native): Cast `data' to
	jobject.
	* gnu/gcj/RawData.java: Clarify documentation.

From-SVN: r33981
2000-05-18 11:08:25 +01:00
Andrew Haley 3951562dfa ppc-signal.h: New file.
2000-05-15  Andrew Haley  <aph@cygnus.com>

        * include/ppc-signal.h: New file.

From-SVN: r33932
2000-05-16 14:38:21 +00:00
Tom Tromey 839ba6c895 ZipInputStream.java (getNextEntry): When reading file headers, don't include `size' in the skip call.
* java/util/zip/ZipInputStream.java (getNextEntry): When reading
	file headers, don't include `size' in the skip call.

From-SVN: r33850
2000-05-11 17:05:03 +00:00
Bryce McKinlay ac83e16bc4 StringBuffer.java (replace): Calculate length for arraycopy() correctly.
2000-05-10  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/StringBuffer.java (replace): Calculate length for
	arraycopy() correctly.

From-SVN: r33822
2000-05-10 12:13:17 +01:00
Bryce McKinlay fe517fb2c9 StringBuffer.java (delete): Call arrayCopy() correctly.
2000-05-10  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/StringBuffer.java (delete): Call arrayCopy() correctly.
	Avoid arrayCopy() call where possible. Update `count' _after_ calling
	arrayCopy().
	(replace): Reimplemented. Fix javadoc.
	(reverse): Call ensureCapacity_unsynchronized().
	(StringBuffer (String)): Use DEFAULT_CAPACITY.

From-SVN: r33819
2000-05-10 11:15:13 +01:00
Tom Tromey 2238de654f StringBuffer.java (toString): Don't mark buffer as shared.
* java/lang/StringBuffer.java (toString): Don't mark buffer as
	shared.
	(insert(int,char[],int,int): New method.
	(delete): New method from Classpath.
	(deleteCharAt): Likewise.
	(substring): Likewise.
	(shared): No longer private.
	Added JavaDoc comments from Classpath.
	* java/lang/String.java (String(StringBuffer)): Ensure `buffer' is
	shared.

From-SVN: r33809
2000-05-09 22:46:58 +00:00
Tom Tromey 89b6698a3e Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (LIBLINK): New macro.
	(libgcj_la_LINK): Use it.
	(libgcjawt_la_LINK): Likewise.

From-SVN: r33760
2000-05-07 16:02:00 +00:00
Tom Tromey fad163ed2f Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (libgcj.zip): Don't pass -L to javac.

From-SVN: r33728
2000-05-06 16:25:13 +00:00
Tom Tromey 327f248083 re GNATS libgcj/220 (build fails with "only absolute run-paths are allowed" error during linking)
Fix for PR libgcj/220:
	* Makefile.in: Rebuilt.
	* Makefile.am (gij_LDFLAGS): Don't use libstdc++.
	(jv_convert_LDFLAGS): Likewise.
	(libgcj_la_LDFLAGS): Likewise.
	(GCJLINK): New macro.
	(jv_convert_LINK): Use it.
	(gij_LINK): Likewise.
	(libgcj_la_LINK): New macro.
	(libgcjawt_la_LINK): Likewise.

From-SVN: r33706
2000-05-05 16:11:36 +00:00
Tom Tromey a52dee2f36 field.h (JvFieldIsRef): Return false for gnu.gcj.RawData field.
* gcj/field.h (JvFieldIsRef): Return false for gnu.gcj.RawData
	field.
	* boehm.cc (_Jv_MarkObj): Removed dead code.  Use `STATIC', not
	`0x0008'.
	Include Modifier.h.

From-SVN: r33702
2000-05-05 04:46:26 +00:00
Bryce McKinlay 9d4c21486c natClass.cc (isInstance): Use __builtin_expect.
2000-05-05  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natClass.cc (isInstance): Use __builtin_expect.
	(_Jv_IsAssignableFrom): Ditto.
	(_Jv_IsInstanceOf): Ditto.
	(_Jv_CheckCast): Ditto.
	(_Jv_CheckArrayStore): Ditto.
	* java/lang/Class.h (_Jv_InitClass): Ditto.
	* java/lang/natObject.cc (_Jv_MonitorEnter): __builtin_expect `false',
	not `0'.
	(notify): Ditto.
	(notifyAll): Ditto.
	(wait): Ditto.
	(_Jv_MonitorExit): Ditto.
	* boehm.cc (_Jv_MarkObj): Ditto.
	(_Jv_MarkObj): Ditto.
	(_Jv_MarkArray): Ditto.
	* prims.cc (_Jv_AllocObject): Ditto.
	(_Jv_NewObjectArray): Ditto.
	(_Jv_NewPrimArray): Ditto.
	(_Jv_Malloc): Ditto.
	(_Jv_Realloc): Ditto.
	(_Jv_MallocUnchecked): Ditto.
	(_Jv_divI): Ditto.
	(_Jv_remI): Ditto.
	(_Jv_divJ): Ditto.
	(_Jv_remJ): Ditto.

From-SVN: r33698
2000-05-05 03:56:14 +01:00
Tom Tromey aff3283b59 Removed erroneous ChangeLog entry
From-SVN: r33672
2000-05-04 15:51:47 +00:00
Tom Tromey f70b7142c2 Locale.java (Locale): Don't explicitly check for null.
* java/util/Locale.java (Locale): Don't explicitly check for
	null.
	* java/util/Hashtable.java (containsKey): Don't explicitly check
	for null.
	(get): Likewise.
	* java/util/BitSet.java (and, or, xor): Don't explicitly check for
	null.
	* java/util/zip/ZipEntry.java (ZipEntry): Don't explicitly check
	for null.
	* java/text/StringCharacterIterator.java
	(StringCharacterIterator): Don't check for null.
	* java/text/ChoiceFormat.java (setChoices): Don't explicitly check
	for null pointer.
	* java/net/MulticastSocket.java (joinGroup): Don't explicitly
	check for null pointer.
	(leaveGroup): Likewise.
	* java/net/DatagramPacket.java (DatagramPacket): Removed erroneous
	comment.
	(setData): Likewise.
	* java/lang/ThreadGroup.java (ThreadGroup): Don't explicitly check
	for `p==null'.

From-SVN: r33671
2000-05-04 15:50:34 +00:00
Jakub Jelinek 1f57788658 Makefile.am (GCJCOMPILE, [...]): Move -L option out of FLAGS.
2000-04-28  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.am (GCJCOMPILE, JCFLAGS, JF1CLAGS, jv_convert_LINK,
	gij_LINK, libgcj.zip, .java=.class): Move -L option out of FLAGS.
	(libgcj_la_LDFLAGS): Add -L../libstdc++ for in-gcc builds.
	(jv_convert_LDFLAGS, gij_LDFLAGS): Add `pwd`/../libstdc++ to
	-rpath for in-gcc builds.
	* Makefile.in: Rebuilt.

From-SVN: r33587
2000-05-01 21:36:39 +00:00
Tom Tromey 72ddef6d32 Removed mistakenly-committed ChangeLog entry
From-SVN: r33512
2000-04-28 16:29:30 +00:00
Tom Tromey f9f70f2dda re GNATS gcj/218 (Java executables can abort trying to access a null pointer in a leaf function)
* libgcj.spec.in (*jc1): Added -fasynchronous-exceptions.
	Fix for PR gcj/218.

From-SVN: r33511
2000-04-28 16:11:56 +00:00
Bryce McKinlay 065ccab369 String.java (toString): Remove `final' hack.
2000-04-28  Bryce McKinlay  <bryce@albatross.co.nz>

	* libjava/java/lang/String.java (toString): Remove `final' hack.

From-SVN: r33508
2000-04-28 08:56:34 +01:00
Tom Tromey 40f4ae3280 Runtime support for PR gcj/2:
* prims.cc (_Jv_ThrowNullPointerException): New function.
	* include/jvm.h (_Jv_ThrowNullPointerException): Declare.

From-SVN: r33492
2000-04-27 23:13:31 +00:00
Bryce McKinlay af4464eb46 prims.cc (_Jv_NewObjectArray): Fix typo.
2000-04-27  Bryce McKinlay  <bryce@albatross.co.nz>

        * prims.cc (_Jv_NewObjectArray): Fix typo.

From-SVN: r33479
2000-04-27 12:47:13 +01:00
Tom Tromey 09acb3e19d Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (AM_CXXFLAGS): Added -fasynchronous-exceptions.

From-SVN: r33447
2000-04-26 17:29:05 +00:00
Jeff Sturm 448415dcae natFirstThread.cc (run): Initialize class before calling main.
* gnu/gcj/runtime/natFirstThread.cc (run): Initialize class before
	calling main.

From-SVN: r33377
2000-04-24 15:07:16 +00:00
Anthony Green 1143c0a03f + 2000-04-22 Anthony Green <green@cygnus.com> + + * include/jvm.h (__builtin_expect): Define as unused for now.
+ 2000-04-22  Anthony Green  <green@cygnus.com>
+
+ 	* include/jvm.h (__builtin_expect): Define as unused for now.
+ 	* java/lang/natObject.cc (_Jv_MonitorEnter): Add __builtin_expect.
+ 	(notify): Ditto.
+ 	(notifyAll): Ditto.
+ 	(wait): Ditto.
+ 	(_Jv_MonitorExit): Ditto.
+ 	* boehm.cc (_Jv_MarkObj): Ditto.
+ 	(_Jv_MarkObj): Ditto.
+ 	(_Jv_MarkArray): Ditto.
+ 	(_Jv_AllocBytes): Ditto.
+ 	* prims.cc (_Jv_AllocObject): Ditto.
+ 	(_Jv_NewObjectArray): Ditto.
+ 	(_Jv_NewPrimArray): Ditto.
+ 	(_Jv_Malloc): Ditto.
+ 	(_Jv_Realloc): Ditto.
+ 	(_Jv_MallocUnchecked): Ditto.
+ 	(_Jv_divI): Ditto.
+ 	(_Jv_remI): Ditto.
+ 	(_Jv_divJ): Ditto.
+ 	(_Jv_remJ): Ditto.
+
+ 	* include/Makefile.in: Rebuilt.
+ 	* include/Makefile.am (include_HEADERS): Add jvmpi.h.
+

From-SVN: r33339
2000-04-22 17:09:39 +00:00
Tom Tromey 6cd167e1a7 PipedInputStream.java, [...]: Yet another new version from Classpath.
* java/io/PipedInputStream.java, java/io/PipedOutputStream.java:
	Yet another new version from Classpath.

From-SVN: r33328
2000-04-21 21:41:32 +00:00
Tom Tromey 7234f9bc03 re GNATS libgcj/15 (_REENTRANT should be defined more consistently)
Fix for PR libgcj/15:
	* java/util/natGregorianCalendar.cc (_REENTRANT,
	_POSIX_PTHREAD_SEMANTICS): Don't define.
	* java/net/natInetAddress.cc (_REENTRANT): Don't define.
	* java/lang/natSystem.cc (_REENTRANT, _POSIX_PTHREAD_SEMANTICS):
	Don't define.
	* java/io/natFile.cc (_REENTRANT, _POSIX_PTHREAD_SEMANTICS): Don't
	define.
	* configure: Rebuilt.
	* configure.in: If using POSIX threads, define _REENTRANT if
	needed.  Define _POSIX_PTHREAD_SEMANTICS.  Don't define
	GETHOSTBYNAME_R_NEEDS_REENTRANT.

From-SVN: r33318
2000-04-21 20:38:43 +00:00
Tom Tromey 051d082b26 PipedInputStream.java, [...]: New version from Classpath.
* java/io/PipedInputStream.java, java/io/PipedReader.java,
	java/io/PipedOutputStream.java, java/io/PipedWriter.java: New
	version from Classpath.

From-SVN: r33316
2000-04-21 20:12:05 +00:00
Tom Tromey 93bc735f86 re GNATS libgcj/213 (Another parallel build error)
Fix for PR libgcj/213:
	* Makefile.in: Rebuilt.
	* Makefile.am (gij_SOURCES): Added gij.cc.
	(EXTRA_gij_SOURCES): Removed.
	(gij_LDADD): Removed gij.lo.
	(gij_DEPENDENCIES): Likewise.
	($(gij_OBJECTS)): Depend on nat_headers.

From-SVN: r33307
2000-04-21 14:23:44 +00:00
Tom Tromey ab8d774e06 Handler.java (openConnection): Use `setURL', not `url.set'.
* gnu/gcj/protocol/file/Handler.java (openConnection): Use
	`setURL', not `url.set'.

From-SVN: r33306
2000-04-21 14:18:49 +00:00
Tom Tromey d3474943bf Fix for PR java.io/204:
* java/io/PipedInputStream.java, java/io/PipedReader.java,
	java/io/PipedOutputStream.java, java/io/PipedWriter.java: Imported
	from Classpath.

From-SVN: r33300
2000-04-21 01:18:16 +00:00
Tom Tromey 18fcc4961b re GNATS libgcj/212 (build is broken on Linux/Alpha)
Fix for PR libgcj/212:
	* gcj/javaprims.h (_Jv_word, _Jv_word2): Removed definitions.
	* include/jvm.h (_Jv_word, _Jv_word2): Define.
	* java/lang/Class.h (_Jv_word): Declare.

From-SVN: r33292
2000-04-20 22:24:33 +00:00
Tom Tromey 6e84eab83f * jni.cc (_Jv_JNI_PopSystemFrame): Clear `env->ex'.
From-SVN: r33285
2000-04-20 17:39:30 +00:00
Tom Tromey af98124ef9 jni.cc (_Jv_JNI_FindClass): Use system class loader if class doesn't have a loader.
* jni.cc (_Jv_JNI_FindClass): Use system class loader if class
	doesn't have a loader.

From-SVN: r33272
2000-04-20 05:49:48 +00:00
Bryce McKinlay 4824d1bb6e boehm.cc: (_Jv_MarkObj...
2000-04-19  Bryce McKinlay  <bryce@albatross.co.nz>

	* boehm.cc: (_Jv_MarkObj, _Jv_MarkArray): Cast pointers for
	MAYBE_MARK to ptr_t, for compatibility with new GC version.

From-SVN: r33252
2000-04-19 11:10:39 +01:00
Bryce McKinlay 8bfecb841a re GNATS java.io/202 (File creation doesn't observe umask)
2000-04-16  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/io/natFileDescriptorPosix.cc (open): Use mode 0666. Fix for
	PR libgcj/202.
	(available): Initialize `Where' to prevent bogus compiler warning.

From-SVN: r33181
2000-04-16 04:09:27 +01:00
Tom Tromey cc309dd512 natString.cc (intern): Temporarily disable finalizer registration.
* java/lang/natString.cc (intern): Temporarily disable finalizer
	registration.

From-SVN: r33127
2000-04-12 21:17:00 +00:00
Tom Tromey 50b99cc8fe natString.cc (unintern): Added `obj' argument.
* java/lang/natString.cc (unintern): Added `obj' argument.
	(intern): Register finalizer for string.
	* java/lang/String.java (unintern): Now static; added obj
	argument.

From-SVN: r33124
2000-04-12 20:45:59 +00:00
Tom Tromey c23c855f38 Vector.java (VectorEnumeration): Now `final'.
* java/util/Vector.java (VectorEnumeration): Now `final'.
	* java/util/Hashtable.java (HashtableEntry): Now `final'.
	(HashtableEnumeration): Likewise.
	* java/util/zip/ZipFile.java (ZipEnumeration): Now `final'.
	* java/text/RuleBasedCollator.java (RBCElement): Now `final'.

From-SVN: r33083
2000-04-11 20:02:48 +00:00
Warren Levy d0123c54ca ObjectStreamException.java: New file.
* java/io/ObjectStreamException.java: New file.
	* java/io/OptionalDataException.java: New file.
	* java/io/StreamCorruptedException.java: New file.
	* java/math/BigDecimal.java: New file.
	* java/sql/CallableStatement.java: New file.
	* java/sql/Connection.java: New file.
	* java/sql/DataTruncation.java: New file.
	* java/sql/DatabaseMetaData.java: New file.
	* java/sql/Date.java: New file.
	* java/sql/Driver.java: New file.
	* java/sql/DriverManager.java: New file.
	* java/sql/DriverPropertyInfo.java: New file.
	* java/sql/PreparedStatement.java: New file.
	* java/sql/ResultSet.java: New file.
	* java/sql/ResultSetMetaData.java: New file.
	* java/sql/SQLException.java: New file.
	* java/sql/SQLWarning.java: New file.
	* java/sql/Statement.java: New file.
	* java/sql/Time.java: New file.
	* java/sql/Timestamp.java: New file.
	* java/sql/Types.java: New file.
	* Makefile.am: Added above new files.
	* Makefile.in: Rebuilt.

	* mauve-libgcj: Turned on java.math, java.sql and java.security tests.
	* java/net/MulticastSocket.java (MulticastSocket): Pass values a la
	DatagramSocket constructor instead of null.

java.sql is JDK 1.1 Compliant

From-SVN: r33077
2000-04-11 09:21:53 +00:00
Anthony Green e472b4f96b posix-threads.h (_Jv_MutexUnlock): Replace _JV_NOT_OWNER.
2000-04-08  Anthony Green  <green@cygnus.com>

	* include/posix-threads.h (_Jv_MutexUnlock): Replace
	_JV_NOT_OWNER.

From-SVN: r33039
2000-04-09 06:53:00 +00:00
Anthony Green 568fe067bc posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h.
2000-04-08  Anthony Green  <green@cygnus.com>

	* posix-threads.cc (_Jv_MutexLock): Moved back to posix-threads.h.
	(_Jv_MutexUnlock): Ditto.
	* include/posix-threads.h (_Jv_MutexLock): From posix-threads.cc.
	(_Jv_MutexUnlock): Ditto.

From-SVN: r33037
2000-04-09 05:41:56 +00:00
Anthony Green bdf2ced905 StringBuffer.java (ensureCapacity): Don't call Math::max.
2000-04-08  Anthony Green  <green@cygnus.com>

	* java/lang/StringBuffer.java (ensureCapacity): Don't call Math::max.
	(ensureCapacity_unsynchronized): New private method.
	(append): Use ensureCapacity_unsynchronized.

From-SVN: r33036
2000-04-09 04:52:43 +00:00
Tom Tromey 4eaf5996ad Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added new files.
	* java/awt/IllegalComponentStateException.java: New file.
	* java/awt/ItemSelectable.java: New file.
	* java/awt/event/WindowEvent.java: Finished.
	* java/awt/event/TextEvent.java: Finished.
	* java/awt/event/ContainerEvent.java: New file.
	* java/awt/Component.java (getX, getY): New methods.
	* java/awt/event/PaintEvent.java: New file.
	* java/awt/event/MouseEvent.java: New file.
	* java/awt/ActiveEvent.java: New file.
	* java/awt/event/KeyEvent.java: Finished.
	* java/awt/event/ItemEvent.java: New file.
	* java/awt/Adjustable.java: New file.
	* java/awt/event/InputMethodEvent.java: New file.
	* java/awt/event/InputEvent.java: Finished.
	* java/awt/event/FocusEvent.java: New file.
	* java/awt/event/MouseMotionAdapter.java: New file.
	* java/awt/event/MouseAdapter.java: New file.
	* java/awt/event/KeyAdapter.java: New file.
	* java/awt/event/FocusAdapter.java: New file.
	* java/awt/event/ContainerAdapter.java: New file.
	* java/awt/event/ComponentEvent.java: Finished.
	* java/awt/event/AdjustmentEvent.java: New file.
	* java/awt/event/ComponentAdapter.java: New file.
	* java/awt/event/ActionEvent.java: Finished.
	* java/awt/event/MouseMotionListener.java: New file.
	* java/awt/event/MouseListener.java: New file.
	* java/awt/event/ItemListener.java: New file.
	* java/awt/event/InputMethodListener.java: New file.
	* java/awt/event/ContainerListener.java: New file.
	* java/awt/event/FocusListener.java: New file.
	* java/awt/event/ComponentListener.java: New file.
	* java/awt/event/AWTEventListener.java: New file.
	* java/awt/event/AdjustmentListener.java: New file.

From-SVN: r33034
2000-04-09 04:13:27 +00:00
Anthony Green 3bd835f73f natObject.cc (_Jv_MonitorEnter): Only perform null check when we have to.
2000-04-08  Anthony Green  <green@redhat.com>

	* java/lang/natObject.cc (_Jv_MonitorEnter): Only perform null
	check when we have to.

	* gcj/array.h: Mark elements(JArray<T>& x) and elements(JArray<T>*
	x) as `inline'.

	* java/util/StringTokenizer.java: Minor optimization.  Eliminates
	one method call.

	* java/util/Vector.java (VectorEnumeration.nextElement): Manually
	inline hasMoreElements.

From-SVN: r33033
2000-04-09 01:26:20 +00:00
Tom Tromey 24969f074e configure: Rebuilt.
* configure: Rebuilt.
	* configure.in: Recognize --enable-java-awt.
	(AWT): New conditional.
	* Makefile.in: Rebuilt.
	* Makefile.am (toolexeclib_LTLIBRARIES): Build libgcjawt.la if
	requested.
	(libgcjawt_la_SOURCES): New macro.
	(EXTRA_libgcjawt_la_SOURCES): Likewise.
	(libgcjawt_la_DEPENDENCIES): Likewise.
	(libgcjawt_la_LIBADD): Likewise.
	(libgcjawt_la_LDFLAGS): Likewise.
	(libgcj.zip): Depend on cond_java_awt_source_files
	(cond_awt_java_source_files): New macro.
	(MOSTLYCLEANFILES): Added awto_files.
	(awto_files): New macro.  Use where javao_files used.
	(nat_headers): Use cond_awt_java_source_files.

From-SVN: r32954
2000-04-06 00:29:39 +00:00
Tom Tromey 69c0caa166 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added AWTException.java.
	* java/awt/AWTException.java: New file.

From-SVN: r32907
2000-04-04 19:56:20 +00:00
Tom Tromey 6719cc92e8 jvm.h (_Jv_GetArrayElementFromElementType): More commentary from Alex.
* include/jvm.h (_Jv_GetArrayElementFromElementType): More
	commentary from Alex.

From-SVN: r32894
2000-04-03 23:36:49 +00:00
Tom Tromey 0c2534d98d Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am ($(javao_files)): Depend on libgcj.zip.
	From H.J. Lu.

From-SVN: r32885
2000-04-03 18:07:45 +00:00
Anthony Green 54c2f04ba0 JVMPI changes...
Sun Apr  2 08:27:18 2000  Anthony Green  <green@redhat.com>

        * configure: Rebuilt.
	* configure.in: Add --disable-jvmpi.
        * include/config.h.in: Rebuilt.
        * acconfig.h: Add ENABLE_JVMPI.

	* include/jvm.h: Declare _Jv_DisableGC and _Jv_EnableGC.
        (_Jv_JVMPI_Notify_OBJECT_ALLOC): New define.
        (_Jv_JVMPI_Notify_THREAD_END): New define.
        (_Jv_JVMPI_Notify_THREAD_END): New define.
        * prims.cc (_Jv_JVMPI_Notify_OBJECT_ALLOC): Declare.
	(_Jv_JVMPI_Notify_THREAD_END): Declare.
        (_Jv_JVMPI_Notify_THREAD_END): Declare.

	* prims.cc (_Jv_AllocObject): Generate JVMPI object allocation
        events.

        * java/lang/natThread.cc: Include JVMPI headers if necessary.
        (finish_): Generate JVMPI thread end events.
        (run_): Generate JVMPI thread start events.
	* gnu/gcj/runtime/natFirstThread.cc (run): Call JNI_OnLoad for any
        preloaded JNI library.
        Include JVMPI headers if necessary.
        (run): Generate JVMPI thread start events.

        * boehm.cc: Define GC_disable and GC_enable.
	(_Jv_DisableGC): New function.
        (_Jv_EnableGC): New function.
        (disable_gc_mutex): Declare.
        * nogc.cc (_Jv_DisableGC): New function.
	(_Jv_EnableGC): New function.

        * jni.cc (_Jv_JNI_GetEnv): Handle JVMPI interface requests.
        (_Jv_JVMPI_Interface): Define.
        (jvmpiEnableEvent): New function.
        (_Jv_JNI_Init): Initialize _Jv_JVMPI_Interface.

        * include/jvmpi.h: New file.

From-SVN: r32866
2000-04-02 15:34:17 +00:00
Bryce McKinlay 8e4b9c9713 Synchronized gcjh commands for java/lang/Thread.h with Makefile.in.
From-SVN: r32776
2000-03-28 05:43:44 +01:00
Bryce McKinlay b834f1fa06 Makefile.in: New #defines and friends for Thread.h.
* Makefile.in: New #defines and friends for Thread.h.
        * posix-threads.cc: (struct starter): Remove `object'.
        (_Jv_CondWait): Use interruptable condition variables and new
        recursive mutexes. New return codes on interrupt or non-ownership
        of mutex.
        (_Jv_CondNotify): Ditto.
        (_Jv_CondNotifyAll): Ditto.
        (_Jv_ThreadInterrupt): Set thread interrupt flag directly. Interrupt
        the target thread by signaling its wait condition.
        (_Jv_ThreadInitData): Set `thread_obj' in the thread data struct,
        not the starter struct. Initialize wait_mutex and wait_cond.
        (_Jv_MutexLock): New recursive mutex implementation. Moved from
        posix-threads.h.
        (_Jv_MutexUnlock): Ditto.
        (really_start): Set info->data->thread from pthread_self() to work
        around a race condition. Destroy wait_mutex and wait_cond when run()
        returns.
        * java/lang/Thread.java: (isInterrupted_): Renamed to overloaded
        `isInterrupted(boolean)'. Clear interrupted flag if clear_flag is
        set.
        startable_flag: New private field.
        (Thread): Initialize `startable_flag'.
        (toString): Check for null thread group.
        * java/lang/natThread.cc: (struct natThread): New fields
        `join_mutex', `join_cond'. Removed fields `joiner', `next'.
        (class locker): Removed.
        (initialize_native): Initialize `join_cond' and `join_mutex'.
        (interrupt): Now just calls _Jv_ThreadInterrupt().
        (join): Simplified. Just wait on the target thread's join condition.
        (finish_): Remove join list code. Unset thread group. Signal
        potential joiners by notifying the dying threads join_cond.
        (start): Check for illegal restarts.
        * java/lang/natObject.cc: Check for return value of _Jv_CondWait and
        act appropriatly.
        * include/posix-threads.h: Remove all HAVE_RECURSIVE_MUTEX related
        #defines and #ifdefs.
        (struct _Jv_Thread_t): New fields `thread_obj', `wait_cond',
        `wait_mutex', `next'.
        (struct _Jv_ConditionVariable_t): Define as a struct instead of
        directly mapping to pthread_cond_t.
        (struct _Jv_Mutex_t): New recursive implementation.
        (_Jv_PthreadCheckMonitor): Reimplemented. Simple `owner' check.
        _Jv_HaveCondDestroy: Never define this for posix-threads.
        (_Jv_CondNotify): Remove inline implementation(s), prototype instead.
        (_Jv_CondNotifyAll): Ditto.
        (_Jv_MutexLock): Ditto.
        (_Jv_MutexUnlock): Ditto.
        (_Jv_MutexInit): Changed to reflect new mutex implementation.
        (_Jv_MutexDestroy): Ditto.
        (_Jv_CondDestroy): Removed.
        (_Jv_PthreadGetMutex): Removed.
        * include/win32-threads.h: (_Jv_CondNotify): Guess _JV_NOT_OWNER on an
        error. Add a FIXME about this.
        (_Jv_CondNotifyAll): Ditto.
        * win32-threads.cc: (_Jv_CondWait): Return 0 on a timeout. Guess
        _JV_NOT_OWNER on other errors. Add FIXME.

From-SVN: r32773
2000-03-28 03:22:24 +01:00
Tom Tromey 4e2d1dbdd3 jni.cc (_Jv_JNI_PopSystemFrame): If environment has exception set, throw it.
* jni.cc (_Jv_JNI_PopSystemFrame): If environment has exception
	set, throw it.
	(call): Don't throw exception here.

From-SVN: r32770
2000-03-27 19:51:46 +00:00
Tom Tromey 99444711eb [multiple changes]
2000-03-26  Tom Tromey  <tromey@cygnus.com>

	* java/lang/mprec.h: Use SIZEOF_VOID_P.
	* interpret.cc: Use SIZEOF_VOID_P.
	* include/java-cpool.h (_Jv_storeLong): Use SIZEOF_VOID_P.
	(_Jv_loadLong): Likewise.
	(_Jv_storeDouble): Likewise.
	* configure: Rebuilt.
	* configure.in: Check size of void*.

	* resolve.cc (ncode): Use FFI_PREP_RAW_CLOSURE and FFI_RAW_SIZE.

2000-03-26  Hans Boehm  <boehm@acm.org>

	* include/java-cpool.h (_Jv_storeLong, _Jv_loadLong,
	_Jv_storeDouble, _Jv_loadDouble): Define differently on 64 bit
	machine.
	* java/lang/ieeefp.h: Define __IEEE_BIG_ENDIAN or
	__IEEE_LITTLE_ENDIAN appropriately on IA64.
	* java/lang/mprec.h: Don't define Pack_32 on 64 bit machine.
	* javaprims.h (_Jv_word): Added `l' and `d' entries in 64 bit
	case.
	* resolve.cc (FFI_PREP_RAW_CLOSURE): New define.
	(FFI_RAW_SIZE): Likewise.
	(_Jv_InterpMethod::ncode): Use them.
	* interpret.cc (PUSHL, PUSHD, POPL, POPD, LOADL, LOADD, STOREL,
	STORED): Define differently on a 64 bit machine.
	(continue1): Use ffi_java_raw_call when appropriate.

From-SVN: r32754
2000-03-26 20:33:04 +00:00
Warren Levy 552cc5b57e BigInteger.java (divide): Handle the special case when dividing by 1 and the high bit of the dividend is set.
* java/math/BigInteger.java(divide): Handle the special case when
	dividing by 1 and the high bit of the dividend is set.
	(setShiftRight): Handle case when count == 0.

From-SVN: r32724
2000-03-24 09:18:12 +00:00
Warren Levy 111393dfd6 Font.java (isBold): Fix syntax error.
* java/awt/Font.java(isBold): Fix syntax error.
	(isItalic): ditto.
	* java/awt/Frame.java(postEvent): ditto.
	* java/awt/Menu.java(postEvent): ditto.
	* java/awt/MenuBar.java(postEvent): ditto.
	* java/awt/Toolkit.java(init): Included a stub.

From-SVN: r32723
2000-03-24 09:09:56 +00:00
Bryce McKinlay 604de2bddf Event.java: Add all the event type constants.
2000-03-21  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/awt/Event.java: Add all the event type constants.
        (Event): Implemented constructors.
        (controlDown): Implemented.
        (metaDown): Implemented.
        (paramString): Stubbed.
        (shiftDown): Implemented.
        (toString): Implemented.
        (translate): Implemented.

From-SVN: r32676
2000-03-21 21:33:53 +00:00
Bryce McKinlay a09f61183a * java/lang/natClass.cc (isInstance): Use JV_CLASS, not getClass().
From-SVN: r32665
2000-03-21 05:54:42 +00:00
Bryce McKinlay afccdd1d6c natClass.cc (isInstance): Use _Jv_IsAssignableFrom(), not Class.isAssignableFrom().
* java/lang/natClass.cc (isInstance): Use _Jv_IsAssignableFrom(),
        not Class.isAssignableFrom().

From-SVN: r32664
2000-03-21 05:44:29 +00:00
Bryce McKinlay a162f9d81e natClass.cc (isInstance): Initialize `this'.
2000-03-21  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/natClass.cc (isInstance): Initialize `this'.
        (isAssignableFrom): Initialize `this' and `klass'.
        (_Jv_IsAssignableFrom): If an interface has no idt, it is not
        implemented by any loaded class, so return false.

From-SVN: r32663
2000-03-21 05:12:20 +00:00
Warren Levy 54b43a686d Color.java: Specified java.io for Serializable.
* java/awt/Color.java: Specified java.io for Serializable.
	* java/awt/Toolkit.java: Imported java.net.URL.

From-SVN: r32639
2000-03-19 12:20:12 +00:00
Warren Levy b6166b4d0f * java/awt/Color.java: Rewrote to be more memory efficient (& compile).
From-SVN: r32634
2000-03-19 11:23:27 +00:00
Warren Levy d05165c393 Color.java: New file.
* java/awt/Color.java: New file.
	* java/awt/Graphics.java: New file.
	* java/awt/Image.java: New file.
	* java/awt/Paint.java: New file.
	* java/awt/PaintContext.java: New file.
	* java/awt/Transparency.java: New file.
	* java/util/Collection.java: New file.
	* java/util/Comparator.java: New file.
	* java/util/Iterator.java: New file.
	* java/util/List.java: New file.
	* java/util/ListIterator.java: New file.
	* Makefile.am: Added above new files.
	* Makefile.in: Rebuilt.

	* java/awt/Font.java (PLAIN): New field.
	(BOLD): New field.
	(ITALIC): New field.
	(ROMAN_BASELINE): New field.
	(CENTER_BASELINE): New field.
	(HANGING_BASELINE): New field.
	(name): New field.
	(style): New field.
	(size): New field.
	(pointSize): New field.
	(Font): Implemented constructor.
	(isPlain): Implemented method.
	(isBold): Implemented method.
	(isItalic): Implemented method.
	(getName): Implemented method.
	(getStyle): Implemented method.
	(getSize): Implemented method.
	(getSize2D): Implemented method.
	(decode): Stubbed.
	* java/awt/Frame.java (getFont): Stubbed.
	(postEvent): Stubbed.
	(remove): Stubbed.
	* java/awt/Menu.java (postEvent): Stubbed.
	* java/awt/MenuBar.java (getFont): Stubbed.
	(postEvent): Stubbed.
	* java/awt/Toolkit.java (getImage): Added abstract method.

From-SVN: r32598
2000-03-17 00:45:06 +00:00
Tom Tromey 878885b411 [multiple changes]
2000-03-15  Tom Tromey  <tromey@cygnus.com>

	* java/io/natFileDescriptorWin32.cc (winerr): Now static.

	* prims.cc (win32_exception_handler): Reformatted.

	* include/win32-threads.h (_Jv_HaveCondDestroy): New define.
	(_Jv_HaveMutexDestroy): Likewise.

2000-03-15 Jon Beniston <jb7216@bristol.ac.uk>

	* java/io/natFileDescriptorWin32.cc: New file.
	* java/io/natFileWin32.cc: New file.
	* java/net/natInetAddress.cc: Added conditional inclusion of
	Windows / Winsock headers.
	* java/net/natPlainDatagramSocketImpl.cc: Added conditional
	inclusion of Windows / Winsock headers.
	* java/net/natPlainSocketImpl.cc: Added conditional inclusion of
	Windows / Winsock headers.
	* include/win32-signal.h: New file.
	* include/win32-threads.h: New file.
	* win32-threads.cc: New file.
	* exception.cc (win32_get_restart_frame): New function.
	* prims.cc (win32_exception_handler): New function.
	(main_init) Performs Winsock initialisation.
	(main_init) Installs exeception handler.

From-SVN: r32567
2000-03-15 22:03:19 +00:00
Tom Tromey 90a883ae6b jni.cc (mangled_name): Fixed assertion.
* jni.cc (mangled_name): Fixed assertion.
	(JNI_GetCreatedJavaVMs): Don't comment out `buf_len' argument;
	turned assert into actual failure.

From-SVN: r32546
2000-03-14 21:59:54 +00:00
Warren Levy ea7f51a4af Key.java (serialVersionUID): Set to 0 for now.
* java/security/Key.java(serialVersionUID): Set to 0 for now.
	* java/security/interfaces/DSAPrivateKey.java(serialVersionUID): Ditto.
	* java/security/interfaces/DSAPublicKey.java(serialVersionUID): Ditto.

From-SVN: r32464
2000-03-10 05:10:40 +00:00
Warren Levy 8560e49702 AlgorithmParameterGeneratorSpi.java: New file.
* java/security/AlgorithmParameterGeneratorSpi.java: New file.
	* java/security/DigestException.java: New file.
	* java/security/GeneralSecurityException.java: New file.
	* java/security/InvalidAlgorithmParameterException.java: New file.
	* java/security/InvalidKeyException.java: New file.
	* java/security/InvalidParameterException.java: New file.
	* java/security/Key.java: New file.
	* java/security/KeyException.java: New file.
	* java/security/KeyPair.java: New file.
	* java/security/KeyPairGenerator.java: New file.
	* java/security/KeyPairGeneratorSpi.java: New file.
	* java/security/NoSuchProviderException.java: New file.
	* java/security/PrivateKey.java: New file.
	* java/security/Provider.java: New file.
	* java/security/PublicKey.java: New file.
	* java/security/SecureRandom.java: New file.
	* java/security/Security.java: New file.
	* java/security/Signature.java: New file.
	* java/security/SignatureException.java: New file.
	* java/security/interfaces/DSAKey.java: New file.
	* java/security/interfaces/DSAParams.java: New file.
	* java/security/interfaces/DSAPrivateKey.java: New file.
	* java/security/interfaces/DSAPublicKey.java: New file.
	* java/security/interfaces/RSAPrivateCrtKey.java: New file.
	* java/security/interfaces/RSAPrivateKey.java: New file.
	* java/security/interfaces/RSAPublicKey.java: New file.
	* java/security/spec/AlgorithmParameterSpec.java: New file.
	* java/security/spec/InvalidKeySpecException.java: New file.
	* java/security/spec/InvalidParameterSpecException.java: New file.
	* java/security/spec/KeySpec.java: New file.
	* java/security/spec/RSAPrivateCrtKeySpec.java: New file.
	* java/security/spec/RSAPrivateKeySpec.java: New file.
	* java/security/spec/RSAPublicKeySpec.java: New file.
	* Makefile.am: Added above java.security files.
	* Makefile.in: Rebuilt.

	* java/security/MessageDigest.java: Rewritten.
	* java/security/SecureClassLoader.java: Added JDK1.2 comment.

From-SVN: r32461
2000-03-10 02:43:57 +00:00
Bryce McKinlay d585552a72 Updated README.
From-SVN: r32456
2000-03-09 22:20:43 +00:00
Bryce McKinlay fb863f625e natClassLoader.cc (_Jv_FindArrayClass): Call _Jv_PrepareConstantTimeTables.
2000-03-09  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/natClassLoader.cc (_Jv_FindArrayClass): Call
        _Jv_PrepareConstantTimeTables.
        * java/lang/natClass.cc (_Jv_PrepareConstantTimeTables): Array
        classes should have an IDT, so don't return if klass is an array
        class.

From-SVN: r32445
2000-03-09 09:22:36 +00:00
Tom Tromey c500e5ec9f natArray.cc (newInstance): Don't allow array of `void' to be created.
* java/lang/reflect/natArray.cc (newInstance): Don't allow array
	of `void' to be created.

From-SVN: r32443
2000-03-09 04:50:49 +00:00
Warren Levy d98729aa0e * java/math/BigInteger.java(signum): Handle zero properly.
From-SVN: r32441
2000-03-09 04:35:30 +00:00
Tom Tromey 2ba5f77454 All files: Updated copyright information.
* All files: Updated copyright information.
	* COPYING: New file.
	* COPYING.LIB: Removed.
	* LIBGCJ_LICENSE: We now use GPL + special exception.

From-SVN: r32387
2000-03-07 19:55:28 +00:00
Bryce McKinlay ddf0fc6c9f resolve.cc (_Jv_SearchMethodInClass): New function.
2000-03-07  Bryce McKinlay  <bryce@albatross.co.nz>

        * resolve.cc (_Jv_SearchMethodInClass): New function.
        (_Jv_ResolvePoolEntry): Search superinterfaces for interface
        methods.
        * java/lang/Class.h (_Jv_SearchMethodInClass): New prototype.

2000-03-07  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/Class.h (union _Jv_IDispatchTable): New declaration.
        (struct _Jv_ifaces): New declaration.
        JV_CLASS: New macro definition.
        (getComponentType): Relocate below isArray() for inlining.
        (getModifiers): Declare `inline'.
        (getSuperclass): Ditto.
        (isArray): Ditto.
        (isPrimitive): Ditto.
        (_Jv_IsAssignableFrom): New prototype.
        (_Jv_LookupInterfaceMethodIdx): New prototype. Predeclare with "C"
        linkage.
        (_Jv_InitClass): Move from natClass.cc. Declare `inline'.
        Check for JV_STATE_DONE before invoking initializeClass().
        (_Jv_PrepareConstantTimeTables): New prototype.
        (_Jv_GetInterfaces): Ditto.
        (_Jv_GenerateITable): Ditto.
        (_Jv_GetMethodString): Ditto.
        (_Jv_AppendPartialITable): Ditto.
        (_Jv_FindIIndex): Ditto.
        depth, ancestors, idt: New class fields.

        * java/lang/natClass.cc (isAssignableFrom): Move functionality to
        inline function `_Jv_IsAssignableFrom'. Use that function.
        (isInstance): Declare `inline'.
        (initializeClass): Get lock on class before checking `state'. Unlock
        before calling resolveClass0. Call _Jv_PrepareConstantTimeTables
	with the lock held.
        (_Jv_LookupInterfaceMethod): Use _Jv_GetMessageString.
        (_Jv_IsAssignableFrom): New inline function. Test assignability
	using class->depth and ancestor table.
        (_Jv_IsInstanceOf): Use _Jv_IsAssignableFrom.
        (_Jv_CheckCast): Move from prims.cc. Use JV_CLASS and
        _Jv_IsAssignableFrom.
        (_Jv_CheckArrayStore): Ditto.
        (_Jv_LookupInterfaceMethodIdx): New function.
        INITIAL_IOFFSETS_LEN, INITIAL_IFACES_LEN: New #defines.
        (_Jv_PrepareConstantTimeTables): New function.
        (_Jv_IndexOf): Ditto.
        (_Jv_GetInterfaces): Ditto.
        (_Jv_GenerateITable): Ditto.
        (_Jv_GetMethodString): Ditto.
        (_Jv_AppendPartialITable): Ditto.
        iindex_mutex, iindex_mutex_initialized: New static fields.
        (_Jv_FindIIndex): New function.

        * java/lang/natClassLoader.cc (_Jv_NewClass): Set new jclass fields.

        * prims.cc (_Jv_CheckCast): Moved to natClass.cc.
        (_Jv_CheckArrayStore): Ditto.
        (JvNewCharArray, JvNewBooleanArray, JvNewByteArray, JvNewShortArray,
        JvNewIntArray, JvNewLongArray, JvNewFloatArray, JvNewDoubleArray):
        Moved to gcj/array.h.
        (_Jv_Realloc): New function.

        * gcj/cni.h: Move _Jv_PrimClass definitions to gcj/array.h.

        * gcj/array.h: _Jv_PrimClass definitions moved from gcj/cni.h.
        (JvNewCharArray, JvNewBooleanArray, JvNewByteArray,
        JvNewShortArray, JvNewIntArray, JvNewLongArray, JvNewFloatArray,
        JvNewDoubleArray): Implementations moved from prims.cc and
        declared `inline'.

        * gcj/javaprims.h (_Jv_Realloc): Prototype.

        * include/jvm.h (_Jv_LookupInterfaceMethodIdx): Prototype.

From-SVN: r32382
2000-03-07 09:52:56 +00:00
Tom Tromey 8d00f6171a jni.cc (MARK_NONE): New define.
* jni.cc (MARK_NONE): New define.
	(MARK_USER): Likewise.
	(MARK_SYSTEM): Likewise.
	(struct _Jv_JNI_LocalFrame): Made `marker' bigger and `size'
	smaller.
	(_Jv_JNI_DeleteLocalRef): Use MARK_NONE in assert.
	(_Jv_JNI_EnsureLocalCapacity): Use MARK_NONE.
	(_Jv_JNI_PushLocalFrame): Use MARK_USER.
	(_Jv_JNI_PopLocalFrame): New version with additional `stop'
	argument.
	(call): Use MARK_SYSTEM.
	(_Jv_GetJNIEnvNewFrame): New function.
	(_Jv_LookupJNIMethod): New function.
	(_Jv_JNI_PopSystemFrame): New function.
	(call): Use _Jv_JNI_PopSystemFrame and _Jv_LookupJNIMethod.

From-SVN: r32373
2000-03-07 00:10:52 +00:00
Tom Tromey 4d54cfecc3 re GNATS libgcj/43 (jni.h not installed)
Fix for PR libgcj/43:
	* include/Makefile.in: Rebuilt.
	* include/Makefile.am (include_HEADERS): New define.

From-SVN: r32351
2000-03-06 02:50:38 +00:00
Anthony Green 008b7307cb javaprims.h ("Java"): Remove FirstThread.
2000-03-08  Anthony Green  <green@redhat.com>

	* gcj/javaprims.h ("Java"): Remove FirstThread.

From-SVN: r32349
2000-03-05 22:31:02 +00:00
Warren Levy c261e080ef DatagramSocket.java (DatagramSocket(int,InetAddress)): Handle null addresses.
* java/net/DatagramSocket.java(DatagramSocket(int,InetAddress)):
	  Handle null addresses.

From-SVN: r32339
2000-03-05 09:01:16 +00:00
Anthony Green aa1e467f34 re GNATS gcj/151 (strange result on Math.sin(1e50))
* configure.host (libgcj_flags): Define __NO_MATH_INLINES.
	See PR gcj/151.

From-SVN: r32337
2000-03-05 08:32:51 +00:00
Anthony Green 0f9c645ea5 configure: Rebuilt.
* configure: Rebuilt.
	      * configure.in (ZLIBTESTSPEC): New macro.
	      (GCTESTSPEC): New macro.
        (LIBGCJTESTSPEC): New macro.
        * libgcj-test.spec.in: New file.

From-SVN: r32330
2000-03-04 21:50:19 +00:00
Tom Tromey b099f07de9 java-interp.h: Don't include MethodInvocation.h.
* include/java-interp.h: Don't include MethodInvocation.h.
	(class _Jv_InterpMethod): Don't make MethodInvocation a friend.
	* Makefile.in: Rebuilt.
	* Makefile.am (gnu/gcj/runtime/MethodInvocation.h): Removed.
	(ordinary_java_source_files): Don't mention
	MethodInvocation.java.
	* gnu/gcj/runtime/MethodInvocation.java: Removed.
	* interpret.cc (MethodInvocation::continue1): Removed.
	(run): Handle exceptions here.
	* java/lang/ClassLoader.java (defineClass1, defineClass2):
	Removed.
	* java/lang/natClassLoader.cc (defineClass0): Catch exceptions
	here.
	(defineClass2): Removed.

	* java/lang/reflect/Method.java (hack_trampoline, hack_call):
	Removed.
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Catch
	exceptions here.
	(hack_call): Removed.

	* java/lang/Class.h (Class): Removed hackRunInitializers,
	hackTrampoline.
	* java/lang/natClass.cc (hackRunInitializers): Removed.
	(initializeClass): Catch exceptions here.
	Include ExceptionInInitializerError.h.
	* java/lang/Class.java (hackTrampoline, hackRunInitializers):
	Removed.

	* java/lang/Object.h (Object): Don't mention hack12_6.
	* java/lang/natObject.cc (_Jv_FinalizeObject): Catch exceptions
	here.
	* java/lang/Object.java (hack12_6): Removed.

	* java/lang/natThread.cc (run_): Renamed.  Catch exceptions here.
	(start): Use run_, not run__.
	* java/lang/Thread.java (run_): Renamed from run__; old run_
	removed.

	* jni.cc (_Jv_JNI_FindClass): Handle exceptions.
	(_Jv_JNI_EnsureLocalCapacity): Likewise.
	(_Jv_JNI_DefineClass): Likewise.
	(_Jv_JNI_ThrowNew): Likewise.
	(_Jv_JNI_AllocObject): Likewise.
	(_Jv_JNI_GetAnyMethodID): Likewise.
	(_Jv_JNI_CallAnyMethodV): Likewise.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_CallAnyVoidMethodV): Likewise.
	(_Jv_JNI_CallAnyVoidMethodA): Likewise.
	(_Jv_JNI_GetAnyFieldID): Likewise.
	(_Jv_JNI_NewString): Likewise.
	(_Jv_JNI_NewStringUTF): Likewise.
	(_Jv_JNI_GetStringUTFChars): Likewise.
	(_Jv_JNI_NewObjectArray): Likewise.
	(_Jv_JNI_NewPrimitiveArray): Likewise.
	(_Jv_JNI_GetPrimitiveArrayRegion): Likewise.
	(_Jv_JNI_GetStringRegion): Likewise.
	(_Jv_JNI_GetStringUTFRegion): Likewise.
	(_Jv_JNI_SetPrimitiveArrayRegion): Likewise.
	(_Jv_JNI_MonitorEnter): Likewise.
	(_Jv_JNI_MonitorExit): Likewise.
	(_Jv_JNI_ToReflectedField): Likewise.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	(_Jv_JNI_RegisterNatives): Likewise.
	(_Jv_JNI_AttachCurrentThread): Likewise.
	(_Jv_JNI_DestroyJavaVM): Likewise.

From-SVN: r32294
2000-03-02 20:25:20 +00:00
Mo DeJong fee2681f8a ZipOutputStream.java (closeEntry): Fixed error caused by the incorrect casting of a long to an int.
2000-02-28  Mo DeJong  <mdejong@cygnus.com>

	* java/util/zip/ZipOutputStream.java(closeEntry) : Fixed
	error caused by the incorrect casting of a long to an int.

From-SVN: r32257
2000-02-29 17:08:00 +00:00
Mo DeJong f8b7a5d26b ZipOutputStream.java (write_entry): Fixed SIGSEV caused by use of the wrong instance variable.
2000-02-28  Mo DeJong  <mdejong@cygnus.com>

	* java/util/zip/ZipOutputStream.java(write_entry) : Fixed
	SIGSEV caused by use of the wrong instance variable.

From-SVN: r32256
2000-02-29 17:04:35 +00:00
Bryce McKinlay 91da35dbf2 File.java (File(String, String)): For dirPath, treat an empty String the same as `null'.
2000-02-27  Bryce McKinlay  <bryce@albatross.co.nz>

       * java/io/File.java (File(String, String)): For dirPath, treat an
       empty String the same as `null'.

From-SVN: r32217
2000-02-27 10:43:47 +00:00
Anthony Green e1b1511329 Minor clean up and bug fix.
From-SVN: r32196
2000-02-26 21:12:54 +00:00
Tom Tromey ac52f669c5 jni.cc (_Jv_JNI_RegisterNatives): Conditionalize body on `INTERPRETER'.
* jni.cc (_Jv_JNI_RegisterNatives): Conditionalize body on
	`INTERPRETER'.

From-SVN: r32156
2000-02-25 23:49:34 +00:00
Bryce McKinlay 4ae4a3c973 re GNATS libgcj/38 (Static initializer in DecimalFormat eventually depends on itself)
2000-02-25  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/net/URLConnection.java (initializeDateFormats): New
        private method.
        (getHeaderFieldDate): Call initializeDateFormats if required.
        locale, dateFormat1, dateFormat2, dateFormat3: Don't initialize
        these.
        Fix for PR libgcj/38.

From-SVN: r32153
2000-02-25 22:38:33 +00:00
Warren Levy 12b595c7c4 BigInteger.java (ival): Made private.
* java/math/BigInteger.java(ival): Made private.
	(words): Ditto.
	(neg): Ditto.

From-SVN: r32143
2000-02-25 04:00:09 +00:00
Anthony Green 9b90451bee Forgot to commit ChangeLog
From-SVN: r32087
2000-02-21 08:21:52 +00:00
Tom Tromey 38b3a2c089 * boehm.cc (_Jv_AllocBytes): Clear returned memory.
From-SVN: r32085
2000-02-21 05:14:06 +00:00
Bryce McKinlay a0e34aaae4 ZipEntry.java (setCrc): Fix overflow.
2000-02-19  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/util/zip/ZipEntry.java (setCrc): Fix overflow.
        (setSize): ditto.

From-SVN: r32062
2000-02-19 02:54:14 +00:00
Tom Tromey 8ade47715e jvm.h (_Jv_GetJavaVM): Declare.
* include/jvm.h (_Jv_GetJavaVM): Declare.
	* include/java-interp.h (_Jv_GetFirstMethod): New function.
	(_Jv_MethodBase::get_method): New method.
	(_Jv_JNIMethod::set_function): New method.
	* jni.cc (_Jv_JNI_UnregisterNatives): New function.
	(_Jv_JNI_RegisterNatives): New function.
	(_Jv_JNIFunctions): Updated for new functions.
	(_Jv_GetJavaVM): New function.
	(_Jv_JNI_GetJavaVM): Use it.  Now static.
	(_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread
	is already a Java thread but does not have a JNIEnv yet.

	* java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload
	function.

From-SVN: r32056
2000-02-18 21:22:06 +00:00
Tom Tromey 8dd8ff2e98 Rotated ChangeLogs
From-SVN: r32043
2000-02-17 22:57:30 +00:00
Tom Tromey de3cb4e4c1 re GNATS gcj/152 (Installation flaw)
* gcj/field.h (_Jv_Field::getClass): Don't use JvAssert.
	Fixes PR gcj/152.

From-SVN: r32036
2000-02-17 18:34:14 +00:00
Tom Tromey 5ef57049f9 * jni.cc (_Jv_JNI_CallStaticMethodV): Added some assertions.
From-SVN: r32021
2000-02-17 00:54:34 +00:00
Tom Tromey 1adbc4d8be jni.cc (_Jv_JNI_NewObjectV): Corrected assertion.
* jni.cc (_Jv_JNI_NewObjectV): Corrected assertion.
	(_Jv_JNI_NewObject): Likewise.
	(_Jv_JNI_NewObjectA): Likewise.
	(_Jv_JNI_CallAnyMethodV): In constructor case, pass correct value
	as "return" type to _Jv_CallAnyMethodA.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_CallAnyVoidMethodV): Likewise.

From-SVN: r32017
2000-02-16 22:42:41 +00:00
Tom Tromey d77a164002 jni.cc (_Jv_JNI_FindClass): Use ClassLoader.loadClass, not findClass.
* jni.cc (_Jv_JNI_FindClass): Use ClassLoader.loadClass, not
	findClass.

From-SVN: r32013
2000-02-16 18:42:48 +00:00
Tom Tromey d348bda453 resolve.cc (ncode): Set args_raw_size.
* resolve.cc (ncode): Set args_raw_size.  Compute jni_cif and
	jni_arg_types.
	(init_cif): Added `rtype_p' argument.
	* include/java-interp.h (class _Jv_MethodBase): Added
	args_raw_size.
	(class _Jv_InterpMethod): Removed args_raw_size.
	(class _Jv_JNIMethod): Added jni_cif and jni_arg_types fields.
	* jni.cc (call): Pass JNIEnv and (for static methods only) the
	class pointer as well as the ordinary arguments.

From-SVN: r31995
2000-02-16 00:07:34 +00:00
Tom Tromey cdd59e7bdf * jni.cc (mangled_name): Skip leading `(' in signature.
From-SVN: r31993
2000-02-15 22:59:23 +00:00
Tom Tromey abfb784400 * jni.cc (add_char): Added missing `else'.
From-SVN: r31991
2000-02-15 22:42:10 +00:00
Tom Tromey 2d759f7165 jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc fails.
* jni.cc (_Jv_JNI_AttachCurrentThread): Return error if malloc
	fails.

From-SVN: r31986
2000-02-15 20:39:36 +00:00
Bryce McKinlay 2e5aca8386 Updated ChangeLog
From-SVN: r31982
2000-02-15 08:53:00 +00:00
Tom Tromey 26c3229c0b re GNATS gcj/150 (System.loadLibrary() semantics arn't the same as in the JDK)
* java/lang/natRuntime.cc (_load): On Unix, prefix library name
	with `lib' for loadLibrary.  Fixes PR gcj/150.

From-SVN: r31976
2000-02-15 07:53:11 +00:00
Warren Levy 34540fe35e MPN.java (findLowestBit): Made methods public.
* gnu/gcj/math/MPN.java(findLowestBit): Made methods public.

	* java/math/BigInteger.java(BigInteger(int,int,java.util.Random):
	  New constructor.
	(min): Implemented.
	(max): Implemented.
	(modPow): Rewritten to not use the naive, slow, brute force approach.
	(isProbablePrime): Implemented.
	(testBit): Implemented.
	(flipBit): Implemented.
	(getLowestSetBit): Implemented.

From-SVN: r31966
2000-02-14 10:23:29 +00:00
Anthony Green 97ce4a51fa gcj/142
i386 and i486 should configure the same as i586 and i686.

From-SVN: r31954
2000-02-13 18:07:09 +00:00
Tom Tromey dd16866663 File.java (createTempFile): Use low bits from counter, not high bits.
* java/io/File.java (createTempFile): Use low bits from counter,
	not high bits.

From-SVN: r31946
2000-02-12 20:13:42 +00:00
Anthony Green 95311793fe More thanks.
From-SVN: r31942
2000-02-12 03:49:13 +00:00
Tom Tromey 28ec5077d7 interpret.cc (continue1): Use STOREA, not STOREI, to implement astore instruction.
* interpret.cc (continue1): Use STOREA, not STOREI, to implement
	astore instruction.  From Hans Boehm.

From-SVN: r31939
2000-02-11 23:24:28 +00:00
Warren Levy 136b5d77fc BigInteger.java (BigInteger(String, int)): New constructor.
* java/math/BigInteger.java(BigInteger(String, int)): New constructor.
	(BigInteger(String)): New constructor.
	(not): Rewritten using version from Kawa's BitOps class.
	(valueOf): New private methods from Kawa's BitOps class.
	(swappedOp): ditto.
	(bitOp): ditto.
	(setBitOp): ditto.
	(and): Implemented.
	(or): Implemented.
	(xor): Implemented.
	(andNot): Implemented.
	(clearBit): Implemented.
	(setBit): Implemented.
	(bitCount): Implemented.
	(toByteArray): Implemented.

From-SVN: r31926
2000-02-11 19:09:03 +00:00
Tom Tromey 9d381124d8 * java/io/File.java (nextValue): Now synchronized.
From-SVN: r31925
2000-02-11 18:44:37 +00:00
Tom Tromey 304ccb1075 natFileDescriptorPosix.cc (open): Recognize EXCL flag.
* java/io/natFileDescriptorPosix.cc (open): Recognize EXCL flag.
	* java/io/FileDescriptor.java (EXCL): New static field.
	* java/io/File.java (tmpdir): New static field.
	(createTempFile): New method.
	(nextValue): New method.
	* java/lang/natSystem.cc (init_properties): Set java.io.tmpdir
	property.

From-SVN: r31922
2000-02-11 17:32:52 +00:00
Tom Tromey 26439cc59c jni.h (JNI_FALSE): Renamed from JNI_TRUE; oops.
* include/jni.h (JNI_FALSE): Renamed from JNI_TRUE; oops.
	(jboolean): Declare as an attributed int, not a bool.
	(_Jv_func): Declare differently for C.

From-SVN: r31907
2000-02-10 23:44:05 +00:00
Tom Tromey aaf0766e9f natNativeThread.cc: New file.
* gnu/gcj/jni/natNativeThread.cc: New file.
	* gnu/gcj/jni/NativeThread.java: New file.
	* java/lang/Thread.java (data): Now a RawData.
	* include/jvm.h (_Jv_GetCurrentJNIEnv, _Jv_SetCurrentJNIEnv):
	Declare.
	* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/Thread.h): New target.
	(ordinary_java_source_files): Added NativeThread.java.
	(nat_source_files): Added natNativeThread.cc.
	* java/lang/natThread.cc: Include <jni.h>
	(struct natThread): Added `jni_env' field.
	(_Jv_GetCurrentJNIEnv): New function.
	(_Jv_SetCurrentJNIEnv): Likewise.
	(initialize_native): Initialize jni_env.
	Include RawData.h.
	* jni.cc (ThreadGroupClass): New define.
	(_Jv_JNI_InvokeFunctions): New structure.
	(JNI_GetCreatedJavaVMs): New function.
	(the_vm): New global.
	(JNI_GetDefaultJavaVMInitArgs): New function.
	Include NativeThread.h.
	(NativeThreadClass): New define.
	(_Jv_JNI_EnsureLocalCapacity): Return JNI_ERR, not -1.
	(_Jv_JNI_DestroyJavaVM): New function.
	(_Jv_JNI_AttachCurrentThread): New function.
	(_Jv_JNI_DetachCurrentThread): New function.
	(_Jv_JNI_GetEnv): New function.
	(JNI_CreateJavaVM): New function.
	(_Jv_JNI_GetJavaVM): New function.
	(_Jv_JNIFunctions): Added entry for GetJavaVM.
	* include/jni.h (JavaVMAttachArgs): New structure.
	(JNI_EDETACHED): New define.
	(JNI_EVERSION): Likewise.
	(JavaVM): Define properly.
	(struct JNIInvokeInterface): New structure.
	(class _Jv_JavaVM): New class.
	(JNI_OnLoad, JNI_OnUnload): Declare.
	(JNI_GetDefaultJavaVMInitArgs, JNI_CreateJavaVM,
	JNI_GetCreatedJavaVMs): Declare.
	(JavaVMInitArgs): New typedef.
	(JavaVMOption): Likewise.
	(JNI_ERR): New define.
	(JNI_OK): Likewise.

From-SVN: r31901
2000-02-10 20:31:48 +00:00
Andrew Haley 715bdd8117 interpret.cc: Don't include fdlibm.h.
2000-02-10  Andrew Haley  <aph@cygnus.com>

	* interpret.cc: Don't include fdlibm.h.
	Replace #if with #ifdef throughout.
	Declare extern __ieee754_fmod.
	(continue1): Remove op_getfield, op_getstatic, op_putfield,
	op_putstatic insns.
	* resolve.cc (_Jv_PrepareClass): Use imeth as method pointer.
	Search class hierarchy for superclass vtable.

	* java/lang/natClassLoader.cc (_Jv_UnregisterClass): Don't fall
	off the end of a pointer list.

	* java/lang/natThread.cc (stop): Don't abort, throw an exception
	instead.
	(suspend): Ditto.

From-SVN: r31897
2000-02-10 17:16:30 +00:00
Tom Tromey 7e3b6e312a natRuntime.cc (_load): Call add_library.
* java/lang/natRuntime.cc (_load): Call add_library.
	(loadLibraryInternal): Likewise.

From-SVN: r31877
2000-02-10 00:17:10 +00:00
Tom Tromey c56c8c43b9 natIconv.cc (Input_iconv::finalize): Call iconv_close when handle is not NULL.
* gnu/gcj/convert/natIconv.cc (Input_iconv::finalize): Call
	iconv_close when handle is not NULL.  Thanks to Andrew Haley.
	(Output_iconv::finalize): Likewise.

From-SVN: r31876
2000-02-10 00:14:54 +00:00
Tom Tromey bad196d78e Properties.java (setProperty): New method.
* java/util/Properties.java (setProperty): New method.
	(store): New method.

From-SVN: r31855
2000-02-08 21:30:45 +00:00
Tom Tromey 3fd64b5a09 Runtime.java (_load): Declare.
* java/lang/Runtime.java (_load): Declare.
	(load, loadLibrary): Wrote in terms of _load.
	* java/lang/natRuntime.cc (load): Call JNI_OnLoad if it appears in
	library.
	(loadLibrary): Likewise.
	Include <jni.h>.
	(_load): New method.
	(loadLibrary, load): Removed.

From-SVN: r31846
2000-02-08 00:26:58 +00:00
Tom Tromey 278abd2849 jni.cc (ThrowableClass): New define.
* jni.cc (ThrowableClass): New define.
	(_Jv_JNI_Throw): Check argument.
	(_Jv_JNI_ThrowNew): Likewise.
	(wrap_value): Don't wrap object if it is NULL.
	(_Jv_JNI_DefineClass): Use wrap_value.
	(_Jv_JNI_FindClass): Likewise.
	(_Jv_JNI_GetSuperclass): Likewise.
	(_Jv_JNI_ExceptionOccurred): Likewise.
	(_Jv_JNI_AllocObject): Likewise.
	(_Jv_JNI_GetObjectClass): Likewise.
	(_Jv_JNI_NewString): Likewise.
	(_Jv_JNI_NewStringUTF): Likewise.
	(_Jv_JNI_NewObjectArray): Likewise.
	(_Jv_JNI_GetObjectArrayElement): Likewise.
	(_Jv_JNI_NewPrimitiveArray): Likewise.
	(_Jv_JNI_ToReflectedField): Likewise.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	(_Jv_JNI_AllocObject): Check argument.
	(_Jv_JNI_NewObjectV): Likewise.
	(_Jv_JNI_NewObject): Likewise.
	(_Jv_JNI_NewObjectA): Likewise.
	(_Jv_JNI_GetObjectClass): Likewise.
	(_Jv_JNI_GetField): Likewise.
	(_Jv_JNI_SetField): Likewise.

From-SVN: r31845
2000-02-08 00:23:09 +00:00
Tom Tromey 7c51d9fb95 interpret.cc (PUSHL): Don't use expression statement.
* interpret.cc (PUSHL): Don't use expression statement.
	(PUSHD): Likewise.
	(LOADL): Likewise.
	(STOREL): Likewise.

From-SVN: r31844
2000-02-08 00:17:28 +00:00
Tom Tromey f39b788a15 jni.cc (add_char): Conditional on INTERPRETER.
* jni.cc (add_char): Conditional on INTERPRETER.
	(mangled_name): Likewise.
	(call): Likewise.
	* include/java-interp.h (class _Jv_MethodBase): Conditional on
	INTERPRETER.
	(class _Jv_JNIMethod): Likewise.

From-SVN: r31839
2000-02-07 21:17:30 +00:00
Warren Levy 4f88416976 Added credits for Per Bothner's work on MPN.java and IntNum.java (for
BigInteger).

From-SVN: r31795
2000-02-04 22:11:07 +00:00
Warren Levy 25c449becf Makefile.am: Added MPN.java and BigInteger.java.
* Makefile.am: Added MPN.java and BigInteger.java.
	* Makefile.in: Rebuilt.
	* gnu/gcj/math/MPN.java: New file.
	* java/math/BigInteger.java: New file.

From-SVN: r31794
2000-02-04 22:00:36 +00:00
Tom Tromey facc279fc1 defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase pointers.
* defineclass.cc (handleMethodsBegin): Allocate _Jv_MethodBase
	pointers.
	(handleMethodsEnd): Fixed error messages.  Create a _Jv_JNIMethod
	if the method is native.
	* resolve.cc (ncode): Don't handle native methods.
	(_Jv_JNIMethod::ncode): New method.
	(_Jv_PrepareClass): Handle native methods.
	* jni.cc (call): Renamed from _Jv_JNI_conversion_call.
	Include AbstractMethodError.h.
	(add_char): New function.
	(mangled_name): Likewise.
	* include/java-interp.h (class _Jv_JNIMethod): New class.
	(class _Jv_MethodBase): New class.
	(class _Jv_InterpMethod): Derive from _Jv_MethodBase.
	(_Jv_InterpClass): Changed `interpreted_methods' field to type
	`_Jv_MethodBase'.

	* include/jvm.h (_Jv_FindSymbolInExecutable): Declare.
	* java/lang/natRuntime.cc (libraries_size, libraries_count,
	libraries): New globals.
	(add_library): New function.
	(_Jv_FindSymbolInExecutable): New function.

	* java/lang/natClassLoader.cc (initiated_classes, loaded_classes):
	Now static.

From-SVN: r31790
2000-02-04 20:49:27 +00:00
Andrew Haley 43c5c8a630 Throwable.java (CPlusPlusDemangler): New class.
2000-02-04  Andrew Haley  <aph@cygnus.com>

        * java/lang/Throwable.java (CPlusPlusDemangler): New class.
        (printStackTrace): Use a CPlusPlusDemangler to demangle names.
        * java/lang/natThrowable.cc (printRawStackTrace): Rename
        printStackTrace to printRawStackTrace.

From-SVN: r31785
2000-02-04 16:59:35 +00:00
Tom Tromey 14447d9674 Calendar.java (toString): New method.
* java/util/Calendar.java (toString): New method.
	* java/util/SimpleTimeZone.java (clone): New method.
	(toString): New method.
	* java/util/TimeZone.java (clone): New method.
	* java/text/SimpleDateFormat.java (clone): New method.
	* java/text/NumberFormat.java (clone): New method.
	(equals): New method.
	* java/text/Format.java (clone): New method.
	* java/text/DateFormatSymbols.java (DateFormatSymbols): New
	constructor.
	(clone): New method.
	* java/text/DateFormat.java (clone): New method.
	* java/text/Collator.java (clone): New method.

From-SVN: r31775
2000-02-03 18:26:51 +00:00
Tom Tromey 7d3151e1c9 PipedOutputStream.java (write(byte[], int, int)): New method.
* java/io/PipedOutputStream.java (write(byte[], int, int)): New
	method.

From-SVN: r31774
2000-02-03 17:17:26 +00:00
Tom Tromey ee6713e782 java-interp.h (_Jv_JNI_conversion_call): Declare.
* include/java-interp.h (_Jv_JNI_conversion_call): Declare.
	* resolve.cc (ncode): Use _Jv_JNI_conversion_call when
	constructing the closure if the function is native.
	* jni.cc (_Jv_JNI_conversion_call): Now returns `void'.  No longer
	a template function, #if'd out, or static.
	Include <java-interp.h>.

From-SVN: r31746
2000-02-02 01:55:03 +00:00
Tom Tromey 8928191114 * include/jni.h (class _Jv_JNIEnv): Corrected calls using `...'.
From-SVN: r31745
2000-02-02 01:47:01 +00:00
Tom Tromey 7d34aa4cff * include/jni.h (class _Jv_JNIEnv): Added all C++ inline methods.
From-SVN: r31739
2000-02-01 21:04:44 +00:00
Tom Tromey ee7f72e41f jni.cc (_Jv_JNI_PopLocalFrame): Leave loop when `n == NULL'.
* jni.cc (_Jv_JNI_PopLocalFrame): Leave loop when `n == NULL'.
	(_Jv_JNI_conversion_call): _Jv_JNI_PopLocalFrame will never leave
	`locals == NULL'.
	(wrap_value): New function.
	(_Jv_JNI_CallAnyMethodV): Use it.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_GetField): Use wrap_value; removed specialized version.
	(_Jv_JNI_GetStaticField): Likewise.

From-SVN: r31736
2000-02-01 17:36:05 +00:00
Tom Tromey 5dc489c190 jni.cc (_Jv_JNI_GetField): Specialize for jobject.
* jni.cc (_Jv_JNI_GetField): Specialize for jobject.
	(_Jv_JNI_GetStaticField): Likewise.

From-SVN: r31735
2000-02-01 16:32:21 +00:00
Tom Tromey 7e648cf954 prims.cc (_Jv_MallocUnchecked): New function.
* prims.cc (_Jv_MallocUnchecked): New function.
	(main_init): Call _Jv_JNI_Init.
	* include/jvm.h (_Jv_MallocUnchecked): Declare.
	(_Jv_JNI_Init): Declare.
	* jni.cc: Include Hashtable.h, OutOfMemoryError.h, Integer.h,
	<string.h>.
	(_Jv_JNI_NewGlobalRef): New function.
	(_Jv_JNI_DeleteGlobalRef): New function.
	(_Jv_JNI_DeleteLocalRef): New function.
	(_Jv_JNI_conversion_call): Initialize and clear local reference
	frame.
	(_Jv_JNI_NewLocalRef): New function.
	(struct _Jv_JNI_LocalFrame): New structure.
	(_Jv_JNI_PushLocalFrame): New function.
	(_Jv_JNI_EnsureLocalCapacity): New function.
	(FRAME_SIZE): New define.
	(_Jv_JNI_GetStringChars): Mark string, not characters.
	(_Jv_JNI_ReleaseStringChars): Unmark string, not characters.
	(_Jv_JNI_GetPrimitiveArrayElements): Mark array, not elements.
	(_Jv_JNI_ReleasePrimitiveArrayElements): Unmark array, not
	elements.
	(_Jv_JNI_DefineClass): Make return value a local ref.
	(_Jv_JNI_FindClass): Likewise.
	(_Jv_JNI_GetSuperclass): Likewise.
	(_Jv_JNI_ExceptionOccurred): Likewise.
	(_Jv_JNI_AllocObject): Likewise.
	(_Jv_JNI_GetObjectClass): Likewise.
	(_Jv_JNI_CallAnyMethodV): Likewise.
	(_Jv_JNI_NewString): Likewise.
	(_Jv_JNI_NewStringUTF): Likewise.
	(_Jv_JNI_NewObjectArray): Likewise.
	(_Jv_JNI_GetObjectArrayElement): Likewise.
	(_Jv_JNI_ToReflectedField): Likewise.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	(_Jv_JNIFunctions): Updated table for new functions.
	(_Jv_JNI_Init): New function.
	(mark_for_gc): Wrote.
	(unmark_for_gc): Wrote.
	* include/jni.h (struct JNINativeInterface): Removed name from
	PopLocalFrame parameter.
	(class _Jv_JNIEnv): Added `locals' field.

From-SVN: r31730
2000-02-01 06:14:26 +00:00
Anthony Green ab5cffc5e8 natIconv.cc (read): Minor fixes.
* gnu/gcj/convert/natIconv.cc (read): Minor fixes.
    (write): Ditto.

From-SVN: r31712
2000-01-31 08:56:09 +00:00
Tom Tromey 946efde181 config.h.in: Rebuilt.
* include/config.h.in: Rebuilt.
	* acconfig.h (HAVE_ICONV): Define.
	* configure: Rebuilt.
	* configure.in: Check for `iconv' function.
	* gnu/gcj/convert/BytesToUnicode.java (getDecoder): Try iconv if
	no specific encoder exists.
	* gnu/gcj/convert/UnicodeToBytes.java (getEncoder): Try iconv if
	no specific encoder exists.
	* Makefile.in: Rebuilt.
	* Makefile.am (convert_source_files): Mention Input_iconv.java and
	Output_iconv.java.
	(nat_source_files): Added natIconv.cc.
	* gnu/gcj/convert/natIconv.cc: New file.
	* gnu/gcj/convert/Input_iconv.java: New file.
	* gnu/gcj/convert/Output_iconv.java: New file.

From-SVN: r31708
2000-01-31 04:53:47 +00:00
Tom Tromey d0a844f86b Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (LIBFFIINCS): Added MULTIBUILDTOP.

From-SVN: r31672
2000-01-28 20:00:21 +00:00
Tom Tromey 355dff4cef method.h (JvNumMethods): Moved from Class.h.
* gcj/method.h (JvNumMethods): Moved from Class.h.
	(JvGetFirstMethod): Likewise.
	* java/lang/Class.h (Object): Updated decl of
	_Jv_JNI_ToReflectedField.
	(Object): Added _Jv_JNI_ToReflectedMethod as a friend.
	* Makefile.in: Rebuilt.
	* Makefile.am (java/lang/reflect/Field.h): Added `jboolean'
	argument of _Jv_JNI_ToReflectedField.
	(java/lang/reflect/Constructor.h): Added _Jv_JNI_ToReflectedMethod
	as a friend.
	(java/lang/reflect/Method.h): Likewise.
	* include/jni.h (class _Jv_JNIEnv): Added `klass' member.  Use
	__GCJ_JNI_IMPL__.
	(jweak): New typedef.
	(struct JNINativeInterface): Correctly declare remaining entries.
	* jni.cc: Include Class.h, ClassLoader.h.
	(_Jv_JNI_FindClass): New function.
	(_Jv_JNI_DefineClass): New function.
	(_Jv_JNI_conversion_call): New function.
	(_Jv_JNI_FindClass): Use current class loader to find class.
	(_Jv_JNI_ExceptionCheck): New function.
	(_Jv_JNI_FromReflectedField): Now static.
	(MethodClass): New define.
	(_Jv_JNI_FromReflectedMethod): New function.
	(_Jv_JNI_ToReflectedMethod): Likewise.
	Include Method.h.
	(_Jv_JNI_IsAssignableFrom): Renamed.
	(_Jv_JNI_GetStringRegion): New function.
	Include StringIndexOutOfBoundsException.h.
	(_Jv_JNI_GetStringUTFRegion): New function.
	(_Jv_JNIFunctions): Updated for new functions.
	(_Jv_JNI_GetPrimitiveArrayCritical): New function
	(_Jv_JNI_ReleasePrimitiveArrayCritical): Likewise.
	(_Jv_JNI_GetStringCritical): New function.
	(_Jv_JNI_ReleaseStringCritical): Likewise.
	(get_throwable): Removed.
	(GCJ_JV_JNIENV_FRIEND): Removed.
	(__GCJ_JNI_IMPL__): Define.
	Include method.h.

From-SVN: r31638
2000-01-26 23:56:36 +00:00
Tom Tromey 673fdf6d77 resolve.cc (get_ffi_type_from_signature): Handle case where boolean is an int.
* resolve.cc (get_ffi_type_from_signature): Handle case where
	boolean is an int.

From-SVN: r31637
2000-01-26 23:44:40 +00:00
Tom Tromey 8de7c9a0eb interpret.cc (run): Don't call println.
* interpret.cc (run): Don't call println.
	Don't include PrintStream.h.

From-SVN: r31622
2000-01-26 00:56:36 +00:00
Tom Tromey 8a9220959f natConstructor.cc (newInstance): Use _Jv_CallAnyMethodA.
* java/lang/reflect/natConstructor.cc (newInstance): Use
	_Jv_CallAnyMethodA.
	* include/jvm.h: Declare _Jv_CallAnyMethodA.
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Renamed
	from _Jv_CallNonvirtualMethodA.  Changed interface; overloaded.
	Include <jni.h>.
	(COPY): Removed.
	(invoke): Use _Jv_CallAnyMethodA.
	(VAL): Redefined.
	* java/lang/Class.h (Class): Declare JvGetFirstStaticField,
	JvNumStaticFields, JvNumMethods, and JvGetFirstMethod as friend
	functions.
	(struct _Jv_Method): Added getNextMethod method.
	(JvNumMethods): New function.
	(JvGetFirstMethod): Likewise.
	* gcj/field.h (JvGetFirstStaticField): New function.
	(JvNumStaticFields): Likewise.
	(getNextField): Renamed from getNextInstanceField.
	(struct _Jv_Field): New method getClass.
	* jni.cc: Wrote many new functions.
	* include/jni.h (JNI_TRUE): Define.
	(JNI_FALSE): Likewise.
	(jobject, jclass, jstring, jarray, jthrowable, jobjectArray,
	jbyteArray, jshortArray, jintArray, jlongArray, jbooleanArray,
	jcharArray, jfloatArray, jdoubleArray): New typedefs.
	(jfieldID, jmethodID): Likewise.
	(JNI_COMMIT, JNI_ABORT): New defines.
	(JNINativeMethod): New struct.
	(struct JNINativeInterface): Correctly declared more entries.
	(class _Jv_JNIEnv): Added `ex' member.
	(JNI_VERSION_1_1): New define.
	(JNI_VERSION_1_2): Likewise.

	* boehm.cc (_Jv_MarkObj): Use getNextField, not
	getNextInstanceField.

From-SVN: r31553
2000-01-21 23:50:31 +00:00
Tom Tromey 0b9309b6e4 resolve.cc (StringClass): Removed.
* resolve.cc (StringClass): Removed.
	* defineclass.cc (StringClass): Removed.

From-SVN: r31539
2000-01-20 17:32:26 +00:00
Bryce McKinlay dda482c1e4 Updated NEWS file.
From-SVN: r31522
2000-01-19 23:08:05 +00:00
Tom Tromey 74436afa42 * interpret.cc (PC_REGISTER_ASM): Removed.
From-SVN: r31510
2000-01-19 21:08:03 +00:00
Tom Tromey db70b4bd91 natThrowable.cc: Don't use `#pragma implementation'.
* java/lang/natThrowable.cc: Don't use `#pragma implementation'.
	From Bryce McKinlay.

From-SVN: r31505
2000-01-19 18:59:27 +00:00
Tom Tromey 7c734b1758 * All files: Updated copyright to reflect Cygnus purchase.
From-SVN: r31504
2000-01-19 18:39:27 +00:00
Bryce McKinlay f7ccaa38a7 configure: Rebuilt.
2000-01-18  Bryce McKinlay <bryce@albatross.co.nz>

	* configure: Rebuilt.
	* configure.in: Recognize --disable-interpreter.

From-SVN: r31496
2000-01-19 05:06:03 +00:00
Andrew Haley b9f243c201 name-finder.cc (lookup): Check for dladdr function.
2000-01-18  Andrew Haley  <aph@cygnus.com>

	* name-finder.cc (lookup): Check for dladdr function.
	acconfig.h (HAVE_DLADDR): Add.
	configure.in: Check for HAVE_DLADDR
	configure: Rebuilt.
	include/config.h.in:  Rebuilt.

From-SVN: r31487
2000-01-18 14:42:14 +00:00
Andrew Haley 0447654432 prims.cc (_Jv_RunMain): Set the name of this executable.
2000-01-17  Andrew Haley  <aph@cygnus.com>

	* prims.cc (_Jv_RunMain): Set the name of this executable.

From-SVN: r31486
2000-01-18 14:37:34 +00:00
Tom Tromey d269d25cd3 natThrowable.cc (fillInStackTrace): Return `this' even when backtrace can't be computed.
* java/lang/natThrowable.cc (fillInStackTrace): Return `this' even
	when backtrace can't be computed.

From-SVN: r31483
2000-01-18 06:22:13 +00:00
Tom Tromey 4f5a5d5cdb configure: Rebuilt.
* configure: Rebuilt.
	* configure.in: Fixed typo in AC_CONFIG_SUBDIRS call.

From-SVN: r31482
2000-01-18 05:33:35 +00:00
Tom Tromey 7af8555855 Runtime.java (loadLibraryInternal): Declare.
* java/lang/Runtime.java (loadLibraryInternal): Declare.
	* java/lang/natClassLoader.cc (_Jv_FindClass): Removed dead copy.
	(_Jv_FindClassInCache): Likewise.
	(_Jv_FindClass): Don't conditionalize body on INTERPRETER.
	(findSystemClass): Try to load class from compiled module.
	Include Runtime.h.
	* java/lang/natRuntime.cc (load): Use UTF-8 copy of filename.
	(loadLibrary): Likewise.
	(lt_preloaded_symbols): Define.
	(loadLibraryInternal): New method.
	* include/config.h.in: Rebuilt.
	* acconfig.h (USE_LTDL): Added.
	* Makefile.am (SUBDIRS): Added $(DIRLTDL).
	(INCLUDES): Added $(INCLTDL).b
	(libgcj_la_DEPENDENCIES): Added $(LIBLTDL).
	(libgcj_la_LIBADD): Likewise.
	* aclocal.m4, configure: Rebuilt.
	* configure.in: Added libltdl support.

From-SVN: r31472
2000-01-17 19:22:20 +00:00
Tom Tromey 451f21ef2d * prims.cc (_Jv_PrimClass): Use `JV_STATE_NOTHING', not `0'.
From-SVN: r31467
2000-01-17 18:56:43 +00:00
Andrew Haley 283a159fe3 natThrowable.cc: New file.
2000-01-14  Andrew Haley  <aph@cygnus.com>

	* java/lang/natThrowable.cc: New file.

	* java/lang/Throwable.java (fillInStackTrace): Make native.
	(printStackTrace): Call native method to do this.
	(Throwable): Call fillInStackTrace.
	(stackTrace): New variable.

	* include/jvm.h: Add _Jv_ThisExecutable functions.

	* prims.cc: (_Jv_execName): New variable.
	(catch_segv): Call fillInStackTrace.
	(catch_fpe): Ditto.
	(_Jv_ThisExecutable): New functions.
	(JvRunMain): Set the name of this executable.

	* Makefile.am: Add java/lang/natThrowable.cc.
	Add name-finder.cc.
	* Makefile.in: Rebuilt.

	* acconfig.h: Add HAVE_PROC_SELF_EXE.

	* configure.in: Force link with __frame_state_for in
	FORCELIBGCCSPEC.  Add new checks for backtrace.
	* include/config.h.in: Rebuilt.

	* name-finder.cc: New file.
	* include/name-finder.h: New file.

From-SVN: r31460
2000-01-17 15:45:24 +00:00
Anthony Green 2a198bc4bf StringBuffer.java (StringBuffer): Don't special case null argument.
2000-01-16  Anthony Green  <green@cygnus.com>

	* java/lang/StringBuffer.java (StringBuffer): Don't special case
	null argument.

From-SVN: r31451
2000-01-17 00:00:43 +00:00
Jeff Sturm 2ce7461bd0 StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).
2000-01-16  Jeff Sturm  <jsturm@sigma6.com>

	* java/io/StreamTokenizer.java (nextToken): Avoid unread(TT_EOF).

From-SVN: r31449
2000-01-16 21:33:46 +00:00
Tom Tromey 357100a3ef natClassLoader.cc (_Jv_FindClass): Register `loader', not system loader, as initiating loader.
* java/lang/natClassLoader.cc (_Jv_FindClass): Register `loader',
	not system loader, as initiating loader.

From-SVN: r31395
2000-01-13 18:13:31 +00:00
Tom Tromey 6baee4c5c3 natSystem.cc (getpwuid_adaptor): New adaptor for HP/UX.
* java/lang/natSystem.cc (getpwuid_adaptor): New adaptor for
	HP/UX.  From David Scott Urban.

From-SVN: r31332
2000-01-11 18:58:13 +00:00
Jeff Sturm 0cf69affdd natMath.cc (pow): Cast args to `double', not `jdouble'.
2000-01-10  Jeff Sturm  <jsturm@sigma6.com>

	* java/lang/natMath.cc (pow): Cast args to `double', not
	`jdouble'.
	(atan2): Likewise.
	(IEEEremainder): Likewise.
	* java/lang/mprec.h: Don't wrap includes in `extern "C"'.
	* java/lang/fdlibm.h: Don't wrap includes in `extern "C"'.

From-SVN: r31305
2000-01-10 20:02:47 +00:00
Anthony Green b11f64301a natString.cc (init): Test for overflow condition during out of bounds check.
2000-01-09  Anthony Green  <green@cygnus.com>

	* java/lang/natString.cc (init): Test for overflow condition
	during out of bounds check.
	(getChars): Throw StringIndexOutOfBoundsException, not
	ArrayIndexOutOfBoundsException.
	(getBytes): Ditto.
	(regionMatches): Obey case option during string comparison.

	* configure.host (ligcj_interpreter): New variable.  Enable
	interpreter by default on IA-32.
	* configure.in:  Examine libgcj_interpreter.
	* configure: Rebuilt.

From-SVN: r31300
2000-01-09 22:25:54 +00:00
Tom Tromey be63d11f60 * mauve-libgcj: Don't disable ClassTest.
From-SVN: r31278
2000-01-07 20:42:26 +00:00
Tom Tromey bd3a924b10 * java/lang/natClass.cc (getClasses): Wrote.
From-SVN: r31276
2000-01-07 20:23:01 +00:00
Tom Tromey 55ff3de705 natClass.cc (_getConstructors): Correctly check whether method name is the init name.
* java/lang/natClass.cc (_getConstructors): Correctly check
	whether method name is the init name.
	(getMethod): Look at accflags on method in `klass', not `this'.

From-SVN: r31258
2000-01-06 18:18:15 +00:00
Tom Tromey 41ecf9300e natClass.cc (getMethod): Compute offset relative to `klass's methods table, not `this's table.
* java/lang/natClass.cc (getMethod): Compute offset relative to
	`klass's methods table, not `this's table.

	* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA):
	In unwrapping/widening case, check whether `k' is null, not
	whether it is primitive.  Initialize `num' from `argelts', not
	`paramelts'.  Correct create and pass arguments to ffi_call.
	Don't let presence of `this' argument affect index used to look in
	argument arrays.
	(COPY): Set appropriate element in `values' vector.

From-SVN: r31253
2000-01-06 00:56:21 +00:00
Tom Tromey d6ab24c514 * java/lang/natClass.cc: Include <gcj/method.h>.
From-SVN: r31249
2000-01-05 22:52:54 +00:00
Tom Tromey 1258cadadc Class.h (_getMethods): Correctly declare as private, not public.
* java/lang/Class.h (_getMethods): Correctly declare as private,
	not public.

From-SVN: r31246
2000-01-05 22:29:27 +00:00
Tom Tromey 6f2b93eb2f Class.h (_getMethods): Declare.
* java/lang/Class.h (_getMethods): Declare.
	* java/lang/Class.java (_getMethods): Declare.
	* java/lang/natClass.cc (getDeclaringClass): Always return NULL.
	(getDeclaredClasses): Always return empty array.
	(_getMethods): New method.
	(getMethods): Wrote.
	(getDeclaredMethod): Return `rmethod'.
	(finit_name): New global.
	(getDeclaredMethods): Check for finit_name.
	(_getMethods): Likewise.
	(getMethod): Only return public methods.

From-SVN: r31245
2000-01-05 22:22:10 +00:00
Tom Tromey 5dab1948f6 natMethod.cc (get_ffi_type): Test size of jboolean and select correct ffi type on that basis.
* java/lang/reflect/natMethod.cc (get_ffi_type): Test size of
	jboolean and select correct ffi type on that basis.
	(_Jv_CallNonvirtualMethodA): Handle `void' return type.
	Constructor call always has `void' return type.

From-SVN: r31242
2000-01-05 17:23:34 +00:00
Tom Tromey 95c6cc0ab5 Class.h (getSignature): Updated.
* java/lang/Class.h (getSignature): Updated.
	* java/lang/Class.java (getSignature): Updated.
	* java/lang/natClass.cc (getSignature): Added `is_constructor'
	argument.
	(getConstructor): Ensure constructor is public.
	(_getConstructors): Check for public-ness of constructor when
	`declared' is false, not when it is true.

From-SVN: r31241
2000-01-05 16:35:20 +00:00
Warren Levy 730ecdd3c3 natPlainDatagramSocketImpl.cc (peek): Removed unnecesary comment.
* java/net/natPlainDatagramSocketImpl.cc (peek): Removed unnecesary
	comment.
	(receive): Set the sender's address in the DatagramPacket.

From-SVN: r31218
2000-01-04 22:41:58 +00:00
Tom Tromey 0f918fea8b [multiple changes]
2000-01-04  Tom Tromey  <tromey@cygnus.com>

	* java/lang/reflect/natConstructor.cc (newInstance): Pass
	declaring class as return_type argument to
	_Jv_CallNonvirtualMethodA.
	* java/lang/reflect/natMethod.cc (_Jv_CallNonvirtualMethodA): In
	constructor case, create object and use it as `this' argument.
	* java/lang/Class.h (_getConstructors): Declare.
	(_getFields): Declare.
	* java/lang/Class.java (getConstructors): Wrote.
	(_getConstructors): New native method.
	(getDeclaredConstructors): Wrote.
	(_getFields): Declare new native method.
	* java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Removed
	incorrect comment.
	(getMethod): Work correctly when class is primitive.
	(getDeclaredMethods): Likewise.  Compute offset using `method',
	not `mptr'.
	(getDeclaredMethod): Likewise.
	(getConstructor): Wrote.
	(ConstructorClass): New define.
	(getDeclaredConstructor): Wrote.
	(_getConstructors): New method.
	(_getFields): New method.
	(getFields): Wrote.

	* Makefile.in: Rebuilt.
	* Makefile.am (AM_CXXFLAGS): Added -D_GNU_SOURCE.

	* prims.cc: Remove `#pragma implementation'.
	* gcj/array.h: Remove `#pragma interface'.

	* prims.cc (_Jv_equaln): New function.
	* java/lang/Class.java (getSignature): Declare.
	* resolve.cc (_Jv_LookupDeclaredMethod): Moved to natClass.cc.
	* java/lang/natClass.cc (_Jv_LookupDeclaredMethod): Moved from
	resolve.cc.
	(getSignature): New method.
	(getDeclaredMethod): Wrote.
	(getMethod): Wrote.
	Include StringBuffer.h.
	* java/lang/Class.h (Class): Added _Jv_FromReflectedConstructor
	as a friend.  Unconditionally declare _Jv_LookupDeclaredMethod as
	a friend.
	(getSignature): Declare.
	* include/jvm.h (_Jv_GetTypesFromSignature): Declare.
	(_Jv_equaln): Declare.
	(_Jv_CallNonvirtualMethodA): Declare.
	* Makefile.in: Rebuilt.
	* Makefile.am (nat_source_files): Added natConstructor.cc.
	(java/lang/reflect/Constructor.h): New target.
	* java/lang/reflect/natConstructor.cc: New file.
	* java/lang/reflect/Constructor.java (newInstance): Now native.
	(declaringClass): Renamed from decl_class.
	(offset): Renamed from index.
	(getType): New native method.
	(getModifiers): Now native.
	(getParameterTypes): Call getType if required.
	(hashCode): Include hash code from declaring class.
	(modifiers): Removed.
	(toString): Call getType if required.
	* gcj/method.h (_Jv_FromReflectedConstructor): New function.
	* java/lang/reflect/natMethod.cc (hack_call): New method.
	Removed `#if 0' around FFI code.
	Include <gnu/gcj/RawData.h>.
	(invoke): Use _Jv_CallNonvirtualMethodA.  Throw
	IllegalArgumentException when argument object and class disagree.
	(_Jv_GetTypesFromSignature): New function.
	(getType): Use it.
	(ObjectClass): New define.
	(_Jv_CallNonvirtualMethodA): New function.
	* java/lang/reflect/Method.java (hack_trampoline): New method.
	(hack_call): New native method.

1999-12-21  Per Bothner  <per@bothner.com>

	* java/lang/natClass.cc (getDeclaredMethods): Correctly compute
	offset in new Method.

From-SVN: r31199
2000-01-04 08:46:52 +00:00
Bryce McKinlay 43cbc9430d natObject.cc (notify): Throw message with IllegalMonitorStateException.
1999-12-22  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/natObject.cc (notify): Throw message with
        IllegalMonitorStateException.
        (notifyAll): Ditto.
        (wait): Ditto.
        * java/lang/Thread.java (isInterrupted): Don't clear interrupt_flag.
        (isInterrupted_): New function, which does clear interrupt_flag.
        (interrupt): Use `isInterrupted_'.
        * java/lang/natThread.cc (interrupt): Add comment.
        (join): Set `Prev' in joiner loop.
        Change various calls to `isInterrupted' to use `isInterrupted_'.
        * posix-threads.cc (_Jv_CondWait): Allways use pthread_cond_timedwait
        on linux. Set result to 0 on an interrupt. Test interrupted status
        of java Thread object directly.
        FLAG_INTERRUPTED: removed.
        (_Jv_ThreadStart): Throw OutOfMemoryError if pthread_create fails.
        (_Jv_ThreadInterrupt): Don't set FLAG_INTERRUPTED.
        (_Jv_InitThreads): Don't block SIGINT.
        (_Jv_ThreadWait): Don't configure SIGINT handler.

From-SVN: r31082
1999-12-24 01:00:46 +00:00
Tom Tromey f9f1f4a651 * mauve-libgcj: Added java.lang.reflect.Modifier.toString12.
From-SVN: r31061
1999-12-21 23:50:01 +00:00
Tom Tromey bcc7684092 Modifier.java (STRICT): New constant.
* java/lang/reflect/Modifier.java (STRICT): New constant.
	(isStrict): New method.
	(toString): Added `strict'.

From-SVN: r31040
1999-12-20 23:05:21 +00:00
Anthony Green d352598f80 Alpha Linux changes.
From-SVN: r31030
1999-12-20 05:55:34 +00:00
Anthony Green 7013e7cda9 libgcjdata.c: New file.
1999-12-19  Anthony Green  <green@cygnus.com>

        * libgcjdata.c: New file.
        * libgcj.spec.in: Use @LIBDATASTARTSPEC@ in startfile.
        * configure: Rebuilt.
        * configure.in (LIBDATASTARTSPEC): Force data with a known name
        into the program.
        * Makefile.in: Rebuilt.
        * Makefile.am: Build libgcjdata.a.

        * libgcj.spec.in: Use @FORCELIBGCCSPEC@ in startfile.
        * configure: Rebuilt.
        * configure.in (FORCELIBGCCSPEC): Force important parts of libgcc
        into every program.

From-SVN: r31027
1999-12-20 02:18:11 +00:00
Tom Tromey ccfe7d0a0d re GNATS libgcj/111 (bug in reflection code)
* java/lang/reflect/Method.java (toString): Call getType if
	required.  Partial fix for PR libgcj/111.  From Per Bothner.

From-SVN: r31002
1999-12-18 00:44:00 +00:00
Tom Tromey ce63fdce90 * java/lang/natPosixProcess.cc (startProcess): Don't use sprintf.
From-SVN: r30996
1999-12-17 16:06:17 +00:00
Bryce McKinlay 5ac99d9adc Boolean.java (Boolean(String)): Set Value' to false on a null String constructor parameter.
1999-12-16  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/lang/Boolean.java (Boolean(String)): Set Value' to false on a
        null String constructor parameter.
        * java/net/natPlainSocketImpl.cc: Remove unneccessary sprintf calls
        for exception messages.
        BooleanClass: declare.
        (setOption): Use BooleanClass instead of Class.forName() for
        instanceof test.
        (bind): Cast 4th parameter of setsockopt to char *' for
        compatibility with older Solaris headers.
        * java/net/natPlainDatagramSocketImpl.cc: Remove unneccessary
        sprintf calls for exception messages.
        BooleanClass, IntegerClass: declare.
        (setOption): Use BooleanClass and IntegerClass, not Class.forName()
        for instanceof test.

From-SVN: r30988
1999-12-17 05:11:28 +00:00
Tom Tromey 6150df627a natSystem.cc (init_properties): Don't set user.name or user.home if NO_GETUID defined.
* java/lang/natSystem.cc (init_properties): Don't set user.name or
	user.home if NO_GETUID defined.  Only set user.dir if getcwd
	exists.

	* include/config.h.in: Rebuilt.
	* acconfig.h (NO_GETUID): New define.
	* configure.in: Rebuilt.
	* configure.in: Define NO_GETUID in cross case.  Check for getcwd
	in native case.

From-SVN: r30964
1999-12-15 22:38:56 +00:00
Tom Tromey c97e511d31 re GNATS libgcj/117 (_Jv_PthreadCheckMonitor test is not portable.)
* include/posix-threads.h (_Jv_PthreadCheckMonitor): Handle case
	where no recursive mutexes exist.  Fixes PR libgcj/117.

From-SVN: r30847
1999-12-09 16:57:27 +00:00
Anthony Green d3189ab7da jvm.h: Declare many functions with __attribute__((__malloc__)).
* include/jvm.h: Declare many functions with
	__attribute__((__malloc__)).
	* gcj/javaprims.h: Ditto.

From-SVN: r30794
1999-12-06 06:33:56 +00:00
Anthony Green 38a7fbac35 Updated the thanks list.
From-SVN: r30764
1999-12-03 03:00:39 +00:00
Bryce McKinlay aa620e4294 natString.cc (equalsIgnoreCase): return false if anotherString is null.
* java/lang/natString.cc (equalsIgnoreCase): return false if
        anotherString is null.
        * java/lang/Boolean.java (valueOf): return FALSE if argument is
        null.

From-SVN: r30763
1999-12-02 19:59:30 +00:00
Bryce McKinlay c390b4a687 ServerSocket.java (ServerSocket): Bind to any interface if bindAddr is null.
1999-12-02  Bryce McKinlay  <bryce@albatross.co.nz>

        * libjava/java/net/ServerSocket.java (ServerSocket): Bind to any
        interface if bindAddr is null.

From-SVN: r30755
1999-12-02 10:09:24 +00:00
Tom Tromey 4cb74b7695 re GNATS libgcj/98 (pthread_mutex_init in libjava/posix-threads.cc)
* posix-threads.cc (_Jv_MutexInit): Use _Jv_PthreadGetMutex to get
	mutex to initialize.  Initialize `count' if required.
	Fixes PR libgcj/98.

From-SVN: r30725
1999-11-30 18:53:15 +00:00
Per Bothner 9b811d11de exception.cc: Remove prototype declarations for malloc and free.
1999-11-27  Per Bothner  <per@bothner.com>

	* exception.cc:  Remove prototype declarations for malloc and free.
	These clash with recent versions of glibc, which specifies `throws ()'
	when __cplusplus is defined.  Instead, #include <stdlib.h>.

From-SVN: r30709
1999-11-29 19:43:55 +00:00
Tom Tromey 93d4556218 prims.cc (_Jv_NewObjectArray): Use _Jv_GetArrayElementFromElementType.
* prims.cc (_Jv_NewObjectArray): Use
	_Jv_GetArrayElementFromElementType.
	(_Jv_NewPrimArray): Likewise.
	* java/lang/natObject.cc (clone): Use
	_Jv_GetArrayElementFromElementType instead of sizeof.
	* java/lang/natSystem.cc (arraycopy): Use
	_Jv_GetArrayElementFromElementType.
	* include/jvm.h (_Jv_GetArrayElementFromElementType): New
	function.

From-SVN: r30655
1999-11-25 00:36:51 +00:00
Bryce McKinlay 429d7c746f re GNATS java.net/57 (potential buffer overruns)
1999-11-23  Bryce McKinlay  <bryce@albatross.co.nz>

        * java/net/natPlainSocketImpl.cc: Fix potential buffer overruns in
        Exception messages. PR java.net/57.
        (bind): set SO_REUSEADDR before bind.
        * java/net/natPlainDatagramSocketImpl.cc: Fix potential buffer
        overruns. PR java.net/57.

From-SVN: r30637
1999-11-23 11:40:26 +00:00
Tom Tromey 3cf88fb4e8 sjlj jumbo patch
From-SVN: r30591
1999-11-19 19:13:42 +00:00
Tom Tromey 8cb9ab4b7e * no-threads.cc (_Jv_ThreadStart): Use JvFail and not JvAssert.
From-SVN: r30569
1999-11-18 07:32:50 +00:00