From 8aa540d2f783474d1d2e06f16744bf67b9c1facc Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 10 Mar 2006 21:46:48 +0000 Subject: Imported GNU Classpath 0.90 Imported GNU Classpath 0.90 * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore. * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant. * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5. * java/lang/Math.java: New override file. * java/lang/Character.java: Merged from Classpath. (start, end): Now 'int's. (canonicalName): New field. (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants. (UnicodeBlock): Added argument. (of): New overload. (forName): New method. Updated unicode blocks. (sets): Updated. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r111942 --- libjava/classpath/native/jni/java-lang/Makefile.am | 2 +- libjava/classpath/native/jni/java-lang/Makefile.in | 14 +- .../native/jni/java-lang/java_lang_Math.c | 161 --------------- .../native/jni/java-lang/java_lang_VMDouble.c | 22 +- .../native/jni/java-lang/java_lang_VMMath.c | 225 +++++++++++++++++++++ 5 files changed, 258 insertions(+), 166 deletions(-) delete mode 100644 libjava/classpath/native/jni/java-lang/java_lang_Math.c create mode 100644 libjava/classpath/native/jni/java-lang/java_lang_VMMath.c (limited to 'libjava/classpath/native/jni/java-lang') diff --git a/libjava/classpath/native/jni/java-lang/Makefile.am b/libjava/classpath/native/jni/java-lang/Makefile.am index fb8390f..db8a3a6 100644 --- a/libjava/classpath/native/jni/java-lang/Makefile.am +++ b/libjava/classpath/native/jni/java-lang/Makefile.am @@ -3,7 +3,7 @@ nativelib_LTLIBRARIES = libjavalang.la libjavalangreflect.la libjavalang_la_SOURCES = java_lang_VMSystem.c \ java_lang_VMFloat.c \ java_lang_VMDouble.c \ - java_lang_Math.c \ + java_lang_VMMath.c \ java_lang_VMProcess.c libjavalang_la_LIBADD = $(wildcard $(top_builddir)/native/fdlibm/*.lo) \ diff --git a/libjava/classpath/native/jni/java-lang/Makefile.in b/libjava/classpath/native/jni/java-lang/Makefile.in index aacb56f..bc26561 100644 --- a/libjava/classpath/native/jni/java-lang/Makefile.in +++ b/libjava/classpath/native/jni/java-lang/Makefile.in @@ -67,7 +67,8 @@ libjavalang_la_DEPENDENCIES = $(wildcard \ $(top_builddir)/native/fdlibm/*.lo) \ $(top_builddir)/native/jni/classpath/jcl.lo am_libjavalang_la_OBJECTS = java_lang_VMSystem.lo java_lang_VMFloat.lo \ - java_lang_VMDouble.lo java_lang_Math.lo java_lang_VMProcess.lo + java_lang_VMDouble.lo java_lang_VMMath.lo \ + java_lang_VMProcess.lo libjavalang_la_OBJECTS = $(am_libjavalang_la_OBJECTS) libjavalangreflect_la_LIBADD = am_libjavalangreflect_la_OBJECTS = java_lang_reflect_Array.lo @@ -106,6 +107,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@ CLASSPATH_MODULE = @CLASSPATH_MODULE@ +COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -113,6 +115,8 @@ CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@ CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@ CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@ CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@ +CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@ +CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@ CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@ CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@ @@ -143,6 +147,7 @@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXAMPLESDIR = @EXAMPLESDIR@ EXEEXT = @EXEEXT@ +FASTJAR = @FASTJAR@ FIND = @FIND@ FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@ FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@ @@ -154,6 +159,8 @@ FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@ FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@ FOUND_KJC_FALSE = @FOUND_KJC_FALSE@ FOUND_KJC_TRUE = @FOUND_KJC_TRUE@ +FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ +FREETYPE2_LIBS = @FREETYPE2_LIBS@ GCJ = @GCJ@ GCJX = @GCJX@ GJDOC = @GJDOC@ @@ -204,6 +211,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@ PANGOFT2_LIBS = @PANGOFT2_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ @@ -285,7 +293,7 @@ nativelib_LTLIBRARIES = libjavalang.la libjavalangreflect.la libjavalang_la_SOURCES = java_lang_VMSystem.c \ java_lang_VMFloat.c \ java_lang_VMDouble.c \ - java_lang_Math.c \ + java_lang_VMMath.c \ java_lang_VMProcess.c libjavalang_la_LIBADD = $(wildcard $(top_builddir)/native/fdlibm/*.lo) \ @@ -366,9 +374,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_Math.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMDouble.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMFloat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMMath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMProcess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMSystem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_reflect_Array.Plo@am__quote@ diff --git a/libjava/classpath/native/jni/java-lang/java_lang_Math.c b/libjava/classpath/native/jni/java-lang/java_lang_Math.c deleted file mode 100644 index b4b88a7..0000000 --- a/libjava/classpath/native/jni/java-lang/java_lang_Math.c +++ /dev/null @@ -1,161 +0,0 @@ -/* Math.c - java.lang.Math native functions - Copyright (C) 1998, 1999, 2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include -#include -#include - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_sin - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return sin (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_cos - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return cos (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_tan - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return tan (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_asin - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return asin (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_acos - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return acos (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_atan - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return atan (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_atan2 - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble y, jdouble x) -{ - return atan2 (y, x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_exp - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return exp (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_log - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return log (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_sqrt - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return sqrt (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_pow - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x, jdouble y) -{ - return pow (x, y); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_IEEEremainder - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x, jdouble y) -{ - return remainder (x, y); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_ceil - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return ceil (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_floor - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return floor (x); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_Math_rint - (JNIEnv * env __attribute__ ((__unused__)), - jclass cls __attribute__ ((__unused__)), jdouble x) -{ - return rint (x); -} diff --git a/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c b/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c index 076f42b..8435c3f 100644 --- a/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c +++ b/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c @@ -1,5 +1,5 @@ /* VMDouble.c - java.lang.VMDouble native functions - Copyright (C) 1998, 1999, 2001, 2003, 2004i, 2005 + Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -123,6 +123,16 @@ Java_java_lang_VMDouble_doubleToLongBits jlong e, f; val.d = doubleValue; +#if defined(__IEEE_BYTES_LITTLE_ENDIAN) + /* On little endian ARM processors when using FPA, word order of + doubles is still big endian. So take that into account here. When + using VFP, word order of doubles follows byte order. */ + +#define SWAP_DOUBLE(a) (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff)) + + val.j = SWAP_DOUBLE(val.j); +#endif + e = val.j & 0x7ff0000000000000LL; f = val.j & 0x000fffffffffffffLL; @@ -144,6 +154,11 @@ Java_java_lang_VMDouble_doubleToRawLongBits { jvalue val; val.d = doubleValue; + +#if defined(__IEEE_BYTES_LITTLE_ENDIAN) + val.j = SWAP_DOUBLE(val.j); +#endif + return val.j; } @@ -159,6 +174,11 @@ Java_java_lang_VMDouble_longBitsToDouble { jvalue val; val.j = longValue; + +#if defined(__IEEE_BYTES_LITTLE_ENDIAN) + val.j = SWAP_DOUBLE(val.j); +#endif + return val.d; } diff --git a/libjava/classpath/native/jni/java-lang/java_lang_VMMath.c b/libjava/classpath/native/jni/java-lang/java_lang_VMMath.c new file mode 100644 index 0000000..de7851f --- /dev/null +++ b/libjava/classpath/native/jni/java-lang/java_lang_VMMath.c @@ -0,0 +1,225 @@ +/* VMMath.c - java.lang.VMMath native functions + Copyright (C) 1998, 1999, 2004, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +#include +#include +#include + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_sin + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return sin (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_cos + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return cos (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_tan + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return tan (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_asin + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return asin (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_acos + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return acos (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_atan + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return atan (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_atan2 + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble y, jdouble x) +{ + return atan2 (y, x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_exp + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return exp (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_log + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return log (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_sqrt + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return sqrt (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_pow + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x, jdouble y) +{ + return pow (x, y); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_IEEEremainder + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x, jdouble y) +{ + return remainder (x, y); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_ceil + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return ceil (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_floor + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return floor (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_rint + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return rint (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_cbrt + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return cbrt (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_cosh + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return cosh (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_expm1 + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return expm1 (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_hypot + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x, jdouble y) +{ + return hypot (x, y); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_log10 + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return log10 (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_log1p + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return log1p (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_sinh + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return sinh (x); +} + +JNIEXPORT jdouble JNICALL +Java_java_lang_VMMath_tanh + (JNIEnv * env __attribute__ ((__unused__)), + jclass cls __attribute__ ((__unused__)), jdouble x) +{ + return tanh (x); +} -- cgit v1.1