[kaffe] CVS kaffe (guilhem): Big NIO merge & a little fix for java.text & a little cleanup for VMObjectStream
Kaffe CVS
Kaffe Mailing List <kaffe@kaffe.org>
Mon Apr 12 04:57:02 2004
PatchSet 4635
Date: 2004/04/12 11:39:52
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
Big NIO merge & a little fix for java.text & a little cleanup for VMObjectStreamClass
2004-04-11 Guilhem Lavaux <guilhem@kaffe.org>
* configure.ac: Added libraries/clib/nio to KAFFELIBRARYPATH.
* libraries/javalib/bootstrap.classlist: Added some new NIO classes.
* libraries/javalib/Klasses.jar.bootstrap: Regenerated.
* include/jsyscall.h: Fixed punctuation.
* include/Makefile.am: Added some new JNI headers to generate.
* libraries/clib/io/FileDescriptor.c: Removed.
* libraries/clib/net/PlainSocketImpl.c,
libraries/clib/net/PlainDatagramSocketImpl.c:
Removed all occurrences of FileDescriptor.
* kaffe/kaffevm/systems/unix-jthreads/syscalls.c: Fixed flags
generation.
* libraries/clib/native/ObjectInputStream.c,
libraries/clib/io/ObjectInputStream.c: Moved ObjectInputStream native
methods into the IO library
(setXXNative0): Upgraded to latest GNU Classpath version.
* libraries/javalib/java/io/VMObjectStreamClass.java,
libraries/javalib/java/io/ObjectStreamField.java
(setXXNative,setXXField): Cleant up exception handling.
* libraries/clib/native/System.c:
Added a new property for NIO: gnu.cpu.endian
* libraries/clib/native/UNIXProcess.c,
libraries/javalib/kaffe/lang/UNIXProcess.java: Upgraded the code
to use NIO entry code instead of standard IO.
* libraries/clib/nio/Channels.c,
libraries/clib/nio/FileChannelImpl.c: New files.
* libraries/clib/nio/DirectByteBufferImpl.c: Use JNI now.
(shiftDown, adjustAddress, getImpl) New methods.
* libraries/clib/nio/NIOServerSocket.c: Use JNI.
* libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java
(PlainDatagramSocketImpl): Do not use FileDescriptor anymore.
(RECEIVE_LOCK, SEND_LOCK): New private fields.
(send, receive): Call send0 and receive0 in a synchronized space.
(send0, receive0): New name for native methods.
* libraries/javalib/gnu/java/net/PlainSocketImpl.java
(PlainSocketImpl): Do not use FileDescriptor anymore.
GNU Classpath text synchronization.
2004-04-02 Tom Tromey <tromey@redhat.com>
* java/text/AttributedCharacterIterator.java (Attribute): Removed
redundant modifiers.
GNU Classpath NIO synchronization.
2004-04-09 Jeroen Frijters <jeroen@frijters.net>
* gnu/java/nio/channels/FileChannelImpl.java: (fd, mode) Made private.
(length, pos) Removed. (FileChannelImpl (int, int)) Removed.
(implPosition, seek, implTruncate, unlock, lock) Added throws clause.
2004-04-09 Jeroen Frijters <jeroen@frijters.net>
* java/io/FileDescriptor.java: (FileDescriptor) Added public
constructor. (valid) Added null check.
2004-04-08 Michael Koch <konqueror@gmx.de>
* java/io/BufferedWriter.java,
java/io/FilterInputStream.java,
java/io/ObjectInputStream.java:
More javadoc and coding style work.
2004-04-08 Michael Koch <konqueror@gmx.de>
* java/nio/DirectByteBufferImpl.java,
java/nio/MappedByteBuffer.java,
java/nio/MappedByteBufferImpl.java:
Forgot to commit this during the big NIO commit.
2004-04-08 Michael Koch <konqueror@gmx.de>
* java/nio/channels/DatagramChannel.java,
java/nio/channels/FileChannel.java,
java/nio/channels/FileLock.java,
java/nio/channels/Pipe.java,
java/nio/channels/ServerSocketChannel.java,
java/nio/channels/SocketChannel.java,
java/nio/channels/spi/AbstractInterruptibleChannel.java,
java/nio/channels/spi/AbstractSelectableChannel.java,
java/nio/channels/spi/AbstractSelectionKey.java,
java/nio/channels/spi/AbstractSelector.java,
java/nio/channels/spi/SelectorProvider.java:
Reworked coding style and javadocs.
2004-04-08 Michael Koch <konqueror@gmx.de>
* java/nio/Buffer.java,
java/nio/ByteBufferImpl.java,
java/nio/CharBufferImpl.java,
java/nio/DoubleBufferImpl.java,
java/nio/DoubleViewBufferImpl.java,
java/nio/FloatBufferImpl.java,
java/nio/FloatViewBufferImpl.java,
java/nio/IntBufferImpl.java,
java/nio/IntViewBufferImpl.java,
java/nio/LongBufferImpl.java,
java/nio/LongViewBufferImpl.java,
java/nio/ShortBufferImpl.java,
java/nio/ShortViewBufferImpl.java,
java/nio/channels/AlreadyConnectedException.java,
java/nio/channels/AsynchronousCloseException.java,
java/nio/channels/ByteChannel.java,
java/nio/channels/CancelledKeyException.java,
java/nio/channels/Channel.java,
java/nio/channels/ClosedByInterruptException.java,
java/nio/channels/ClosedChannelException.java,
java/nio/channels/ClosedSelectorException.java,
java/nio/channels/ConnectionPendingException.java,
java/nio/channels/FileLockInterruptionException.java,
java/nio/channels/GatheringByteChannel.java,
java/nio/channels/IllegalBlockingModeException.java,
java/nio/channels/IllegalSelectorException.java,
java/nio/channels/InterruptibleChannel.java,
java/nio/channels/NoConnectionPendingException.java,
java/nio/channels/NonReadableChannelException.java,
java/nio/channels/NonWritableChannelException.java,
java/nio/channels/NotYetBoundException.java,
java/nio/channels/NotYetConnectedException.java,
java/nio/channels/OverlappingFileLockException.java,
java/nio/channels/ReadableByteChannel.java,
java/nio/channels/ScatteringByteChannel.java,
java/nio/channels/SelectableChannel.java,
java/nio/channels/SelectionKey.java,
java/nio/channels/Selector.java,
java/nio/channels/UnresolvedAddressException.java,
java/nio/channels/UnsupportedAddressTypeException.java,
java/nio/channels/WritableByteChannel.java,
java/nio/charset/spi/CharsetProvider.java:
Reworked coding style and javadocs.
2004-04-08 Per Bothner <per@bothner.com>
* java/nio/channels/FileChannelImpl.java: Moved to package
gnu/java/nio/channels, since we need to refer to it from java.io.
* java/nio/channels/natFileChannelImpl.cc: Removed file.
* gnu/java/nio/channels/FileChannelImpl.java: New class, renamed
from java/nio/channels. Don't depend on FileDescriptor.
(in, out, err): New static fields.
(mode): New field.
(SET, CUR, READ, WRITE, APPEND, EXCL, SYNC, DSYNC): Moved constants
from FileDescriptor.
(by): Removed MappedByteBuffer field.
(map): New working implementation.
* java/io/FileDescriptor.java: Implement on top of FileChannel.
Remove native methods.
* gnu/java/nio/FileLockImpl.java (fd): Remove field, replacing it by:
(ch): New FileChannelImpl field. Update constructor to match.
(releaseImpl): Remove native method. Instead ...
(release): Call unlock on channel.
* java/io/FileInputStream.java (ch): Change type to FileChannelImpl.
(<init>(File)): Allocate a FileChannelImpl, not a FileDescriptor.
(<init>(FileChannelImpl)): New package-private constructor.
(<init>(FileDescriptor)): Extract FileChannelImpl from arg.
(available, close, read, skip): Implement using FileChannelImpl.
(getFD): Allocate FileDescriptor if needed.
(getChannel): Is now trivial.
* java/io/FileOutputStream.java: Corresponding changes.
* java/io/RandomAccessFile.java: Corresponding changes.
* java/nio/MappedByteBuffer.java: (forceImpl, isLoadedImpl, loadImpl,
unmapImpl): New dummy methods, to be overridden by subclass.
(finalize, isLoaded, load, force): New methods.
* java/nio/MappedByteBufferImpl.java: More-or-less rewrite.
Now works, at least for read mapping.
2004-04-08 Per Bothner <per@bothner.com>
* java/nio/CharBufferImpl.java: Inline super constructor.
* java/nio/DoubleBufferImpl.java: Likewise.
* java/nio/FloatBufferImpl.java: Likewise.
* java/nio/IntBufferImpl.java: Likewise.
* java/nio/LongBufferImpl.java: Likewise.
* java/nio/ShortBufferImpl.java: Likewise.
* java/nio/CharBuffer.java: Remove unused constructor.
* java/nio/DoubleBuffer.java: Likewise.
* java/nio/FloatBuffer.java: Likewise.
* java/nio/IntBuffer.java: Likewise.
* java/nio/LongBuffer.java: Likewise.
* java/nio/ShortBuffer.java: Likewise.
* java/nio/CharViewBufferImpl.java: New convenience constructor.
Fix buggy call to super constructor.
* java/nio/DoubleViewBufferImpl.java: Likewise.
* java/nio/FloatViewBufferImpl.java: Likewise.
* java/nio/IntViewBufferImpl.java: Likewise.
* java/nio/LongViewBufferImpl.java: Likewise.
* java/nio/ShortViewBufferImpl.java: Likewise.
* java/nio/ByteBuffer.java (endian): Make non-private so other
java.nio classes can inherit it.
(<init>): Don't bother clearing array_offset.
* java/nio/ByteBuffer.java (allocate): Re-implement using wrap.
* java/nio/ByteBuffer.java (get(byte[],int,int)): Check underflow.
Remove redundant test.
* java/nio/ByteBufferImpl.java (asCharBuffer, asShortBuffer,
asIntBuffer, asLongBuffer, asFloatBuffer, asDoubleBuffer):
Use new XxxViewBufferImpl constructors.
* java/nio/MappedByteBufferImpl.java: Likewise.
* java/nio/DirectByteBufferImpl.java: Likewise.
* java/nio/ByteBufferImpl.java: Remove one constructor.
Inline super in remaining constructor.
* java/nio/ByteBuffer.java: Remove unused constructor.
* java/nio/ByteBufferImpl.java (shiftDown): New optimized method.
* java/nio/ByteBufferImpl.java (get, put): Add array_offset.
* java/nio/DirectByteBufferImpl.java (owner): New field.
(offset): Remove unused field.
(<init>): Modify one and add another constructor. Change callers.
(allocateDirect): Removed - not used.
(getImpl, putImpl): Make static and pass address explicitly,
to make them useful for MappedByteBufferImpl.
(get, put): Check for underflow. Modify for new getImpl.
(getImpl): New native method where target is array.
(get(byte[],int,int)): Use the above.
(adjustAddress): New static native method.
(slice, duplicate, asReadOnly): New implementations.
2004-04-08 Per Bothner <per@bothner.com>
* java/nio/ByteBuffer.java (shiftDown): New helper method.
* java/nio/ByteBufferImpl.java (compact): Use new shiftDown method.
* sava/nio/ByteBufferHelper.java: Remove redundant 'final' specifiers.
Pass ByteOrder parameter to most methods, since the underlying
ByteBuffer's order isn't always what we should use.
* java/nio/ByteBufferImpl.java: Pass byte-order various places.
* java/nio/DirectByteBufferImpl.java: Likewise.
Use ByteBufferHelper methods.
* java/nio/MappedByteBufferImpl.java: Likewise.
(compact): Use shiftDown.
* java/nio/CharViewBufferImpl.java (<init>): Pass byte-order.
(get, put): Use ByteBufferHelper.
(compact): Use new shiftDown method.
(duplicate(boolean)): New helper method.
(duplicate, asReadOnlyBuffer): Use it.
(order): Return endian field.
* java/nio/DoubleViewBufferImpl.java: Likewise.
* java/nio/FloatViewBufferImpl.java: Likewise.
* java/nio/IntViewBufferImpl.java: Likewise.
* java/nio/LongViewBufferImpl.java: Likewise.
* java/nio/ShortViewBufferImpl.java: Likewise.
* java/nio/CharViewBufferImpl.java (subsequence): Redundant test.
* java/nio/DirectByteBufferImpl.java (shiftDown): New native method.
(compact): Re-implement using shiftDown.
Members:
ChangeLog:1.2211->1.2212
configure:1.306->1.307
configure.ac:1.6->1.7
include/Makefile.am:1.55->1.56
include/Makefile.in:1.151->1.152
include/jsyscall.h:1.15->1.16
kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.12->1.13
libltdl/config-h.in:1.17->1.18
libraries/clib/io/FileDescriptor.c:1.10->1.11(DEAD)
libraries/clib/io/Makefile.am:1.11->1.12
libraries/clib/io/Makefile.in:1.96->1.97
libraries/clib/io/ObjectInputStream.c:INITIAL->1.1
libraries/clib/native/Makefile.am:1.30->1.31
libraries/clib/native/Makefile.in:1.130->1.131
libraries/clib/native/ObjectInputStream.c:1.20->1.21(DEAD)
libraries/clib/native/System.c:1.41->1.42
libraries/clib/native/UNIXProcess.c:1.27->1.28
libraries/clib/net/PlainDatagramSocketImpl.c:1.41->1.42
libraries/clib/net/PlainSocketImpl.c:1.41->1.42
libraries/clib/nio/Channels.c:INITIAL->1.1
libraries/clib/nio/DirectByteBufferImpl.c:1.1->1.2
libraries/clib/nio/FileChannelImpl.c:INITIAL->1.1
libraries/clib/nio/Makefile.am:1.4->1.5
libraries/clib/nio/Makefile.in:1.23->1.24
libraries/clib/nio/NIOServerSocket.c:1.2->1.3
libraries/javalib/Klasses.jar.bootstrap:1.51->1.52
libraries/javalib/Makefile.am:1.180->1.181
libraries/javalib/Makefile.in:1.242->1.243
libraries/javalib/bootstrap.classlist:1.43->1.44
libraries/javalib/essential.files:1.42->1.43
libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java:1.2->1.3
libraries/javalib/gnu/java/net/PlainSocketImpl.java:1.4->1.5
libraries/javalib/gnu/java/nio/ChannelInputStream.java:1.2->1.3
libraries/javalib/gnu/java/nio/ChannelOutputStream.java:1.2->1.3
libraries/javalib/gnu/java/nio/DatagramChannelImpl.java:1.9->1.10
libraries/javalib/gnu/java/nio/FileLockImpl.java:1.6->1.7
libraries/javalib/gnu/java/nio/InputStreamChannel.java:1.2->1.3
libraries/javalib/gnu/java/nio/NIODatagramSocket.java:1.3->1.4
libraries/javalib/gnu/java/nio/NIOServerSocket.java:1.3->1.4
libraries/javalib/gnu/java/nio/NIOSocket.java:1.4->1.5
libraries/javalib/gnu/java/nio/OutputStreamChannel.java:1.2->1.3
libraries/javalib/gnu/java/nio/SelectorImpl.java:1.8->1.9
libraries/javalib/gnu/java/nio/SelectorProviderImpl.java:1.4->1.5
libraries/javalib/gnu/java/nio/ServerSocketChannelImpl.java:1.7->1.8
libraries/javalib/gnu/java/nio/SocketChannelImpl.java:1.12->1.13
libraries/javalib/gnu/java/nio/channels/FileChannelImpl.java:INITIAL->1.1
libraries/javalib/gnu/java/nio/charset/UTF_16.java:1.2->1.3
libraries/javalib/gnu/java/nio/charset/UTF_16BE.java:1.2->1.3
libraries/javalib/gnu/java/nio/charset/UTF_16LE.java:1.2->1.3
libraries/javalib/java/io/BufferedWriter.java:1.7->1.8
libraries/javalib/java/io/DataInput.java:1.6->1.7
libraries/javalib/java/io/DataInputStream.java:1.19->1.20
libraries/javalib/java/io/FileDescriptor.java:1.6->1.7
libraries/javalib/java/io/FileInputStream.java:1.16->1.17
libraries/javalib/java/io/FileOutputStream.java:1.11->1.12
libraries/javalib/java/io/FilterInputStream.java:1.10->1.11
libraries/javalib/java/io/InputStream.java:1.10->1.11
libraries/javalib/java/io/InputStreamReader.java:1.14->1.15
libraries/javalib/java/io/ObjectInputStream.java:1.35->1.36
libraries/javalib/java/io/PushbackReader.java:1.3->1.4
libraries/javalib/java/io/RandomAccessFile.java:1.23->1.24
libraries/javalib/java/io/StringWriter.java:1.7->1.8
libraries/javalib/java/io/Writer.java:1.7->1.8
libraries/javalib/java/nio/Buffer.java:1.6->1.7
libraries/javalib/java/nio/ByteBufferImpl.java:1.4->1.5
libraries/javalib/java/nio/CharBufferImpl.java:1.3->1.4
libraries/javalib/java/nio/DirectByteBufferImpl.java:1.5->1.6
libraries/javalib/java/nio/DoubleBufferImpl.java:1.3->1.4
libraries/javalib/java/nio/DoubleViewBufferImpl.java:1.2->1.3
libraries/javalib/java/nio/FloatBufferImpl.java:1.3->1.4
libraries/javalib/java/nio/FloatViewBufferImpl.java:1.2->1.3
libraries/javalib/java/nio/IntBufferImpl.java:1.3->1.4
libraries/javalib/java/nio/IntViewBufferImpl.java:1.2->1.3
libraries/javalib/java/nio/LongBufferImpl.java:1.3->1.4
libraries/javalib/java/nio/LongViewBufferImpl.java:1.2->1.3
libraries/javalib/java/nio/MappedByteBuffer.java:1.6->1.7
libraries/javalib/java/nio/MappedByteBufferImpl.java:1.4->1.5
libraries/javalib/java/nio/ShortBufferImpl.java:1.3->1.4
libraries/javalib/java/nio/ShortViewBufferImpl.java:1.2->1.3
libraries/javalib/java/nio/channels/AlreadyConnectedException.java:1.1->1.2
libraries/javalib/java/nio/channels/AsynchronousCloseException.java:1.1->1.2
libraries/javalib/java/nio/channels/ByteChannel.java:1.1->1.2
libraries/javalib/java/nio/channels/CancelledKeyException.java:1.1->1.2
libraries/javalib/java/nio/channels/Channel.java:1.2->1.3
libraries/javalib/java/nio/channels/Channels.java:1.5->1.6
libraries/javalib/java/nio/channels/ClosedByInterruptException.java:1.1->1.2
libraries/javalib/java/nio/channels/ClosedChannelException.java:1.1->1.2
libraries/javalib/java/nio/channels/ClosedSelectorException.java:1.1->1.2
libraries/javalib/java/nio/channels/ConnectionPendingException.java:1.1->1.2
libraries/javalib/java/nio/channels/DatagramChannel.java:1.3->1.4
libraries/javalib/java/nio/channels/FileChannel.java:1.6->1.7
libraries/javalib/java/nio/channels/FileChannelImpl.java:1.5->1.6(DEAD)
libraries/javalib/java/nio/channels/FileLock.java:1.3->1.4
libraries/javalib/java/nio/channels/FileLockInterruptionException.java:1.1->1.2
libraries/javalib/java/nio/channels/GatheringByteChannel.java:1.3->1.4
libraries/javalib/java/nio/channels/IllegalBlockingModeException.java:1.1->1.2
libraries/javalib/java/nio/channels/IllegalSelectorException.java:1.1->1.2
libraries/javalib/java/nio/channels/InterruptibleChannel.java:1.1->1.2
libraries/javalib/java/nio/channels/NoConnectionPendingException.java:1.1->1.2
libraries/javalib/java/nio/channels/NonReadableChannelException.java:1.1->1.2
libraries/javalib/java/nio/channels/NonWritableChannelException.java:1.1->1.2
libraries/javalib/java/nio/channels/NotYetBoundException.java:1.1->1.2
libraries/javalib/java/nio/channels/NotYetConnectedException.java:1.1->1.2
libraries/javalib/java/nio/channels/OverlappingFileLockException.java:1.1->1.2
libraries/javalib/java/nio/channels/Pipe.java:1.2->1.3
libraries/javalib/java/nio/channels/ReadableByteChannel.java:1.2->1.3
libraries/javalib/java/nio/channels/ScatteringByteChannel.java:1.3->1.4
libraries/javalib/java/nio/channels/SelectableChannel.java:1.2->1.3
libraries/javalib/java/nio/channels/SelectionKey.java:1.2->1.3
libraries/javalib/java/nio/channels/Selector.java:1.1->1.2
libraries/javalib/java/nio/channels/ServerSocketChannel.java:1.4->1.5
libraries/javalib/java/nio/channels/SocketChannel.java:1.4->1.5
libraries/javalib/java/nio/channels/UnresolvedAddressException.java:1.1->1.2
libraries/javalib/java/nio/channels/UnsupportedAddressTypeException.java:1.1->1.2
libraries/javalib/java/nio/channels/WritableByteChannel.java:1.2->1.3
libraries/javalib/java/nio/channels/spi/AbstractInterruptibleChannel.java:1.4->1.5
libraries/javalib/java/nio/channels/spi/AbstractSelectableChannel.java:1.8->1.9
libraries/javalib/java/nio/channels/spi/AbstractSelectionKey.java:1.2->1.3
libraries/javalib/java/nio/channels/spi/AbstractSelector.java:1.5->1.6
libraries/javalib/java/nio/channels/spi/SelectorProvider.java:1.5->1.6
libraries/javalib/java/text/AttributedCharacterIterator.java:1.5->1.6
libraries/javalib/kaffe/lang/UNIXProcess.java:1.17->1.18
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2211 kaffe/ChangeLog:1.2212
--- kaffe/ChangeLog:1.2211 Sun Apr 11 15:14:46 2004
+++ kaffe/ChangeLog Mon Apr 12 11:39:52 2004
@@ -1,5 +1,264 @@
2004-04-11 Guilhem Lavaux <guilhem@kaffe.org>
+ * configure.ac: Added libraries/clib/nio to KAFFELIBRARYPATH.
+
+ * libraries/javalib/bootstrap.classlist: Added some new NIO classes.
+
+ * libraries/javalib/Klasses.jar.bootstrap: Regenerated.
+
+ * include/jsyscall.h: Fixed punctuation.
+
+ * include/Makefile.am: Added some new JNI headers to generate.
+
+ * libraries/clib/io/FileDescriptor.c: Removed.
+
+ * libraries/clib/net/PlainSocketImpl.c,
+ libraries/clib/net/PlainDatagramSocketImpl.c:
+ Removed all occurrences of FileDescriptor.
+
+ * kaffe/kaffevm/systems/unix-jthreads/syscalls.c: Fixed flags
+ generation.
+
+ * libraries/clib/native/ObjectInputStream.c,
+ libraries/clib/io/ObjectInputStream.c: Moved ObjectInputStream native
+ methods into the IO library.
+ (setXXNative0): Upgraded to latest GNU Classpath version.
+
+ * libraries/javalib/java/io/VMObjectStreamClass.java,
+ libraries/javalib/java/io/ObjectStreamField.java
+ (setXXNative,setXXField): Cleant up exception handling.
+
+ * libraries/clib/native/System.c:
+ Added a new property for NIO: gnu.cpu.endian
+
+ * libraries/clib/native/UNIXProcess.c,
+ libraries/javalib/kaffe/lang/UNIXProcess.java: Upgraded the code
+ to use NIO entry code instead of standard IO.
+
+ * libraries/clib/nio/Channels.c,
+ libraries/clib/nio/FileChannelImpl.c: New files.
+
+ * libraries/clib/nio/DirectByteBufferImpl.c: Use JNI now.
+ (shiftDown, adjustAddress, getImpl) New methods.
+
+ * libraries/clib/nio/NIOServerSocket.c: Use JNI.
+
+ * libraries/javalib/gnu/java/net/PlainDatagramSocketImpl.java
+ (PlainDatagramSocketImpl): Do not use FileDescriptor anymore.
+ (RECEIVE_LOCK, SEND_LOCK): New private fields.
+ (send, receive): Call send0 and receive0 in a synchronized space.
+ (send0, receive0): New name for native methods.
+
+ * libraries/javalib/gnu/java/net/PlainSocketImpl.java
+ (PlainSocketImpl): Do not use FileDescriptor anymore.
+
+ GNU Classpath text synchronization.
+
+ 2004-04-02 Tom Tromey <tromey@redhat.com>
+
+ * java/text/AttributedCharacterIterator.java (Attribute): Removed
+ redundant modifiers.
+
+ GNU Classpath NIO synchronization.
+
+ 2004-04-09 Jeroen Frijters <jeroen@frijters.net>
+
+ * gnu/java/nio/channels/FileChannelImpl.java: (fd, mode) Made private.
+ (length, pos) Removed. (FileChannelImpl (int, int)) Removed.
+ (implPosition, seek, implTruncate, unlock, lock) Added throws clause.
+
+ 2004-04-09 Jeroen Frijters <jeroen@frijters.net>
+
+ * java/io/FileDescriptor.java: (FileDescriptor) Added public
+ constructor. (valid) Added null check.
+
+ 2004-04-08 Michael Koch <konqueror@gmx.de>
+
+ * java/io/BufferedWriter.java,
+ java/io/FilterInputStream.java,
+ java/io/ObjectInputStream.java:
+ More javadoc and coding style work.
+
+ 2004-04-08 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/DirectByteBufferImpl.java,
+ java/nio/MappedByteBuffer.java,
+ java/nio/MappedByteBufferImpl.java:
+ Forgot to commit this during the big NIO commit.
+
+ 2004-04-08 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/channels/DatagramChannel.java,
+ java/nio/channels/FileChannel.java,
+ java/nio/channels/FileLock.java,
+ java/nio/channels/Pipe.java,
+ java/nio/channels/ServerSocketChannel.java,
+ java/nio/channels/SocketChannel.java,
+ java/nio/channels/spi/AbstractInterruptibleChannel.java,
+ java/nio/channels/spi/AbstractSelectableChannel.java,
+ java/nio/channels/spi/AbstractSelectionKey.java,
+ java/nio/channels/spi/AbstractSelector.java,
+ java/nio/channels/spi/SelectorProvider.java:
+ Reworked coding style and javadocs.
+
+ 2004-04-08 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/Buffer.java,
+ java/nio/ByteBufferImpl.java,
+ java/nio/CharBufferImpl.java,
+ java/nio/DoubleBufferImpl.java,
+ java/nio/DoubleViewBufferImpl.java,
+ java/nio/FloatBufferImpl.java,
+ java/nio/FloatViewBufferImpl.java,
+ java/nio/IntBufferImpl.java,
+ java/nio/IntViewBufferImpl.java,
+ java/nio/LongBufferImpl.java,
+ java/nio/LongViewBufferImpl.java,
+ java/nio/ShortBufferImpl.java,
+ java/nio/ShortViewBufferImpl.java,
+ java/nio/channels/AlreadyConnectedException.java,
+ java/nio/channels/AsynchronousCloseException.java,
+ java/nio/channels/ByteChannel.java,
+ java/nio/channels/CancelledKeyException.java,
+ java/nio/channels/Channel.java,
+ java/nio/channels/ClosedByInterruptException.java,
+ java/nio/channels/ClosedChannelException.java,
+ java/nio/channels/ClosedSelectorException.java,
+ java/nio/channels/ConnectionPendingException.java,
+ java/nio/channels/FileLockInterruptionException.java,
+ java/nio/channels/GatheringByteChannel.java,
+ java/nio/channels/IllegalBlockingModeException.java,
+ java/nio/channels/IllegalSelectorException.java,
+ java/nio/channels/InterruptibleChannel.java,
+ java/nio/channels/NoConnectionPendingException.java,
+ java/nio/channels/NonReadableChannelException.java,
+ java/nio/channels/NonWritableChannelException.java,
+ java/nio/channels/NotYetBoundException.java,
+ java/nio/channels/NotYetConnectedException.java,
+ java/nio/channels/OverlappingFileLockException.java,
+ java/nio/channels/ReadableByteChannel.java,
+ java/nio/channels/ScatteringByteChannel.java,
+ java/nio/channels/SelectableChannel.java,
+ java/nio/channels/SelectionKey.java,
+ java/nio/channels/Selector.java,
+ java/nio/channels/UnresolvedAddressException.java,
+ java/nio/channels/UnsupportedAddressTypeException.java,
+ java/nio/channels/WritableByteChannel.java,
+ java/nio/charset/spi/CharsetProvider.java:
+ Reworked coding style and javadocs.
+
+ 2004-04-08 Per Bothner <per@bothner.com>
+
+ * java/nio/channels/FileChannelImpl.java: Moved to package
+ gnu/java/nio/channels, since we need to refer to it from java.io.
+ * java/nio/channels/natFileChannelImpl.cc: Removed file.
+ * gnu/java/nio/channels/FileChannelImpl.java: New class, renamed
+ from java/nio/channels. Don't depend on FileDescriptor.
+ (in, out, err): New static fields.
+ (mode): New field.
+ (SET, CUR, READ, WRITE, APPEND, EXCL, SYNC, DSYNC): Moved constants
+ from FileDescriptor.
+ (by): Removed MappedByteBuffer field.
+ (map): New working implementation.
+ * java/io/FileDescriptor.java: Implement on top of FileChannel.
+ Remove native methods.
+ * gnu/java/nio/FileLockImpl.java (fd): Remove field, replacing it by:
+ (ch): New FileChannelImpl field. Update constructor to match.
+ (releaseImpl): Remove native method. Instead ...
+ (release): Call unlock on channel.
+ * java/io/FileInputStream.java (ch): Change type to FileChannelImpl.
+ (<init>(File)): Allocate a FileChannelImpl, not a FileDescriptor.
+ (<init>(FileChannelImpl)): New package-private constructor.
+ (<init>(FileDescriptor)): Extract FileChannelImpl from arg.
+ (available, close, read, skip): Implement using FileChannelImpl.
+ (getFD): Allocate FileDescriptor if needed.
+ (getChannel): Is now trivial.
+ * java/io/FileOutputStream.java: Corresponding changes.
+ * java/io/RandomAccessFile.java: Corresponding changes.
+ * java/nio/MappedByteBuffer.java: (forceImpl, isLoadedImpl, loadImpl,
+ unmapImpl): New dummy methods, to be overridden by subclass.
+ (finalize, isLoaded, load, force): New methods.
+ * java/nio/MappedByteBufferImpl.java: More-or-less rewrite.
+ Now works, at least for read mapping.
+
+ 2004-04-08 Per Bothner <per@bothner.com>
+
+ * java/nio/CharBufferImpl.java: Inline super constructor.
+ * java/nio/DoubleBufferImpl.java: Likewise.
+ * java/nio/FloatBufferImpl.java: Likewise.
+ * java/nio/IntBufferImpl.java: Likewise.
+ * java/nio/LongBufferImpl.java: Likewise.
+ * java/nio/ShortBufferImpl.java: Likewise.
+ * java/nio/CharBuffer.java: Remove unused constructor.
+ * java/nio/DoubleBuffer.java: Likewise.
+ * java/nio/FloatBuffer.java: Likewise.
+ * java/nio/IntBuffer.java: Likewise.
+ * java/nio/LongBuffer.java: Likewise.
+ * java/nio/ShortBuffer.java: Likewise.
+ * java/nio/CharViewBufferImpl.java: New convenience constructor.
+ Fix buggy call to super constructor.
+ * java/nio/DoubleViewBufferImpl.java: Likewise.
+ * java/nio/FloatViewBufferImpl.java: Likewise.
+ * java/nio/IntViewBufferImpl.java: Likewise.
+ * java/nio/LongViewBufferImpl.java: Likewise.
+ * java/nio/ShortViewBufferImpl.java: Likewise.
+ * java/nio/ByteBuffer.java (endian): Make non-private so other
+ java.nio classes can inherit it.
+ (<init>): Don't bother clearing array_offset.
+ * java/nio/ByteBuffer.java (allocate): Re-implement using wrap.
+ * java/nio/ByteBuffer.java (get(byte[],int,int)): Check underflow.
+ Remove redundant test.
+ * java/nio/ByteBufferImpl.java (asCharBuffer, asShortBuffer,
+ asIntBuffer, asLongBuffer, asFloatBuffer, asDoubleBuffer):
+ Use new XxxViewBufferImpl constructors.
+ * java/nio/MappedByteBufferImpl.java: Likewise.
+ * java/nio/DirectByteBufferImpl.java: Likewise.
+ * java/nio/ByteBufferImpl.java: Remove one constructor.
+ Inline super in remaining constructor.
+ * java/nio/ByteBuffer.java: Remove unused constructor.
+ * java/nio/ByteBufferImpl.java (shiftDown): New optimized method.
+ * java/nio/ByteBufferImpl.java (get, put): Add array_offset.
+ * java/nio/DirectByteBufferImpl.java (owner): New field.
+ (offset): Remove unused field.
+ (<init>): Modify one and add another constructor. Change callers.
+ (allocateDirect): Removed - not used.
+ (getImpl, putImpl): Make static and pass address explicitly,
+ to make them useful for MappedByteBufferImpl.
+ (get, put): Check for underflow. Modify for new getImpl.
+ (getImpl): New native method where target is array.
+ (get(byte[],int,int)): Use the above.
+ (adjustAddress): New static native method.
+ (slice, duplicate, asReadOnly): New implementations.
+
+ 2004-04-08 Per Bothner <per@bothner.com>
+
+ * java/nio/ByteBuffer.java (shiftDown): New helper method.
+ * java/nio/ByteBufferImpl.java (compact): Use new shiftDown method.
+ * sava/nio/ByteBufferHelper.java: Remove redundant 'final' specifiers.
+ Pass ByteOrder parameter to most methods, since the underlying
+ ByteBuffer's order isn't always what we should use.
+ * java/nio/ByteBufferImpl.java: Pass byte-order various places.
+ * java/nio/DirectByteBufferImpl.java: Likewise.
+ Use ByteBufferHelper methods.
+ * java/nio/MappedByteBufferImpl.java: Likewise.
+ (compact): Use shiftDown.
+ * java/nio/CharViewBufferImpl.java (<init>): Pass byte-order.
+ (get, put): Use ByteBufferHelper.
+ (compact): Use new shiftDown method.
+ (duplicate(boolean)): New helper method.
+ (duplicate, asReadOnlyBuffer): Use it.
+ (order): Return endian field.
+ * java/nio/DoubleViewBufferImpl.java: Likewise.
+ * java/nio/FloatViewBufferImpl.java: Likewise.
+ * java/nio/IntViewBufferImpl.java: Likewise.
+ * java/nio/LongViewBufferImpl.java: Likewise.
+ * java/nio/ShortViewBufferImpl.java: Likewise.
+ * java/nio/CharViewBufferImpl.java (subsequence): Redundant test.
+ * java/nio/DirectByteBufferImpl.java (shiftDown): New native method.
+ (compact): Re-implement using shiftDown.
+
+2004-04-11 Guilhem Lavaux <guilhem@kaffe.org>
+
* libraries/javalib/kjc.jar: Regenerated. KJC-CVS 2004-04-10.
* test/regression/TestScript.in: Ignore deprecated messages.
Index: kaffe/configure
diff -u kaffe/configure:1.306 kaffe/configure:1.307
--- kaffe/configure:1.306 Tue Apr 6 19:51:30 2004
+++ kaffe/configure Mon Apr 12 11:39:53 2004
@@ -52203,6 +52203,7 @@
\$(top_builddir)/libraries/clib/native/libnative.la \
\$(top_builddir)/libraries/clib/net/libnet.la \
\$(top_builddir)/libraries/clib/io/libio.la \
+\$(top_builddir)/libraries/clib/nio/libnio.la \
\$(top_builddir)/libraries/clib/zip/libzip.la \
$MATH_LIB \
$ALSA_LIB \
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.6 kaffe/configure.ac:1.7
--- kaffe/configure.ac:1.6 Tue Apr 6 17:28:56 2004
+++ kaffe/configure.ac Mon Apr 12 11:39:59 2004
@@ -1700,6 +1700,7 @@
\$(top_builddir)/libraries/clib/native/libnative.la \
\$(top_builddir)/libraries/clib/net/libnet.la \
\$(top_builddir)/libraries/clib/io/libio.la \
+\$(top_builddir)/libraries/clib/nio/libnio.la \
\$(top_builddir)/libraries/clib/zip/libzip.la \
$MATH_LIB \
$ALSA_LIB \
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.55 kaffe/include/Makefile.am:1.56
--- kaffe/include/Makefile.am:1.55 Fri Apr 2 20:14:41 2004
+++ kaffe/include/Makefile.am Mon Apr 12 11:40:02 2004
@@ -43,7 +43,6 @@
java_lang_VMThrowable.h \
java_lang_SecurityManager.h \
java_io_File.h \
- java_io_FileDescriptor.h \
java_io_FileInputStream.h \
java_io_FileOutputStream.h \
java_io_InputStream.h \
@@ -97,7 +96,6 @@
kaffe_lang_PrimordialClassLoader.h \
kaffe_lang_ThreadStack.h \
kaffe_management_Classpath.h \
- java_nio_DirectByteBufferImpl.h \
gnu_java_nio_SelectorImpl.h
DERIVED_HDRS = $(INSTALL_DERIVED_HDRS) $(NOINSTALL_DERIVED_HDRS)
@@ -106,6 +104,11 @@
NOINSTALL_JNI_DERIVED_HDRS = \
java_math_BigInteger.h \
+ gnu_java_nio_channels_FileChannelImpl.h \
+ gnu_java_nio_NIOServerSocket.h \
+ java_nio_channels_Channels.h \
+ java_nio_DirectByteBufferImpl.h \
+ java_nio_MappedByteBufferImpl.h \
kaffe_io_ByteToCharDefault.h \
kaffe_io_ByteToCharIconv.h \
kaffe_io_CharToByteDefault.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.151 kaffe/include/Makefile.in:1.152
--- kaffe/include/Makefile.in:1.151 Mon Apr 5 16:28:17 2004
+++ kaffe/include/Makefile.in Mon Apr 12 11:40:02 2004
@@ -346,7 +346,6 @@
java_lang_VMThrowable.h \
java_lang_SecurityManager.h \
java_io_File.h \
- java_io_FileDescriptor.h \
java_io_FileInputStream.h \
java_io_FileOutputStream.h \
java_io_InputStream.h \
@@ -400,13 +399,17 @@
kaffe_lang_PrimordialClassLoader.h \
kaffe_lang_ThreadStack.h \
kaffe_management_Classpath.h \
- java_nio_DirectByteBufferImpl.h \
gnu_java_nio_SelectorImpl.h
DERIVED_HDRS = $(INSTALL_DERIVED_HDRS) $(NOINSTALL_DERIVED_HDRS)
INSTALL_JNI_DERIVED_HDRS =
NOINSTALL_JNI_DERIVED_HDRS = \
java_math_BigInteger.h \
+ gnu_java_nio_channels_FileChannelImpl.h \
+ gnu_java_nio_NIOServerSocket.h \
+ java_nio_channels_Channels.h \
+ java_nio_DirectByteBufferImpl.h \
+ java_nio_MappedByteBufferImpl.h \
kaffe_io_ByteToCharDefault.h \
kaffe_io_ByteToCharIconv.h \
kaffe_io_CharToByteDefault.h \
Index: kaffe/include/jsyscall.h
diff -u kaffe/include/jsyscall.h:1.15 kaffe/include/jsyscall.h:1.16
--- kaffe/include/jsyscall.h:1.15 Thu Mar 25 10:14:46 2004
+++ kaffe/include/jsyscall.h Mon Apr 12 11:40:02 2004
@@ -171,6 +171,6 @@
#define KAFFE_MMAP_WRITE 1
#define KAFFE_MMAP_PRIVATE 2
-#define NOTIMEOUT -1
+#define NOTIMEOUT (-1)
#endif
Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.12 kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.13
--- kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c:1.12 Sat Aug 30 14:18:24 2003
+++ kaffe/kaffe/kaffevm/systems/unix-jthreads/syscalls.c Mon Apr 12 11:40:03 2004
@@ -328,12 +328,12 @@
switch (mode) {
case KAFFE_MMAP_READ:
- sysflags = MAP_SHARED;
+ sysflags = MAP_PRIVATE;
sysmode = PROT_READ;
break;
case KAFFE_MMAP_WRITE:
sysflags = MAP_SHARED;
- sysmode = PROT_WRITE | PROT_READ;
+ sysmode = PROT_READ | PROT_WRITE;
break;
case KAFFE_MMAP_PRIVATE:
sysflags = MAP_PRIVATE;
Index: kaffe/libltdl/config-h.in
diff -u kaffe/libltdl/config-h.in:1.17 kaffe/libltdl/config-h.in:1.18
--- kaffe/libltdl/config-h.in:1.17 Wed Mar 17 00:59:47 2004
+++ kaffe/libltdl/config-h.in Mon Apr 12 11:40:04 2004
@@ -3,9 +3,6 @@
/* Define to 1 if you have the `argz_append' function. */
#undef HAVE_ARGZ_APPEND
-/* Define to 1 if you have the `argz_create_sep' function. */
-#undef HAVE_ARGZ_CREATE_SEP
-
/* Define to 1 if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
===================================================================
Checking out kaffe/libraries/clib/io/FileDescriptor.c
RCS: /home/cvs/kaffe/kaffe/libraries/clib/io/Attic/FileDescriptor.c,v
VERS: 1.10
***************
--- kaffe/libraries/clib/io/FileDescriptor.c Mon Apr 12 11:44:43 2004
+++ /dev/null Sun Aug 4 19:57:58 2002
@@ -1,452 +0,0 @@
-/*
- * java.io.FileDescriptor.c
- *
- * Copyright (c) 2003 Kaffe's team.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file.
- */
-
-#include "config.h"
-#include "config-std.h"
-#include "config-io.h"
-#include "files.h"
-#include "defs.h"
-#include "java_io_FileDescriptor.h"
-#include "jsyscall.h"
-#include "../../../kaffe/kaffevm/classMethod.h"
-#include "../../../kaffe/kaffevm/utf8const.h"
-#include "../../../kaffe/kaffevm/support.h"
-
-/* Mask for open Javacall */
-#define JAVA_READ 1
-#define JAVA_WRITE 2
-#define JAVA_APPEND 4
-#define JAVA_EXCL 8
-#define JAVA_SYNC 16
-#define JAVA_DSYNC 32
-
-/* Seek mode for Javacall */
-#define JAVA_SET 0
-#define JAVA_CUR 1
-#define JAVA_END 2
-
-static Hjava_lang_Class* FileDescriptorClass = NULL;
-
-void java_io_FileDescriptor_nativeInit()
-{
- errorInfo einfo;
- struct Hjava_io_FileDescriptor** fd;
- Field* field;
- char *field_names[3] = { "in", "out", "err" };
- int i;
-
- FileDescriptorClass = lookupClass("java/io/FileDescriptor", NULL, &einfo);
- if (FileDescriptorClass == NULL)
- {
- throwError(&einfo);
- }
-
- /* Initialize the static fields */
- for (i=0;i<3;i++)
- {
- Utf8Const* utf8;
- utf8 = checkPtr(utf8ConstNew(field_names[i], -1));
- field = lookupClassField(FileDescriptorClass, utf8, true, &einfo);
- utf8ConstRelease(utf8);
-
- if (field == NULL)
- {
- throwError(&einfo);
- }
- fd = (struct Hjava_io_FileDescriptor **) FIELD_ADDRESS(field);
- (*fd)->nativeFd = i;
- }
-}
-
-jlong java_io_FileDescriptor_nativeOpen(struct Hjava_io_FileDescriptor* this, struct Hjava_lang_String* name, jint mode)
-{
- char str[MAXPATHLEN];
- int fd;
- int rc;
- int open_options = 0;
-
- stringJava2CBuf(name, str, sizeof(str));
-
- if ((mode & JAVA_READ) && (mode & JAVA_WRITE))
- open_options = O_RDWR|O_CREAT;
- else if (mode & JAVA_READ)
- open_options = O_RDONLY;
- else {
- open_options = O_WRONLY|O_CREAT;
- if (mode & JAVA_APPEND)
- open_options |= O_APPEND;
- else
- open_options |= O_TRUNC;
- }
-
-#if defined(O_SYNC)
- if (mode & JAVA_SYNC)
- open_options |= O_SYNC;
-#endif
-#if defined(O_DSYNC)
- if (mode & JAVA_DSYNC)
- open_options |= O_DSYNC;
-#endif
-
- /* By default we put the files in all rw access.
- * It will be modified by process umask.
- */
- rc = KOPEN(str, open_options|O_BINARY, 0666, &fd);
- switch (rc) {
- case 0:
- break;
- default:
- SignalError("java.io.FileNotFoundException", SYS_ERROR(rc));
- }
- return fd;
-}
-
-jlong java_io_FileDescriptor_nativeClose(struct Hjava_io_FileDescriptor* this, jlong fd)
-{
- int rc;
-
- rc = KCLOSE(fd);
- if (rc != 0)
- {
- SignalError("java.io.IOException", SYS_ERROR(rc));
- }
- return 0;
-}
-
-jlong java_io_FileDescriptor_nativeWriteByte(struct Hjava_io_FileDescriptor* this, jlong fd,
- jint b)
-{
- int rc;
- int nativeFd = (int)fd;
- char native_data = b & 0xFF;
- ssize_t ret;
-
- do
- {
- rc = KWRITE(nativeFd, &native_data, 1, &ret);
- if (rc != 0 && rc != EINTR)
- {
- SignalError("java.io.IOException", SYS_ERROR(rc));
- }
- }
- while (rc != 0);
- return 0;
-}
-
-jlong java_io_FileDescriptor_nativeWriteBuf(struct Hjava_io_FileDescriptor* this, jlong fd,
- HArrayOfByte* bytes, jint offset, jint len)
-{
- int rc;
- int nativeFd = (int)fd;
- ssize_t nativeLen = (ssize_t)len;
- ssize_t nativeWritten = 0;
- off_t off = (off_t)offset;
- ssize_t ret;
-
- while (nativeWritten < nativeLen)
- {
- rc = KWRITE(nativeFd, &unhand_array(bytes)->body[off], nativeLen-nativeWritten, &ret);
- if (rc != 0 && rc != EINTR)
- {
- SignalError("java.io.IOException", SYS_ERROR(rc));
- }
- nativeWritten += ret;
- }
-
- return 0;
-}
-
-jint java_io_FileDescriptor_nativeReadByte(struct Hjava_io_FileDescriptor* this,
- jlong fd)
-{
- int rc;
- int nativeFd = (int)fd;
- char native_data;
- ssize_t ret;
-
- do
- {
- rc = KREAD(nativeFd, &native_data, 1, &ret);
- if (rc == 0 && ret == 0)
- return -1;
- if (rc != 0 && rc != EINTR)
- {
- SignalError("java.io.IOException", SYS_ERROR(rc));
- }
- }
- while (ret != 1);
-
- return (jint)(native_data & 0xFF);
-}
-
-extern jint java_io_FileDescriptor_nativeReadBuf(struct Hjava_io_FileDescriptor* this, jlong fd,
- HArrayOfByte* bytes, jint offset, jint len)
-{
- int rc;
- int nativeFd = (int)fd;
- ssize_t nativeLen = (ssize_t)len;
- ssize_t nativeRead = 0;
- off_t off = (off_t)offset;
- ssize_t ret;
-
- while (nativeRead < nativeLen)
- {
- rc = KREAD(nativeFd, &unhand_array(bytes)->body[off], nativeLen-nativeRead, &ret);
*** Patch too long, truncated ***