harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r503632 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/native: include/shared/ luni/shared/ luni/unix/ luni/windows/
Date Mon, 05 Feb 2007 11:10:14 GMT
Author: pyang
Date: Mon Feb  5 03:10:11 2007
New Revision: 503632

URL: http://svn.apache.org/viewvc?view=rev&rev=503632
Log:
Apply patch for HARMONY-3106 ([classlib][luni]add some cache ids to improve performance and rename JCL to Harmony)

Added:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/harmonyglob.h
      - copied, changed from r503532, harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/jclglob.h
Removed:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/jclglob.h
Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/libglob.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/inetadds.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.h
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/osc.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/proxy.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/procimpl.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/libglob.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/libglob.h?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/libglob.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/shared/libglob.h Mon Feb  5 03:10:11 2007
@@ -23,6 +23,10 @@
 	(((JniIDCache*) HY_VMLS_GET((env), JCL_ID_CACHE))->x)
 #define JCL_CACHE_SET(env,x,v) \
 	(((JniIDCache*) HY_VMLS_GET((env), JCL_ID_CACHE))->x = (v))
+#define HARMONY_CACHE_GET(env,x) \
+	(((JniIDCache*) HY_VMLS_GET((env), HARMONY_ID_CACHE))->x)
+#define HARMONY_CACHE_SET(env,x,v) \
+	(((JniIDCache*) HY_VMLS_GET((env), HARMONY_ID_CACHE))->x = (v))	
 #define jclmem_allocate_memory(env, byteAmount) \
 	hymem_allocate_memory(byteAmount)
 #define jclmem_free_memory(env, buf) \

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c Mon Feb  5 03:10:11 2007
@@ -1,4 +1,4 @@
-/*
+ /*
  *  Licensed to the Apache Software Foundation (ASF) under one or more
  *  contributor license agreements.  See the NOTICE file distributed with
  *  this work for additional information regarding copyright ownership.
@@ -22,7 +22,7 @@
 #include "jclprots.h"
 #include "hysock.h"
 #include "socket.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 void setSocketImplPort (JNIEnv * env, jobject socketImpl, U_16 hPort);
 void setSocketImplAddress (JNIEnv * env, jobject socketImpl,
@@ -57,7 +57,7 @@
 setDatagramPacketAddress (JNIEnv * env,	jobject	datagramPacket,	
 	jobject	anInetAddress)
 {
-  jfieldID fid = JCL_CACHE_GET (env, FID_java_net_DatagramPacket_address);
+  jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_DatagramPacket_address);
   //jfieldID fid = getJavaNetDatagramPacketAddress(env);
   (*env)->SetObjectField (env, datagramPacket, fid, anInetAddress);
 }
@@ -73,7 +73,7 @@
 void
 setDatagramPacketPort (JNIEnv *	env, jobject datagramPacket, U_16 hPort)
 {
-  jfieldID fid = JCL_CACHE_GET (env, FID_java_net_DatagramPacket_port);  
+  jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_DatagramPacket_port);  
   //jfieldID fid = getJavaNetDatagramPacketPort(env);
   (*env)->SetIntField (env, datagramPacket, fid, hPort);
 }
@@ -89,7 +89,7 @@
 void
 setDatagramPacketLength	(JNIEnv	* env, jobject datagramPacket, I_32 length)
 {
-  jfieldID fid = JCL_CACHE_GET (env, FID_java_net_DatagramPacket_length);
+  jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_DatagramPacket_length);
   //jfieldID fid = getJavaNetDatagramPacketLength(env);
   (*env)->SetIntField (env, datagramPacket, fid, length);
 }
@@ -143,7 +143,7 @@
   U_32 scope_id	= 0;
   hysock_sockaddr_address6 (sockaddrP, (U_8 *) ipv4Addr, &length, &scope_id);
   (*env)->SetObjectField (env, senderAddress,	
-  	  JCL_CACHE_GET	(env,
+  	  HARMONY_CACHE_GET	(env,
   	     FID_java_net_InetAddress_address),	
   	  newJavaByteArray (env, ipv4Addr, length));
   /* 
@@ -151,7 +151,7 @@
 	getJavaNetInetAddressIpaddress(env),
 	newJavaByteArray (env, ipv4Addr, length));
   */
-  if (jcl_supports_ipv6	(env) && (scope_id != 0))
+  if (harmony_supports_ipv6	(env) && (scope_id != 0))
     {
       jclass tempClass = getJavaNetInetAddressClass(env);
       jfieldID fid = NULL;
@@ -209,7 +209,7 @@
 void
 setSocketImplAddress (JNIEnv * env, jobject socketImpl,	jobject	anInetAddress)
 {
-  jfieldID fid = JCL_CACHE_GET (env, FID_java_net_SocketImpl_address);  
+  jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_SocketImpl_address);  
   //jfieldID fid = getJavaNetSocketImplAddress(env);
   (*env)->SetObjectField (env, socketImpl, fid,	anInetAddress);	
 }
@@ -225,7 +225,7 @@
 void
 setSocketImplPort (JNIEnv * env, jobject socketImpl, U_16 hPort)
 {
-  jfieldID fid = JCL_CACHE_GET (env, FID_java_net_SocketImpl_port);  
+  jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_SocketImpl_port);  
   //jfieldID fid = getJavaNetSocketImplPort( env);
   (*env)->SetIntField (env, socketImpl,	fid, hPort);
 }
@@ -289,17 +289,17 @@
       "Ljava/net/InetAddress;");
   if (!fid)
     return;
-  JCL_CACHE_SET	(env, FID_java_net_DatagramPacket_address, fid);
+  HARMONY_CACHE_SET	(env, FID_java_net_DatagramPacket_address, fid);
 
   fid =	(*env)->GetFieldID (env, lookupClass, "length",	"I");
   if (!fid)
     return;
-  JCL_CACHE_SET	(env, FID_java_net_DatagramPacket_length, fid);	
+  HARMONY_CACHE_SET	(env, FID_java_net_DatagramPacket_length, fid);	
 
   fid =	(*env)->GetFieldID (env, lookupClass, "port", "I");
   if (!fid)
     return;
-  JCL_CACHE_SET	(env, FID_java_net_DatagramPacket_port,	fid);
+  HARMONY_CACHE_SET	(env, FID_java_net_DatagramPacket_port,	fid);
 }
 
 /*
@@ -308,11 +308,11 @@
  * Signature: (Z)V
  */
 JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_oneTimeInitializationImpl(JNIEnv	* env, jclass clazz,
-	    jboolean jcl_supports_ipv6)	
+	    jboolean harmony_supports_ipv6)	
 {
   jfieldID fid;	
   jclass lookupClass;
-  netInitializeIDCaches (env,	jcl_supports_ipv6);
+  netInitializeIDCaches (env,	harmony_supports_ipv6);
 
   lookupClass =	(*env)->FindClass (env,	"java/net/SocketImpl");	
   if (!lookupClass)
@@ -321,12 +321,12 @@
   fid =	(*env)->GetFieldID (env, lookupClass, "address", "Ljava/net/InetAddress;");
   if (!fid)
     return;
-  JCL_CACHE_SET (env,	FID_java_net_SocketImpl_address, fid);
+  HARMONY_CACHE_SET (env,	FID_java_net_SocketImpl_address, fid);
 
   fid =	(*env)->GetFieldID (env, lookupClass, "port", "I");
   if (!fid)
     return;
-  JCL_CACHE_SET (env,	FID_java_net_SocketImpl_port, fid);
+  HARMONY_CACHE_SET (env,	FID_java_net_SocketImpl_port, fid);
   
     lookupClass =	(*env)->FindClass (env,	"java/net/DatagramPacket");
   if (!lookupClass)
@@ -337,17 +337,17 @@
       "Ljava/net/InetAddress;");
   if (!fid)
     return;
-  JCL_CACHE_SET	(env, FID_java_net_DatagramPacket_address, fid);
+  HARMONY_CACHE_SET	(env, FID_java_net_DatagramPacket_address, fid);
 
   fid =	(*env)->GetFieldID (env, lookupClass, "length",	"I");
   if (!fid)
     return;
-  JCL_CACHE_SET	(env, FID_java_net_DatagramPacket_length, fid);	
+  HARMONY_CACHE_SET	(env, FID_java_net_DatagramPacket_length, fid);	
 
   fid =	(*env)->GetFieldID (env, lookupClass, "port", "I");
   if (!fid)
     return;
-  JCL_CACHE_SET	(env, FID_java_net_DatagramPacket_port,	fid);
+  HARMONY_CACHE_SET	(env, FID_java_net_DatagramPacket_port,	fid);
 }
 
 /*
@@ -2671,7 +2671,7 @@
    jbyteArray addr_array =
      (jbyteArray) ((*env)->GetObjectField (env,
                                            sender,
-                                           JCL_CACHE_GET (env,
+                                           HARMONY_CACHE_GET (env,
                                                           FID_java_net_InetAddress_address)));
    I_32	length = (*env)->GetArrayLength	(env, address);	
    addr_array =	(*env)->NewByteArray(env, (jsize) length);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include <math.h>
 #include "vmi.h"
 #include "cbigint.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "exceptions.h"
 
 #if defined(LINUX) || defined(FREEBSD)

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/file.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include <ctype.h>
 #include "iohelp.h"
 #include "exceptions.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "helpers.h"
 #include "jclprots.h"
 
@@ -96,16 +96,14 @@
           if (numEntries > 0)
             {
               currentEntry->next =
-                (struct dirEntry *) jclmem_allocate_memory (env,
-                                                            sizeof (struct
+                (struct dirEntry *) hymem_allocate_memory (sizeof (struct
                                                                     dirEntry));
               currentEntry = currentEntry->next;
             }
           else
             {
               dirList =
-                (struct dirEntry *) jclmem_allocate_memory (env,
-                                                            sizeof (struct
+                (struct dirEntry *) hymem_allocate_memory (sizeof (struct
                                                                     dirEntry));
               currentEntry = dirList;
             }
@@ -125,7 +123,7 @@
   if (numEntries == 0)
     return NULL;
 
-  javaClass = JCL_CACHE_GET (env, CLS_array_of_byte);
+  javaClass = HARMONY_CACHE_GET (env, CLS_array_of_byte);
   javaClass = (*env)->NewLocalRef(env, javaClass);
   if (javaClass == NULL) {
       return NULL;
@@ -147,7 +145,7 @@
           (*env)->DeleteLocalRef (env, entrypath);
         }
       dirList = dirList->next;
-      jclmem_free_memory (env, currentEntry);
+      hymem_free_memory (currentEntry);
     }
   return answer;
 }
@@ -374,7 +372,7 @@
 
   answer =
     (*env)->NewObjectArray (env, numRoots,
-                            JCL_CACHE_GET (env, CLS_array_of_byte), NULL);
+                            HARMONY_CACHE_GET (env, CLS_array_of_byte), NULL);
   if (!answer)
     {
       return NULL;
@@ -448,7 +446,7 @@
     {
       jobject globalRef = (*env)->NewWeakGlobalRef (env, arrayClass);
       if (globalRef)
-        JCL_CACHE_SET (env, CLS_array_of_byte, globalRef);
+        HARMONY_CACHE_SET (env, CLS_array_of_byte, globalRef);
     }
   return;
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/filedesc.c Mon Feb  5 03:10:11 2007
@@ -17,7 +17,7 @@
 
 #include "iohelp.h"
 #include "exceptions.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 JNIEXPORT jboolean JNICALL
 Java_java_io_FileDescriptor_valid (JNIEnv * env, jobject recv)
@@ -65,5 +65,5 @@
     (*env)->GetFieldID (env, fdClazz, "descriptor", "J");
   if (!descriptorFID)
     return;
-  JCL_CACHE_SET (env, FID_java_io_FileDescriptor_descriptor, descriptorFID);
+  HARMONY_CACHE_SET (env, FID_java_io_FileDescriptor_descriptor, descriptorFID);
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include <math.h>
 #include "vmi.h"
 #include "cbigint.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "exceptions.h"
 
 #if defined(LINUX)

Copied: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/harmonyglob.h (from r503532, harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/jclglob.h)
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/harmonyglob.h?view=diff&rev=503632&p1=harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/jclglob.h&r1=503532&p2=harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/harmonyglob.h&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/jclglob.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/harmonyglob.h Mon Feb  5 03:10:11 2007
@@ -15,11 +15,11 @@
  *  limitations under the License.
  */
 
-#if !defined(jclglob_h)
-#define jclglob_h
+#if !defined(harmonyglob_h)
+#define harmonyglob_h
 #include "vmi.h"
-extern void *LUNI_JCL_ID_CACHE;
-#define JCL_ID_CACHE LUNI_JCL_ID_CACHE
+extern void *LUNI_HARMONY_ID_CACHE;
+#define HARMONY_ID_CACHE LUNI_HARMONY_ID_CACHE
 typedef struct LUNIJniIDCache
 {
 
@@ -70,8 +70,13 @@
   char **synthPortArray;
   int portListLen;
 
-  /* JCL support for IPv6 */
-  jboolean jcl_supports_ipv6;
+  /* HARMONY support for IPv6 */
+  jboolean harmony_supports_ipv6;
+  /* additional IDs for luni and nio */
+  jclass CLS_java_lang_Long;
+  jclass CLS_java_net_Inet6Address;
+  jfieldID FID_java_lang_Long_value;
+  jmethodID MID_java_net_InetAddress_init;
 } LUNIJniIDCache;
 #define JniIDCache LUNIJniIDCache
 /* Now that the module-specific defines are in place, include the shared file */
@@ -80,4 +85,4 @@
 #if defined(LINUX)
 #include "hysignal.h"
 #endif /* UNIX */
-#endif /* jclglob_h */
+#endif /* harmonyglob_h */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/inetadds.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/inetadds.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/inetadds.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/inetadds.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include "jclprots.h"
 #include "nethelp.h"
 #include "hysock.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 /**
  * Answer the aliases for the nominated host name.  Useful for multihomed hosts.

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/luniglob.c Mon Feb  5 03:10:11 2007
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include "vmi.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "hyport.h"
 #include "strhelp.h"
 #include "jsig.h"
@@ -33,7 +33,7 @@
 
 static UDATA keyInitCount = 0;
 
-void *JCL_ID_CACHE = NULL;
+void *HARMONY_ID_CACHE = NULL;
 
 static int props_compare(const void *arg1, const void *arg2);
 static jint readClassPathFromPropertiesFile (VMInterface *vmInterface);
@@ -49,7 +49,7 @@
   JniIDCache *idCache;
   JNIEnv *env;
   void *keyInitCountPtr = GLOBAL_DATA (keyInitCount);
-  void **jclIdCache = GLOBAL_DATA (JCL_ID_CACHE);
+  void **harmonyIdCache = GLOBAL_DATA (HARMONY_ID_CACHE);
   VMInterface *vmInterface;
   char *bootPath = NULL;
 
@@ -71,7 +71,7 @@
       PORT_ACCESS_FROM_ENV (env);
 
       if (HY_VMLS_FNTBL (env)->
-          HYVMLSAllocKeys (env, keyInitCountPtr, jclIdCache, NULL))
+          HYVMLSAllocKeys (env, keyInitCountPtr, harmonyIdCache, NULL))
         {
           goto fail;
         }
@@ -81,11 +81,11 @@
         goto fail2;
 
       memset (idCache, 0, sizeof (JniIDCache));
-      HY_VMLS_SET (env, *jclIdCache, idCache);
+      HY_VMLS_SET (env, *harmonyIdCache, idCache);
 
-      JCL_CACHE_SET (env, realPortArray, NULL);
-      JCL_CACHE_SET (env, synthPortArray, NULL);
-      JCL_CACHE_SET (env, portListLen, 0);
+      HARMONY_CACHE_SET (env, realPortArray, NULL);
+      HARMONY_CACHE_SET (env, synthPortArray, NULL);
+      HARMONY_CACHE_SET (env, portListLen, 0);
 
       /* Attach to the common library */
       if (JNI_OK != ClearLibAttach (env))
@@ -133,7 +133,7 @@
     }
 
 fail2:
-  HY_VMLS_FNTBL (env)->HYVMLSFreeKeys (env, keyInitCountPtr, jclIdCache, NULL);
+  HY_VMLS_FNTBL (env)->HYVMLSFreeKeys (env, keyInitCountPtr, harmonyIdCache, NULL);
 fail:
   return 0;
 }
@@ -147,14 +147,14 @@
 {
   JNIEnv *env;
   void *keyInitCountPtr = GLOBAL_DATA (keyInitCount);
-  void **jclIdCache = GLOBAL_DATA (JCL_ID_CACHE);
+  void **harmonyIdCache = GLOBAL_DATA (HARMONY_ID_CACHE);
 
   int i, listlen;
   char **portArray, **portArray2;
 
   if ((*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2) == JNI_OK)
     {
-      JniIDCache *idCache = (JniIDCache *) HY_VMLS_GET (env, *jclIdCache);
+      JniIDCache *idCache = (JniIDCache *) HY_VMLS_GET (env, *harmonyIdCache);
 
       if (idCache)
         {
@@ -164,11 +164,11 @@
           ClearLibDetach (env);
 
           /*free the arrays of available portnames */
-          portArray = JCL_CACHE_GET (env, realPortArray);
+          portArray = HARMONY_CACHE_GET (env, realPortArray);
           if (portArray != NULL)
             {
-              portArray2 = JCL_CACHE_GET (env, synthPortArray);
-              listlen = JCL_CACHE_GET (env, portListLen);
+              portArray2 = HARMONY_CACHE_GET (env, synthPortArray);
+              listlen = HARMONY_CACHE_GET (env, portListLen);
               for (i = 0; i < listlen; i++)
                 {
                   if (portArray[i] != NULL)
@@ -178,18 +178,18 @@
                 }
               hymem_free_memory (portArray);
               hymem_free_memory (portArray2);
-              JCL_CACHE_SET (env, realPortArray, NULL);
-              JCL_CACHE_SET (env, synthPortArray, NULL);
-              JCL_CACHE_SET (env, portListLen, 0);
+              HARMONY_CACHE_SET (env, realPortArray, NULL);
+              HARMONY_CACHE_SET (env, synthPortArray, NULL);
+              HARMONY_CACHE_SET (env, portListLen, 0);
             }
 
           /* Free any global references */
           freeReferences (env);
 
           /* Free VMLS keys */
-          idCache = (JniIDCache *) HY_VMLS_GET (env, *jclIdCache);
+          idCache = (JniIDCache *) HY_VMLS_GET (env, *harmonyIdCache);
           HY_VMLS_FNTBL (env)->HYVMLSFreeKeys (env, keyInitCountPtr,
-                                              jclIdCache, NULL);
+                                              harmonyIdCache, NULL);
           hymem_free_memory (idCache);
         }
     }
@@ -347,23 +347,23 @@
   jclass classRef;
 
   /* clean up class references */
-  classRef = JCL_CACHE_GET (env, CLS_java_lang_Boolean);
+  classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Boolean);
   if (classRef)
     (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
 
-  classRef = JCL_CACHE_GET (env, CLS_java_lang_Byte);
+  classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Byte);
   if (classRef)
     (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
 
-  classRef = JCL_CACHE_GET (env, CLS_java_lang_Integer);
+  classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Integer);
   if (classRef)
     (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
 
-  classRef = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+  classRef = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
   if (classRef)
     (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
 
-  classRef = JCL_CACHE_GET (env, CLS_array_of_byte);
+  classRef = HARMONY_CACHE_GET (env, CLS_array_of_byte);
   if (classRef)
     (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.c Mon Feb  5 03:10:11 2007
@@ -18,7 +18,7 @@
 #include "nethelp.h"
 #include "hysock.h"
 #include "hyport.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "exceptions.h"
 
 /**
@@ -36,8 +36,8 @@
   jfieldID fid;
   jobject globalRef;
 
-  /* Set the JCL cache to use IPv6 address support */
-  JCL_CACHE_SET (env, jcl_supports_ipv6, ipv6_support);
+  /* Set the Harmony ID cache to use IPv6 address support */
+  HARMONY_CACHE_SET (env, harmony_supports_ipv6, ipv6_support);
 
   /* java/lang/Boolean class, constructors, and fids */
   lookupClass = (*env)->FindClass (env, "java/lang/Boolean");
@@ -52,9 +52,9 @@
   fid = (*env)->GetFieldID (env, lookupClass, "value", "Z");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, CLS_java_lang_Boolean, globalRef);
-  JCL_CACHE_SET (env, MID_java_lang_Boolean_init, mid);
-  JCL_CACHE_SET (env, FID_java_lang_Boolean_value, fid);
+  HARMONY_CACHE_SET (env, CLS_java_lang_Boolean, globalRef);
+  HARMONY_CACHE_SET (env, MID_java_lang_Boolean_init, mid);
+  HARMONY_CACHE_SET (env, FID_java_lang_Boolean_value, fid);
 
   /* java/lang/Byte class, constructors, and fids */
   lookupClass = (*env)->FindClass (env, "java/lang/Byte");
@@ -69,9 +69,9 @@
   fid = (*env)->GetFieldID (env, lookupClass, "value", "B");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, CLS_java_lang_Byte, globalRef);
-  JCL_CACHE_SET (env, MID_java_lang_Byte_init, mid);
-  JCL_CACHE_SET (env, FID_java_lang_Byte_value, fid);
+  HARMONY_CACHE_SET (env, CLS_java_lang_Byte, globalRef);
+  HARMONY_CACHE_SET (env, MID_java_lang_Byte_init, mid);
+  HARMONY_CACHE_SET (env, FID_java_lang_Byte_value, fid);
 
   /* java/lang/Integer class, constructors, and fids */
   lookupClass = (*env)->FindClass (env, "java/lang/Integer");
@@ -86,9 +86,9 @@
   fid = (*env)->GetFieldID (env, lookupClass, "value", "I");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, CLS_java_lang_Integer, globalRef);
-  JCL_CACHE_SET (env, MID_java_lang_Integer_init, mid);
-  JCL_CACHE_SET (env, FID_java_lang_Integer_value, fid);
+  HARMONY_CACHE_SET (env, CLS_java_lang_Integer, globalRef);
+  HARMONY_CACHE_SET (env, MID_java_lang_Integer_init, mid);
+  HARMONY_CACHE_SET (env, FID_java_lang_Integer_value, fid);
 
   /* InetAddress cache setup */
   lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
@@ -101,8 +101,8 @@
 
   if (!fid)
     return;
-  JCL_CACHE_SET (env, CLS_java_net_InetAddress, globalRef);
-  JCL_CACHE_SET (env, FID_java_net_InetAddress_address, fid);
+  HARMONY_CACHE_SET (env, CLS_java_net_InetAddress, globalRef);
+  HARMONY_CACHE_SET (env, FID_java_net_InetAddress_address, fid);
 
   mid = NULL;
   mid =
@@ -110,7 +110,7 @@
              "()Z");
   if (!mid)
     return;
-  JCL_CACHE_SET (env, MID_java_net_InetAddress_preferIPv6Addresses, mid);
+  HARMONY_CACHE_SET (env, MID_java_net_InetAddress_preferIPv6Addresses, mid);
 
   if (ipv6_support)
     {
@@ -120,7 +120,7 @@
         "(Ljava/lang/String;[B)Ljava/net/InetAddress;");
       if (!mid)
         return;
-      JCL_CACHE_SET (env,
+      HARMONY_CACHE_SET (env,
         MID_java_net_InetAddress_getByAddress_Ljava_lang_String_byteArray,
         mid);
 
@@ -130,7 +130,7 @@
         "([B)Ljava/net/InetAddress;");
       if (!mid)
         return;
-      JCL_CACHE_SET (env, MID_java_net_InetAddress_getByAddress_byteArray,
+      HARMONY_CACHE_SET (env, MID_java_net_InetAddress_getByAddress_byteArray,
         mid);
     }
   else
@@ -139,7 +139,7 @@
       mid = (*env)->GetMethodID (env, lookupClass, "<init>", "([B)V");
       if (!mid)
         return;
-      JCL_CACHE_SET (env, MID_java_net_InetAddress_init_byteArray, mid);
+      HARMONY_CACHE_SET (env, MID_java_net_InetAddress_init_byteArray, mid);
 
       /* InetAddress( byte[] addr, String address ) */
       mid =
@@ -147,7 +147,7 @@
         "([BLjava/lang/String;)V");
       if (!mid)
         return;
-      JCL_CACHE_SET (env,
+      HARMONY_CACHE_SET (env,
         MID_java_net_InetAddress_init_byteArrayLjava_lang_String,
         mid);
     }
@@ -163,8 +163,8 @@
     (*env)->GetStaticMethodID (env, lookupClass, "preferIPv4Stack", "()Z");
   if (!mid)
     return;
-  JCL_CACHE_SET (env, CLS_java_net_Socket, globalRef);
-  JCL_CACHE_SET (env, MID_java_net_Socket_preferIPv4Stack, mid);
+  HARMONY_CACHE_SET (env, CLS_java_net_Socket, globalRef);
+  HARMONY_CACHE_SET (env, MID_java_net_Socket_preferIPv4Stack, mid);
 
   lookupClass = (*env)->FindClass (env, "java/lang/Thread");
   if (!lookupClass)
@@ -175,9 +175,35 @@
   mid = (*env)->GetStaticMethodID (env, lookupClass, "yield", "()V");
   if (!mid)
     return;
-  JCL_CACHE_SET (env, CLS_java_lang_Thread, globalRef);
-  JCL_CACHE_SET (env, MID_java_lang_Thread_yield, mid);
-
+  HARMONY_CACHE_SET (env, CLS_java_lang_Thread, globalRef);
+  HARMONY_CACHE_SET (env, MID_java_lang_Thread_yield, mid);
+  
+  
+  /*Add additional cache*/
+  lookupClass = (*env)->FindClass (env, "java/lang/Long");
+  if (!lookupClass)
+    return;
+  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  if (!globalRef)
+    return;
+  HARMONY_CACHE_SET (env, CLS_java_lang_Long, globalRef);
+  fid = (*env)->GetFieldID (env, lookupClass, "value", "J");
+    if (!lookupClass)
+    return;
+  HARMONY_CACHE_SET (env, FID_java_lang_Long_value, fid);
+  lookupClass = (*env)->FindClass (env, "java/net/Inet6Address");
+  if (!lookupClass)
+    return;
+  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  if (!globalRef)
+    return;
+  HARMONY_CACHE_SET (env, CLS_java_net_Inet6Address, globalRef);
+  lookupClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
+  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "()V");
+  if (!mid)
+    return;
+  HARMONY_CACHE_SET (env, MID_java_net_InetAddress_init, mid);
+  
 }
 
 
@@ -440,9 +466,9 @@
   jclass tempClass;
   jmethodID tempMethod;
 
-  tempClass = JCL_CACHE_GET (env, CLS_java_lang_Boolean);
+  tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Boolean);
   //tempClass = getJavaLangBooleanClass(env);
-  tempMethod = JCL_CACHE_GET (env, MID_java_lang_Boolean_init);
+  tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Boolean_init);
   //tempMethod = getJavaLangBooleanInit(env);
   return (*env)->NewObject (env, tempClass, tempMethod, (jboolean) aBool);
 }
@@ -462,8 +488,8 @@
   jclass tempClass;
   jmethodID tempMethod;
 
-  tempClass = JCL_CACHE_GET (env, CLS_java_lang_Byte);
-  tempMethod = JCL_CACHE_GET (env, MID_java_lang_Byte_init);
+  tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Byte);
+  tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Byte_init);
   //tempClass = getJavaLangByteClass(env);
   //tempMethod = getJavaLangByteInit(env);
   return (*env)->NewObject (env, tempClass, tempMethod, (jbyte) aByte);
@@ -484,8 +510,8 @@
   jclass tempClass;
   jmethodID tempMethod;
 
-  tempClass = JCL_CACHE_GET (env, CLS_java_lang_Integer);
-  tempMethod = JCL_CACHE_GET (env, MID_java_lang_Integer_init);
+  tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Integer);
+  tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Integer_init);
   //tempClass = getJavaLangIntegerClass(env);
   //tempMethod = getJavaLangIntegerInit(env);
   return (*env)->NewObject (env, tempClass, tempMethod, (jint) anInt);
@@ -551,7 +577,7 @@
 {
   return (BOOLEAN) ((*env)->
         GetBooleanField (env, aBoolean,
-             JCL_CACHE_GET (env,
+             HARMONY_CACHE_GET (env,
                 FID_java_lang_Boolean_value)));
   /*return (BOOLEAN) ((*env)->
         GetBooleanField (env, aBoolean,
@@ -572,7 +598,7 @@
 {
   return (U_8) ((*env)->
     GetByteField (env, aByte,
-            JCL_CACHE_GET (env, FID_java_lang_Byte_value)));
+            HARMONY_CACHE_GET (env, FID_java_lang_Byte_value)));
   /*return (U_8) ((*env)->
     GetByteField (env, aByte,
             getJavaLangByteValue(env)));*/
@@ -592,7 +618,7 @@
 {
   return (I_32) ((*env)->
      GetIntField (env, anInteger,
-            JCL_CACHE_GET (env,
+            HARMONY_CACHE_GET (env,
                FID_java_lang_Integer_value)));
   /*return (I_32) ((*env)->
      GetIntField (env, anInteger,
@@ -737,7 +763,7 @@
 {
   jbyteArray byte_array =
     (jbyteArray) ((*env)->GetObjectField (env, anInetAddress,
-            JCL_CACHE_GET (env,
+            HARMONY_CACHE_GET (env,
                FID_java_net_InetAddress_address)));
   /*jbyteArray byte_array =
     (jbyteArray) ((*env)->GetObjectField (env, anInetAddress,
@@ -760,8 +786,8 @@
   jclass tempClass;
   jobject globalRef;
 
-  tempClass = JCL_CACHE_GET (env, CLS_java_lang_Thread);
-  tempMethod = JCL_CACHE_GET (env, MID_java_lang_Thread_yield);
+  tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Thread);
+  tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Thread_yield);
   
   //tempClass = getJavaLangThreadClass(env);
   //tempMethod = getJavaLangThreadYield(env);
@@ -776,8 +802,8 @@
       tempMethod = (*env)->GetStaticMethodID (env, tempClass, "yield", "()V");
       if (!tempMethod)
         return;
-      JCL_CACHE_SET (env, CLS_java_lang_Thread, globalRef);
-      JCL_CACHE_SET (env, MID_java_lang_Thread_yield, tempMethod);      
+      HARMONY_CACHE_SET (env, CLS_java_lang_Thread, globalRef);
+      HARMONY_CACHE_SET (env, MID_java_lang_Thread_yield, tempMethod);      
     }
   (*env)->CallStaticVoidMethod (env, tempClass, tempMethod);
 }
@@ -806,7 +832,7 @@
   U_32 i, length;
   jobjectArray aliases = NULL;
   jobject element;
-  jclass tempClass = (*env)->FindClass (env, "java/net/InetAddress");
+  jclass tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress); //(*env)->FindClass (env, "java/net/InetAddress");
 
   /* Number of structures */
   for (i = 0; i < count; i++)
@@ -924,9 +950,9 @@
  */
 
 BOOLEAN
-jcl_supports_ipv6 (JNIEnv * env)
+harmony_supports_ipv6 (JNIEnv * env)
 {
-  return (BOOLEAN) JCL_CACHE_GET (env, jcl_supports_ipv6);
+  return (BOOLEAN) HARMONY_CACHE_GET (env, harmony_supports_ipv6);
   //return (BOOLEAN) support;
 }
 
@@ -981,7 +1007,7 @@
   /* check if the address being returned is the any address.  If so we need to check the prefer flags to see how it should be returned
   (either as IPv4 Any or IPv6 ANY) */
 
-  if (jcl_supports_ipv6 (env))
+  if (harmony_supports_ipv6 (env))
     {
       /* Figure out if it is the any address */
       for (i = 0; i < length; i++)
@@ -1028,14 +1054,14 @@
         }
     }
 
-  if (jcl_supports_ipv6 (env))
+  if (harmony_supports_ipv6 (env))
     {
       tempMethodWithScope = NULL;
       if (scope_id != 0)
         {
           tempMethodWithScope =
             (*env)->GetStaticMethodID (env,
-            JCL_CACHE_GET (env,
+            HARMONY_CACHE_GET (env,
             CLS_java_net_InetAddress),
             "getByAddress",
             "([BI)Ljava/net/InetAddress;");
@@ -1055,7 +1081,7 @@
       if (tempMethodWithScope != NULL)
         {
           /* create using the scope id */
-          tempClass = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+          tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
           //tempClass = getJavaNetInetAddressClass(env);
           return (*env)->CallStaticObjectMethod (env, tempClass,
             tempMethodWithScope,
@@ -1063,10 +1089,10 @@
         }
       else
         {
-          tempClass = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+          tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
           //tempClass = getJavaNetInetAddressClass(env);
           tempMethod =
-            JCL_CACHE_GET (env,
+            HARMONY_CACHE_GET (env,
             MID_java_net_InetAddress_getByAddress_byteArray);
           //tempMethod = getJavaNetInetAddressGetByAddressByteArray(env);
           return (*env)->CallStaticObjectMethod (env, tempClass, tempMethod,
@@ -1075,9 +1101,9 @@
     }
   else
     {
-      tempClass = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+      tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
       tempMethod =
-        JCL_CACHE_GET (env, MID_java_net_InetAddress_init_byteArray);
+        HARMONY_CACHE_GET (env, MID_java_net_InetAddress_init_byteArray);
       //tempClass = getJavaNetInetAddressClass(env);
       //tempMethod = getJavaNetInetAddressInitByteArray(env);
       return (*env)->NewObject (env, tempClass, tempMethod, byte_array);
@@ -1117,7 +1143,7 @@
   /* check if the address being returned is the any address.  If so we need to check the prefer flags to see how it should be returned
      (either as IPv4 Any or IPv6 ANY) */
 
-  if (jcl_supports_ipv6 (env))
+  if (harmony_supports_ipv6 (env))
     {
       /* Figure out if it is the any address */
       for (i = 0; i < length; i++)
@@ -1164,14 +1190,14 @@
         }
     }
 
-  if (jcl_supports_ipv6 (env))
+  if (harmony_supports_ipv6 (env))
     {
       tempMethodWithScope = NULL;
       if (scope_id != 0)
         {
           tempMethodWithScope =
             (*env)->GetStaticMethodID (env,
-            JCL_CACHE_GET (env,
+            HARMONY_CACHE_GET (env,
             CLS_java_net_InetAddress),
             "getByAddress",
             "(Ljava/lang/String;[BI)Ljava/net/InetAddress;");
@@ -1191,7 +1217,7 @@
       if (tempMethodWithScope != NULL)
         {
           /* create using the scope id */
-          tempClass = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+          tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
           //tempClass = getJavaNetInetAddressClass(env);
           return (*env)->CallStaticObjectMethod (env, tempClass,
             tempMethodWithScope, aString,
@@ -1199,9 +1225,9 @@
         }
       else
         {
-          tempClass = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+          tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
           tempMethod =
-            JCL_CACHE_GET (env,
+            HARMONY_CACHE_GET (env,
             MID_java_net_InetAddress_getByAddress_Ljava_lang_String_byteArray);
           
           //tempClass = getJavaNetInetAddressClass(env);
@@ -1212,9 +1238,9 @@
       }
     else
       {
-        tempClass = JCL_CACHE_GET (env, CLS_java_net_InetAddress);
+        tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
         tempMethod =
-          JCL_CACHE_GET (env,
+          HARMONY_CACHE_GET (env,
           MID_java_net_InetAddress_init_byteArrayLjava_lang_String);
         
         //tempClass = getJavaNetInetAddressClass(env);
@@ -1275,15 +1301,15 @@
 
   /* if the jcl does not support IPV6 then just use the IPV4 stack without checking
      the values of the flags */
-  if (!jcl_supports_ipv6 (env))
+  if (!harmony_supports_ipv6 (env))
     {
       return TRUE;
     }
 
   result =
     (*env)->CallStaticBooleanMethod (env,
-             JCL_CACHE_GET (env, CLS_java_net_Socket),
-             JCL_CACHE_GET (env,
+             HARMONY_CACHE_GET (env, CLS_java_net_Socket),
+             HARMONY_CACHE_GET (env,
                 MID_java_net_Socket_preferIPv4Stack));
   
   /*result =
@@ -1317,16 +1343,16 @@
 
   /* if the jcl does not support IPV6 then we don't prefer IPv6 addresses for any case so just return false 
      without checking the values of the flags */
-  if (!jcl_supports_ipv6 (env))
+  if (!harmony_supports_ipv6 (env))
     {
       return FALSE;
     }
 
   result =
     (*env)->CallStaticBooleanMethod (env,
-             JCL_CACHE_GET (env,
+             HARMONY_CACHE_GET (env,
                 CLS_java_net_InetAddress),
-             JCL_CACHE_GET (env,
+             HARMONY_CACHE_GET (env,
                 MID_java_net_InetAddress_preferIPv6Addresses));
   /*
   result =
@@ -1359,7 +1385,7 @@
          U_32 * scope_id)
 {
   jfieldID scopeFid;
-  jclass inet6AddressClass = (*env)->FindClass (env, "java/net/Inet6Address");
+  jclass inet6AddressClass =  HARMONY_CACHE_GET (env,CLS_java_net_Inet6Address);
 
   /* only inet6 addresses have the scope id so only get the value for this type of InetAddress */
   if ((!((*env)->ExceptionCheck (env)))
@@ -1388,7 +1414,7 @@
 
 jclass 
 getJavaLangBooleanClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Boolean");
+  jclass lookupClass = HARMONY_CACHE_GET(env,CLS_java_lang_Boolean);
   if (!lookupClass)
     return NULL;
   return lookupClass;
@@ -1397,10 +1423,7 @@
 jmethodID
 getJavaLangBooleanInit(JNIEnv * env){
   jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Boolean");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(Z)V");
+  mid = HARMONY_CACHE_GET(env,MID_java_lang_Boolean_init);;
   if (!mid)
     return NULL;
   return mid;
@@ -1715,22 +1738,7 @@
 jfieldID
 getJavaIoFileDescriptorDescriptor (JNIEnv * env)
 {
-  jclass descriptorCLS;
-  jfieldID descriptorFID;
-
-  descriptorCLS = (*env)->FindClass (env, "java/io/FileDescriptor");
-  if (NULL == descriptorCLS)
-    {
-      return NULL;
-    }
-
-  descriptorFID = (*env)->GetFieldID (env, descriptorCLS, "descriptor", "J");
-  if (NULL == descriptorFID)
-    {
-      return NULL;
-    }
-
-  return descriptorFID;
+  return HARMONY_CACHE_GET (env, FID_java_io_FileDescriptor_descriptor);
 }
 
 void
@@ -1754,7 +1762,7 @@
     }
   return (void *) ((IDATA)((*env)->GetLongField (env, fd, descriptorFID)));
 }
-
+		
 jobject getJavaNioChannelsSocketChannelImplObj(JNIEnv * env, jclass channel_class){
           jmethodID channel_new;
 	  jobject channel_object;
@@ -1778,11 +1786,7 @@
 
 void setFDContent(JNIEnv * env, jclass channel_class, jobject channel_object, void * sock){
 	jobject fd_object;
-	jfieldID fd_field = (*env)->GetFieldID(env,channel_class,"fd","Ljava/io/FileDescriptor;");
-	jclass fd_class = (*env)->FindClass(env,"java/io/FileDescriptor");
-	if(NULL == fd_class) {
-		return;
-        }
+	jfieldID fd_field = HARMONY_CACHE_GET (env, FID_java_io_FileDescriptor_descriptor);
 	fd_object = (*env)->GetObjectField(env,channel_object,fd_field);
 	if(NULL == fd_object) {
         	return;
@@ -1796,11 +1800,11 @@
 	jobject addr_object,socketaddr_object;
 	jclass addr_class,socketaddr_class ;
 	jbyteArray addr_array;
-	addr_class = (*env)->FindClass(env,"Ljava/net/InetAddress;");
+	addr_class = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
 	if(NULL == addr_class) {
 	        return;
         }
-	addr_new = (*env)->GetMethodID(env,addr_class,"<init>","()V");
+	addr_new = HARMONY_CACHE_GET (env, MID_java_net_InetAddress_init);
         addr_object = (*env)->NewObject(env,addr_class,addr_new);
 	if(NULL == addr_object) {
         	return;
@@ -1813,7 +1817,7 @@
 	}
 	addr_field = (*env)->GetFieldID(env,socketaddr_class,"addr","Ljava/net/InetAddress;");
 	(*env)->SetObjectField(env, socketaddr_object, addr_field, addr_object);
-	addrarray_field = (*env)->GetFieldID(env,addr_class,"ipaddress","[B");
+	addrarray_field = HARMONY_CACHE_GET (env, FID_java_net_InetAddress_address);
 	addr_array = (*env)->NewByteArray(env,(jsize)4);		
         (*env)->SetByteArrayRegion(env,addr_array,(jsize)0,(jsize)4,address);
 	(*env)->SetObjectField(env, addr_object, addrarray_field, addr_array);
@@ -1822,8 +1826,8 @@
 void setSocketLocalAddressContent(JNIEnv * env, jclass channel_class, jobject channel_object,jbyte * address){
 	jfieldID addrarray_field;
 	jfieldID localAddr_field = (*env)->GetFieldID(env,channel_class,"localAddress","Ljava/net/InetAddress;");
-	jclass addr_class = (*env)->FindClass(env,"Ljava/net/InetAddress;");
-	jmethodID addr_new = (*env)->GetMethodID(env,addr_class,"<init>","()V");
+	jclass addr_class = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
+	jmethodID addr_new = HARMONY_CACHE_GET (env, MID_java_net_InetAddress_init);
 	jobject localAddr_object = (*env)->NewObject(env,addr_class,addr_new);
 	jfieldID socketaddr_field = (*env)->GetFieldID(env,channel_class,"connectAddress","Ljava/net/InetSocketAddress;");
 	jobject socketaddr_object = (*env)->GetObjectField(env,channel_object,socketaddr_field);
@@ -1837,7 +1841,7 @@
         }
 	addr_array = (*env)->NewByteArray(env,(jsize)4);	
 	(*env)->SetByteArrayRegion(env,addr_array,(jsize)0,(jsize)4,address);
-	addrarray_field = (*env)->GetFieldID(env,addr_class,"ipaddress","[B");
+	addrarray_field = HARMONY_CACHE_GET (env, FID_java_net_InetAddress_address);
 	(*env)->SetObjectField(env, localAddr_object, addrarray_field, addr_array);
 }
 
@@ -1846,12 +1850,12 @@
 	jfieldID localAddr_field,addrarray_field;
 	jobject localAddr_object;
 	jbyteArray addr_array;
-	jclass addr_class = (*env)->FindClass(env,"Ljava/net/InetAddress;");
+	jclass addr_class = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
 	if(NULL == addr_class) {
 	        return;
         }
 	addr_new = (*env)->GetMethodID(env,addr_class,"<init>","()V");
-	localAddr_field = (*env)->GetFieldID(env,socketImpl_class,"address","Ljava/net/InetAddress;");
+	localAddr_field = HARMONY_CACHE_GET (env, FID_java_net_InetAddress_address);
 	localAddr_object = (*env)->NewObject(env,addr_class,addr_new);
 	if(NULL == localAddr_object) {
         	return;
@@ -1859,6 +1863,6 @@
 	(*env)->SetObjectField(env, socketImpl_object, localAddr_field, localAddr_object);
 	addr_array = (*env)->NewByteArray(env,(jsize)4);	
 	(*env)->SetByteArrayRegion(env,addr_array,(jsize)0,(jsize)4,localAddr);
-	addrarray_field = (*env)->GetFieldID(env,addr_class,"ipaddress","[B");
+	addrarray_field = HARMONY_CACHE_GET (env, FID_java_net_InetAddress_address);
 	(*env)->SetObjectField(env, localAddr_object, addrarray_field, addr_array);
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.h?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.h (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/nethelp.h Mon Feb  5 03:10:11 2007
@@ -60,7 +60,7 @@
              hyaddrinfo_t addresses,
              char *hName);
 BOOLEAN booleanValue (JNIEnv * env, jobject aBoolean);
-BOOLEAN jcl_supports_ipv6 (JNIEnv * env);
+BOOLEAN harmony_supports_ipv6 (JNIEnv * env);
 jobject newJavaLangInteger (JNIEnv * env, I_32 anInt);
 BOOLEAN preferIPv4Stack (JNIEnv * env);
 char *netLookupErrorString (JNIEnv * env, I_32 anErrorNum);

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/netif.c Mon Feb  5 03:10:11 2007
@@ -18,7 +18,7 @@
 #include "nethelp.h"
 #include "jclprots.h"
 #include "helpers.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "hysock.h"
 
 /**

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/osc.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/osc.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/osc.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/osc.c Mon Feb  5 03:10:11 2007
@@ -16,7 +16,7 @@
  */
 
 #include "vmi.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 JNIEXPORT jobject JNICALL
 Java_java_io_ObjectStreamClass_getFieldSignature (JNIEnv * env, jclass clazz,
@@ -24,7 +24,7 @@
 {
   jclass fieldClass = (*env)->GetObjectClass (env, reflectField);
   return (*env)->CallNonvirtualObjectMethod (env, reflectField, fieldClass,
-                                             JCL_CACHE_GET (env,
+                                             HARMONY_CACHE_GET (env,
                                                             MID_java_lang_reflect_Field_getSignature));
 }
 
@@ -34,7 +34,7 @@
 {
   jclass methodClass = (*env)->GetObjectClass (env, reflectMethod);
   return (*env)->CallNonvirtualObjectMethod (env, reflectMethod, methodClass,
-                                             JCL_CACHE_GET (env,
+                                             HARMONY_CACHE_GET (env,
                                                             MID_java_lang_reflect_Method_getSignature));
 }
 
@@ -47,7 +47,7 @@
   jclass constructorClass = (*env)->GetObjectClass (env, reflectConstructor);
   return (*env)->CallNonvirtualObjectMethod (env, reflectConstructor,
                                              constructorClass,
-                                             JCL_CACHE_GET (env,
+                                             HARMONY_CACHE_GET (env,
                                                             MID_java_lang_reflect_Constructor_getSignature));
 }
 
@@ -86,7 +86,7 @@
                          "()Ljava/lang/String;");
   if (!mid)
     return;
-  JCL_CACHE_SET (env, MID_java_lang_reflect_Field_getSignature, mid);
+  HARMONY_CACHE_SET (env, MID_java_lang_reflect_Field_getSignature, mid);
 
   lookupClass = (*env)->FindClass (env, "java/lang/reflect/Method");
   if (!lookupClass)
@@ -96,7 +96,7 @@
                          "()Ljava/lang/String;");
   if (!mid)
     return;
-  JCL_CACHE_SET (env, MID_java_lang_reflect_Method_getSignature, mid);
+  HARMONY_CACHE_SET (env, MID_java_lang_reflect_Method_getSignature, mid);
 
   lookupClass = (*env)->FindClass (env, "java/lang/reflect/Constructor");
   if (!lookupClass)
@@ -106,5 +106,5 @@
                          "()Ljava/lang/String;");
   if (!mid)
     return;
-  JCL_CACHE_SET (env, MID_java_lang_reflect_Constructor_getSignature, mid);
+  HARMONY_CACHE_SET (env, MID_java_lang_reflect_Constructor_getSignature, mid);
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/process.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include "exceptions.h"
 #include "procimpl.h"
 
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 /**
   * Create a System Process with the specified
@@ -177,7 +177,7 @@
   jlong pHandle;
   pHandle =
     (*env)->GetLongField (env, recv,
-        JCL_CACHE_GET (env,
+        HARMONY_CACHE_GET (env,
            FID_org_apache_harmony_luni_internal_process_SystemProcess_handle));
   termProc ((IDATA) pHandle);
 }
@@ -188,7 +188,7 @@
                 jobject recv)
 {
   new_ioh_close (env, recv,
-     JCL_CACHE_GET (env,
+     HARMONY_CACHE_GET (env,
         FID_org_apache_harmony_luni_internal_process_ProcessInputStream_fd));
 }
 
@@ -197,7 +197,7 @@
                  jobject recv)
 {
   new_ioh_close (env, recv,
-     JCL_CACHE_GET (env,
+     HARMONY_CACHE_GET (env,
         FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_fd));
 }
 
@@ -224,7 +224,7 @@
 
   sHandle =
     (*env)->GetLongField (env, recv,
-        JCL_CACHE_GET (env,
+        HARMONY_CACHE_GET (env,
            FID_org_apache_harmony_luni_internal_process_ProcessInputStream_handle));
   retVal = getAvailable ((jint)sHandle);
   if (retVal < 0)
@@ -273,7 +273,7 @@
   jlong pHandle;
   pHandle =
     (*env)->GetLongField (env, recv,
-        JCL_CACHE_GET (env,
+        HARMONY_CACHE_GET (env,
            FID_org_apache_harmony_luni_internal_process_SystemProcess_handle));
   return (jint) waitForProc ((IDATA) pHandle);
 }
@@ -285,7 +285,7 @@
   jfieldID fid = (*env)->GetFieldID (env, clazz, "handle", "J");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_SystemProcess_handle, fid);
+  HARMONY_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_SystemProcess_handle, fid);
 }
 
 JNIEXPORT void JNICALL
@@ -297,12 +297,12 @@
   fid = (*env)->GetFieldID (env, clazz, "handle", "J");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_handle, fid);
+  HARMONY_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_handle, fid);
 
   fid = (*env)->GetFieldID (env, clazz, "fd", "Ljava/io/FileDescriptor;");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_fd, fid);
+  HARMONY_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessOutputStream_fd, fid);
 }
 
 JNIEXPORT void JNICALL
@@ -314,12 +314,12 @@
   fid = (*env)->GetFieldID (env, clazz, "handle", "J");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessInputStream_handle, fid);
+  HARMONY_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessInputStream_handle, fid);
 
   fid = (*env)->GetFieldID (env, clazz, "fd", "Ljava/io/FileDescriptor;");
   if (!fid)
     return;
-  JCL_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessInputStream_fd, fid);
+  HARMONY_CACHE_SET (env, FID_org_apache_harmony_luni_internal_process_ProcessInputStream_fd, fid);
 }
 
 /* Close the handle */
@@ -329,7 +329,7 @@
   jlong pHandle;
   pHandle =
     (*env)->GetLongField (env, recv,
-        JCL_CACHE_GET (env,
+        HARMONY_CACHE_GET (env,
            FID_org_apache_harmony_luni_internal_process_SystemProcess_handle));
   closeProc ((IDATA) pHandle);
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/proxy.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/proxy.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/proxy.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/proxy.c Mon Feb  5 03:10:11 2007
@@ -17,7 +17,7 @@
 
 #include "iohelp.h"
 #include "exceptions.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 JNIEXPORT jclass JNICALL
 Java_java_lang_reflect_Proxy_defineClassImpl (JNIEnv * env, jclass recvClass,

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/socket.c Mon Feb  5 03:10:11 2007
@@ -18,7 +18,7 @@
 #include "nethelp.h"
 #include "jclprots.h"
 #include "helpers.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "hysock.h"
 
 #define BROKEN_MULTICAST_IF 1
@@ -76,7 +76,7 @@
   I_32 result;
   hysocket_t sockdesc;
   int family = HYADDR_FAMILY_AFINET4;
-  int supportsIPv6 = JCL_CACHE_GET (env, jcl_supports_ipv6);
+  int supportsIPv6 = HARMONY_CACHE_GET (env, harmony_supports_ipv6);
 
   if (supportsIPv6 && !(preferIPv4Stack))
     {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c Mon Feb  5 03:10:11 2007
@@ -23,7 +23,7 @@
 #include<netinet/ip.h>
 #include<netinet/ip_icmp.h>
 #include "nethelp.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "hysock.h"
 #include "hyport.h"
 #include "jni.h"

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/helpers.c Mon Feb  5 03:10:11 2007
@@ -32,7 +32,7 @@
 
 #include "helpers.h"
 #include "jclprots.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 int portCmp (const void **a, const void **b);
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include "helpers.h"
 #include "jclprots.h"
 #include "socket.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 #include "OSNetworkSystem.h"
 #include "nethelp.h"
 #include "hysock.h"

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/helpers.c Mon Feb  5 03:10:11 2007
@@ -30,7 +30,7 @@
 
 #include "vmi.h"
 #include "jclprots.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 #include "hysock.h"
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/procimpl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/procimpl.c?view=diff&rev=503632&r1=503631&r2=503632
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/procimpl.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/procimpl.c Mon Feb  5 03:10:11 2007
@@ -19,7 +19,7 @@
 #include <string.h>
 #include "vmi.h"
 #include "procimpl.h"
-#include "jclglob.h"
+#include "harmonyglob.h"
 
 /*Kill the Process with ID procHandle */
 



Mime
View raw message