--- /home/cpdev/src/classpath/java/lang/Double.java	2005-07-02 21:03:31.000000000 +0000
+++ java/lang/Double.java	2005-06-30 05:34:38.000000000 +0000
@@ -103,6 +103,18 @@
   private final double value;
 
   /**
+   * Load native routines necessary for this class.
+   */
+  static
+  {
+    if (Configuration.INIT_LOAD_LIBRARY)
+      {
+	System.loadLibrary("javalang");
+	initIDs();
+      }
+  }
+
+  /**
    * Create a <code>Double</code> from the primitive <code>double</code>
    * specified.
    *
@@ -164,7 +176,7 @@
    */
   public static String toString(double d)
   {
-    return VMDouble.toString(d, false);
+    return toString(d, false);
   }
 
   /**
@@ -231,10 +243,7 @@
    * @see #NEGATIVE_INFINITY
    * @since 1.2
    */
-  public static double parseDouble(String str)
-  {
-    return VMDouble.parseDouble(str);
-  }
+  public static native double parseDouble(String str);
 
   /**
    * Return <code>true</code> if the <code>double</code> has the same
@@ -419,10 +428,9 @@
    * @return the bits of the <code>double</code>
    * @see #longBitsToDouble(long)
    */
-  public static long doubleToLongBits(double value)
-  {
-    return VMDouble.doubleToLongBits(value);
-  }
+  // GCJ LOCAL: We diverge from Classpath for efficiency.
+  public static native long doubleToLongBits(double value);
+  // END GCJ LOCAL
 
   /**
    * Convert the double to the IEEE 754 floating-point "double format" bit
@@ -438,10 +446,9 @@
    * @return the bits of the <code>double</code>
    * @see #longBitsToDouble(long)
    */
-  public static long doubleToRawLongBits(double value)
-  {
-    return VMDouble.doubleToRawLongBits(value);
-  }
+  // GCJ LOCAL: We diverge from Classpath for efficiency.
+  public static native long doubleToRawLongBits(double value);
+  // END GCJ LOCAL
 
   /**
    * Convert the argument in IEEE 754 floating-point "double format" bit
@@ -456,10 +463,9 @@
    * @see #doubleToLongBits(double)
    * @see #doubleToRawLongBits(double)
    */
-  public static double longBitsToDouble(long bits)
-  {
-    return VMDouble.longBitsToDouble(bits);
-  }
+  // GCJ LOCAL: We diverge from Classpath for efficiency.
+  public static native double longBitsToDouble(long bits);
+  // END GCJ LOCAL
 
   /**
    * Compare two Doubles numerically by comparing their <code>double</code>
@@ -518,4 +524,20 @@
 
     return x > y ? 1 : -1;
   }
+
+  /**
+   * Helper method to convert to string.
+   *
+   * @param d the double to convert
+   * @param isFloat true if the conversion is requested by Float (results in
+   *        fewer digits)
+   */
+  // Package visible for use by Float.
+  static native String toString(double d, boolean isFloat);
+
+  /**
+   * Initialize JNI cache.  This method is called only by the
+   * static initializer when using JNI.
+   */
+  private static native void initIDs();
 }
