[kaffe] CVS kaffe (robilad): resynced VMDouble.c with classpath

Kaffe CVS cvs-commits at kaffe.org
Mon Apr 17 04:24:36 PDT 2006


PatchSet 7228 
Date: 2006/04/17 11:11:19
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
resynced VMDouble.c with classpath

2006-04-17  Dalibor Topic  <robilad at kaffe.org>

        * libraries/clib/native/java_lang_VMDouble.c:
        Resynced with GNU Classpath.

        2006-01-26  Christian Thalinger  <twisti at complang.tuwien.ac.at>

        * native/jni/java-lang/java_lang_VMDouble.c (doubleToLongBits)
        (doubleToRawLongBits, longBitsToDouble): Swap the byte
        ordering for little-endian arms without VFP.

        2005-11-15  Christian Thalinger  <twisti at complang.tuwien.ac.at>

        * native/jni/java-lang/java_lang_VMDouble.c (initIDs): Register
        clsDouble as global ref.

        2005-08-24  Mark Wielaard  <mark at klomp.org>

        * native/jni/java-lang/java_lang_VMDouble.c
        (Java_java_lang_VMDouble_parseDouble): Remove KISSME_LINUX_USER hack.

Members: 
	ChangeLog:1.4734->1.4735 
	libraries/clib/native/java_lang_VMDouble.c:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4734 kaffe/ChangeLog:1.4735
--- kaffe/ChangeLog:1.4734	Sun Apr 16 23:49:13 2006
+++ kaffe/ChangeLog	Mon Apr 17 11:11:19 2006
@@ -1,3 +1,24 @@
+2006-04-17  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/clib/native/java_lang_VMDouble.c:
+	Resynced with GNU Classpath.
+
+	2006-01-26  Christian Thalinger  <twisti at complang.tuwien.ac.at>
+
+        * native/jni/java-lang/java_lang_VMDouble.c (doubleToLongBits)
+        (doubleToRawLongBits, longBitsToDouble): Swap the byte
+        ordering for little-endian arms without VFP.
+
+	2005-11-15  Christian Thalinger  <twisti at complang.tuwien.ac.at>
+
+        * native/jni/java-lang/java_lang_VMDouble.c (initIDs): Register
+        clsDouble as global ref.
+
+	2005-08-24  Mark Wielaard  <mark at klomp.org>
+
+        * native/jni/java-lang/java_lang_VMDouble.c
+        (Java_java_lang_VMDouble_parseDouble): Remove KISSME_LINUX_USER hack.
+
 2006-04-16  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/jni/jni-base.c (detectAllActiveThreads):
Index: kaffe/libraries/clib/native/java_lang_VMDouble.c
diff -u kaffe/libraries/clib/native/java_lang_VMDouble.c:1.4 kaffe/libraries/clib/native/java_lang_VMDouble.c:1.5
--- kaffe/libraries/clib/native/java_lang_VMDouble.c:1.4	Sun Mar  5 14:03:49 2006
+++ kaffe/libraries/clib/native/java_lang_VMDouble.c	Mon Apr 17 11:11:23 2006
@@ -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.
@@ -72,6 +72,11 @@
     {
       DBG ("unable to get class java.lang.Double\n") return;
     }
+  clsDouble = (*env)->NewGlobalRef(env, clsDouble);
+  if (clsDouble == NULL)
+    {
+      DBG ("unable to register class java.lang.Double as global ref\n") return;
+    }
   isNaNID = (*env)->GetStaticMethodID (env, clsDouble, "isNaN", "(D)Z");
   if (isNaNID == NULL)
     {
@@ -119,6 +124,16 @@
   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;
 
@@ -140,6 +155,11 @@
 {
   jvalue val;
   val.d = doubleValue;
+
+#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
+  val.j = SWAP_DOUBLE(val.j);
+#endif
+
   return val.j;
 }
 
@@ -155,6 +175,11 @@
 {
   jvalue val;
   val.j = longValue;
+
+#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
+  val.j = SWAP_DOUBLE(val.j);
+#endif
+
   return val.d;
 }
 
@@ -222,12 +247,7 @@
       struct _Jv_reent reent;
       memset (&reent, 0, sizeof reent);
 
-#ifdef KISSME_LINUX_USER
-      /* FIXME: The libc strtod may not be reliable. */
-      val = strtod (p, &endptr);
-#else
       val = _strtod_r (&reent, p, &endptr);
-#endif
 
 #ifdef DEBUG
       fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);




More information about the kaffe mailing list