From: Gary Benson Date: Thu, 18 Jan 2007 11:32:40 +0000 (+0000) Subject: natVMPipeEcos.cc: Renamed from gnu/java/nio/natPipeImplEcos.cc. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=463c03f1bc2380d46a39e63efd00df157a18fee2;p=gcc.git natVMPipeEcos.cc: Renamed from gnu/java/nio/natPipeImplEcos.cc. 2007-01-18 Gary Benson * gnu/java/nio/natVMPipeEcos.cc: Renamed from gnu/java/nio/natPipeImplEcos.cc. * gnu/java/nio/natVMPipePosix.cc: Renamed from gnu/java/nio/natPipeImplPosix.cc. * gnu/java/nio/natVMPipeWin32.cc: Renamed from gnu/java/nio/natPipeImplWin32.cc. * gnu/java/nio/natVMSelectorEcos.cc: Renamed from gnu/java/nio/natSelectorImplEcos.cc. * gnu/java/nio/natVMSelectorPosix.cc: Renamed from gnu/java/nio/natSelectorImplPosix.cc. * gnu/java/nio/natVMSelectorWin32.cc: Renamed from gnu/java/nio/natSelectorImplWin32.cc. * java/io/natVMObjectInputStream.cc: Renamed from java/io/natObjectInputStream.cc. * java/lang/natVMDouble.cc: Renamed from java/lang/natDouble.cc. * java/lang/natVMFloat.cc: Renamed from java/lang/natFloat.cc. * Makefile.am, configure.ac: Reflect the above. * Makefile.in, configure: Rebuilt. From-SVN: r120895 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 3cc61abe4cd..4cecf1bfdba 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,26 @@ +2007-01-18 Gary Benson + + * gnu/java/nio/natVMPipeEcos.cc: + Renamed from gnu/java/nio/natPipeImplEcos.cc. + * gnu/java/nio/natVMPipePosix.cc: + Renamed from gnu/java/nio/natPipeImplPosix.cc. + * gnu/java/nio/natVMPipeWin32.cc: + Renamed from gnu/java/nio/natPipeImplWin32.cc. + * gnu/java/nio/natVMSelectorEcos.cc: + Renamed from gnu/java/nio/natSelectorImplEcos.cc. + * gnu/java/nio/natVMSelectorPosix.cc: + Renamed from gnu/java/nio/natSelectorImplPosix.cc. + * gnu/java/nio/natVMSelectorWin32.cc: + Renamed from gnu/java/nio/natSelectorImplWin32.cc. + * java/io/natVMObjectInputStream.cc: + Renamed from java/io/natObjectInputStream.cc. + * java/lang/natVMDouble.cc: + Renamed from java/lang/natDouble.cc. + * java/lang/natVMFloat.cc: + Renamed from java/lang/natFloat.cc. + * Makefile.am, configure.ac: Reflect the above. + * Makefile.in, configure: Rebuilt. + 2007-01-17 Andrew Haley * Makefile.in: Rebuilt. diff --git a/libjava/Makefile.am b/libjava/Makefile.am index d28f6fa7849..a89a7f32cb3 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -835,21 +835,21 @@ gnu/java/lang/management/natVMThreadMXBeanImpl.cc \ gnu/java/net/natPlainDatagramSocketImpl.cc \ gnu/java/net/natPlainSocketImpl.cc \ gnu/java/net/protocol/core/natCoreInputStream.cc \ -gnu/java/nio/natPipeImpl.cc \ -gnu/java/nio/natSelectorImpl.cc \ +gnu/java/nio/natVMPipe.cc \ +gnu/java/nio/natVMSelector.cc \ gnu/java/nio/natNIOServerSocket.cc \ gnu/java/nio/natVMChannel.cc \ gnu/java/nio/channels/natFileChannelImpl.cc \ java/io/natFile.cc \ -java/io/natObjectInputStream.cc \ +java/io/natVMObjectInputStream.cc \ java/io/natVMObjectStreamClass.cc \ java/lang/management/natVMManagementFactory.cc \ java/lang/natCharacter.cc \ java/lang/natClass.cc \ java/lang/natClassLoader.cc \ java/lang/natConcreteProcess.cc \ -java/lang/natDouble.cc \ -java/lang/natFloat.cc \ +java/lang/natVMDouble.cc \ +java/lang/natVMFloat.cc \ java/lang/natMath.cc \ java/lang/natObject.cc \ java/lang/natRuntime.cc \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 5ca8be56d18..e3fac10e37f 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -106,7 +106,7 @@ CONFIG_CLEAN_FILES = libgcj.pc libgcj.spec libgcj-test.spec \ java/net/natVMInetAddress.cc java/net/natVMNetworkInterface.cc \ gnu/java/net/natPlainSocketImpl.cc \ gnu/java/net/natPlainDatagramSocketImpl.cc \ - gnu/java/nio/natPipeImpl.cc gnu/java/nio/natSelectorImpl.cc \ + gnu/java/nio/natVMPipe.cc gnu/java/nio/natVMSelector.cc \ gnu/java/nio/channels/natFileChannelImpl.cc sysdep/locks.h \ sysdep/backtrace.h sysdep/descriptor.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -307,16 +307,16 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc jvmti.cc exception.cc \ gnu/java/net/natPlainDatagramSocketImpl.cc \ gnu/java/net/natPlainSocketImpl.cc \ gnu/java/net/protocol/core/natCoreInputStream.cc \ - gnu/java/nio/natPipeImpl.cc gnu/java/nio/natSelectorImpl.cc \ + gnu/java/nio/natVMPipe.cc gnu/java/nio/natVMSelector.cc \ gnu/java/nio/natNIOServerSocket.cc \ gnu/java/nio/natVMChannel.cc \ gnu/java/nio/channels/natFileChannelImpl.cc java/io/natFile.cc \ - java/io/natObjectInputStream.cc \ + java/io/natVMObjectInputStream.cc \ java/io/natVMObjectStreamClass.cc \ java/lang/management/natVMManagementFactory.cc \ java/lang/natCharacter.cc java/lang/natClass.cc \ java/lang/natClassLoader.cc java/lang/natConcreteProcess.cc \ - java/lang/natDouble.cc java/lang/natFloat.cc \ + java/lang/natVMDouble.cc java/lang/natVMFloat.cc \ java/lang/natMath.cc java/lang/natObject.cc \ java/lang/natRuntime.cc java/lang/natString.cc \ java/lang/natStringBuffer.cc java/lang/natStringBuilder.cc \ @@ -370,16 +370,16 @@ am__objects_2 = gnu/classpath/jdwp/natVMFrame.lo \ gnu/java/net/natPlainDatagramSocketImpl.lo \ gnu/java/net/natPlainSocketImpl.lo \ gnu/java/net/protocol/core/natCoreInputStream.lo \ - gnu/java/nio/natPipeImpl.lo gnu/java/nio/natSelectorImpl.lo \ + gnu/java/nio/natVMPipe.lo gnu/java/nio/natVMSelector.lo \ gnu/java/nio/natNIOServerSocket.lo \ gnu/java/nio/natVMChannel.lo \ gnu/java/nio/channels/natFileChannelImpl.lo java/io/natFile.lo \ - java/io/natObjectInputStream.lo \ + java/io/natVMObjectInputStream.lo \ java/io/natVMObjectStreamClass.lo \ java/lang/management/natVMManagementFactory.lo \ java/lang/natCharacter.lo java/lang/natClass.lo \ java/lang/natClassLoader.lo java/lang/natConcreteProcess.lo \ - java/lang/natDouble.lo java/lang/natFloat.lo \ + java/lang/natVMDouble.lo java/lang/natVMFloat.lo \ java/lang/natMath.lo java/lang/natObject.lo \ java/lang/natRuntime.lo java/lang/natString.lo \ java/lang/natStringBuffer.lo java/lang/natStringBuilder.lo \ @@ -7920,21 +7920,21 @@ gnu/java/lang/management/natVMThreadMXBeanImpl.cc \ gnu/java/net/natPlainDatagramSocketImpl.cc \ gnu/java/net/natPlainSocketImpl.cc \ gnu/java/net/protocol/core/natCoreInputStream.cc \ -gnu/java/nio/natPipeImpl.cc \ -gnu/java/nio/natSelectorImpl.cc \ +gnu/java/nio/natVMPipe.cc \ +gnu/java/nio/natVMSelector.cc \ gnu/java/nio/natNIOServerSocket.cc \ gnu/java/nio/natVMChannel.cc \ gnu/java/nio/channels/natFileChannelImpl.cc \ java/io/natFile.cc \ -java/io/natObjectInputStream.cc \ +java/io/natVMObjectInputStream.cc \ java/io/natVMObjectStreamClass.cc \ java/lang/management/natVMManagementFactory.cc \ java/lang/natCharacter.cc \ java/lang/natClass.cc \ java/lang/natClassLoader.cc \ java/lang/natConcreteProcess.cc \ -java/lang/natDouble.cc \ -java/lang/natFloat.cc \ +java/lang/natVMDouble.cc \ +java/lang/natVMFloat.cc \ java/lang/natMath.cc \ java/lang/natObject.cc \ java/lang/natRuntime.cc \ @@ -8385,9 +8385,9 @@ gnu/java/nio/$(am__dirstamp): gnu/java/nio/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) gnu/java/nio/$(DEPDIR) @: > gnu/java/nio/$(DEPDIR)/$(am__dirstamp) -gnu/java/nio/natPipeImpl.lo: gnu/java/nio/$(am__dirstamp) \ +gnu/java/nio/natVMPipe.lo: gnu/java/nio/$(am__dirstamp) \ gnu/java/nio/$(DEPDIR)/$(am__dirstamp) -gnu/java/nio/natSelectorImpl.lo: gnu/java/nio/$(am__dirstamp) \ +gnu/java/nio/natVMSelector.lo: gnu/java/nio/$(am__dirstamp) \ gnu/java/nio/$(DEPDIR)/$(am__dirstamp) gnu/java/nio/natNIOServerSocket.lo: gnu/java/nio/$(am__dirstamp) \ gnu/java/nio/$(DEPDIR)/$(am__dirstamp) @@ -8410,7 +8410,7 @@ java/io/$(DEPDIR)/$(am__dirstamp): @: > java/io/$(DEPDIR)/$(am__dirstamp) java/io/natFile.lo: java/io/$(am__dirstamp) \ java/io/$(DEPDIR)/$(am__dirstamp) -java/io/natObjectInputStream.lo: java/io/$(am__dirstamp) \ +java/io/natVMObjectInputStream.lo: java/io/$(am__dirstamp) \ java/io/$(DEPDIR)/$(am__dirstamp) java/io/natVMObjectStreamClass.lo: java/io/$(am__dirstamp) \ java/io/$(DEPDIR)/$(am__dirstamp) @@ -8437,9 +8437,9 @@ java/lang/natClassLoader.lo: java/lang/$(am__dirstamp) \ java/lang/$(DEPDIR)/$(am__dirstamp) java/lang/natConcreteProcess.lo: java/lang/$(am__dirstamp) \ java/lang/$(DEPDIR)/$(am__dirstamp) -java/lang/natDouble.lo: java/lang/$(am__dirstamp) \ +java/lang/natVMDouble.lo: java/lang/$(am__dirstamp) \ java/lang/$(DEPDIR)/$(am__dirstamp) -java/lang/natFloat.lo: java/lang/$(am__dirstamp) \ +java/lang/natVMFloat.lo: java/lang/$(am__dirstamp) \ java/lang/$(DEPDIR)/$(am__dirstamp) java/lang/natMath.lo: java/lang/$(am__dirstamp) \ java/lang/$(DEPDIR)/$(am__dirstamp) @@ -8855,16 +8855,16 @@ mostlyclean-compile: -rm -f gnu/java/nio/channels/natFileChannelImpl.lo -rm -f gnu/java/nio/natNIOServerSocket.$(OBJEXT) -rm -f gnu/java/nio/natNIOServerSocket.lo - -rm -f gnu/java/nio/natPipeImpl.$(OBJEXT) - -rm -f gnu/java/nio/natPipeImpl.lo - -rm -f gnu/java/nio/natSelectorImpl.$(OBJEXT) - -rm -f gnu/java/nio/natSelectorImpl.lo -rm -f gnu/java/nio/natVMChannel.$(OBJEXT) -rm -f gnu/java/nio/natVMChannel.lo + -rm -f gnu/java/nio/natVMPipe.$(OBJEXT) + -rm -f gnu/java/nio/natVMPipe.lo + -rm -f gnu/java/nio/natVMSelector.$(OBJEXT) + -rm -f gnu/java/nio/natVMSelector.lo -rm -f java/io/natFile.$(OBJEXT) -rm -f java/io/natFile.lo - -rm -f java/io/natObjectInputStream.$(OBJEXT) - -rm -f java/io/natObjectInputStream.lo + -rm -f java/io/natVMObjectInputStream.$(OBJEXT) + -rm -f java/io/natVMObjectInputStream.lo -rm -f java/io/natVMObjectStreamClass.$(OBJEXT) -rm -f java/io/natVMObjectStreamClass.lo -rm -f java/lang/Object.$(OBJEXT) @@ -8879,10 +8879,6 @@ mostlyclean-compile: -rm -f java/lang/natClassLoader.lo -rm -f java/lang/natConcreteProcess.$(OBJEXT) -rm -f java/lang/natConcreteProcess.lo - -rm -f java/lang/natDouble.$(OBJEXT) - -rm -f java/lang/natDouble.lo - -rm -f java/lang/natFloat.$(OBJEXT) - -rm -f java/lang/natFloat.lo -rm -f java/lang/natMath.$(OBJEXT) -rm -f java/lang/natMath.lo -rm -f java/lang/natObject.$(OBJEXT) @@ -8903,6 +8899,10 @@ mostlyclean-compile: -rm -f java/lang/natThreadLocal.lo -rm -f java/lang/natVMClassLoader.$(OBJEXT) -rm -f java/lang/natVMClassLoader.lo + -rm -f java/lang/natVMDouble.$(OBJEXT) + -rm -f java/lang/natVMDouble.lo + -rm -f java/lang/natVMFloat.$(OBJEXT) + -rm -f java/lang/natVMFloat.lo -rm -f java/lang/natVMThrowable.$(OBJEXT) -rm -f java/lang/natVMThrowable.lo -rm -f java/lang/ref/natReference.$(OBJEXT) @@ -9029,20 +9029,18 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/$(DEPDIR)/natPlainSocketImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@gnu/java/net/protocol/core/$(DEPDIR)/natCoreInputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/natNIOServerSocket.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/natPipeImpl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/natSelectorImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/natVMChannel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/natVMPipe.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/$(DEPDIR)/natVMSelector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@gnu/java/nio/channels/$(DEPDIR)/natFileChannelImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natFile.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natObjectInputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natVMObjectInputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/io/$(DEPDIR)/natVMObjectStreamClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/Object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natCharacter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natClass.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natClassLoader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natConcreteProcess.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natDouble.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natFloat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natMath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natRuntime.Plo@am__quote@ @@ -9053,6 +9051,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natThread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natThreadLocal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMClassLoader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMDouble.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMFloat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/$(DEPDIR)/natVMThrowable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/management/$(DEPDIR)/natVMManagementFactory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@java/lang/ref/$(DEPDIR)/natReference.Plo@am__quote@ diff --git a/libjava/configure b/libjava/configure index 4e2e1fcb80a..7cd8c71a03d 100755 --- a/libjava/configure +++ b/libjava/configure @@ -7682,12 +7682,14 @@ test -d gnu/java/net || mkdir gnu/java/net ac_config_links="$ac_config_links gnu/java/net/natPlainDatagramSocketImpl.cc:gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc" -# Likewise for natPipeImpl.cc and natSelectorImpl.cc. +# Likewise for natVMPipe.cc and natVMSelector.cc. test -d gnu/java/nio || mkdir gnu/java/nio - ac_config_links="$ac_config_links gnu/java/nio/natPipeImpl.cc:gnu/java/nio/natPipeImpl${PLATFORM}.cc" + ac_config_links="$ac_config_links gnu/java/nio/natVMPipe.cc:gnu/java/nio/natVMPipe${PLATFORM}.cc" - ac_config_links="$ac_config_links gnu/java/nio/natSelectorImpl.cc:gnu/java/nio/natSelectorImpl${PLATFORM}.cc" + ac_config_links="$ac_config_links gnu/java/nio/natVMSelector.cc:gnu/java/nio/natVMSelector${PLATFORM}.cc" + +# Likewise for natFileChannelImpl.cc test -d gnu/java/nio/channels || mkdir gnu/java/nio/channels ac_config_links="$ac_config_links gnu/java/nio/channels/natFileChannelImpl.cc:gnu/java/nio/channels/natFileChannel${FILE-${PLATFORM}}.cc" @@ -17846,8 +17848,8 @@ do "java/net/natVMNetworkInterface.cc" ) CONFIG_LINKS="$CONFIG_LINKS java/net/natVMNetworkInterface.cc:java/net/natVMNetworkInterface${PLATFORMNET}.cc" ;; "gnu/java/net/natPlainSocketImpl.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/net/natPlainSocketImpl.cc:gnu/java/net/natPlainSocketImpl${PLATFORMNET}.cc" ;; "gnu/java/net/natPlainDatagramSocketImpl.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/net/natPlainDatagramSocketImpl.cc:gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc" ;; - "gnu/java/nio/natPipeImpl.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/nio/natPipeImpl.cc:gnu/java/nio/natPipeImpl${PLATFORM}.cc" ;; - "gnu/java/nio/natSelectorImpl.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/nio/natSelectorImpl.cc:gnu/java/nio/natSelectorImpl${PLATFORM}.cc" ;; + "gnu/java/nio/natVMPipe.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/nio/natVMPipe.cc:gnu/java/nio/natVMPipe${PLATFORM}.cc" ;; + "gnu/java/nio/natVMSelector.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/nio/natVMSelector.cc:gnu/java/nio/natVMSelector${PLATFORM}.cc" ;; "gnu/java/nio/channels/natFileChannelImpl.cc" ) CONFIG_LINKS="$CONFIG_LINKS gnu/java/nio/channels/natFileChannelImpl.cc:gnu/java/nio/channels/natFileChannel${FILE-${PLATFORM}}.cc" ;; "include/java-gc.h" ) CONFIG_LINKS="$CONFIG_LINKS include/java-gc.h:include/$GCHDR" ;; "include/java-threads.h" ) CONFIG_LINKS="$CONFIG_LINKS include/java-threads.h:include/$THREADH" ;; diff --git a/libjava/configure.ac b/libjava/configure.ac index b8007506630..5f2eb63b28d 100644 --- a/libjava/configure.ac +++ b/libjava/configure.ac @@ -724,10 +724,12 @@ test -d gnu/java/net || mkdir gnu/java/net AC_CONFIG_LINKS(gnu/java/net/natPlainSocketImpl.cc:gnu/java/net/natPlainSocketImpl${PLATFORMNET}.cc) AC_CONFIG_LINKS(gnu/java/net/natPlainDatagramSocketImpl.cc:gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc) -# Likewise for natPipeImpl.cc and natSelectorImpl.cc. +# Likewise for natVMPipe.cc and natVMSelector.cc. test -d gnu/java/nio || mkdir gnu/java/nio -AC_CONFIG_LINKS(gnu/java/nio/natPipeImpl.cc:gnu/java/nio/natPipeImpl${PLATFORM}.cc) -AC_CONFIG_LINKS(gnu/java/nio/natSelectorImpl.cc:gnu/java/nio/natSelectorImpl${PLATFORM}.cc) +AC_CONFIG_LINKS(gnu/java/nio/natVMPipe.cc:gnu/java/nio/natVMPipe${PLATFORM}.cc) +AC_CONFIG_LINKS(gnu/java/nio/natVMSelector.cc:gnu/java/nio/natVMSelector${PLATFORM}.cc) + +# Likewise for natFileChannelImpl.cc test -d gnu/java/nio/channels || mkdir gnu/java/nio/channels AC_CONFIG_LINKS(gnu/java/nio/channels/natFileChannelImpl.cc:gnu/java/nio/channels/natFileChannel${FILE-${PLATFORM}}.cc) diff --git a/libjava/gnu/java/nio/natPipeImplEcos.cc b/libjava/gnu/java/nio/natPipeImplEcos.cc deleted file mode 100644 index 75af4eb627e..00000000000 --- a/libjava/gnu/java/nio/natPipeImplEcos.cc +++ /dev/null @@ -1,27 +0,0 @@ -// natPipeImplEcos.cc - -/* Copyright (C) 2003, 2004 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include -#include - -#include -#include -#include - -#include -#include -#include - -void -gnu::java::nio::VMPipe::init (gnu::java::nio::PipeImpl *self, - ::java::nio::channels::spi::SelectorProvider*) -{ - throw new ::java::io::IOException (JvNewStringUTF ("nativeInit() not implemented")); -} diff --git a/libjava/gnu/java/nio/natPipeImplPosix.cc b/libjava/gnu/java/nio/natPipeImplPosix.cc deleted file mode 100644 index 1726dc70f6c..00000000000 --- a/libjava/gnu/java/nio/natPipeImplPosix.cc +++ /dev/null @@ -1,41 +0,0 @@ -// natPipeImplPosix.cc - -/* Copyright (C) 2003, 2004 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include -#include - -#include -#include -#include - -#include -#include -//#include -//#include -#include -#include - -void -gnu::java::nio::VMPipe::init (gnu::java::nio::PipeImpl*, /*self*/ - ::java::nio::channels::spi::SelectorProvider* - /*provider*/) -{ - int filedes [2]; - - if (_Jv_pipe (filedes) < 0) - throw new ::java::io::IOException (JvNewStringUTF (strerror (errno))); - - /* FIXME - source = new gnu::java::nio::PipeImpl$SourceChannelImpl - (this, provider, filedes [0]); - sink = new gnu::java::nio::PipeImpl$SinkChannelImpl - (this, provider, filedes [1]); - */ -} diff --git a/libjava/gnu/java/nio/natPipeImplWin32.cc b/libjava/gnu/java/nio/natPipeImplWin32.cc deleted file mode 100644 index 2f14b50a14d..00000000000 --- a/libjava/gnu/java/nio/natPipeImplWin32.cc +++ /dev/null @@ -1,40 +0,0 @@ -// natPipeImplWin32.cc - -/* Copyright (C) 2003, 2004 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include -#include - -#include -#include -#include - -#include -#include -//#include -//#include -#include -#include - -void -gnu::java::nio::VMPipe::init (gnu::java::nio::PipeImpl *self, - ::java::nio::channels::spi::SelectorProvider* /*provider*/) -{ - int filedes [2]; - - if (_Jv_pipe (filedes) < 0) - throw new ::java::io::IOException (JvNewStringUTF (strerror (errno))); - - /* FIXME - source = new gnu::java::nio::PipeImpl$SourceChannelImpl - (this, provider, filedes [0]); - sink = new gnu::java::nio::PipeImpl$SinkChannelImpl - (this, provider, filedes [1]); - */ -} diff --git a/libjava/gnu/java/nio/natSelectorImplEcos.cc b/libjava/gnu/java/nio/natSelectorImplEcos.cc deleted file mode 100644 index 15fbafde70f..00000000000 --- a/libjava/gnu/java/nio/natSelectorImplEcos.cc +++ /dev/null @@ -1,25 +0,0 @@ -// natSelectorImplEcos.cc - -/* Copyright (C) 2003, 2004 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include -#include - -#include -#include - -#include -#include - -jint -gnu::java::nio::VMSelector::select (jintArray read, jintArray write, - jintArray except, jlong timeout) -{ - throw new ::java::io::IOException (JvNewStringUTF ("implSelect() not implemented")); -} diff --git a/libjava/gnu/java/nio/natSelectorImplPosix.cc b/libjava/gnu/java/nio/natSelectorImplPosix.cc deleted file mode 100644 index b433900abb0..00000000000 --- a/libjava/gnu/java/nio/natSelectorImplPosix.cc +++ /dev/null @@ -1,127 +0,0 @@ -// natSelectorImplPosix.cc - -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include -#include - -#include -#include - -#include -#include -#include -#include - -static void -helper_put_filedescriptors (jintArray fdArray, fd_set& fds, int& max_fd) -{ - jint* tmpFDArray = elements (fdArray); - - for (int index = 0; index < JvGetArrayLength (fdArray); index++) - { - int fd = tmpFDArray [index]; - if (fd > 0) - { - FD_SET (tmpFDArray [index], &fds); - - if (tmpFDArray [index] > max_fd) - max_fd = tmpFDArray [index]; - } - } -} - -static void -helper_get_filedescriptors (jintArray& fdArray, fd_set fds) -{ - jint* tmpFDArray = elements (fdArray); - - for (int index = 0; index < JvGetArrayLength (fdArray); index++) - { - int fd = tmpFDArray [index]; - if (fd < 0 || !FD_ISSET (fd, &fds)) - tmpFDArray [index] = 0; - } -} - -static void -helper_reset (jintArray& fdArray) -{ - jint* tmpFDArray = elements (fdArray); - - for (int index = 0; index < JvGetArrayLength (fdArray); index++) - tmpFDArray [index] = 0; -} - -jint -gnu::java::nio::VMSelector::select (jintArray read, jintArray write, - jintArray except, jlong timeout) -{ - jint result; - int max_fd = 0; - fd_set read_fds; - fd_set write_fds; - fd_set except_fds; - struct timeval real_time_data; - struct timeval *time_data = NULL; - - // If a legal timeout value isn't given, use NULL. - // This means an infinite timeout. The specification - // also says that a zero timeout should be treated - // as infinite. Otherwise (if the timeout value is legal), - // fill our timeval struct and use it for the select. - if (timeout > 0) - { - real_time_data.tv_sec = timeout / 1000; - real_time_data.tv_usec = (timeout % 1000) * 1000; - time_data = &real_time_data; - } - - // Reset all fd_set structures - FD_ZERO (&read_fds); - FD_ZERO (&write_fds); - FD_ZERO (&except_fds); - - // Fill the fd_set data structures for the _Jv_select() call. - helper_put_filedescriptors (read, read_fds, max_fd); - helper_put_filedescriptors (write, write_fds, max_fd); - helper_put_filedescriptors (except, except_fds, max_fd); - - // Actually do the select - try - { - result = _Jv_select (max_fd + 1, &read_fds, &write_fds, - &except_fds, time_data); - } - catch (::java::io::InterruptedIOException *e) - { - // The behavior of JRE 1.4.1 is that no exception is thrown - // when the thread is interrupted, but the thread's interrupt - // status is set. Clear all of our select sets and return 0, - // indicating that nothing was selected. - ::java::lang::Thread::currentThread ()->interrupt (); - helper_reset (read); - helper_reset (write); - helper_reset (except); - return 0; - } - - if (result < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - // Set the file descriptors according to the values returned from select(). - helper_get_filedescriptors (read, read_fds); - helper_get_filedescriptors (write, write_fds); - helper_get_filedescriptors (except, except_fds); - - return result; -} diff --git a/libjava/gnu/java/nio/natSelectorImplWin32.cc b/libjava/gnu/java/nio/natSelectorImplWin32.cc deleted file mode 100644 index 860f654890a..00000000000 --- a/libjava/gnu/java/nio/natSelectorImplWin32.cc +++ /dev/null @@ -1,93 +0,0 @@ -// natSelectorImplWin32.cc - -/* Copyright (C) 2003, 2004 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include -#include - -#include -#include - -jint -gnu::java::nio::VMSelector::select (jintArray read, jintArray write, - jintArray except, jlong timeout) -{ - // FIXME: The API for implSelect is biased towards POSIX implementations. - jint* pReadFD = elements (read); - int nNbReadFDs = JvGetArrayLength (read); - - jint* pWriteFD = elements (write); - int nNbWriteFDs = JvGetArrayLength (write); - - int nNbEvents = nNbReadFDs + nNbWriteFDs; - - // Create and initialize our event wrapper array - - // FIXME: We're creating fresh WSAEVENTs for each call. - // This is inefficient. It would probably be better to cache these - // in the Win32 socket implementation class. - WSAEventWrapper aArray[nNbEvents]; - - int nCurIndex = 0; - for (int i=0; i < nNbReadFDs; ++i) - aArray[nCurIndex++].init(pReadFD[i], FD_ACCEPT | FD_READ); - - for (int i=0; i < nNbWriteFDs; ++i) - aArray[nCurIndex++].init(pWriteFD[i], FD_WRITE); - - // Build our array of WSAEVENTs to wait on. Also throw in our thread's - // interrupt event in order to detect thread interruption. - HANDLE arh[nNbEvents + 1]; - for (int i=0; i < nNbEvents; ++i) - arh[i] = aArray[i].getEventHandle(); - arh[nNbEvents] = _Jv_Win32GetInterruptEvent (); - - // A timeout value of 0 needs to be treated as infinite. - if (timeout <= 0) - timeout = WSA_INFINITE; - - // Do the select. - DWORD dwRet = WSAWaitForMultipleEvents (nNbEvents+1, arh, 0, timeout, false); - - if (dwRet == WSA_WAIT_FAILED) - _Jv_ThrowIOException (); - - // Before we do anything else, clear output file descriptor arrays. - memset(pReadFD, 0, sizeof(jint) * nNbReadFDs); - memset(pWriteFD, 0, sizeof(jint) * nNbWriteFDs); - memset(elements (except), 0, sizeof(jint) * JvGetArrayLength (except)); - - if (dwRet == DWORD(WSA_WAIT_EVENT_0 + nNbEvents)) - { - // We were interrupted. Set the current thread's interrupt - // status and get out of here, with nothing selected.. - ::java::lang::Thread::currentThread ()->interrupt (); - return 0; - } - else if (dwRet < DWORD(WSA_WAIT_EVENT_0 + nNbEvents)) - { - int nSelectedEventIndex = dwRet - WSA_WAIT_EVENT_0; - - // Record the selected file descriptor. - // FIXME: This implementation only allows one file descriptor - // to be selected at a time. Remedy this by looping on - // WSAWaitForMultipleEvents 'til nothing more is selected. - jint fd = aArray[nSelectedEventIndex].getFD(); - if (nSelectedEventIndex < nNbReadFDs) - pReadFD[0] = fd; - else - pWriteFD[0] = fd; - - return 1; - } - else - // None of the event objects was signalled, so nothing was - // selected. - return 0; -} diff --git a/libjava/gnu/java/nio/natVMPipeEcos.cc b/libjava/gnu/java/nio/natVMPipeEcos.cc new file mode 100644 index 00000000000..c806fb49e5e --- /dev/null +++ b/libjava/gnu/java/nio/natVMPipeEcos.cc @@ -0,0 +1,27 @@ +// natVMPipeImplEcos.cc + +/* Copyright (C) 2003, 2004, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include +#include + +#include +#include +#include + +#include +#include +#include + +void +gnu::java::nio::VMPipe::init (gnu::java::nio::PipeImpl *self, + ::java::nio::channels::spi::SelectorProvider*) +{ + throw new ::java::io::IOException (JvNewStringUTF ("nativeInit() not implemented")); +} diff --git a/libjava/gnu/java/nio/natVMPipePosix.cc b/libjava/gnu/java/nio/natVMPipePosix.cc new file mode 100644 index 00000000000..3de136a6e3d --- /dev/null +++ b/libjava/gnu/java/nio/natVMPipePosix.cc @@ -0,0 +1,41 @@ +// natVMPipeImplPosix.cc + +/* Copyright (C) 2003, 2004, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include +#include + +#include +#include +#include + +#include +#include +//#include +//#include +#include +#include + +void +gnu::java::nio::VMPipe::init (gnu::java::nio::PipeImpl*, /*self*/ + ::java::nio::channels::spi::SelectorProvider* + /*provider*/) +{ + int filedes [2]; + + if (_Jv_pipe (filedes) < 0) + throw new ::java::io::IOException (JvNewStringUTF (strerror (errno))); + + /* FIXME + source = new gnu::java::nio::PipeImpl$SourceChannelImpl + (this, provider, filedes [0]); + sink = new gnu::java::nio::PipeImpl$SinkChannelImpl + (this, provider, filedes [1]); + */ +} diff --git a/libjava/gnu/java/nio/natVMPipeWin32.cc b/libjava/gnu/java/nio/natVMPipeWin32.cc new file mode 100644 index 00000000000..5278c7a893e --- /dev/null +++ b/libjava/gnu/java/nio/natVMPipeWin32.cc @@ -0,0 +1,40 @@ +// natVMPipeImplWin32.cc + +/* Copyright (C) 2003, 2004, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include +#include + +#include +#include +#include + +#include +#include +//#include +//#include +#include +#include + +void +gnu::java::nio::VMPipe::init (gnu::java::nio::PipeImpl *self, + ::java::nio::channels::spi::SelectorProvider* /*provider*/) +{ + int filedes [2]; + + if (_Jv_pipe (filedes) < 0) + throw new ::java::io::IOException (JvNewStringUTF (strerror (errno))); + + /* FIXME + source = new gnu::java::nio::PipeImpl$SourceChannelImpl + (this, provider, filedes [0]); + sink = new gnu::java::nio::PipeImpl$SinkChannelImpl + (this, provider, filedes [1]); + */ +} diff --git a/libjava/gnu/java/nio/natVMSelectorEcos.cc b/libjava/gnu/java/nio/natVMSelectorEcos.cc new file mode 100644 index 00000000000..f2ebff809e0 --- /dev/null +++ b/libjava/gnu/java/nio/natVMSelectorEcos.cc @@ -0,0 +1,25 @@ +// natVMSelectorImplEcos.cc + +/* Copyright (C) 2003, 2004, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include +#include + +#include +#include + +#include +#include + +jint +gnu::java::nio::VMSelector::select (jintArray read, jintArray write, + jintArray except, jlong timeout) +{ + throw new ::java::io::IOException (JvNewStringUTF ("implSelect() not implemented")); +} diff --git a/libjava/gnu/java/nio/natVMSelectorPosix.cc b/libjava/gnu/java/nio/natVMSelectorPosix.cc new file mode 100644 index 00000000000..9f026792a01 --- /dev/null +++ b/libjava/gnu/java/nio/natVMSelectorPosix.cc @@ -0,0 +1,127 @@ +// natVMSelectorImplPosix.cc + +/* Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include +#include + +#include +#include + +#include +#include +#include +#include + +static void +helper_put_filedescriptors (jintArray fdArray, fd_set& fds, int& max_fd) +{ + jint* tmpFDArray = elements (fdArray); + + for (int index = 0; index < JvGetArrayLength (fdArray); index++) + { + int fd = tmpFDArray [index]; + if (fd > 0) + { + FD_SET (tmpFDArray [index], &fds); + + if (tmpFDArray [index] > max_fd) + max_fd = tmpFDArray [index]; + } + } +} + +static void +helper_get_filedescriptors (jintArray& fdArray, fd_set fds) +{ + jint* tmpFDArray = elements (fdArray); + + for (int index = 0; index < JvGetArrayLength (fdArray); index++) + { + int fd = tmpFDArray [index]; + if (fd < 0 || !FD_ISSET (fd, &fds)) + tmpFDArray [index] = 0; + } +} + +static void +helper_reset (jintArray& fdArray) +{ + jint* tmpFDArray = elements (fdArray); + + for (int index = 0; index < JvGetArrayLength (fdArray); index++) + tmpFDArray [index] = 0; +} + +jint +gnu::java::nio::VMSelector::select (jintArray read, jintArray write, + jintArray except, jlong timeout) +{ + jint result; + int max_fd = 0; + fd_set read_fds; + fd_set write_fds; + fd_set except_fds; + struct timeval real_time_data; + struct timeval *time_data = NULL; + + // If a legal timeout value isn't given, use NULL. + // This means an infinite timeout. The specification + // also says that a zero timeout should be treated + // as infinite. Otherwise (if the timeout value is legal), + // fill our timeval struct and use it for the select. + if (timeout > 0) + { + real_time_data.tv_sec = timeout / 1000; + real_time_data.tv_usec = (timeout % 1000) * 1000; + time_data = &real_time_data; + } + + // Reset all fd_set structures + FD_ZERO (&read_fds); + FD_ZERO (&write_fds); + FD_ZERO (&except_fds); + + // Fill the fd_set data structures for the _Jv_select() call. + helper_put_filedescriptors (read, read_fds, max_fd); + helper_put_filedescriptors (write, write_fds, max_fd); + helper_put_filedescriptors (except, except_fds, max_fd); + + // Actually do the select + try + { + result = _Jv_select (max_fd + 1, &read_fds, &write_fds, + &except_fds, time_data); + } + catch (::java::io::InterruptedIOException *e) + { + // The behavior of JRE 1.4.1 is that no exception is thrown + // when the thread is interrupted, but the thread's interrupt + // status is set. Clear all of our select sets and return 0, + // indicating that nothing was selected. + ::java::lang::Thread::currentThread ()->interrupt (); + helper_reset (read); + helper_reset (write); + helper_reset (except); + return 0; + } + + if (result < 0) + { + char* strerr = strerror (errno); + throw new ::java::io::IOException (JvNewStringUTF (strerr)); + } + + // Set the file descriptors according to the values returned from select(). + helper_get_filedescriptors (read, read_fds); + helper_get_filedescriptors (write, write_fds); + helper_get_filedescriptors (except, except_fds); + + return result; +} diff --git a/libjava/gnu/java/nio/natVMSelectorWin32.cc b/libjava/gnu/java/nio/natVMSelectorWin32.cc new file mode 100644 index 00000000000..790de22e413 --- /dev/null +++ b/libjava/gnu/java/nio/natVMSelectorWin32.cc @@ -0,0 +1,93 @@ +// natVMSelectorImplWin32.cc + +/* Copyright (C) 2003, 2004, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include +#include + +#include +#include + +jint +gnu::java::nio::VMSelector::select (jintArray read, jintArray write, + jintArray except, jlong timeout) +{ + // FIXME: The API for implSelect is biased towards POSIX implementations. + jint* pReadFD = elements (read); + int nNbReadFDs = JvGetArrayLength (read); + + jint* pWriteFD = elements (write); + int nNbWriteFDs = JvGetArrayLength (write); + + int nNbEvents = nNbReadFDs + nNbWriteFDs; + + // Create and initialize our event wrapper array + + // FIXME: We're creating fresh WSAEVENTs for each call. + // This is inefficient. It would probably be better to cache these + // in the Win32 socket implementation class. + WSAEventWrapper aArray[nNbEvents]; + + int nCurIndex = 0; + for (int i=0; i < nNbReadFDs; ++i) + aArray[nCurIndex++].init(pReadFD[i], FD_ACCEPT | FD_READ); + + for (int i=0; i < nNbWriteFDs; ++i) + aArray[nCurIndex++].init(pWriteFD[i], FD_WRITE); + + // Build our array of WSAEVENTs to wait on. Also throw in our thread's + // interrupt event in order to detect thread interruption. + HANDLE arh[nNbEvents + 1]; + for (int i=0; i < nNbEvents; ++i) + arh[i] = aArray[i].getEventHandle(); + arh[nNbEvents] = _Jv_Win32GetInterruptEvent (); + + // A timeout value of 0 needs to be treated as infinite. + if (timeout <= 0) + timeout = WSA_INFINITE; + + // Do the select. + DWORD dwRet = WSAWaitForMultipleEvents (nNbEvents+1, arh, 0, timeout, false); + + if (dwRet == WSA_WAIT_FAILED) + _Jv_ThrowIOException (); + + // Before we do anything else, clear output file descriptor arrays. + memset(pReadFD, 0, sizeof(jint) * nNbReadFDs); + memset(pWriteFD, 0, sizeof(jint) * nNbWriteFDs); + memset(elements (except), 0, sizeof(jint) * JvGetArrayLength (except)); + + if (dwRet == DWORD(WSA_WAIT_EVENT_0 + nNbEvents)) + { + // We were interrupted. Set the current thread's interrupt + // status and get out of here, with nothing selected.. + ::java::lang::Thread::currentThread ()->interrupt (); + return 0; + } + else if (dwRet < DWORD(WSA_WAIT_EVENT_0 + nNbEvents)) + { + int nSelectedEventIndex = dwRet - WSA_WAIT_EVENT_0; + + // Record the selected file descriptor. + // FIXME: This implementation only allows one file descriptor + // to be selected at a time. Remedy this by looping on + // WSAWaitForMultipleEvents 'til nothing more is selected. + jint fd = aArray[nSelectedEventIndex].getFD(); + if (nSelectedEventIndex < nNbReadFDs) + pReadFD[0] = fd; + else + pWriteFD[0] = fd; + + return 1; + } + else + // None of the event objects was signalled, so nothing was + // selected. + return 0; +} diff --git a/libjava/java/io/natObjectInputStream.cc b/libjava/java/io/natObjectInputStream.cc deleted file mode 100644 index 62123965526..00000000000 --- a/libjava/java/io/natObjectInputStream.cc +++ /dev/null @@ -1,70 +0,0 @@ -// natObjectInputStream.cc - Native part of VMObjectInputStream class. - -/* Copyright (C) 1998, 1999, 2000, 2001, 2005, 2006 Free Software Foundation - - This ObjectInputStream is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the ObjectInputStream "LIBGCJ_LICENSE" for -details. */ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef DEBUG -#include -#include -#endif - -jobject -java::io::VMObjectInputStream::allocateObject (jclass klass, jclass, - ::java::lang::reflect::Constructor *ctr) -{ - jobject obj = NULL; - using namespace java::lang::reflect; - - try - { - JvAssert (klass && ! klass->isArray ()); - if (klass->isInterface() || Modifier::isAbstract(klass->getModifiers())) - obj = NULL; - else - { - obj = _Jv_AllocObject (klass); - } - } - catch (jthrowable t) - { - return NULL; - } - - jmethodID meth = _Jv_FromReflectedConstructor (ctr); - - // This is a bit inefficient, and a bit of a hack, since we don't - // actually use the Method and since what is returned isn't - // technically a Method. We can't use Method.invoke as it looks up - // the declared method. - JArray *arg_types - = (JArray *) JvNewObjectArray (0, &java::lang::Class::class$, - NULL); - - // We lie about this being a constructor. If we put `true' here - // then _Jv_CallAnyMethodA would try to allocate the object for us. - _Jv_CallAnyMethodA (obj, JvPrimClass (void), meth, false, arg_types, NULL); - - return obj; -} diff --git a/libjava/java/io/natVMObjectInputStream.cc b/libjava/java/io/natVMObjectInputStream.cc new file mode 100644 index 00000000000..86410a4e76b --- /dev/null +++ b/libjava/java/io/natVMObjectInputStream.cc @@ -0,0 +1,71 @@ +// natVMObjectInputStream.cc - Native part of VMObjectInputStream class. + +/* Copyright (C) 1998, 1999, 2000, 2001, 2005, 2006, 2007 + Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the ObjectInputStream "LIBGCJ_LICENSE" for +details. */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DEBUG +#include +#include +#endif + +jobject +java::io::VMObjectInputStream::allocateObject (jclass klass, jclass, + ::java::lang::reflect::Constructor *ctr) +{ + jobject obj = NULL; + using namespace java::lang::reflect; + + try + { + JvAssert (klass && ! klass->isArray ()); + if (klass->isInterface() || Modifier::isAbstract(klass->getModifiers())) + obj = NULL; + else + { + obj = _Jv_AllocObject (klass); + } + } + catch (jthrowable t) + { + return NULL; + } + + jmethodID meth = _Jv_FromReflectedConstructor (ctr); + + // This is a bit inefficient, and a bit of a hack, since we don't + // actually use the Method and since what is returned isn't + // technically a Method. We can't use Method.invoke as it looks up + // the declared method. + JArray *arg_types + = (JArray *) JvNewObjectArray (0, &java::lang::Class::class$, + NULL); + + // We lie about this being a constructor. If we put `true' here + // then _Jv_CallAnyMethodA would try to allocate the object for us. + _Jv_CallAnyMethodA (obj, JvPrimClass (void), meth, false, arg_types, NULL); + + return obj; +} diff --git a/libjava/java/lang/natDouble.cc b/libjava/java/lang/natDouble.cc deleted file mode 100644 index 87123bc1bc6..00000000000 --- a/libjava/java/lang/natDouble.cc +++ /dev/null @@ -1,214 +0,0 @@ -// natDouble.cc - Implementation of java.lang.VMDouble native methods. - -/* Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006, 2007 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "fdlibm.h" - -union u -{ - jlong l; - jdouble d; -}; - -jlong -java::lang::VMDouble::doubleToLongBits(jdouble value) -{ - union u u; - u.d = value; - - jlong e = u.l & 0x7ff0000000000000LL; - jlong f = u.l & 0x000fffffffffffffLL; - - if (e == 0x7ff0000000000000LL && f != 0L) - u.l = 0x7ff8000000000000LL; - - return u.l; -} - -jlong -java::lang::VMDouble::doubleToRawLongBits(jdouble value) -{ - union u u; - u.d = value; - return u.l; -} - -jdouble -java::lang::VMDouble::longBitsToDouble(jlong bits) -{ - union u u; - u.l = bits; - return u.d; -} - -jstring -java::lang::VMDouble::toString(jdouble value, jboolean isFloat) -{ - if (Double::isNaN (value)) - return JvNewStringLatin1 ("NaN", sizeof ("NaN") - 1); - - if (value == Double::POSITIVE_INFINITY) - return JvNewStringLatin1 ("Infinity", sizeof ("Infinity") - 1); - - if (value == Double::NEGATIVE_INFINITY) - return JvNewStringLatin1 ("-Infinity", sizeof ("-Infinity") - 1); - - char buffer[50], result[50]; - int decpt, sign; - - _dtoa (value, 0, 20, &decpt, &sign, NULL, buffer, (int)isFloat); - - value = fabs (value); - - char *s = buffer; - char *d = result; - - if (sign) - *d++ = '-'; - - if ((value >= 1e-3 && value < 1e7) || value == 0) - { - if (decpt <= 0) - *d++ = '0'; - else - { - for (int i = 0; i < decpt; i++) - if (*s) - *d++ = *s++; - else - *d++ = '0'; - } - - *d++ = '.'; - - if (*s == 0) - { - *d++ = '0'; - decpt++; - } - - while (decpt++ < 0) - *d++ = '0'; - - while (*s) - *d++ = *s++; - - *d = 0; - - return JvNewStringLatin1 (result, strlen (result)); - } - - *d++ = *s++; - decpt--; - *d++ = '.'; - - if (*s == 0) - *d++ = '0'; - - while (*s) - *d++ = *s++; - - *d++ = 'E'; - - if (decpt < 0) - { - *d++ = '-'; - decpt = -decpt; - } - - { - char exp[4]; - char *e = exp + sizeof exp; - - *--e = 0; - do - { - *--e = '0' + decpt % 10; - decpt /= 10; - } - while (decpt > 0); - - while (*e) - *d++ = *e++; - } - - *d = 0; - - return JvNewStringLatin1 (result, strlen (result)); -} - -jdouble -java::lang::VMDouble::parseDouble(jstring str) -{ - int length = str->length(); - - while (length > 0 - && Character::isWhitespace(str->charAt(length - 1))) - length--; - - // The String could end with a f/F/d/D which is valid but we don't need. - bool saw_trailer = false; - if (length > 0) - { - jchar last = str->charAt(length-1); - if (last == 'f' || last == 'F' || last == 'd' || last == 'D') - { - length--; - saw_trailer = true; - } - } - - jsize start = 0; - while (length > 0 - && Character::isWhitespace(str->charAt(start))) - start++, length--; - - if (length > 0) - { - // Note that UTF can expand 3x. - char *data = (char *) __builtin_alloca (3 * length + 1); - jsize blength = _Jv_GetStringUTFRegion (str, start, length, data); - data[blength] = 0; - - if (! saw_trailer) - { - if (! strcmp (data, "NaN") || ! strcmp (data, "+NaN") - || ! strcmp (data, "-NaN")) - return Double::NaN; - else if (! strcmp (data, "Infinity") || ! strcmp (data, "+Infinity")) - return Double::POSITIVE_INFINITY; - else if (! strcmp (data, "-Infinity")) - return Double::NEGATIVE_INFINITY; - } - - struct _Jv_reent reent; - memset (&reent, 0, sizeof reent); - - char *endptr; - double val = _strtod_r (&reent, data, &endptr); - if (endptr == data + blength) - return val; - } - throw new NumberFormatException(str); -} diff --git a/libjava/java/lang/natFloat.cc b/libjava/java/lang/natFloat.cc deleted file mode 100644 index f090b815e26..00000000000 --- a/libjava/java/lang/natFloat.cc +++ /dev/null @@ -1,52 +0,0 @@ -// natFloat.cc - Implementation of java.lang.VMFloat native methods. - -/* Copyright (C) 1998, 1999, 2001, 2006 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include - -#include -#include -#include - -union u -{ - jint l; - jfloat d; -}; - -jint -java::lang::VMFloat::floatToIntBits(jfloat value) -{ - union u u; - u.d = value; - jint e = u.l & 0x7f800000; - jint f = u.l & 0x007fffff; - - if (e == 0x7f800000 && f != 0) - u.l = 0x7fc00000; - - return u.l; -} - -jint -java::lang::VMFloat::floatToRawIntBits(jfloat value) -{ - union u u; - u.d = value; - return u.l; -} - -jfloat -java::lang::VMFloat::intBitsToFloat(jint bits) -{ - union u u; - u.l = bits; - return u.d; -} - diff --git a/libjava/java/lang/natVMDouble.cc b/libjava/java/lang/natVMDouble.cc new file mode 100644 index 00000000000..f770bc422f8 --- /dev/null +++ b/libjava/java/lang/natVMDouble.cc @@ -0,0 +1,215 @@ +// natVMDouble.cc - Implementation of java.lang.VMDouble native methods. + +/* Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006, 2007 + Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "fdlibm.h" + +union u +{ + jlong l; + jdouble d; +}; + +jlong +java::lang::VMDouble::doubleToLongBits(jdouble value) +{ + union u u; + u.d = value; + + jlong e = u.l & 0x7ff0000000000000LL; + jlong f = u.l & 0x000fffffffffffffLL; + + if (e == 0x7ff0000000000000LL && f != 0L) + u.l = 0x7ff8000000000000LL; + + return u.l; +} + +jlong +java::lang::VMDouble::doubleToRawLongBits(jdouble value) +{ + union u u; + u.d = value; + return u.l; +} + +jdouble +java::lang::VMDouble::longBitsToDouble(jlong bits) +{ + union u u; + u.l = bits; + return u.d; +} + +jstring +java::lang::VMDouble::toString(jdouble value, jboolean isFloat) +{ + if (Double::isNaN (value)) + return JvNewStringLatin1 ("NaN", sizeof ("NaN") - 1); + + if (value == Double::POSITIVE_INFINITY) + return JvNewStringLatin1 ("Infinity", sizeof ("Infinity") - 1); + + if (value == Double::NEGATIVE_INFINITY) + return JvNewStringLatin1 ("-Infinity", sizeof ("-Infinity") - 1); + + char buffer[50], result[50]; + int decpt, sign; + + _dtoa (value, 0, 20, &decpt, &sign, NULL, buffer, (int)isFloat); + + value = fabs (value); + + char *s = buffer; + char *d = result; + + if (sign) + *d++ = '-'; + + if ((value >= 1e-3 && value < 1e7) || value == 0) + { + if (decpt <= 0) + *d++ = '0'; + else + { + for (int i = 0; i < decpt; i++) + if (*s) + *d++ = *s++; + else + *d++ = '0'; + } + + *d++ = '.'; + + if (*s == 0) + { + *d++ = '0'; + decpt++; + } + + while (decpt++ < 0) + *d++ = '0'; + + while (*s) + *d++ = *s++; + + *d = 0; + + return JvNewStringLatin1 (result, strlen (result)); + } + + *d++ = *s++; + decpt--; + *d++ = '.'; + + if (*s == 0) + *d++ = '0'; + + while (*s) + *d++ = *s++; + + *d++ = 'E'; + + if (decpt < 0) + { + *d++ = '-'; + decpt = -decpt; + } + + { + char exp[4]; + char *e = exp + sizeof exp; + + *--e = 0; + do + { + *--e = '0' + decpt % 10; + decpt /= 10; + } + while (decpt > 0); + + while (*e) + *d++ = *e++; + } + + *d = 0; + + return JvNewStringLatin1 (result, strlen (result)); +} + +jdouble +java::lang::VMDouble::parseDouble(jstring str) +{ + int length = str->length(); + + while (length > 0 + && Character::isWhitespace(str->charAt(length - 1))) + length--; + + // The String could end with a f/F/d/D which is valid but we don't need. + bool saw_trailer = false; + if (length > 0) + { + jchar last = str->charAt(length-1); + if (last == 'f' || last == 'F' || last == 'd' || last == 'D') + { + length--; + saw_trailer = true; + } + } + + jsize start = 0; + while (length > 0 + && Character::isWhitespace(str->charAt(start))) + start++, length--; + + if (length > 0) + { + // Note that UTF can expand 3x. + char *data = (char *) __builtin_alloca (3 * length + 1); + jsize blength = _Jv_GetStringUTFRegion (str, start, length, data); + data[blength] = 0; + + if (! saw_trailer) + { + if (! strcmp (data, "NaN") || ! strcmp (data, "+NaN") + || ! strcmp (data, "-NaN")) + return Double::NaN; + else if (! strcmp (data, "Infinity") || ! strcmp (data, "+Infinity")) + return Double::POSITIVE_INFINITY; + else if (! strcmp (data, "-Infinity")) + return Double::NEGATIVE_INFINITY; + } + + struct _Jv_reent reent; + memset (&reent, 0, sizeof reent); + + char *endptr; + double val = _strtod_r (&reent, data, &endptr); + if (endptr == data + blength) + return val; + } + throw new NumberFormatException(str); +} diff --git a/libjava/java/lang/natVMFloat.cc b/libjava/java/lang/natVMFloat.cc new file mode 100644 index 00000000000..54ae5191ddb --- /dev/null +++ b/libjava/java/lang/natVMFloat.cc @@ -0,0 +1,52 @@ +// natVMFloat.cc - Implementation of java.lang.VMFloat native methods. + +/* Copyright (C) 1998, 1999, 2001, 2006, 2007 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + +#include + +#include +#include +#include + +union u +{ + jint l; + jfloat d; +}; + +jint +java::lang::VMFloat::floatToIntBits(jfloat value) +{ + union u u; + u.d = value; + jint e = u.l & 0x7f800000; + jint f = u.l & 0x007fffff; + + if (e == 0x7f800000 && f != 0) + u.l = 0x7fc00000; + + return u.l; +} + +jint +java::lang::VMFloat::floatToRawIntBits(jfloat value) +{ + union u u; + u.d = value; + return u.l; +} + +jfloat +java::lang::VMFloat::intBitsToFloat(jint bits) +{ + union u u; + u.l = bits; + return u.d; +} +