harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r506992 [1/2] - in /harmony/enhanced: classlib/trunk/modules/portlib/src/main/native/include/shared/ classlib/trunk/modules/portlib/src/main/native/port/shared/ classlib/trunk/modules/portlib/src/main/native/port/unix/ classlib/trunk/module...
Date Tue, 13 Feb 2007 13:15:42 GMT
Author: gshimansky
Date: Tue Feb 13 05:15:34 2007
New Revision: 506992

URL: http://svn.apache.org/viewvc?view=rev&rev=506992
Log:
Applied HARMONY-3026 [drlvm] Add Internationalization support to the drlvm.

Tests passed on Ubuntu6 x86, Windows 2003 server x86 and SuSE9 x86_64


Added:
    harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfiletext.c
    harmony/enhanced/drlvm/trunk/build/make/components/vm/port.xml
    harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
    harmony/enhanced/drlvm/trunk/build/make/deploy.xml
    harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_cc/src/gc_for_vm.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_cc/src/init.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_linux.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_win32.cpp
    harmony/enhanced/drlvm/trunk/vm/gc_cc/src/slot.cpp
    harmony/enhanced/drlvm/trunk/vm/gcv4/src/block_store.cpp
    harmony/enhanced/drlvm/trunk/vm/gcv4/src/gc_for_vm.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
    harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h
    harmony/enhanced/drlvm/trunk/vm/port/include/logger.h
    harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/dll_gc.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dll_jit.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_method.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/ini_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/jit_runtime_support_ipf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/signals_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/signals_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/mem_alloc.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/nt_exception_filter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_dataflow.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hyport.h Tue Feb 13 05:15:34 2007
@@ -998,6 +998,10 @@
   /** see @ref hysysinfo.c::hysysinfo_get_processing_capacity "hysysinfo_get_processing_capacity"*/
   UDATA (PVMCALL sysinfo_get_processing_capacity) (struct HyPortLibrary *
                                                   portLibrary);
+  /** see @ref hyfile.c::hybuf_write_text "hybuf_write_text"*/
+  char *(PVMCALL buf_write_text) (struct HyPortLibrary * portLibrary,
+                                 const char *buf, IDATA nbytes);
+
   char _hypadding039C[4];       /* 4 bytes of automatic padding */
 } HyPortLibrary;
 #define HYPORT_SL_FOUND  0
@@ -1213,6 +1217,7 @@
 #define hyfile_shutdown() privatePortLibrary->file_shutdown(privatePortLibrary)
 #define hyfile_write(param1,param2,param3) privatePortLibrary->file_write(privatePortLibrary,param1,param2,param3)
 #define hyfile_write_text(param1,param2,param3) privatePortLibrary->file_write_text(privatePortLibrary,param1,param2,param3)
+#define hybuf_write_text(param1,param2) privatePortLibrary->buf_write_text(privatePortLibrary,param1,param2)
 #define hyfile_vprintf(param1,param2,param3) privatePortLibrary->file_vprintf(privatePortLibrary,param1,param2,param3)
 #define hyfile_printf privatePortLibrary->file_printf
 #define hyfile_open(param1,param2,param3) privatePortLibrary->file_open(privatePortLibrary,param1,param2,param3)

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hynls.c Tue Feb 13 05:15:34 2007
@@ -51,7 +51,7 @@
                                               U_32 message_num,
                                               const char *message,
                                               U_32 sizeOfMessage);
-static const char *parse_catalog (struct HyPortLibrary *portLibrary,
+static const char *parse_catalogues (struct HyPortLibrary *portLibrary,
                                   UDATA flags, U_32 module_name,
                                   U_32 message_num,
                                   const char *default_string);
@@ -274,14 +274,14 @@
 
   hythread_monitor_enter (nls->monitor);
 
-  if (!nls->catalog)
+  if (!nls->catalogues[0])
     open_catalog (portLibrary);
 
   message = nlsh_lookup (portLibrary, module_name, message_num);
   if (!message)
     {
       message =
-        parse_catalog (portLibrary, flags, module_name, message_num,
+        parse_catalogues (portLibrary, flags, module_name, message_num,
                        default_string);
       if (!message)
         message =
@@ -332,6 +332,9 @@
       if (nls->baseCatalogPaths[i])
         portLibrary->mem_free_memory (portLibrary, nls->baseCatalogPaths[i]);
       nls->baseCatalogPaths[i] = NULL;
+      if (nls->catalogues[i])
+          portLibrary->mem_free_memory (portLibrary, nls->catalogues[i]);
+      nls->catalogues[i] = NULL;
     }
   nls->nPaths = 0;
   if (nls->baseCatalogName)
@@ -484,7 +487,9 @@
 {
   HyNLSDataCache *nls = &portLibrary->portGlobals->nls_data;
   char *catalog = NULL;
-  I_32 fd = -1, d, p;
+  char *add_catalog = NULL;
+  I_32 position = 0;
+  I_32 fd = -1, d, p, successfully_opened = 0;
 
 #if defined(NLS_DEBUG_TRACE)
   portLibrary->tty_printf (portLibrary, "NLS - open_catalog\n");
@@ -519,11 +524,21 @@
           if (fd != -1)
             break;
         }
-      if (fd != -1)
-        break;
+      if (fd != -1) 
+        {
+          add_catalog = portLibrary->mem_allocate_memory (portLibrary, strlen(catalog) +1);
+          strcpy(add_catalog, catalog);
+          portLibrary->portGlobals->nls_data.catalogues[position++] = add_catalog;
+          portLibrary->file_close (portLibrary, fd);
+#if defined(NLS_DEBUG)
+          portLibrary->tty_printf (portLibrary, "NLS - succesfully opened %s\n", catalog);
+#endif
+          successfully_opened = 1;
+          fd = -1;
+        }
     }
 
-  if (fd == -1)
+  if (!successfully_opened)
     {
 #if defined(NLS_DEBUG)
       portLibrary->tty_printf (portLibrary,
@@ -534,24 +549,15 @@
       return;
     }
 
-  portLibrary->portGlobals->nls_data.catalog = catalog;
-
-  portLibrary->file_close (portLibrary, fd);
 
-#if defined(NLS_DEBUG)
-  portLibrary->tty_printf (portLibrary, "NLS - succesfully opened %s\n",
-                           catalog);
-#endif
-
-
-  free_catalog (portLibrary);
+  free_catalog(portLibrary);
 }
 
 #undef CDEV_CURRENT_FUNCTION
 
-#define CDEV_CURRENT_FUNCTION parse_catalog
+#define CDEV_CURRENT_FUNCTION parse_catalogues
 static const char *
-parse_catalog (struct HyPortLibrary *portLibrary, UDATA flags,
+parse_catalogues (struct HyPortLibrary *portLibrary, UDATA flags,
                U_32 module_name, U_32 message_num, const char *default_string)
 {
 
@@ -573,10 +579,12 @@
   char *buf, *newBuf;
   BOOLEAN firstChar = TRUE;
   IDATA fd = -1;
+  I_32 success_reading = 0;
   HyNLSDataCache *nls = &portLibrary->portGlobals->nls_data;
   HyNLSHashEntry *entry = NULL;
   char *message = NULL;
   char convertedModuleEnum[5];
+  U_32 catalog_index;
   /* calculate a size which is larger than we could possibly need by putting together all of the prefixes and suffixes */
   char
     prefix[sizeof
@@ -633,35 +641,27 @@
 
   /* we do a lazy caching, populate the cache as we look up messages */
 
-  if (nls->catalog)
-    {
-      fd =
-        portLibrary->file_open (portLibrary, (char *) nls->catalog,
-                                HyOpenRead, 0);
-    }
-  if (fd == -1)
-    {
-      /* couldn't open the file, store the searchKey instead */
-      char *tmpStr = prefix;
-      if (default_string)
-        {
-          tmpStr = (char *) default_string;
-        }
-      entry =
-        nls_allocateHashEntry (portLibrary, module_name, message_num, tmpStr,
-                               strlen (tmpStr));
-      if (!entry)
-        {
-          return default_string;
-        }
-      nlsh_insert (portLibrary, entry);
-      return entry->message;
-    }
-
   if (!(buf = portLibrary->mem_allocate_memory (portLibrary, bufSize)))
-    {
+  {
       goto finished;
-    }
+  }
+  for(catalog_index = 0; catalog_index < nls->nPaths; catalog_index++)
+  {
+  if (nls->catalogues[catalog_index])
+    {
+      fd = -1;
+      fd = portLibrary->file_open (portLibrary, (char *) nls->catalogues[catalog_index], HyOpenRead, 0);
+      offset = 0;
+      maxOffset = 0;
+      keyLength = -1;
+      firstChar = TRUE;
+      mode = MSG_NONE;
+      count = 0;
+      unicode = 0;
+    }
+  if (fd != -1)
+  {
+      success_reading = 1;
 
   while (read_from_catalog (portLibrary, fd, (char *) dataBuf, BUF_SIZE) !=
          NULL)
@@ -936,6 +936,26 @@
           buf[offset++] = nextChar;
         }
     }
+  }
+  }
+  if (!success_reading)
+  {
+      /* couldn't open the file, store the searchKey instead */
+      char *tmpStr = prefix;
+      if (default_string)
+      {
+          tmpStr = (char *) default_string;
+      }
+      entry =
+          nls_allocateHashEntry (portLibrary, module_name, message_num, tmpStr,
+          strlen (tmpStr));
+      if (!entry)
+      {
+          return default_string;
+      }
+      nlsh_insert (portLibrary, entry);
+      return entry->message;
+  }
   goto makeStrings;
 
 #undef MSG_NONE
@@ -1109,6 +1129,11 @@
                                         nls->baseCatalogPaths[i]);
           nls->baseCatalogPaths[i] = NULL;
         }
+      if (nls->catalogues[i])
+        {
+            portLibrary->mem_free_memory (portLibrary, nls->catalogues[i]);
+            nls->catalogues[i] = NULL;
+        }
     }
 
   if (nls->baseCatalogExtension)
@@ -1128,8 +1153,6 @@
 
   if (nls->baseCatalogName)
     portLibrary->mem_free_memory (portLibrary, nls->baseCatalogName);
-  if (nls->catalog)
-    portLibrary->mem_free_memory (portLibrary, nls->catalog);
 
   hythread_monitor_destroy (nls->monitor);
 }

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c Tue Feb 13 05:15:34 2007
@@ -547,6 +547,8 @@
 {
   char *endPathPtr = NULL;
   char *launcherName = NULL;
+  char **pathSet = portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
+  char *vmPath = NULL;
 
   hysysinfo_get_executable_name (portLib, NULL, &launcherName);
 
@@ -561,10 +563,17 @@
     endPathPtr = strrchr (launcherName, DIR_SEPARATOR);
     endPathPtr[1] = '\0';
     // launcherName now holds the name of the launcher's home directory
-  
-    portLib->nls_set_catalog (portLib, (const char **) &launcherName, 1, "harmony", "properties");
-
+    vmPath = portLib->mem_allocate_memory (portLib, strlen(launcherName) + 9);
+    strcpy(vmPath, launcherName);
+    strcat(vmPath, "default");
+    vmPath[strlen(vmPath)+1] = '\0';
+    vmPath[strlen(vmPath)] = DIR_SEPARATOR;
+    pathSet[0] = launcherName;
+    pathSet[1] = vmPath;
+    portLib->nls_set_catalog (portLib, pathSet, 2, "harmony", "properties");
     // Free memory for launcherName -- necessary ??
     portLib->mem_free_memory (portLib, launcherName);
+    portLib->mem_free_memory (portLib, pathSet);
+    portLib->mem_free_memory (portLib, vmPath);
   }
 }

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/portpriv.h Tue Feb 13 05:15:34 2007
@@ -62,7 +62,7 @@
   UDATA nPaths;
   char *baseCatalogName;
   char *baseCatalogExtension;
-  char *catalog;
+  char *catalogues[4];
   char language[4];
   char region[4];
   char variant[32];
@@ -242,6 +242,11 @@
             IDATA nbytes));
 struct HyPortLibrary;
 extern HY_CFUNC char *VMCALL
+  hybuf_write_text
+PROTOTYPE ((struct HyPortLibrary * portLibrary, const char *buf,
+           IDATA nbytes));
+struct HyPortLibrary;
+extern HY_CFUNC char *VMCALL
   hyfile_read_text
 PROTOTYPE ((struct HyPortLibrary * portLibrary, IDATA fd, char *buf,
             IDATA nbytes));
@@ -1394,6 +1399,7 @@
   hyshmem_findclose,            /* shmem_findclose */
   hyshmem_stat,                 /* shmem_stat */
   hysysinfo_get_processing_capacity,    /* sysinfo_get_processing_capacity */
+  hybuf_write_text,            /* buf_write_text */
 };
 #endif
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/hyfiletext.c Tue Feb 13 05:15:34 2007
@@ -56,6 +56,11 @@
                                      IDATA fd, const char *buf, IDATA nbytes);
 #endif /* HYVM_USE_ICONV (autogen) */
 
+#if (defined(HYVM_USE_ICONV))
+static char* buf_write_using_iconv (struct HyPortLibrary *portLibrary,
+                                     const char *buf, IDATA nbytes);
+#endif /* HYVM_USE_ICONV (autogen) */
+
 #if (defined(HYVM_USE_WCTOMB))
 static IDATA walkUTF8String (const U_8 * buf, IDATA nbytes);
 #endif /* HYVM_USE_WCTOMB (autogen) */
@@ -70,6 +75,63 @@
                                       IDATA nbytes);
 #endif /* HYVM_USE_WCTOMB (autogen) */
 
+#if (defined(HYVM_USE_WCTOMB))
+static char* buf_write_using_wctomb (struct HyPortLibrary *portLibrary,
+                                      const char *buf, IDATA nbytes);
+#endif /* HYVM_USE_WCTOMB (autogen) */
+
+#undef CDEV_CURRENT_FUNCTION
+
+
+#define CDEV_CURRENT_FUNCTION hybuf_write_text
+/**
+* Output the buffer onto the another buffer as text. The in buffer is a UTF8-encoded array of chars.
+* It is converted to the appropriate platform encoding.
+*
+* @param[in] portLibrary The port library
+* @param[in] buf buffer of text to be converted.
+* @param[in] nbytes size of buffer of text to be converted.
+*
+* @return buffer of converted to the appropriate platform encoding text.
+*/
+char *VMCALL
+hybuf_write_text (struct HyPortLibrary * portLibrary,
+                  const char *buf, IDATA nbytes)
+{
+  char* outBuf = NULL;
+  IDATA i;
+  int requiresTranslation = 0;
+
+  const char *utf8Encoding = "UTF-8";
+
+  /* we can short circuit if the string is all ASCII */
+  for (i = 0; i < nbytes; i++)
+  {
+      if ((U_8) buf[i] >= 0x80)
+      {
+          requiresTranslation = 1;
+          break;
+      }
+  }
+
+  if (!requiresTranslation
+      || strcmp (nl_langinfo (CODESET), utf8Encoding) == 0)
+  {
+      /* We're in luck! No transformations are necessary */
+      outBuf = portLibrary->mem_allocate_memory (portLibrary, nbytes + 1);
+      memcpy(outBuf, buf, nbytes);
+      outBuf[nbytes] = '\0';
+      return outBuf;
+  }
+
+#if defined(HYVM_USE_WCTOMB)
+  return buf_write_using_wctomb (portLibrary, buf, nbytes);
+#else
+  return buf_write_using_iconv (portLibrary, buf, nbytes);
+#endif
+
+}
+
 #undef CDEV_CURRENT_FUNCTION
 
 #define CDEV_CURRENT_FUNCTION hyfile_write_text
@@ -257,6 +319,40 @@
 
 #undef CDEV_CURRENT_FUNCTION
 
+#define CDEV_CURRENT_FUNCTION buf_write_using_wctomb
+#if (defined(HYVM_USE_WCTOMB))
+static char*
+buf_write_using_wctomb (struct HyPortLibrary *portLibrary, const char *buf,
+                         IDATA nbytes)
+{
+    IDATA newLength = 0;
+    char *outBuf = (char*)buf;
+    newLength = walkUTF8String ((U_8 *) buf, nbytes);
+    if (newLength)
+    {
+        outBuf = portLibrary->mem_allocate_memory (portLibrary, newLength + 1);
+        if (outBuf)
+        {
+            translateUTF8String (buf, outBuf, nbytes);
+            nbytes = newLength;
+            outBuf[nbytes] = '\0';
+        } else
+        {
+            outBuf = portLibrary->mem_allocate_memory (portLibrary, nbytes + 1);
+            memcpy(outBuf, buf, nbytes);
+            outBuf[nbytes] = '\0';
+        }
+        return outBuf;
+    }
+    outBuf = portLibrary->mem_allocate_memory (portLibrary, nbytes + 1);
+    memcpy(outBuf, buf, nbytes);
+    outBuf[nbytes] = '\0';
+    return outBuf;
+}
+#endif /* HYVM_USE_WCTOMB (autogen) */
+
+#undef CDEV_CURRENT_FUNCTION
+
 #define CDEV_CURRENT_FUNCTION file_write_using_iconv
 #if (defined(HYVM_USE_ICONV))
 static IDATA
@@ -325,6 +421,73 @@
       portLibrary->mem_free_memory (portLibrary, bufStart);
     }
   return (result == nbytes) ? 0 : result;
+}
+#endif /* HYVM_USE_ICONV (autogen) */
+
+#undef CDEV_CURRENT_FUNCTION
+
+#define CDEV_CURRENT_FUNCTION buf_write_using_iconv
+#if (defined(HYVM_USE_ICONV))
+static IDATA
+buf_write_using_iconv (struct HyPortLibrary *portLibrary,
+                        const char *buf, IDATA nbytes)
+{
+    UDATA outBufLen = 512;
+    iconv_t converter;
+    size_t inbytesleft, outbytesleft;
+    char *inbuf;
+    /* iconv_open is not an a2e function, so we need to pass it honest-to-goodness EBCDIC strings */
+    converter = iconv_open (nl_langinfo (CODESET), "UTF-8");
+    if (converter == (iconv_t) - 1)
+    {
+        /* no converter available for this code set. Just dump the UTF-8 chars */
+        outbuf = portLibrary->mem_allocate_memory (portLibrary, nbytes + 1);
+        memcpy(outbuf, buf, nbytes);
+        outBuf[nbytes] = '\0';
+        return  outbuf;
+    }
+    char *bufStart = portLibrary->mem_allocate_memory (portLibrary, 512);
+    char *outbuf = bufStart;
+    inbuf = (char *) buf;         /* for some reason this argument isn't const */
+    inbytesleft = nbytes;
+    outbytesleft = sizeof (stackBuf);
+    while ((size_t) - 1 ==
+        iconv (converter, &inbuf, &inbytesleft, &outbuf, &outbytesleft))
+    {
+        if (errno == E2BIG)
+        {
+            /* grow the buffer by 512 more bytes */
+            char *newBuf =
+                portLibrary->mem_allocate_memory (portLibrary, outBufLen += 512);
+            if (newBuf == NULL)
+            {
+                break;            /* just output what we've got so far */
+            }
+            /* copy over the work we've already done */
+            memcpy (newBuf, bufStart, outbuf - bufStart);
+            /* set up the new buffer, and free the old one */
+            outbytesleft = outBufLen - (outbuf - bufStart);
+            outbuf = newBuf + (outbuf - bufStart);
+            portLibrary->mem_free_memory (portLibrary, bufStart);
+            bufStart = newBuf;
+        }
+        else
+        {
+            /* failure -- just output the unconverted data */
+            iconv_close (converter);
+            outbuf = portLibrary->mem_allocate_memory (portLibrary, nbytes + 1);
+            memcpy(outbuf, buf, nbytes);
+            outBuf[nbytes] = '\0';
+            portLibrary->mem_free_memory (portLibrary, bufStart);
+            return  outbuf;
+        }
+    }
+    iconv_close (converter);
+    outbuf = portLibrary->mem_allocate_memory (portLibrary, outbuf - bufStart + 1);
+    memcpy(outbuf, buf, outbuf - bufStart);
+    outBuf[outbuf - bufStart] = '\0';
+    portLibrary->mem_free_memory (portLibrary, bufStart);
+    return outbuf;
 }
 #endif /* HYVM_USE_ICONV (autogen) */
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfiletext.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfiletext.c?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfiletext.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/windows/hyfiletext.c Tue Feb 13 05:15:34 2007
@@ -30,6 +30,132 @@
 U_32 decodeUTF8CharN (const U_8 * input, U_16 * result, U_32 bytesRemaining);
 #undef CDEV_CURRENT_FUNCTION
 
+#define CDEV_CURRENT_FUNCTION hybuf_write_text
+/**
+* Output the buffer onto the another buffer as text. The in buffer is a UTF8-encoded array of chars.
+* It is converted to the appropriate platform encoding.
+*
+* @param[in] portLibrary The port library
+* @param[in] buf buffer of text to be converted.
+* @param[in] nbytes size of buffer of text to be converted.
+*
+* @return buffer of converted to the appropriate platform encoding text.
+*/
+char *VMCALL
+hybuf_write_text (struct HyPortLibrary * portLibrary,
+                  const char *buf, IDATA nbytes)
+{
+    IDATA i;
+    int newlines = 0, highchars = 0;
+    char *newBuf = NULL;
+    IDATA newLen;
+    char *outBuf = (char*)buf;
+
+    /* scan the buffer for any characters which need to be converted */
+    for (i = 0; i < nbytes; i++)
+    {
+        if (outBuf[i] == '\n')
+        {
+            newlines += 1;
+        }
+        else if ((U_8) outBuf[i] & 0x80)
+        {
+            highchars += 1;
+        }
+    }
+    newlines = 0;
+    /* if there are any non-ASCII chars, convert to Unicode and then to the local code page */
+    if (highchars)
+    {
+        U_16 *wBuf;
+        newLen = (nbytes + newlines) * 2;
+        wBuf = portLibrary->mem_allocate_memory (portLibrary, newLen);
+        if (wBuf)
+        {
+            U_8 *in = (U_8 *) outBuf;
+            U_8 *end = in + nbytes;
+            U_16 *out = wBuf;
+
+            while (in < end)
+            {
+                if (*in == '\n')
+                {
+                    *out++ = (U_16) '\r';
+                    *out++ = (U_16) '\n';
+                    in += 1;
+                }
+                else
+                {
+                    U_32 numberU8Consumed =
+                        decodeUTF8CharN (in, out++, end - in);
+                    if (numberU8Consumed == 0)
+                    {
+                        break;
+                    }
+                    in += numberU8Consumed;
+                }
+            }
+            /* in will be NULL if an error occurred */
+            if (in)
+            {
+                UINT codePage = GetConsoleOutputCP ();
+                IDATA wLen = out - wBuf;
+                IDATA mbLen =
+                    WideCharToMultiByte (codePage, 0, wBuf, wLen, NULL, 0, NULL,
+                    NULL);
+                if (mbLen > 0)
+                {
+                    newBuf = portLibrary->mem_allocate_memory (portLibrary, mbLen + 1);
+                    /* if we couldn't allocate the buffer, just output the data the way it was */
+                    if (newBuf)
+                    {
+                        WideCharToMultiByte (codePage, 0, wBuf, wLen, newBuf,
+                            mbLen, NULL, NULL);
+                        outBuf = newBuf;
+                        nbytes = mbLen;
+                        newBuf[nbytes] = '\0';
+                        newBuf = NULL;
+                    }
+                }
+            }
+                portLibrary->mem_free_memory (portLibrary, wBuf);
+        }
+    }
+    else if (newlines)
+    {
+        /* change any LFs to CRLFs */
+        newLen = nbytes + newlines;
+        newBuf = portLibrary->mem_allocate_memory (portLibrary, newLen + 1);
+        /* if we couldn't allocate the buffer, just output the data the way it was */
+        if (newBuf)
+        {
+            char *cursor = newBuf;
+            for (i = 0; i < nbytes; i++)
+            {
+                if (outBuf[i] == '\n')
+                    *cursor++ = '\r';
+                *cursor++ = outBuf[i];
+            }
+            if (outBuf != buf)
+            {
+                portLibrary->mem_free_memory (portLibrary, outBuf);
+            }
+            outBuf = newBuf;
+            nbytes = newLen;
+            outBuf[nbytes] = '\0';
+
+        }
+    }
+    if (outBuf == buf) {
+        outBuf = portLibrary->mem_allocate_memory (portLibrary, nbytes + 1);
+        memcpy((void*)outBuf, (const void*)buf, nbytes);
+        outBuf[nbytes] = '\0';
+    }
+    return outBuf;
+}
+
+#undef CDEV_CURRENT_FUNCTION
+
 #define CDEV_CURRENT_FUNCTION hyfile_read_text
 /**
  * Read a line of text from the file into buf.  Text is converted from the platform file encoding to UTF8.

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/port.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/port.xml?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/port.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/port.xml Tue Feb 13 05:15:34 2007
@@ -39,6 +39,7 @@
                 <pathelement location="${extra.apr.includes}" />
                 <pathelement location="${extra.log4cxx.includes}" />
                 <pathelement location="${vm.port.includes}" />
+                <pathelement location="${external.dep.CLASSLIB.includes}" />
             </includepath>
 
             <defineset define="APR_DECLARE_EXPORT" />
@@ -87,6 +88,7 @@
                 <pathelement location="${extra.apr.includes}" />
                 <pathelement location="${extra.log4cxx.includes}" />
                 <pathelement location="${vm.port.includes}" />
+                <pathelement location="${external.dep.CLASSLIB.includes}" />
             </includepath>
 
             <defineset define="APR_DECLARE_EXPORT" />

Modified: harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml Tue Feb 13 05:15:34 2007
@@ -348,5 +348,15 @@
                 <linkerarg value="-lstdc++" /-->
             </select>
         </linker>
+        <echo message="Copying files for internationalization..."/>
+
+        <mkdir dir="${build.semi.dir}/vm/vmcore/_other"/> 
+        <copy todir="${build.semi.dir}/vm/vmcore/_other" 
+              flatten="true" 
+              includeEmptyDirs="false">
+              <fileset dir="${build.VM.home}/vmcore/src/init">
+                   <include name="harmony*.properties" />
+              </fileset>
+        </copy>
     </target>
 </project>

Modified: harmony/enhanced/drlvm/trunk/build/make/deploy.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/deploy.xml?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/deploy.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/deploy.xml Tue Feb 13 05:15:34 2007
@@ -35,6 +35,7 @@
         <vmcore>
             <static>bin/default:harmonyvm</static>
             <shared>bin/default:harmonyvm</shared>
+            <other>bin/default:*</other>
         </vmcore>
 
         <interpreter>

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Tue Feb 13 05:15:34 2007
@@ -327,8 +327,7 @@
         rc = !config.empty();
     } 
     if (!rc) {
-        std::string errMsg = "EM: Can't read configuration from '" + fileName+ "'";
-        ECHO(errMsg.c_str());
+        LECHO(1, "EM: Can't read configuration from '{0}'" << fileName.c_str());
     }
     return config;
 }
@@ -377,7 +376,7 @@
 bool DrlEMImpl::initJIT(const std::string& libName, apr_dso_handle_t* libHandle, RStep& step) {
     apr_dso_handle_sym_t fn = NULL;
     if (apr_dso_sym(&fn, libHandle, "JIT_init") != APR_SUCCESS) {
-        ECHO(("EM: Not a JIT shared lib: '" + libName + "'").c_str());
+        LECHO(2, "EM: Not a JIT shared lib: '{0}'" << libName.c_str());
         return false;
     }
     void (*_init)(JIT_Handle, const char*) = (void (*)(JIT_Handle, const char*)) fn;
@@ -416,7 +415,7 @@
     bool loggingEnabled =  is_info_enabled(LOG_DOMAIN);
     StringList chainNames = getParamAsList(config, "chains", ',', true);
     if (chainNames.empty()) {
-        ECHO("EM: No 'chains' property found in configuration");
+        LECHO(3, "EM: No 'chains' property found in configuration");
         return;
     }
     bool failed = false;
@@ -436,7 +435,7 @@
                 jitLib = getParam(config, jitName+".file");
             } 
             if (jitLib.empty()) {
-                ECHO(("EM: No JIT library specified for JIT :'"  + jitLib + "'").c_str());
+                LECHO(4, "EM: No JIT library specified for JIT :'{0}'" << jitLib.c_str());
                 failed = true;
                 break;
             }
@@ -444,7 +443,7 @@
             apr_dso_handle_t* libHandle;
             JIT_Handle jh = vm_load_jit(fullJitLibPath.c_str(), &libHandle); //todo: do not load the same dll twice!!!
             if (jh == NULL) {
-                ECHO(("EM: JIT library loading error:'"  + fullJitLibPath + "'").c_str());
+                LECHO(5, "EM: JIT library loading error:'{0}'" << fullJitLibPath.c_str());
                 failed = true;
                 break;
             }
@@ -465,7 +464,7 @@
                 const std::string& filter = *filterIt;
                 bool res = chain->addMethodFilter(filter);
                 if (!res) {
-                    ECHO(("EM: Invalid filter :'"  + filter+ "'").c_str());
+                    LECHO(6, "EM: Invalid filter :'{0}'" << filter.c_str());
                 }
             }
         }
@@ -582,7 +581,7 @@
     }    
     std::string profilerType = getParam(config, profilerName+".profilerType");
     if (profilerType!=ENTRY_BACKEDGE_PROFILER_STR && profilerType!=EDGE_PROFILER_STR  && profilerType!=VALUE_PROFILER_STR) {
-        ECHO("EM: Unsupported profiler type");
+        LECHO(7, "EM: Unsupported profiler type");
         return NULL;
     }
 
@@ -593,31 +592,31 @@
         if (mode == "ASYNC") {
             ebMode = EBProfileCollector::EB_PCMODE_ASYNC;
         }  else if (mode!="SYNC") {
-            ECHO("EM: unsupported profiler mode");
+            LECHO(8, "EM: unsupported profiler mode");
             return NULL;
         }
         
         bool ok = false;
         uint32 eThreshold = toNum(getParam(config, profilerName+".entryThreshold"), &ok);//todo: default values..
             if (!ok) {
-            ECHO("EM: illegal 'entryThreshold' value");
+            LECHO(9, "EM: illegal '{0}' value" << "entryThreshold");
             return NULL;
             }
                 uint32 bThreshold = toNum(getParam(config, profilerName+".backedgeThreshold"), &ok);
         if (!ok) {
-            ECHO("EM: illegal 'backedgeThreshold' value");
+            LECHO(9, "EM: illegal '{0}' value" << "backedgeThreshold");
             return NULL;
         }
         uint32 tbsTimeout = 0, tbsInitialTimeout = 0;
         if (ebMode == EBProfileCollector::EB_PCMODE_ASYNC) {
             tbsTimeout= toNum(getParam(config, profilerName+".tbsTimeout"), &ok);
             if (!ok) {
-                ECHO("EM: illegal 'tbsTimeout' value");
+                LECHO(9, "EM: illegal '{0}' value" << "tbsTimeout");
                 return NULL;
                 }
             tbsInitialTimeout= toNum(getParam(config, profilerName+".tbsInitialTimeout"), &ok);
             if (!ok) {
-                ECHO("EM: illegal 'tbsInitialTimeout' value");
+                LECHO(9, "EM: illegal '{0}' value" << "tbsInitialTimeout");
                 return NULL;
             }
         }
@@ -633,24 +632,24 @@
         if (vpalgo == "TNV_DIVIDED") {
             vpMode = ValueProfileCollector::TNV_DIVIDED;    
         } else if (vpalgo != "TNV_FIRST_N") {
-            ECHO("EM: unsupported value profiler algotype");
+            LECHO(10, "EM: unsupported value profiler algotype");
             return NULL;
         }
         bool ok = false;
         vpSteadySize = toNum(getParam(config, profilerName+".vpSteadySize"), &ok);
         if (!ok) {
-            ECHO("EM: illegal 'SteadySize' value");
+            LECHO(9, "EM: illegal '{0}' value" << "SteadySize");
             return NULL;
         }
         if (vpMode == ValueProfileCollector::TNV_DIVIDED) {
             vpClearSize = toNum(getParam(config, profilerName+".vpClearSize"), &ok);
             if (!ok) {
-                ECHO("EM: illegal 'ClearSize' value");
+                LECHO(9, "EM: illegal '{0}' value" << "ClearSize");
                 return NULL;
             }
             vpClearInterval = toNum(getParam(config, profilerName+".vpClearInterval"), &ok);
             if (!ok) {
-                ECHO("EM: illegal 'ClearInterval' value");
+                LECHO(9, "EM: illegal '{0}' value" << "ClearInterval");
                 return NULL;
             }
         }
@@ -679,7 +678,7 @@
             if (!profilerName.empty()) {
                 ProfileCollector* pc = createProfileCollector(profilerName, config, step);
                 if (pc == NULL) {
-                    ECHO(("EM: profile configuration failed: "+ profilerName).c_str());
+                    LECHO(11, "EM: profile configuration failed: {0}" << profilerName.c_str());
                     failed = true;
                     break;
                 }
@@ -693,7 +692,7 @@
                         tbsClients.push_back(tbsClient);
                     }
                 } else {
-                    ECHO(("EM: profile generation is not supported: " + profilerName).c_str());
+                    LECHO(12, "EM: profile generation is not supported: {0}" << profilerName.c_str());
                     delete pc;
                     failed = true;
                     break;
@@ -721,11 +720,11 @@
                     pc->addUseJit(step->jit);
                 } else {
                     if (pc == NULL) {
-                        ECHO(("EM: profile not found: " + profilerName).c_str());
+                        LECHO(13, "EM: profile not found: {0}" << profilerName.c_str());
                     } else if (invalidChain) {
-                        ECHO(("EM: illegal use of profile: " + profilerName).c_str());
+                        LECHO(14, "EM: illegal use of profile: {0}" << profilerName.c_str());
                     } else {
-                        ECHO(("EM: profile usage is not supported: " + profilerName).c_str());
+                        LECHO(15, "EM: profile usage is not supported: {0}" << profilerName.c_str());
                     }
                 }
             }

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/src/gc_for_vm.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/gc_for_vm.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/src/gc_for_vm.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/src/gc_for_vm.cpp Tue Feb 13 05:15:34 2007
@@ -404,7 +404,7 @@
     volatile uint8 *info = (volatile uint8 *)&obj->obj_info_byte();
     uint8 value = *info;
     if ((value & OBJECT_IS_PINNED_BITS) == OBJECT_IS_PINNED_BITS) {
-        DIE2("gc", "no handling for pin overflow");
+        LDIE2("gc", 1, "no handling for pin overflow");
     }
 
     while (true) {

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/src/init.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/init.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/src/init.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/src/init.cpp Tue Feb 13 05:15:34 2007
@@ -247,13 +247,13 @@
                 max_heap_size -= dec;
                 assert(max_heap_size > 0);
             }
-            ECHO("WARNING: max heap size is too large, reduced to " << mb(max_heap_size) << " Mb");
+            LECHO(19, "WARNING: max heap size is too large, reduced to {0} Mb" << mb(max_heap_size));
         }
     }
 
     if (min_heap_size > max_heap_size) {
         min_heap_size = max_heap_size;
-        ECHO("WARNING: min heap size reduced to " << mb(min_heap_size) << " Mb");
+        LECHO(20, "WARNING: min heap size reduced to {0} Mb" << mb(min_heap_size));
     }
 
     heap.ceiling = heap_base + min_heap_size - RESERVED_FOR_LAST_HASH;
@@ -268,7 +268,7 @@
     void *res;
     if (heap_base && !lp_hint) {
         res = VirtualAlloc(heap.base, heap.size, MEM_COMMIT, PAGE_READWRITE);
-        if (!res) DIE("Can't create heap_L");
+        if (!res) LDIE(2, "Can't create heap_L");
     }
 #endif
     chunk_size = round_down(heap.size / 10, 65536);

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_linux.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_linux.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_linux.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_linux.cpp Tue Feb 13 05:15:34 2007
@@ -135,7 +135,7 @@
         if (is_info_enabled("gc.lp")) {
             INFO2("gc.lp", "read also /usr/src/linux/Documentation/vm/hugetlbpage.txt");
         } else {
-            WARN2("gc.lp", "large pages allocation failed, use -verbose:gc.lp for more info");
+            LWARN2("gc.lp", 1, "large pages allocation failed, use -verbose:gc.lp for more info");
         }
     }
     return addr;

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_win32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_win32.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_win32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/src/large_pages_win32.cpp Tue Feb 13 05:15:34 2007
@@ -94,7 +94,7 @@
                            "gc.lp: become fragmented and unusable after a while\n"
                            "gc.lp: Heap size should be multiple of large page size");
         } else {
-            WARN2("gc.lp", "large pages allocation failed, use -verbose:gc.lp for more info");
+            LWARN2("gc.lp", 1, "large pages allocation failed, use -verbose:gc.lp for more info");
         }
         return NULL;
     } else {

Modified: harmony/enhanced/drlvm/trunk/vm/gc_cc/src/slot.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_cc/src/slot.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_cc/src/slot.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_cc/src/slot.cpp Tue Feb 13 05:15:34 2007
@@ -37,7 +37,7 @@
         heap_chunk = (Reference*) heap.roots_pos;
         heap.roots_pos += ROOTS_CAPACITY * sizeof(Reference);
         if (heap.roots_pos > heap.roots_end) {
-            DIE2("gc", "not enough reserved space for roots");
+            LDIE2("gc", 3, "not enough reserved space for roots");
         }
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/gcv4/src/block_store.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gcv4/src/block_store.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gcv4/src/block_store.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gcv4/src/block_store.cpp Tue Feb 13 05:15:34 2007
@@ -220,12 +220,12 @@
             final_heap_size -= dec;
             VERIFY(final_heap_size > 0, "Are we able to allocate heap");
         }
-        ECHO("WARNING: final heap size is too large, reduced to " << mb(final_heap_size) << " Mb");
+        LECHO(16, "WARNING: final heap size is too large, reduced to {0} Mb" << mb(final_heap_size));
     }
 
     if (initial_heap_size > final_heap_size) {
         initial_heap_size = final_heap_size;
-        ECHO("WARNING: initial heap size reduced to " << mb(initial_heap_size) << " Mb");
+        LECHO(17, "WARNING: initial heap size reduced to {0} Mb" << mb(initial_heap_size));
     }
 
     // Check that ceiling is block aligned

Modified: harmony/enhanced/drlvm/trunk/vm/gcv4/src/gc_for_vm.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gcv4/src/gc_for_vm.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gcv4/src/gc_for_vm.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gcv4/src/gc_for_vm.cpp Tue Feb 13 05:15:34 2007
@@ -184,7 +184,7 @@
         if (sz > 0) {
             initial_heap_size_bytes = sz;
         } else {
-            ECHO("WARNING: Incorrect minimum gc size specified, using default");
+            LECHO(18, "WARNING: Incorrect {0} gc size specified, using default" << minimum);
         }
     }
     
@@ -193,7 +193,7 @@
         if (sz > 0) {
             final_heap_size_bytes = sz;
         } else {
-            ECHO("WARNING: Incorrect maximum gc size specified, using default");
+            LECHO(18, "WARNING: Incorrect {0} gc size specified, using default" << "maximum");
         }
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Tue Feb 13 05:15:34 2007
@@ -979,8 +979,8 @@
             break;
         default:
             DEBUG_BYTECODE("#" << dec << (int)index << " Unknown type = " << cp.get_tag(index));
-            DIE("ldc instruction: unexpected type (" << cp.get_tag(index)
-                << ") of constant pool entry [" << index << "]");
+            LDIE(4, "ldc instruction: unexpected type ({0}) of constant pool entry [{1}]"
+                 << cp.get_tag(index) << index);
             break;
     }
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/cxxlog.h Tue Feb 13 05:15:34 2007
@@ -24,6 +24,7 @@
 #include <assert.h>
 #include "logger.h"
 #include "loggerstring.h"
+#include "logparams.h"
 #include "log_macro.h"
 
 namespace util
@@ -54,6 +55,12 @@
     log4cxx_from_c("root", DIE, logger_string.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
 }
 
+#define LECHO(message_number, messagedef_and_params) { \
+    LogParams log_params(0x4543484f, message_number); \
+    log_params << messagedef_and_params; \
+    log4cxx_from_c("root", DIE, log_params.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
+}
+
 #define DIE2(category, message) { \
     LoggerString logger_string; \
     logger_string << message; \
@@ -62,6 +69,14 @@
     ::abort(); \
 }
 
+#define LDIE2(category, message_number, messagedef_and_params) { \
+    LogParams log_params(0x4c444945, message_number); \
+    log_params << messagedef_and_params; \
+    log4cxx_from_c(category, DIE, log_params.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
+    shutdown_log_system(); \
+    ::abort(); \
+}
+
 #define WARN2(category, message) { \
     if (is_warn_enabled(category)) { \
     LoggerString logger_string; \
@@ -70,6 +85,14 @@
     } \
 }
 
+#define LWARN2(category, message_number, messagedef_and_params) { \
+    if (is_warn_enabled(category)) { \
+    LogParams log_params(0x5741524e, message_number); \
+    log_params << messagedef_and_params; \
+    log4cxx_from_c(category, WARN, log_params.release(), __FILE__, __LOG4CXX_FUNC__, __LINE__); \
+    } \
+}
+
 #define INFO2(category, message) { \
     if (is_info_enabled(category)) { \
     LoggerString logger_string; \
@@ -111,7 +134,11 @@
 #ifdef LOG_DOMAIN
 
 #define DIE(message) DIE2(LOG_DOMAIN, message)
+#define LDIE(message_number, messagedef_and_params) \
+LDIE2(LOG_DOMAIN, message_number, messagedef_and_params)
 #define WARN(message) WARN2(LOG_DOMAIN, message)
+#define LWARN(message_number, messagedef_and_params) \
+LWARN2(LOG_DOMAIN, message_number, messagedef_and_params)
 #define INFO(message) INFO2(LOG_DOMAIN, message)
 #define LOG(message) LOG2(LOG_DOMAIN, message)
 #define TRACE(message) TRACE2(LOG_DOMAIN, message)
@@ -149,4 +176,3 @@
 #endif // LOG_DOMAIN
 
 #endif // _CXX_LOG_H_
-

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/logger.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/logger.h?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/logger.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/logger.h Tue Feb 13 05:15:34 2007
@@ -68,7 +68,7 @@
 /**
 * Inits log system.  
 */
-VMEXPORT void init_log_system();
+VMEXPORT void init_log_system(void *portLib);
 
 /**
 * shutdown log system.  
@@ -79,6 +79,7 @@
 * Sets loggers logging levels from file  
 */
 VMEXPORT void set_logging_level_from_file(const char* filename);
+
 /**
  * Passes the message specified with level assigned to the category specified for logging.  
  */

Added: harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h?view=auto&rev=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h Tue Feb 13 05:15:34 2007
@@ -0,0 +1,208 @@
+/*
+ *  Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+/** 
+* @author Dmitry B. Yershov
+*/  
+
+#ifndef LOG_PARAMS_H
+#define LOG_PARAMS_H
+
+#include <iostream>
+#include <vector>
+#include "port_malloc.h"
+
+#ifdef PLATFORM_NT
+#define FMT64 "I64"
+#else // !PLATFORM_NT
+#define FMT64 "ll"
+#endif // !PLATFORM_NT
+
+using std::string;
+using std::vector;
+
+class LogParams {
+private:
+    vector<string> values;
+    const char* def_messageId;
+    const char* messageId;
+    string result_string;
+    int prefix, message_number, is_def_messageId_set;
+public:
+
+    LogParams(int pref, int mess_num) {
+        prefix = pref;
+        message_number = mess_num;
+        is_def_messageId_set = 0;
+        messageId = NULL;
+    }
+
+    ~LogParams() {
+        STD_FREE((void*)def_messageId);
+    }
+
+    VMEXPORT const char* release();
+
+    LogParams& operator<<(const char* message) {
+        if (!is_def_messageId_set) {
+            def_messageId = strdup(message);
+            is_def_messageId_set = 1;
+            return *this;
+        } else {
+            string logger_string;
+            logger_string += message;
+            values.push_back(logger_string);
+            return *this;
+        }
+    }
+
+    LogParams& operator<<(char* message) {
+        if (!is_def_messageId_set) {
+            def_messageId = strdup(message);
+            is_def_messageId_set = 1;
+            return *this;
+        } else {
+            string logger_string;
+            logger_string += message;
+            values.push_back(logger_string);
+            return *this;
+        }
+    }
+
+    LogParams& operator<<(volatile void* pointer) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(21);
+        sprintf(buf, "%p", pointer);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(const void* pointer) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(21);
+        sprintf(buf, "%p", pointer);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(void *pointer) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(21);
+        sprintf(buf, "%p", pointer);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(char c) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(2*sizeof(char));
+        sprintf(buf, "%c", c);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(int i) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(21);
+        sprintf(buf, "%d", i);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(long i) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(50);
+        sprintf(buf, "%ld", i);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(unsigned i) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(50);
+        sprintf(buf, "%u", i);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(unsigned long i) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(100);
+        sprintf(buf, "%lu", i);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(int64 i) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(100);
+        sprintf(buf, "%" FMT64 "d", i);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(uint64 i) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(100);
+        sprintf(buf, "%" FMT64 "u", i);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    LogParams& operator<<(double d) {
+        string logger_string;
+        char* buf = (char*)STD_MALLOC(100);
+        sprintf(buf, "%lf", d);
+        logger_string += buf;
+        STD_FREE(buf);
+        values.push_back(logger_string);
+        return *this;
+    }
+
+    typedef std::ios_base& (*iomanip)(std::ios_base&);
+    LogParams& operator<<(iomanip UNREF i) {
+        //FIXME: NYI
+        return *this;
+    }
+
+    typedef std::ostream& (*iomanip2)(std::ostream&);
+    LogParams& operator<<(iomanip2 UNREF i) {
+        //FIXME: NYI
+        return *this;
+    }
+};
+
+#endif //LOG_PARAMS_H
+ 

Propchange: harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp Tue Feb 13 05:15:34 2007
@@ -28,6 +28,7 @@
 #include <stdarg.h>
 #include "port_malloc.h"
 #include "logger.h"
+#include "logparams.h"
 #include <log4cxx/logger.h>
 #include <log4cxx/logmanager.h>
 #include <log4cxx/level.h>
@@ -39,6 +40,8 @@
 #include <log4cxx/filter/stringmatchfilter.h>
 #include <log4cxx/helpers/transcoder.h>
 #include <log4cxx/propertyconfigurator.h>
+#include <apr_env.h>
+#include "hyport.h"
 
 #if defined(_MSC_VER) && !defined (__INTEL_COMPILER)
 #pragma warning( pop )
@@ -67,6 +70,38 @@
     }
 }
 
+void* portlib_for_logger = NULL;
+
+const char* LogParams::release() {
+
+    if (portlib_for_logger) {
+        messageId = (char*) ((HyPortLibrary*)portlib_for_logger)->nls_lookup_message ((HyPortLibrary*)portlib_for_logger,
+        HYNLS_DO_NOT_PRINT_MESSAGE_TAG | HYNLS_DO_NOT_APPEND_NEWLINE ,
+        prefix, message_number, def_messageId);
+    } else {
+        messageId = def_messageId;
+    }
+    if (portlib_for_logger) {
+        messageId = ((HyPortLibrary *)portlib_for_logger)->buf_write_text((struct HyPortLibrary *)portlib_for_logger, (const char *)messageId, (IDATA) strlen(messageId));
+    }
+    int i = 0;
+    while(messageId[i] != '\0') {
+        if (messageId[i] == '{' && messageId[i + 1] >= '0' &&
+            messageId[i + 1] <= '9' && messageId[i + 2] == '}') {
+                int arg = messageId[i + 1] - '0';
+                result_string += values[arg];
+                i += 3;
+            } else {
+                result_string += messageId[i];
+                i++;
+            }
+    }
+    if (portlib_for_logger) {
+        ((HyPortLibrary *)portlib_for_logger)->mem_free_memory ((struct HyPortLibrary *)portlib_for_logger, (void*)messageId);
+    }
+    return (const char*)result_string.c_str();
+}
+
 static LevelPtr get_log4cxx_level(LoggingLevel level) {
     switch(level) {
         case DIE:
@@ -92,7 +127,39 @@
     }
 }
 
-void init_log_system() {
+int set_locale(char* logger_locale) {
+    char* lang = strdup(logger_locale);
+    char* region = NULL;
+    char* variant = NULL;
+    if (portlib_for_logger) {
+        region = strchr(lang, '_');
+        if (region == NULL) {
+            ((HyPortLibrary *)portlib_for_logger)->nls_set_locale((HyPortLibrary *)portlib_for_logger, lang, "", "");
+            free((void*)lang);
+            return 1;
+        } else {
+            region[0] = 0;
+            region++;
+            variant = strchr(region, '.');
+            if (variant == NULL) {
+                ((HyPortLibrary *)portlib_for_logger)->nls_set_locale((HyPortLibrary *)portlib_for_logger, lang, region, "");
+                free((void*)lang);
+                return 1;
+            } else {
+                variant[0] = 0;
+                variant++;
+                ((HyPortLibrary *)portlib_for_logger)->nls_set_locale((HyPortLibrary *)portlib_for_logger, lang, region, variant);
+                free((void*)lang);
+                return 1;
+            }
+        }
+    }
+    free((void*)lang);
+    return 0;
+}
+
+void init_log_system(void *portlib) {
+    int set_locale_success = 0;
     trace_levelPtr = new Level(Level::TRACE_INT, LOG4CXX_STR("TRACE"), 7);
 
     LoggerPtr logger = Logger::getRootLogger();
@@ -102,6 +169,32 @@
 
     LoggerPtr info_logger = get_logger("info");
     info_logger->setLevel(Level::getInfo());
+
+    portlib_for_logger = portlib;
+
+    apr_pool_t *pool;
+    apr_pool_create(&pool, 0);
+    char* value;
+
+    if (APR_SUCCESS == apr_env_get(&value, "LC_ALL", pool)) {
+        if (set_locale(value)) {
+            set_locale_success = 1;
+        }
+    } else if (APR_SUCCESS == apr_env_get(&value, "LC_MESSAGES", pool)) {
+        if (!set_locale_success) {
+            if (set_locale(value)) {
+                set_locale_success = 1;
+            }
+        }
+    } else if (APR_SUCCESS == apr_env_get(&value, "LANG", pool)) {
+        if (!set_locale_success) {
+            if (set_locale(value)) {
+                set_locale_success = 1;
+            }
+        }
+    }
+    apr_pool_destroy(pool);
+
 }
 
 void shutdown_log_system() {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h Tue Feb 13 05:15:34 2007
@@ -32,6 +32,7 @@
 void initialize_vm_cmd_state(Global_Env *p_env, JavaVMInitArgs* arguments);
 void set_log_levels_from_cmd(JavaVMInitArgs* vm_arguments);
 void parse_vm_arguments(Global_Env *p_env);
+void* get_portlib_for_logger(Global_Env *p_env);
 void parse_jit_arguments(JavaVMInitArgs* vm_arguments);
 void print_generic_help();
 void initialize_properties(Global_Env *p_env);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp Tue Feb 13 05:15:34 2007
@@ -858,7 +858,7 @@
             break;
         }
     default:
-        DIE("non-constant type is requested from constant pool : " << cp.get_tag(index));
+        LDIE(5, "non-constant type is requested from constant pool : {0}" << cp.get_tag(index));
     }
 
     return (VM_Data_Type)jt;
@@ -2134,7 +2134,7 @@
     Field_Handle referent =
         class_lookup_field_recursive(ch, "referent", "Ljava/lang/Object;");
     if (!referent) {
-        DIE("Class " << class_get_name(ch) << " have no 'Object referent' field");
+        LDIE(6, "Class {0} has no 'Object referent' field" << class_get_name(ch));
     }
     return referent->get_offset();
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Class_File_Loader.cpp Tue Feb 13 05:15:34 2007
@@ -3339,8 +3339,8 @@
     }
 
     if (m_enclosing_class_index && m_simple_name == NULL) {
-        WARN("Attention: EnclosingMethod attribute does not imply "
-            "InnerClasses presence for class " << m_name->bytes);
+        LWARN(3, "Attention: EnclosingMethod attribute does not imply "
+            "InnerClasses presence for class {0}" << m_name->bytes);
     }
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp Tue Feb 13 05:15:34 2007
@@ -276,7 +276,7 @@
         bootstrap_class_loader->LoadVerifyAndPrepareClass(this, s);
     if(clss == NULL) {
         // print error diagnostics and exit VM
-        WARN("Failed to load bootstrap class " << s->bytes);
+        LWARN(4, "Failed to load bootstrap class {0}" << s->bytes);
         LOGGER_EXIT(1);
     }
     return clss;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp Tue Feb 13 05:15:34 2007
@@ -965,7 +965,7 @@
         default:
             // FIXME Potentially this can be any RuntimeException or Error
             // The most probable case is OutOfMemoryError.
-            WARN("**Java exception occured during resolution under compilation");
+            LWARN(5, "**Java exception occured during resolution under compilation");
             exn_raise_object(VM_Global_State::loader_env->java_lang_OutOfMemoryError);
             //ASSERT(0, "Unexpected opcode: " << opcode);
             break;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/dll_gc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/dll_gc.cpp?view=diff&rev=506992&r1=506991&r2=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/dll_gc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/dll_gc.cpp Tue Feb 13 05:15:34 2007
@@ -131,7 +131,7 @@
 {
     apr_dso_handle_sym_t fn; 
     if (apr_dso_sym(&fn, handle, name) != APR_SUCCESS) {
-        WARN("Couldn't load GC dll " << dllName << ": missing entry point " << name);
+        LWARN(6, "Couldn't load GC dll {0}: missing entry point {1}" << dllName << name);
         return 0;
     }
     return fn;
@@ -163,7 +163,7 @@
     apr_dso_handle_t *handle;
     if (apr_dso_load(&handle, dllName, pool) != APR_SUCCESS)
     {
-        WARN("Failure to open GC dll " << dllName);
+        LWARN(7, "Failure to open GC dll {0}" << dllName);
         return;
     }
 
@@ -321,7 +321,7 @@
     } else {
         char buf[1024];
         apr_dso_error(handle, buf, 1024);
-        WARN("Loading error" << buf);
+        LWARN(8, "Loading error {0}" << buf);
         //apr_strerror(stat, buf, 1024);
         //printf("error %s, is %d, expected %d\n", buf, stat, APR_SUCCESS);
     }
@@ -409,7 +409,7 @@
 
 static void default_gc_add_compressed_root_set_entry(uint32 * UNREF ref)
 {
-    DIE("Fatal GC error: compressed references are not supported\n");
+    LDIE(7, "Fatal GC error: compressed references are not supported.");
 } //default_gc_add_compressed_root_set_entry
 
 
@@ -417,7 +417,7 @@
 static void default_gc_add_root_set_entry_managed_pointer(void ** UNREF slot,
                                                           Boolean UNREF is_pinned)
 {
-    DIE("Fatal GC error: managed pointers are not supported\n");
+    LDIE(8,"Fatal GC error: managed pointers are not supported.");
 } //default_gc_add_root_set_entry_managed_pointer
 
 
@@ -452,11 +452,11 @@
     // Do nothing.
 } // default_gc_test_safepoint
 
-#define WARN_ONCE(message) \
+#define WARN_ONCE(message_number, messagedef_and_params) \
     {                               \
         static bool warning = true; \
         if (warning) {              \
-            WARN(message);          \
+            LWARN(message_number, messagedef_and_params);\
             warning = false;        \
         }                           \
     }
@@ -464,12 +464,12 @@
 
 static void default_gc_pin_object(Managed_Object_Handle*)
 {
-    WARN_ONCE("The GC did not provide gc_pin_object()");
+    WARN_ONCE(9, "The GC did not provide {0}" << "gc_pin_object()");
 }
 
 static void default_gc_unpin_object(Managed_Object_Handle*)
 {
-    WARN_ONCE("The GC did not provide gc_unpin_object()");
+    WARN_ONCE(9, "The GC did not provide {0}" << "gc_unpin_object()");
 }
 
 /* $$$ GMJ
@@ -481,23 +481,23 @@
 
 static Managed_Object_Handle default_gc_get_next_live_object(void*)
 {
-    WARN_ONCE("The GC did not provide live object iterator");
+    WARN_ONCE(10, "The GC did not provide live object iterator");
     return NULL;
 }
 
 static void default_gc_iterate_heap()
 {
-    WARN_ONCE("The GC did not provide heap iteration");
+    WARN_ONCE(11, "The GC did not provide heap iteration");
 }
 
 static void default_gc_finalize_on_exit()
 {
-    WARN_ONCE("The GC did not provide finalization on exit");
+    WARN_ONCE(12, "The GC did not provide finalization on exit");
 }
 
 static int64 default_gc_max_memory()
 {
-    WARN_ONCE("The GC did not provide gc_max_memory()");
+    WARN_ONCE(9, "The GC did not provide {0}" << "gc_max_memory()");
     return 0x7fffFFFFl;
 }
 
@@ -508,7 +508,7 @@
 static void default_gc_add_weak_root_set_entry(
         Managed_Object_Handle* root, Boolean pinned, Boolean is_short)
 {
-    WARN_ONCE("The GC did not provide gc_add_weak_root_set_entry()");
+    WARN_ONCE(9, "The GC did not provide {0}" << "gc_add_weak_root_set_entry()");
     // default to strong reference semantics
     gc_add_root_set_entry(root, pinned);
 }

Added: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties?view=auto&rev=506992
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties (added)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties Tue Feb 13 05:15:34 2007
@@ -0,0 +1,153 @@
+# 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.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# ECHO messages
+# =============
+
+ECHO001=EM: Can't read configuration from '{0}'
+ECHO002=EM: Not a JIT shared lib: '{0}'
+ECHO003=EM: No 'chains' property found in configuration
+ECHO004=EM: No JIT library specified for JIT :'{0}'
+ECHO005=EM: JIT library loading error:'{0}'
+ECHO006=EM: Invalid filter :'{0}'
+ECHO007=EM: Unsupported profiler type
+ECHO008=EM: unsupported profiler mode
+ECHO009=EM: illegal '{0}' value
+ECHO010=EM: unsupported value profiler algotype
+ECHO011=EM: profile configuration failed: {0}
+ECHO012=EM: profile generation is not supported: {0}
+ECHO013=EM: profile not found: {0}
+ECHO014=EM: illegal use of profile: {0}
+ECHO015=EM: profile usage is not supported: {0}
+ECHO016=WARNING: final heap size is too large, reduced to {0} Mb
+ECHO017=WARNING: initial heap size reduced to {0} Mb
+ECHO018=WARNING: Incorrect {0} gc size specified, using default
+ECHO019=WARNING: max heap size is too large, reduced to {0} Mb
+ECHO020=WARNING: min heap size reduced to {0} Mb
+ECHO021=Usage: {0} [-options] class [args...]\n        (to execute a method main() of the class)\n    or {0} [-options] -jar jarfile [args...]\n        (to execute the jar file)\n\nwhere options include:\n    -classpath <class search path of directories and zip/jar files>\n    -cp        <class search path of directories and zip/jar files>\n                  A '{1}' separated list of directories, jar archives,\n                  and zip archives to search for class file\n    -D<name>=<value>\n                  set a system property\n    -showversion  print product version and continue\n    -version      print product version and exit\n    -verbose[:class|:gc|:jni]\n                  enable verbose output\n    -agentlib:<library name>[=<agent options>]\n                  load JVMTI agent library, library name is platform independent\n    -agentpath:<library name>[=<agent options]\n                  load JVMTI agent library, library name is platform dependent\n    -verify\n   
                do full bytecode verification\n    -noverify\n                  do no bytecode verification\n    -enableassertions[:<package>...|:<class>]\n    -ea[:<package>...|:<class>]\n                  enable assertions\n    -disableassertions[:<package>...|:<class>]\n    -da[:<package>...|:<class>]\n                  disable assertions\n    -esa | -enablesystemassertions\n                  enable system assertions\n    -dsa | -disablesystemassertions\n                  disable system assertions\n    -? -help      print this help message\n    -help properties\n                  help on system properties\n    -X            print help on non-standard options
+ECHO022=\    -Xbootclasspath:<PATH>\n              Set bootclasspath to the specified value\n    -Xbootclasspath/a:<PATH>\n              Append specified directories and files to bootclasspath\n    -Xbootclasspath/p:<PATH>\n              Prepend specified directories and files to bootclasspath\n    -Xjit <JIT options>\n              Specify JIT specific options\n    -Xms<size>\n              Set Java heap size\n    -Xmx<size>\n              Set maximum Java heap size\n    -Xdebug\n              Does nothing, this is a compatibility option\n    -Xnoagent\n              Does nothing, this is a compatibility option\n    -Xrun\n              Specify debugger agent library\n    -Xverbose[:<category>[:<file>]\n              Switch logging on [for specified category only\n              [and log that category to a file]]\n    -Xwarn[:<category>[:<file>]\n              Switch verbose logging off [for specified category only\n              [and log that category to a file]]\n    -Xver
 boseconf:<file>\n              Set up logging via log4cxx configuration file\n    -Xverboselog:<file>\n              Log verbose output to a file\n    -Xverify[:none|all]\n              Do full bytecode verification\n    -Xinvisible\n              Retain invisible annotations at runtime\n    -Xfileline\n              Add source information to logging messages\n    -Xthread\n              Add thread id to logging messages\n    -Xcategory\n              Add category name to logging messages\n    -Xtimestamp\n              Add timestamp to logging messages\n    -Xfunction\n              Add function signature to logging messages
+ECHO023=\    -Xlog[:<category>[:<file>]\n              Switch debug logging on [for specified category only\n              [and log that category to a file]]\n    -Xtrace[:<category>[:<file>]\n              Switch trace logging on [for specified category only\n              [and log that category to a file]]
+ECHO024=\    -Xstats:<mask>\n              Generates different statistics
+ECHO025=\    -Xint\n              Use interpreter to execute the program\n    -Xgc:<gc options>\n              Specify gc specific options\n    -Xem:<em options>\n              Specify em specific options\n    -Xdumpstubs\n              Writes stubs generated by LIL to disk\n    -Xparallel_jit\n              Launch compilation in parallel (default)\n    -Xno_parallel_jit\n              Do not launch compilation in parallel\n    -Xdumpfile:<file>\n              Specifies a file name for the dump\n    -XD<name>=<value>\n              set an internal system property
+ECHO026=Boolean-valued properties (set to one of {on,true,1,off,false,0} through -XD<name>=<value>):\n\n    vm.assert_dialog (default TRUE):\n            If false, prevent assertion failures from popping up a dialog box.
+ECHO027=\    vm.crash_handler (default FALSE):\n            Invoke gdb on crashes.
+ECHO028=\    vm.finalize (default TRUE):\n            Run finalizers.\n    vm.jit_may_inline_sync (default TRUE):\n            The JIT is allowed to inline part of the synchronization sequence.\n    vm.use_interpreter (default FALSE):\n            Use interpreter not jit.\n    vm.use_verifier (default TRUE):\n            Use verifier.\n    vm.jvmti.enabled (default FALSE):\n            Whether JVMTI mode is enabled.\n    vm.bootclasspath.appendclasspath (default FALSE):\n            Append classpath to the bootclasspath.\n\nOther properties:\n\n    vm.boot.library.path:\n            List of directories which contain additional dynamic libraries to load into VM.\n    vm.boot.class.path:\n            Virtual machine bootclasspath.\n    vm.dlls:\n            A '{0}'-delimited list of modular dlls (GC/etc.) to load at startup.\n    vm.em_dll:\n            A '{0}'-execution manager (EM) dll to load at startup.\n    vm.other_natives_dlls:\n            A '{0}'-delimited list of dll
 s contained native methods implementations to load at startup.\n    vm.components.<component>.classpath:\n            Part of a <component>'s classpath to append to the JDK booclasspath\n    vm.components.<component>.startupclass:\n            A <component> class to be initialized during startup
+ECHO029=Use {0} -help to get help on command line options
+ECHO030=Unknown option {0}
+ECHO031=Unknown argument {0} of -Xhelp: option
+ECHO032=java version "1.5.0" \npre-alpha : not complete or compatible\nsvn = r{0}, ({1}), {2}/{3}/{4}, {5} build\nhttp://incubator.apache.org/harmony
+ECHO033=Apache Harmony HEAD
+ECHO034=Negative or invalid heap size. Default value will be used!
+ECHO035={0}can't find starter class: java.lang.VMStart.
+ECHO036={0}can't find java.lang.VMStart.initialize() method.
+ECHO037={0}java.lang.VMStart.initialize() method completed with an exception.
+ECHO038={0}can't find java.lang.System class.
+ECHO039={0}can't find java.lang.System.execShutdownSequence() method.
+ECHO040={0}java.lang.System.execShutdownSequence() method completed with an exception.
+ECHO041=Verifier: {0}: out of memory
+ECHO042=Verifier: {0}: null pointer for free
+
+# DIE messages
+# ============
+
+LDIE001=no handling for pin overflow
+LDIE002=Can't create heap_L
+LDIE003=not enough reserved space for roots
+LDIE004=ldc instruction: unexpected type ({0}) of constant pool entry [{1}]
+LDIE005=non-constant type is requested from constant pool : {0}
+LDIE006=Class {0} has no 'Object referent' field
+LDIE007=Fatal GC error: compressed references are not supported.
+LDIE008=Fatal GC error: managed pointers are not supported.
+LDIE009=Cannot initialize properties pool
+LDIE010=Cannot initialize properties table mutex
+LDIE011=Cannot lock properties table
+LDIE012=Cannot unlock properties table
+LDIE013=Failed to find executable location
+LDIE014=Failed to determine executable parent directory
+LDIE015=Failed to determine java home directory
+LDIE016=Failed to get user name from the system. Error code {0}
+LDIE017=Failed to get user home from the system. Error code {0}
+LDIE018=class constructor has thrown an exception
+LDIE019=Fatal: an access to findLoadedClass method of java.lang.Class is not provided
+LDIE020=Error initializing java machine
+LDIE021=Can't find method {0} {1}
+LDIE022=Unknown agent loading option {0}
+LDIE023={0} try to release unknown interface
+LDIE024={0} cannot attach current thread
+LDIE025=SingleStepLocation: not implemented ret instruction
+LDIE026=Invalid enum field descriptor: {0}
+LDIE027=Cannot allocate pool storage: {0} bytes of virtual memory for code or data.\nError code = {1}
+LDIE028=Error: VTable pool overflow, resize is not allowed. Please, extand VTable pool size.\n
+LDIE029={0} apr_palloc failed
+LDIE030=This functionality is not currently supported
+LDIE031=INTERNAL ERROR: Unexpected type of the argument: {0}
+LDIE032=INTERNAL ERROR: Unexpected return type: {0}
+LDIE033=Return type {0} is not implemented
+LDIE034=This runtime support function is not implemented: f={0}, {1}
+LDIE035=Cannot find Java thread using signal context
+LDIE036=Unexpected exception code
+LDIE037=Verifier: vf_parse_description: incorrect structure of constant pool
+LDIE038=Verifier: vf_check_entry_refs: unknown check in switch
+LDIE039=Verifier: CompareTypes: unknown check type in switch
+LDIE040=Verifier: vf_is_valid: invalid check type
+LDIE041=Verifier: vf_set_error: unknown check type
+LDIE042={0} Verifier: abort!
+
+# WARN messages
+# =============
+
+WARN001=large pages allocation failed, use -verbose:gc.lp for more info
+WARN002=cp_check_class: illegal const pool class index {0}
+WARN003=Attention: EnclosingMethod attribute does not imply InnerClasses presence for class {0}
+WARN004=Failed to load bootstrap class {0}
+WARN005=**Java exception occured during resolution under compilation
+WARN006=Couldn't load GC dll {0}: missing entry point {1}
+WARN007=Failure to open GC dll {0}
+WARN008=Loading error {0}
+WARN009=The GC did not provide {0}
+WARN010=The GC did not provide live object iterator
+WARN011=The GC did not provide heap iteration
+WARN012=The GC did not provide finalization on exit
+WARN013=Cannot load EM component from {0}
+WARN014=Cannot instantiate EM
+WARN015=Cannot get EM_VM interface
+WARN016=Mandatory library cannot be loaded: {0}
+WARN017=VM component mismatch: the VM compresses references but the GC doesn't.
+WARN018=VM component mismatch: the VM compresses references but a JIT doesn't
+WARN019=VM component mismatch: the VM doesn't compress references but the GC does.
+WARN020=VM component mismatch: the VM doesn't compress references but a JIT does
+WARN021=Failed to initialize JNI NIO support: {0}
+WARN022=Failed to import JNI NIO functions.
+WARN023=Faild to initialize a "Component Manager".
+WARN024=Failed to initialize JVMTI.
+WARN025=Failed to resolve class {0}
+WARN026=Couldn't startup Winsock 2.0 dll
+WARN027=Failed to initialize system class loader.
+WARN028=Failure to open JIT dll {0} {1}
+WARN029=Couldn't load dll {0}: missing entry point {1}
+WARN030=GetEnv requested unsupported {0} environment!! Only JVMTI is supported by VM.
+WARN031=GetEnv called with unsupported interface version 0x{0}
+WARN032=Failed to open agent library {0} : {1}
+WARN033=No agent entry function found in library {0} : {1}
+WARN034=Agent library {0} initialization function returned {1}
+WARN035=Failed to open agent library {0}
+WARN036=Failed to unload agent library {0} : {1}
+WARN037=Zero interrupted method encountered
+WARN038=JIT {0} {1} returned error {2} for exception method {3} location {4}
+WARN039=JIT {0} {1} returned error {2} for catch method {3} location {4}
+WARN040=ATTENTION! Could not get cause exception from lazy machinery
+WARN041=Execution stack follows, consider using addr2line\n{0}
+WARN042=Fatal error
+WARN043=Fatal exception, terminating

Propchange: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message