harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r649391 [3/4] - in /harmony/enhanced/drlvm/trunk: ./ make/ make/extra/ make/vm/ vm/em/src/ vm/gc_gen/src/common/ vm/gc_gen/src/gen/ vm/gc_gen/src/mark_compact/ vm/gc_gen/src/semi_space/ vm/interpreter/src/ vm/port/include/ vm/port/include/t...
Date Fri, 18 Apr 2008 07:26:38 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp Fri Apr 18 00:26:23 2008
@@ -15,15 +15,10 @@
  *  limitations under the License.
  */
 /** 
- * @author Intel, Alexey V. Varlamov, Gregory Shimansky
- * @version $Revision: 1.1.2.4.4.7 $
+ * @author Alexey V. Varlamov, Gregory Shimansky
  */  
-
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-#include <apr_strings.h>
-#include <apr_env.h>
+#define LOG_DOMAIN "arguments"
+#include "cxxlog.h"
 
 #include "open/gc.h" 
 #include "open/vm_util.h"
@@ -45,9 +40,6 @@
 #include "dll_jit_intf.h"
 #include "dll_gc.h"
 
-#define LOG_DOMAIN "vm.core"
-#include "cxxlog.h"
-
 #define EXECUTABLE_NAME "java"
 #define USE_JAVA_HELP LECHO(29, "Use {0} -help to get help on command line options" << EXECUTABLE_NAME)
 #define LECHO_VERSION LECHO(32, VERSION << VERSION_SVN_TAG << __DATE__ << VERSION_OS \
@@ -115,7 +107,7 @@
     } else if (':' != arg[0]) {
         LECHO(30, "Unknown option {0}" << option);
         USE_JAVA_HELP;
-        LOGGER_EXIT(1);
+        log_exit(1);
     } else {
         unsigned len = (unsigned)strlen(++arg);
         if (len >= 3 && strncmp("...", arg + len - 3, 3) == 0) {
@@ -126,36 +118,93 @@
     }
 }
 
-void parse_vm_arguments1(JavaVMInitArgs *vm_args, size_t *p_string_pool_size, jboolean *p_is_class_data_shared, void **portlib)
+void parse_vm_arguments1(JavaVMInitArgs *vm_args, size_t *p_string_pool_size,
+                         jboolean *p_is_class_data_shared, apr_pool_t* pool)
 {
+    LogFormat logger_header = LOG_EMPTY;
     *p_string_pool_size = DEFAULT_STRING_TABLE_SIZE;
+
+    // initialize logging system as soon as possible
+    log_init(pool);
+
     for (int i = 0; i < vm_args->nOptions; i++) {
         const char* option = vm_args->options[i].optionString;
         if (begins_with(option, STRING_POOL_SIZE_OPTION)) {
             const char* arg = option + strlen(STRING_POOL_SIZE_OPTION);
             *p_string_pool_size = parse_size(arg);
             if (0 == *p_string_pool_size) {
-                LECHO(34, "Negative or invalid string pool size. A default value is used, " << DEFAULT_STRING_TABLE_SIZE << " bytes.");
+                LECHO(34, "Negative or invalid string pool size. A default value is used, "
+                    << DEFAULT_STRING_TABLE_SIZE << " bytes.");
                 *p_string_pool_size = DEFAULT_STRING_TABLE_SIZE;
             }
-            TRACE2("init", "string_pool_size = " << *p_string_pool_size);
+            TRACE("string_pool_size = " << *p_string_pool_size);
         } else if (!strcmp(option, CLASS_DATA_SHARING_OFF_OPTION)) {
             *p_is_class_data_shared = JNI_FALSE;
         } else if (!strcmp(option, CLASS_DATA_SHARING_ON_OPTION)) {
             *p_is_class_data_shared = JNI_TRUE;
         } else if (!strcmp(option, PORTLIB_OPTION)) {
-            *portlib = vm_args->options[i].extraInfo;
+            log_set_portlib((HyPortLibrary*) vm_args->options[i].extraInfo);
+        } else if (!strcmp(option, "vfprintf")) {
+            log_set_vfprintf(vm_args->options[i].extraInfo);
+        } else if (!strcmp(option, "exit")) {
+            log_set_exit(vm_args->options[i].extraInfo);
+        } else if (!strcmp(option, "abort")) {
+            log_set_abort(vm_args->options[i].extraInfo);
+        } else if (!strcmp(option, "-Xfileline")) {
+            logger_header |= LOG_FILELINE;
+        } else if (!strcmp(option, "-Xthread")) {
+            logger_header |= LOG_THREAD_ID;
+        } else if (!strcmp(option, "-Xcategory")) {
+            logger_header |= LOG_CATEGORY;
+        } else if (!strcmp(option, "-Xtimestamp")) {
+            logger_header |= LOG_TIMESTAMP;
+        } else if (!strcmp(option, "-Xfunction")) {
+            logger_header |= LOG_FUNCTION;
+        } else if (!strcmp(option, "-Xwarn")) {
+            logger_header |= LOG_WARN;
+        /*
+         * -verbose[:class|:gc|:jni] set specification log filters.
+         */
+        } else if (!strcmp(option, "-verbose")) {
+            log_enable_info_category(LOG_CLASS_INFO, 0);
+            log_enable_info_category(LOG_GC_INFO, 0);
+            log_enable_info_category(LOG_JNI_INFO, 0);
+        }  else if (!strcmp(option, "-verbose:class")) {
+            log_enable_info_category(LOG_CLASS_INFO, 0);
+        }  else if (!strcmp(option, "-verbose:gc")) {
+            log_enable_info_category(LOG_GC_INFO, 0);
+        }  else if (!strcmp(option, "-verbose:jni")) {
+            log_enable_info_category(LOG_JNI_INFO, 0);
+        } else if (begins_with(option, "-Xverboselog:")) {
+            const char* file_name = option + strlen("-Xverboselog:");
+            FILE *f = fopen(file_name, "w");
+            if (NULL != f) {
+                log_set_out(f);
+            } else {
+                WARN(("Cannot open: %s", file_name));
+            }
+        } else if (begins_with(option, "-Xverbose:")) {
+            log_enable_info_category(option + strlen("-Xverbose:"), 1);
+        } else if (begins_with(option, "-Xnoverbose:")) {
+            log_disable_info_category(option + strlen("-Xnoverbose:"), 1);
+#ifdef _DEBUG
+        } else if (begins_with(option, "-Xtrace:")) {
+            log_enable_trace_category(option + strlen("-Xtrace:"), 1);
+        } else if (begins_with(option, "-Xnotrace:")) {
+            log_disable_trace_category(option + strlen("-Xnotrace:"), 1);
+#endif //_DEBUG
         }
     }
+    log_set_header_format(logger_header);
 } // parse_vm_arguments1
 
 void parse_vm_arguments2(Global_Env *p_env)
 {
     bool version_printed = false;
 #ifdef _DEBUG
-    TRACE2("arguments", "p_env->vm_arguments.nOptions  = " << p_env->vm_arguments.nOptions);
+    TRACE("p_env->vm_arguments.nOptions  = " << p_env->vm_arguments.nOptions);
     for (int _i = 0; _i < p_env->vm_arguments.nOptions; _i++)
-        TRACE2("arguments", "p_env->vm_arguments.options[ " << _i << "] = " << p_env->vm_arguments.options[_i].optionString);
+        TRACE("p_env->vm_arguments.options[ " << _i << "] = " << p_env->vm_arguments.options[_i].optionString);
 #endif //_DEBUG
 
     apr_pool_t *pool;
@@ -238,7 +287,7 @@
         } else if (strcmp(option, "-version") == 0) {
             // Print the version number and exit
             LECHO_VERSION;
-            LOGGER_EXIT(0);
+            log_exit(0);
         } else if (strcmp(option, "-showversion") == 0) {
             if (!version_printed) {
                 // Print the version number and continue
@@ -248,13 +297,13 @@
         } else if (strcmp(option, "-fullversion") == 0) {
             // Print the version number and exit
             LECHO_VM_VERSION;
-            LOGGER_EXIT(0);
+            log_exit(0);
 
         } else if (begins_with(option, "-Xgc:")) {
             // make prop_key to be "gc.<something>"
             char* prop_key = strdup(option + strlen("-X"));
             prop_key[2] = '.';
-            TRACE2("init", prop_key << " = 1");
+            TRACE(prop_key << " = 1");
             p_env->VmProperties()->set(prop_key, "1");
             free(prop_key);
 
@@ -268,7 +317,7 @@
         } else if (begins_with(option, "-Xms") || begins_with(option, "-ms")) {
             // cut -Xms || -ms
             const char* arg = option + (begins_with(option, "-ms") ? 3 : 4);
-            TRACE2("init", "gc.ms = " << arg);
+            TRACE("gc.ms = " << arg);
             if (atoi(arg) <= 0) {
                 LECHO(34, "Negative or invalid heap size. Default value will be used!");
             }
@@ -277,14 +326,14 @@
         } else if (begins_with(option, "-Xmx") || begins_with(option, "-mx")) {
             // cut -Xmx
             const char* arg = option + (begins_with(option, "-mx") ? 3 : 4);
-            TRACE2("init", "gc.mx = " << arg);
+            TRACE("gc.mx = " << arg);
             if (atoi(arg) <= 0) {
                 LECHO(34, "Negative or invalid heap size. Default value will be used!");
             }
             p_env->VmProperties()->set("gc.mx", arg);
         } else if (begins_with(option, "-Xss")) {
             const char* arg = option + 4;
-            TRACE2("init", "thread.stacksize = " << arg);
+            TRACE("thread.stacksize = " << arg);
             if (atoi(arg) <= 0) {
                 LECHO(34, "Negative or invalid stack size. Default value will be used!");
             }
@@ -380,11 +429,11 @@
               || strcmp(option, "-h") == 0
               || strcmp(option, "-?") == 0) {
             print_generic_help();
-            LOGGER_EXIT(0);
+            log_exit(0);
         }
         else if (strcmp(option,"-X") == 0) {
                 print_help_on_nonstandard_options();
-                LOGGER_EXIT(0);
+                log_exit(0);
         }
         else if (begins_with(option, "-enableassertions")) {
             add_assert_rec(p_env, option, "-enableassertions", true);
@@ -411,7 +460,7 @@
         else {
             LECHO(30, "Unknown option {0}" << option);
             USE_JAVA_HELP;
-            LOGGER_EXIT(1);
+            log_exit(1);
        }
     } // for
 
@@ -434,125 +483,6 @@
         }
     }
 } //parse_jit_arguments
-
-// converts exposed verbosity category names 
-// to the internally used logger category names.
-static char* convert_logging_category(char* category) {
-    if (0 == strcmp("gc*", category) || 0 == strcmp("gc.*", category)) {
-        // handle the non-standard logging category specification
-        return "gc";
-    } else {
-        return category;
-    }
-} //convert_logging_category()
-
-static void set_threshold_list(char* list, LoggingLevel level, const char* file, bool convert) {
-    char *next;
-    while (list) {
-        if ( (next = strchr(list, ',')) ) {
-            *next = '\0';
-        }
-
-        char* category = (convert) ? convert_logging_category(list) : list;
-        if (0 == strcmp("*", category)) { //alias to root category
-            category = "root";
-        }
-        set_threshold(category, level);
-        if (file) {
-            set_out(category, file);
-        }
-
-        if (next) {
-            *next = ',';
-            list = next + 1;
-        } else {
-            break;
-        }
-    }
-}
-
-static void parse_logger_arg(char* arg, const char* cmd, LoggingLevel level) {
-    char* next_sym = arg + strlen(cmd);
-    if (*next_sym == '\0') {
-        set_threshold("root", level);
-    } else if (*next_sym == ':') { // -cmd:category
-        next_sym++;
-        char *out = strchr(next_sym, ':');
-        if (out) { // -cmd:category:file
-            *out = '\0';
-        }
-        set_threshold_list(next_sym, level, out ? out + 1 : NULL, false);
-        if (out){
-            *out = ':';
-        }
-    } else {
-        LECHO(30, "Unknown option {0}" << arg);
-        USE_JAVA_HELP;
-        LOGGER_EXIT(1); 
-    }
-}
-
-void set_log_levels_from_cmd(JavaVMInitArgs* vm_arguments)
-{
-    HeaderFormat logger_header = HEADER_EMPTY;
-    int arg_num = 0;
-    for (arg_num = 0; arg_num < vm_arguments->nOptions; arg_num++) {
-        char *option = vm_arguments->options[arg_num].optionString;
-
-        if (begins_with(option, "-Xfileline")) {
-            logger_header |= HEADER_FILELINE;
-        } else if (begins_with(option, "-Xthread")) {
-            logger_header |= HEADER_THREAD_ID;
-        } else if (begins_with(option, "-Xcategory")) {
-            logger_header |= HEADER_CATEGORY;
-        } else if (begins_with(option, "-Xtimestamp")) {
-            logger_header |= HEADER_TIMESTAMP;
-        } else if (begins_with(option, "-Xfunction")) {
-            logger_header |= HEADER_FUNCTION;
-        }
-    } 
-    // set logging filter if one is set
-    if (logger_header != HEADER_EMPTY) {
-        set_header_format("root", logger_header);
-    }
-
-    for (arg_num = 0; arg_num < vm_arguments->nOptions; arg_num++) {
-        char *option = vm_arguments->options[arg_num].optionString;
-
-        if (begins_with(option, "-verbose")) {
-            /*
-             * -verbose[:class|:gc|:jni] set specification log filters.
-             */
-            char* next_sym = option + 8;
-            if (*next_sym == '\0') {
-                set_threshold(util::CLASS_LOGGER, INFO);
-                set_threshold(util::GC_LOGGER, INFO);
-                set_threshold(util::JNI_LOGGER, INFO);
-            } else if (*next_sym == ':') { // -verbose:
-                next_sym++;
-                set_threshold_list(next_sym, INFO, NULL, true); // true = convert standard categories to internal
-            } else {
-                LECHO(30, "Unknown option {0}" << option);
-                USE_JAVA_HELP;
-                LOGGER_EXIT(1);
-            }
-        } else if (begins_with(option, "-Xverboseconf:")) {
-            set_logging_level_from_file(option + strlen("-Xverboseconf:"));
-        } else if (begins_with(option, "-Xverboselog:")) {
-            set_out("root", option + strlen("-Xverboselog:"));
-        } else if (begins_with(option, "-Xverbose")) {
-            parse_logger_arg(option, "-Xverbose", INFO);
-        } else if (begins_with(option, "-Xwarn")) {
-            parse_logger_arg(option, "-Xwarn", WARN);
-#ifdef _DEBUG
-        } else if (begins_with(option, "-Xlog")) {
-            parse_logger_arg(option, "-Xlog", LOG);
-        } else if (begins_with(option, "-Xtrace")) {
-            parse_logger_arg(option, "-Xtrace", TRACE);
-#endif //_DEBUG
-        }
-    } // for (arg_num)
-} //set_log_levels_from_cmd
 
 void initialize_vm_cmd_state(Global_Env *p_env, JavaVMInitArgs* arguments)
 {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp Fri Apr 18 00:26:23 2008
@@ -14,10 +14,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Intel, Alexei Fedotov
- * @version $Revision: 1.1.2.4.4.3 $
- */  
+#define LOG_DOMAIN "vm.core.init"
+#include "cxxlog.h"
 
 #include <apr_env.h>
 #include <apr_general.h>
@@ -59,9 +57,6 @@
 // 20040427 Used to turn on heap checking on every allocation
 #include <crtdbg.h>
 #endif
-
-#define LOG_DOMAIN "vm.core.init"
-#include "cxxlog.h"
 
 VTable * cached_object_array_vtable_ptr;
 bool parallel_jit = true;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp Fri Apr 18 00:26:23 2008
@@ -355,7 +355,7 @@
         } 
         else if (strncmp(option, "-XD", 3) == 0)
         {
-            WARN("Deprecated syntax to set internal property, use -XX:key=value instead: " << option);
+            WARN(("Deprecated syntax to set internal property, use -XX:key=value instead: %s", option));
             TRACE("setting internal property " << option + 3);
             src = strdup(option + 3);
             tok = strchr(src, '=');

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp Fri Apr 18 00:26:23 2008
@@ -19,6 +19,9 @@
  * @version $Revision: 1.1 $
  */
 
+#define LOG_DOMAIN "vm.core.shutdown"
+#include "cxxlog.h"
+
 #include <stdlib.h>
 #include <apr_thread_mutex.h>
 
@@ -38,9 +41,6 @@
 #include "interpreter.h"
 #include "finalize.h"
 #include "signals.h"
-
-#define LOG_DOMAIN "vm.core.shutdown"
-#include "cxxlog.h"
 
 #define PROCESS_EXCEPTION(messageId, message) \
 { \

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp Fri Apr 18 00:26:23 2008
@@ -167,7 +167,7 @@
 {
     int max_jit_num = sizeof(jit_compilers) / sizeof(JIT *) - 2;
     if(jit_compilers[max_jit_num]) {
-        ASSERT(0, "Can't add new JIT");
+        DIE(("Can't add new JIT"));
         return;
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Fri Apr 18 00:26:23 2008
@@ -1899,7 +1899,7 @@
             }
             break;
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
             break;
         }
         iter = advance_arg_iterator(iter);
@@ -2002,20 +2002,6 @@
     assert(cs2 != NULL);
     return cs2;
 }  // gen_lil_throw_ClassCastException
-
-
-// appends code that throws a ClassCastException to a LIL stub
-static LilCodeStub *gen_lil_throw_ClassCastException_for_inlining(LilCodeStub *cs) {
-    ABORT("The function is deprecated, should be never called");
-    // if instanceof returns false, throw an exception
-    LilCodeStub *cs2 = lil_parse_onto_end
-        (cs,
-         "out lil::void;"
-         "call.noret %0i;",
-         NULL);
-    assert(cs2 != NULL);
-    return cs2;
-}  // gen_lil_throw_ClassCastException_for_inlining
 
 
 // emits the slow path of the instanceof / checkcast check

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/primitives_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/primitives_support.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/primitives_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/primitives_support.cpp Fri Apr 18 00:26:23 2008
@@ -264,7 +264,7 @@
         break;
     }
     default:
-        ABORT("Unknown type descriptor");
+        DIE(("Unknown type descriptor"));
     }
 
     return retobj;
@@ -317,7 +317,7 @@
         value.d = GetDoubleField (env, wobj, value_id);
         break;
     default:
-        ABORT("Unknown type descriptor");
+        DIE(("Unknown type descriptor"));
     }
 
     return value;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/rt_helper_info.cpp Fri Apr 18 00:26:23 2008
@@ -223,7 +223,7 @@
         assert(it->second);
         return it->second->name;
     } else {
-        ASSERT(VM_RT_UNKNOWN == id, "Unexpected helper id " << id);
+        ASSERT(VM_RT_UNKNOWN == id, ("Unexpected helper id %d", id));
         return "unknown";
     }
 }
@@ -242,38 +242,26 @@
 HELPER_INTERRUPTIBILITY_KIND vm_helper_get_interruptibility_kind(VM_RT_SUPPORT id)
 {
     HelperInfoMap::const_iterator it = helper_map->find(id);
-    if (helper_map->end() != it) {
-        assert(it->second);
-        return it->second->i_kind;
-    } else {
-        ASSERT(false, "Unexpected helper id " << id);
-        return INTERRUPTIBLE_SOMETIMES;
-    }
+    ASSERT(helper_map->end() != it, ("Unexpected helper id %d", id));
+    assert(it->second);
+    return it->second->i_kind;
 }
 
 VMEXPORT 
 HELPER_CALLING_CONVENTION vm_helper_get_calling_convention(VM_RT_SUPPORT id) 
 {
     HelperInfoMap::const_iterator it = helper_map->find(id);
-    if (helper_map->end() != it) {
-        assert(it->second);
-        return it->second->cc_kind;
-    } else {
-        ASSERT(false, "Unexpected helper id " << id);
-        return CALLING_CONVENTION_STDCALL;
-    }
+    ASSERT(helper_map->end() != it, ("Unexpected helper id %d", id));
+    assert(it->second);
+    return it->second->cc_kind;
 }
 
 U_32 vm_helper_get_numargs(VM_RT_SUPPORT id)
 {
     HelperInfoMap::const_iterator it = helper_map->find(id);
-    if (helper_map->end() != it) {
-        assert(it->second);
-        return it->second->number_of_args;
-    } else {
-        ASSERT(false, "Unexpected helper id " << id);
-        return 0;
-    }
+    ASSERT(helper_map->end() != it, ("Unexpected helper id %d", id));
+    assert(it->second);
+    return it->second->number_of_args;
 }
 
 static Class* load_magic_helper_class(Global_Env * vm_env, const char * class_name) {
@@ -285,7 +273,7 @@
     class_initialize(magic_helper_class);
 
     if (exn_raised()){
-        DIE("Exception raised while initializing helper class "  << magic_helper_class->get_name()->bytes);
+        DIE(("Exception raised while initializing helper class %s", magic_helper_class->get_name()->bytes));
     }
     tmn_suspend_enable();
 }
@@ -333,10 +321,7 @@
         assert (method_descr);
 
         Method_Handle method_handle = resolve_magic_helper(vm_env, class_name, method_name, method_descr);
-        if (!method_handle) {
-            ASSERT(method_handle, "Method " << class_name <<"."<< method_name << method_descr<<" not found.");
-            return JNI_ERR;
-        }
+        ASSERT(method_handle, ("Method %s.%s%s not found.", class_name, method_name, method_descr));
         jit_rt_function_entries[i].magic_mh = method_handle;
     }
     return JNI_OK;
@@ -350,30 +335,18 @@
     assert (method_name);
     
     HelperInfoMap::const_iterator it = helper_map->find(id);
-    if (helper_map->end() != it) {
-        assert(it->second);
-        if (it->second->magic_method_name) {
-            ASSERT(it->second->magic_method_name == NULL, "Helper " << id << " is registered already.");
-            return JNI_ERR;
-        } else {
-            it->second->magic_class_name = class_name;
-            it->second->magic_method_name = method_name;
-            return JNI_OK;
-        }
-    } else {
-        ASSERT(VM_RT_UNKNOWN == id, "Unexpected helper id " << id);
-        return JNI_ERR;
-    }
+    ASSERT(helper_map->end() != it, ("Unexpected helper id %d", id));
+    assert(it->second);
+    ASSERT(it->second->magic_method_name == NULL, ("Helper %d is registered already.", id));
+    it->second->magic_class_name = class_name;
+    it->second->magic_method_name = method_name;
+    return JNI_OK;
 }
 
 VMEXPORT
 Method_Handle vm_helper_get_magic_helper(VM_RT_SUPPORT id) {
     HelperInfoMap::const_iterator it = helper_map->find(id);
-    if (helper_map->end() != it) {
-        assert(it->second);
-        return it->second->magic_mh;
-    } else {
-        ASSERT(false, "Unexpected helper id " << id);
-        return NULL;
-    }
+    ASSERT(helper_map->end() != it, ("Unexpected helper id %d", id));
+    assert(it->second);
+    return it->second->magic_mh;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp Fri Apr 18 00:26:23 2008
@@ -413,7 +413,7 @@
                apr_pool_t* pool) {
     STD_PCALLOC_STRUCT(pool, JavaVM_Internal, instance);
 
-    instance->pool1 = pool; // TODO rename pool1 bak to pool
+    instance->pool = pool;
     *p_instance = (OpenInstanceHandle) instance;
     return JNI_OK;
 }
@@ -499,18 +499,6 @@
     }
     JavaVMInitArgs *vm_args = (JavaVMInitArgs *)args;
  
-    // get a string pool size and if the shared data pool should be read from cache
-    size_t string_pool_size;
-    jboolean is_class_data_shared;
-    void *portlib = NULL;
-    parse_vm_arguments1(vm_args, &string_pool_size, &is_class_data_shared, &portlib);
-
-    // initialize logging system as soon as possible
-    // log system supports the only instance
-    // TODO make the logging initialization thread and multi-instance safe
-    init_log_system(portlib);
-    set_log_levels_from_cmd(vm_args);
-
     OpenComponentManagerHandle cm;
     int status  = CmAcquire(&cm);
     if (APR_SUCCESS != status) {
@@ -536,8 +524,13 @@
         goto instance_number_error;
     }
 
+    // get a string pool size and if the shared data pool should be read from cache
+    size_t string_pool_size;
+    jboolean is_class_data_shared;
+    parse_vm_arguments1(vm_args, &string_pool_size, &is_class_data_shared, java_vm->pool);
+
     // Create Global_Env.
-    vm_env = new(java_vm->pool1) Global_Env(java_vm->pool1, string_pool_size);
+    vm_env = new(java_vm->pool) Global_Env(java_vm->pool, string_pool_size);
     if (vm_env == NULL) {
         status = JNI_ENOMEM;
         goto error;
@@ -609,14 +602,13 @@
 
     /* in case of error, frees resources in reverse order, ignores other errors */
 error:
+    log_shutdown();
 instance_number_error:
     cm->FreeInstance((OpenInstanceHandle) java_vm);
 instance_allocation_error:
     CmReleaseComponent(OPEN_VM);
 component_allocation_error:
     CmRelease();
-    // TODO make the logging initialization thread and multi-instance safe
-    shutdown_log_system();
     return status;
 }
 
@@ -626,13 +618,13 @@
 {
     // If we ever get here, we are in an implemented JNI function
     // By looking at the call stack and assembly it should be clear which one
-    ABORT("Not implemented");
+    DIE(("Not implemented"));
 }
 
 
 jint JNICALL GetVersion(JNIEnv * UNREF env)
 {
-    TRACE2("jni", "GetVersion called");
+    TRACE("GetVersion called");
     return JNI_VERSION_1_4;
 } //GetVersion
 
@@ -642,7 +634,7 @@
                            const jbyte *buf,
                            jsize len)
 {
-    TRACE2("jni", "DefineClass called, name = " << (NULL != name ? name : "NULL"));
+    TRACE("DefineClass called, name = " << (NULL != name ? name : "NULL"));
     assert(hythread_is_suspend_enabled());
     Global_Env* env = VM_Global_State::loader_env;
     ClassLoader* cl;
@@ -670,7 +662,7 @@
     bool ld_result;
     if(clss != NULL)
     {
-        TRACE2("jni", "Class defined successfully, name = " << res_name->bytes);
+        TRACE("Class defined successfully, name = " << res_name->bytes);
         ld_result = clss->verify(env) && clss->prepare(env);
     }
 
@@ -687,7 +679,7 @@
  jclass JNICALL FindClass(JNIEnv * jni_env,
                           const char * name)
 {
-    TRACE2("jni", "FindClass called, name = " << name);
+    TRACE("FindClass called, name = " << name);
 
     Global_Env * vm_env = jni_get_vm_env(jni_env);
 
@@ -706,7 +698,7 @@
 
 jclass JNICALL GetSuperclass(JNIEnv * jni_env, jclass clazz)
 {
-    TRACE2("jni", "GetSuperclass called");
+    TRACE("GetSuperclass called");
     assert(hythread_is_suspend_enabled());
     
     if (exn_raised()) return NULL;
@@ -733,7 +725,7 @@
                                   jclass clazz1,
                                   jclass clazz2)
 {
-    TRACE2("jni", "IsAssignableFrom called");
+    TRACE("IsAssignableFrom called");
     assert(hythread_is_suspend_enabled());
     Class* clss1 = jclass_to_struct_Class(clazz1);
     Class* clss2 = jclass_to_struct_Class(clazz2);
@@ -748,7 +740,7 @@
 
 jint JNICALL Throw(JNIEnv * UNREF jni_env, jthrowable obj)
 {
-    TRACE2("jni", "Throw called");
+    TRACE("Throw called");
     assert(hythread_is_suspend_enabled());
 
     if(obj) {
@@ -761,7 +753,7 @@
 
 jint JNICALL ThrowNew(JNIEnv * jni_env, jclass clazz, const char *message)
 {
-    TRACE2("jni", "ThrowNew called, message = " << (message ? message : "<no message>"));
+    TRACE("ThrowNew called, message = " << (message ? message : "<no message>"));
     assert(hythread_is_suspend_enabled());
     if (!clazz) return -1;
 
@@ -809,7 +801,7 @@
 {
     jthrowable result;
 
-    TRACE2("jni", "ExceptionOccurred called");
+    TRACE("ExceptionOccurred called");
     assert(hythread_is_suspend_enabled());
         
     result = exn_get();
@@ -817,9 +809,9 @@
 #ifdef _DEBUG
     hythread_suspend_disable();
     if (result) {
-        TRACE2("jni", "Exception occured, class = " << exn_get_name());
+        TRACE("Exception occured, class = " << exn_get_name());
     } else {
-        TRACE2("jni", "Exception occured, no exception");        
+        TRACE("Exception occured, no exception");        
     }
     hythread_suspend_enable();
 #endif
@@ -829,7 +821,7 @@
 
 void JNICALL ExceptionDescribe(JNIEnv * jni_env)
 {
-    TRACE2("jni", "ExceptionDescribe called");
+    TRACE("ExceptionDescribe called");
     assert(hythread_is_suspend_enabled());
     
     // we should not report vm shutdown exception to the user
@@ -843,7 +835,7 @@
 
 void JNICALL ExceptionClear(JNIEnv * jni_env)
 {
-    TRACE2("jni", "ExceptionClear called");
+    TRACE("ExceptionClear called");
     assert(hythread_is_suspend_enabled());
     
     tmn_suspend_disable();
@@ -857,11 +849,11 @@
 #ifdef _DEBUG
     if (!exn_raised())
     {
-        TRACE2("jni", "Exception clear, no exception");
+        TRACE("Exception clear, no exception");
     }
     else
     {
-        TRACE2("jni", "Exception clear, class = " << exn_get_name());
+        TRACE("Exception clear, class = " << exn_get_name());
     }
 #endif
     exn_clear();
@@ -870,7 +862,7 @@
 
 void JNICALL FatalError(JNIEnv * UNREF jni_env, const char *msg)
 {
-    TRACE2("jni", "FatalError called");
+    TRACE("FatalError called");
     assert(hythread_is_suspend_enabled());
     
     fprintf(stdout, "\nFATAL ERROR occurred in native method: %s\n", msg);
@@ -882,7 +874,7 @@
 
 jobject JNICALL NewGlobalRef(JNIEnv * jni_env, jobject obj)
 {
-    TRACE2("jni", "NewGlobalRef called");
+    TRACE("NewGlobalRef called");
     assert(hythread_is_suspend_enabled());
     
     if (exn_raised() || !obj) return NULL;
@@ -903,7 +895,7 @@
     tmn_suspend_disable();       //---------------------------------v
 
     new_handle->object = old_handle->object;
-    TRACE2("jni", "NewGlobalRef class = " << old_handle->object->vt()->clss);
+    TRACE("NewGlobalRef class = " << old_handle->object->vt()->clss);
 
     tmn_suspend_enable();        //---------------------------------^
 
@@ -912,7 +904,7 @@
 
 void JNICALL DeleteGlobalRef(JNIEnv * UNREF jni_env, jobject globalRef)
 {
-    TRACE2("jni", "DeleteGlobalRef called");
+    TRACE("DeleteGlobalRef called");
     assert(hythread_is_suspend_enabled());
     
     if (globalRef == NULL) return;
@@ -920,7 +912,7 @@
 #ifdef _DEBUG
     tmn_suspend_disable();
     ObjectHandle h = (ObjectHandle)globalRef;
-    TRACE2("jni", "DeleteGlobalRef class = " << h->object->vt()->clss);
+    TRACE("DeleteGlobalRef class = " << h->object->vt()->clss);
     tmn_suspend_enable();
 #endif
 
@@ -929,7 +921,7 @@
 
 jobject JNICALL NewLocalRef(JNIEnv * jni_env, jobject ref)
 {
-    TRACE2("jni", "NewLocalRef called");
+    TRACE("NewLocalRef called");
     assert(hythread_is_suspend_enabled());
     
     Global_Env * vm_env = jni_get_vm_env(jni_env);
@@ -943,7 +935,7 @@
         tmn_suspend_enable();
         // Gregory -
         // The following TRACE2 requires suspend to be enabled!
-        TRACE2("jni", "NewLocalRef class = " << jobject_to_struct_Class(new_ref));
+        TRACE("NewLocalRef class = " << jobject_to_struct_Class(new_ref));
     }
     else
     {
@@ -954,7 +946,7 @@
 
 void JNICALL DeleteLocalRef(JNIEnv * UNREF jni_env, jobject localRef)
 {
-    TRACE2("jni", "DeleteLocalRef called");
+    TRACE("DeleteLocalRef called");
     assert(hythread_is_suspend_enabled());
 
     if (localRef == NULL) return;
@@ -962,7 +954,7 @@
 #ifdef _DEBUG
     tmn_suspend_disable();
     ObjectHandle h = (ObjectHandle)localRef;
-    TRACE2("jni", "DeleteLocalRef class = " << h->object->vt()->clss);
+    TRACE("DeleteLocalRef class = " << h->object->vt()->clss);
     tmn_suspend_enable();
 #endif
 
@@ -1003,7 +995,7 @@
 
 VMEXPORT jint JNICALL PushLocalFrame(JNIEnv * UNREF jni_env, jint UNREF cap)
 {
-    TRACE2("jni", "PushLocalFrame called");
+    TRACE("PushLocalFrame called");
     assert(hythread_is_suspend_enabled());
     // 20020904: Not good for performance, but we can ignore local frames for now
     return 0;
@@ -1011,7 +1003,7 @@
 
 VMEXPORT jobject JNICALL PopLocalFrame(JNIEnv * UNREF jni_env, jobject res)
 {
-    TRACE2("jni", "PopLocalFrame called");
+    TRACE("PopLocalFrame called");
     assert(hythread_is_suspend_enabled());
     // 20020904: Not good for performance, but we can ignore local frames for now
     return res;
@@ -1020,7 +1012,7 @@
 
 jint JNICALL EnsureLocalCapacity(JNIEnv * UNREF jni_env, jint UNREF cap)
 {
-    TRACE2("jni", "EnsureLocalCapacity called");
+    TRACE("EnsureLocalCapacity called");
     assert(hythread_is_suspend_enabled());
     return 0;
 }
@@ -1029,7 +1021,7 @@
 jobject JNICALL AllocObject(JNIEnv * jni_env,
                             jclass clazz)
 {
-    TRACE2("jni", "AllocObject called");
+    TRACE("AllocObject called");
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised() || clazz == NULL) return NULL;
@@ -1065,7 +1057,7 @@
                           jmethodID methodID,
                           ...)
 {
-    TRACE2("jni", "NewObject called");
+    TRACE("NewObject called");
     assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
@@ -1077,7 +1069,7 @@
                            jmethodID methodID,
                            va_list args)
 {
-    TRACE2("jni", "NewObjectV called");
+    TRACE("NewObjectV called");
     assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jobject result = NewObjectA(jni_env, clazz, methodID, jvalue_args);
@@ -1090,7 +1082,7 @@
                            jmethodID methodID,
                            jvalue *args)
 {
-    TRACE2("jni", "NewObjectA called");
+    TRACE("NewObjectA called");
     assert(hythread_is_suspend_enabled());
     // Allocate the object.
     jobject new_handle = AllocObject(jni_env, clazz);
@@ -1107,7 +1099,7 @@
 jclass JNICALL GetObjectClass(JNIEnv * jni_env,
                               jobject obj)
 {
-    TRACE2("jni", "GetObjectClass called");
+    TRACE("GetObjectClass called");
     assert(hythread_is_suspend_enabled());
     // The spec guarantees that the reference is not null.
     assert(obj);
@@ -1125,7 +1117,7 @@
     assert(jlo);
     assert(jlo->vt());
     Class *clss = jlo->vt()->clss;
-    TRACE2("jni", "GetObjectClass: class = " << clss->get_name()->bytes);
+    TRACE("GetObjectClass: class = " << clss->get_name()->bytes);
     new_handle->object= struct_Class_to_java_lang_Class(clss);
     tmn_suspend_enable();        //---------------------------------^
 
@@ -1136,7 +1128,7 @@
                               jobject obj,
                               jclass clazz)
 {
-    TRACE2("jni", "IsInstanceOf called");
+    TRACE("IsInstanceOf called");
     assert(hythread_is_suspend_enabled());
     if(!obj) {
         return JNI_TRUE;
@@ -1180,7 +1172,7 @@
                           const jchar *unicodeChars,
                           jsize length)
 {
-    TRACE2("jni", "NewString called, length = " << length);
+    TRACE("NewString called, length = " << length);
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised()) return NULL;
@@ -1191,7 +1183,7 @@
 jsize JNICALL GetStringLength(JNIEnv * UNREF jni_env,
                               jstring string)
 {
-    TRACE2("jni", "GetStringLength called");
+    TRACE("GetStringLength called");
     assert(hythread_is_suspend_enabled());
     if(!string)
         return 0;
@@ -1203,7 +1195,7 @@
                                     jstring string,
                                     jboolean *isCopy)
 {
-    TRACE2("jni", "GetStringChars called");
+    TRACE("GetStringChars called");
     assert(hythread_is_suspend_enabled());
 
     if (!string || exn_raised()) return NULL;
@@ -1222,7 +1214,7 @@
                                 jstring string,
                                 const jchar *chars)
 {
-    TRACE2("jni", "ReleaseStringChars called");
+    TRACE("ReleaseStringChars called");
     if(!string)
         return;
     assert(check_is_jstring_class(string));
@@ -1233,7 +1225,7 @@
 jstring JNICALL NewStringUTF(JNIEnv * jni_env,
                              const char *bytes)
 {
-    TRACE2("jni", "NewStringUTF called, bytes = " << bytes);
+    TRACE("NewStringUTF called, bytes = " << bytes);
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised()) return NULL;
@@ -1244,7 +1236,7 @@
 jsize JNICALL GetStringUTFLength(JNIEnv * UNREF jni_env,
                                  jstring string)
 {
-    TRACE2("jni", "GetStringUTFLength called");
+    TRACE("GetStringUTFLength called");
     if(!string)
         return 0;
     assert(check_is_jstring_class(string));
@@ -1256,7 +1248,7 @@
                                       jstring string,
                                       jboolean *isCopy)
 {
-    TRACE2("jni", "GetStringUTFChars called");
+    TRACE("GetStringUTFChars called");
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised() || !string) return NULL;
@@ -1271,7 +1263,7 @@
                                    jstring string,
                                    const char *utf)
 {
-    TRACE2("jni", "ReleaseStringUTFChars called");
+    TRACE("ReleaseStringUTFChars called");
     if(!string)
         return;
     assert(check_is_jstring_class(string));
@@ -1284,7 +1276,7 @@
                              const JNINativeMethod *methods,
                              jint nMethods)
 {
-    TRACE2("jni", "RegisterNatives called");
+    TRACE("RegisterNatives called");
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised()) return -1;
@@ -1295,7 +1287,7 @@
 
 jint JNICALL UnregisterNatives(JNIEnv * jni_env, jclass clazz)
 {
-    TRACE2("jni", "UnregisterNatives called");
+    TRACE("UnregisterNatives called");
     assert(hythread_is_suspend_enabled());
     Class* clss = jclass_to_struct_Class(clazz);
     return class_unregister_methods(clss) ? -1 : 0;
@@ -1303,7 +1295,7 @@
 
 jint JNICALL MonitorEnter(JNIEnv * jni_env, jobject obj)
 {
-    TRACE2("jni", "MonitorEnter called");
+    TRACE("MonitorEnter called");
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised()) return -1;
@@ -1318,7 +1310,7 @@
 {
     ASSERT_RAISE_AREA;
 
-    TRACE2("jni", "MonitorExit called");
+    TRACE("MonitorExit called");
     assert(hythread_is_suspend_enabled());
     jthread_monitor_exit(obj);
     return exn_raised() ? -1 : 0;
@@ -1328,7 +1320,7 @@
 
 jint JNICALL GetJavaVM(JNIEnv * jni_env, JavaVM **vm)
 {
-    TRACE2("jni", "GetJavaVM called");
+    TRACE("GetJavaVM called");
     assert(hythread_is_suspend_enabled());
     *vm = ((JNIEnv_Internal *) jni_env)->vm;
     return JNI_OK;
@@ -1337,7 +1329,7 @@
 
 void JNICALL GetStringRegion(JNIEnv * jni_env, jstring s, jsize off, jsize len, jchar *b)
 {
-    TRACE2("jni", "GetStringRegion called");
+    TRACE("GetStringRegion called");
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised()) return;
@@ -1349,21 +1341,21 @@
 
 void JNICALL GetStringUTFRegion(JNIEnv * UNREF env, jstring s, jsize off, jsize len, char *b)
 {
-    TRACE2("jni", "GetStringUTFRegion called");
+    TRACE("GetStringUTFRegion called");
     assert(hythread_is_suspend_enabled());
     string_get_utf8_region_h((ObjectHandle)s, off, len, b);
 }
 
 VMEXPORT void* JNICALL GetPrimitiveArrayCritical(JNIEnv * jni_env, jarray array, jboolean* isCopy)
 {
-    TRACE2("jni", "GetPrimitiveArrayCritical called");
+    TRACE("GetPrimitiveArrayCritical called");
     assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
     Class* array_clss = ((ObjectHandle)array)->object->vt()->clss;
+    TRACE2("jni.pin", "pinning array " << array->object);
     tmn_suspend_enable();
     assert(array_clss->get_name()->bytes[0]=='[');
 
-    TRACE2("jni.pin", "pinning array " << array->object);
     gc_pin_object((Managed_Object_Handle*)array);
     switch (array_clss->get_name()->bytes[1]) {
     case 'B':  return GetByteArrayElements(jni_env, array, isCopy);
@@ -1374,17 +1366,20 @@
     case 'J':  return GetLongArrayElements(jni_env, array, isCopy);
     case 'S':  return GetShortArrayElements(jni_env, array, isCopy);
     case 'Z':  return GetBooleanArrayElements(jni_env, array, isCopy);
-    default:   ABORT("Wrong array type descriptor"); return NULL;
+    default:   DIE(("Wrong array type descriptor")); return NULL;
     }
 }
 
 VMEXPORT void JNICALL ReleasePrimitiveArrayCritical(JNIEnv * jni_env, jarray array, void* carray, jint mode)
 {
-    TRACE2("jni", "ReleasePrimitiveArrayCritical called");
+    TRACE("ReleasePrimitiveArrayCritical called");
     assert(hythread_is_suspend_enabled());
 
     tmn_suspend_disable();
     Class* array_clss = ((ObjectHandle)array)->object->vt()->clss;
+    if (mode != JNI_COMMIT) {
+        TRACE2("jni.pin", "unpinning array " << array->object);
+    }
     tmn_suspend_enable();
     assert(array_clss->get_name()->bytes[0]=='[');
     switch (array_clss->get_name()->bytes[1]) {
@@ -1396,45 +1391,44 @@
     case 'J':  ReleaseLongArrayElements(jni_env, array, (jlong*)carray, mode); break;
     case 'S':  ReleaseShortArrayElements(jni_env, array, (jshort*)carray, mode); break;
     case 'Z':  ReleaseBooleanArrayElements(jni_env, array, (jboolean*)carray, mode); break;
-    default:   ABORT("Wrong array type descriptor"); break;
+    default:   DIE(("Wrong array type descriptor")); break;
     }
     if (mode != JNI_COMMIT) {
-        TRACE2("jni.pin", "unpinning array " << array->object);
         gc_unpin_object((Managed_Object_Handle*)array);
     }
 }
 
 const jchar* JNICALL GetStringCritical(JNIEnv *jni_env, jstring s, jboolean* isCopy)
 {
-    TRACE2("jni", "GetStringCritical called");
+    TRACE("GetStringCritical called");
     assert(hythread_is_suspend_enabled());
     return GetStringChars(jni_env, s, isCopy);
 }
 
 void JNICALL ReleaseStringCritical(JNIEnv * jni_env, jstring s, const jchar* cstr)
 {
-    TRACE2("jni", "ReleaseStringCritical called");
+    TRACE("ReleaseStringCritical called");
     assert(hythread_is_suspend_enabled());
     ReleaseStringChars(jni_env, s, cstr);
 }
 
 VMEXPORT jweak JNICALL NewWeakGlobalRef(JNIEnv * jni_env, jobject obj)
 {
-    TRACE2("jni", "NewWeakGlobalRef called");
+    TRACE("NewWeakGlobalRef called");
     assert(hythread_is_suspend_enabled());
     return NewGlobalRef(jni_env, obj);
 }
 
 VMEXPORT void JNICALL DeleteWeakGlobalRef(JNIEnv * jni_env, jweak obj)
 {
-    TRACE2("jni", "DeleteWeakGlobalRef called");
+    TRACE("DeleteWeakGlobalRef called");
     assert(hythread_is_suspend_enabled());
     DeleteGlobalRef(jni_env, obj);
 }
 
 jboolean JNICALL ExceptionCheck(JNIEnv * jni_env)
 {
-    TRACE2("jni", "ExceptionCheck called, exception status = " << exn_raised());
+    TRACE("ExceptionCheck called, exception status = " << exn_raised());
     assert(hythread_is_suspend_enabled());
 
     if (exn_raised())
@@ -1445,7 +1439,7 @@
 
 VMEXPORT jmethodID JNICALL FromReflectedMethod(JNIEnv * jni_env, jobject method)
 {
-    TRACE2("jni", "FromReflectedMethod called");
+    TRACE("FromReflectedMethod called");
     Class* clss = jobject_to_struct_Class(method);
 
     Global_Env * vm_env = jni_get_vm_env(jni_env);
@@ -1465,7 +1459,7 @@
 
 VMEXPORT jfieldID JNICALL FromReflectedField(JNIEnv * jni_env, jobject field)
 {
-    TRACE2("jni", "FromReflectedField called");
+    TRACE("FromReflectedField called");
     Class* clss = jobject_to_struct_Class(field);
 
     Global_Env * vm_env = jni_get_vm_env(jni_env);
@@ -1481,7 +1475,7 @@
 VMEXPORT jobject JNICALL ToReflectedMethod(JNIEnv * jni_env, jclass UNREF cls, jmethodID methodID,
                                             jboolean isStatic)
 {
-    TRACE2("jni", "ToReflectedMethod called");
+    TRACE("ToReflectedMethod called");
 
     Method *m = (Method*)methodID;
     // True if flags are different
@@ -1497,7 +1491,7 @@
 VMEXPORT jobject JNICALL ToReflectedField(JNIEnv * jni_env, jclass UNREF cls, jfieldID fieldID,
                                            jboolean isStatic)
 {
-    TRACE2("jni", "ToReflectedField called");
+    TRACE("ToReflectedField called");
 
     Field *f = (Field*)fieldID;
     if ((bool)f->is_static() != (bool)isStatic || exn_raised()) // True if flags are different
@@ -1535,7 +1529,7 @@
     JNIEnv * jni_env;
     jint status;
 
-    TRACE2("jni", "DestroyJavaVM  called");
+    TRACE("DestroyJavaVM  called");
 
     java_vm = (JavaVM_Internal *) vm;
 
@@ -1579,7 +1573,7 @@
     jthread java_thread;
     IDATA status; 
 
-    TRACE2("jni", "AttachCurrentThread called");
+    TRACE("AttachCurrentThread called");
     
     if (jthread_self()) {
         *p_jni_env = jthread_get_JNI_env(jthread_self());
@@ -1643,7 +1637,7 @@
 {
     VM_thread * vm_thread;
 
-    TRACE2("jni", "GetEnv called, ver = " << ver);
+    TRACE("GetEnv called, ver = " << ver);
     assert(hythread_is_suspend_enabled());
 
     vm_thread = p_TLS_vmthread;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp Fri Apr 18 00:26:23 2008
@@ -775,7 +775,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseBooleanArrayElements
@@ -828,7 +828,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseByteArrayElements
@@ -882,7 +882,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseCharArrayElements
@@ -936,7 +936,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseShortArrayElements
@@ -990,7 +990,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseIntArrayElements
@@ -1044,7 +1044,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseLongArrayElements
@@ -1099,7 +1099,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseFloatArrayElements
@@ -1153,7 +1153,7 @@
         STD_FREE(elems);
         break;
     default:
-        ASSERT(0, "Unexpected value of 'mode' input parameter");
+        DIE(("Unexpected value of 'mode' input parameter"));
         break;
     }
 } //ReleaseDoubleArrayElements

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp Fri Apr 18 00:26:23 2008
@@ -135,7 +135,7 @@
             jvalue_args[arg_number].d = va_arg(args, jdouble);
             break;
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
             break;
         }
         iter = advance_arg_iterator(iter);
@@ -355,7 +355,7 @@
         strcpy(classname, "void");
         break;
     default:
-        ABORT("Invalid type descriptor");
+        DIE(("Invalid type descriptor"));
         break;
     }
 } // PrimitiveSignatureToName
@@ -407,7 +407,7 @@
     case 'i': sig = 'I'; break;
     case 'l': sig = 'J'; break;
     case 'v': sig = 'V'; break;
-    default: ABORT("Invalid type name");
+    default: DIE(("Invalid type name"));
     }
     return sig;
 } // PrimitiveNameToSignature
@@ -480,7 +480,7 @@
             clss = ge->Void_Class;
             break;
         default:
-            ABORT("Invalid type descriptor");
+            DIE(("Invalid type descriptor"));
             break;
     }
 
@@ -670,7 +670,7 @@
     char *ch = strchr(name->bytes, '.');
     if (NULL != ch)
     {
-        ABORT("Class name should not contain dots");
+        DIE(("Class name should not contain dots"));
     }
 #endif
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp Fri Apr 18 00:26:23 2008
@@ -231,7 +231,7 @@
 {
     // If we ever get here, we are in an implemented JVMTI function
     // By looking at the call stack and assembly it should be clear which one
-    ABORT("Not implemented");
+    DIE(("Not implemented"));
 }
 
 jint JNICALL create_jvmti_environment(JavaVM *vm_ext, void **env, jint version)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp Fri Apr 18 00:26:23 2008
@@ -17,6 +17,8 @@
 /*
  * JVMTI API for working with breakpoints
  */
+#define LOG_DOMAIN "jvmti.break"
+#include "cxxlog.h"
 
 #include "open/hythread_ext.h"
 #include "open/vm_method_access.h"
@@ -26,7 +28,6 @@
 #include "jvmti_internal.h"
 #include "environment.h"
 #include "Class.h"
-#include "cxxlog.h"
 #include "vm_log.h"
 #include "cci.h"
 
@@ -42,7 +43,7 @@
 {
     assert(bp);
 
-    TRACE2("jvmti.break", "Process breakpoint: "
+    TRACE("Process breakpoint: "
         << bp->method << " :" << bp->location << " :" << bp->addr );
 
     DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
@@ -68,12 +69,12 @@
     {
         if (env->global_events[JVMTI_EVENT_BREAKPOINT - JVMTI_MIN_EVENT_TYPE_VAL])
         {
-            TRACE2("jvmti.break", "Calling global breakpoint callback: "
+            TRACE("Calling global breakpoint callback: "
                 << method << " :" << location << " :" << addr);
 
             func((jvmtiEnv*)env, jni_env, (jthread)hThread, method, location);
 
-            TRACE2("jvmti.break", "Finished global breakpoint callback: "
+            TRACE("Finished global breakpoint callback: "
                 << method << " :" << location << " :" << addr);
         }
         else
@@ -88,12 +89,12 @@
 
                 if (et->thread == hythread_self())
                 {
-                    TRACE2("jvmti.break", "Calling local breakpoint callback: "
+                    TRACE("Calling local breakpoint callback: "
                         << method << " :" << location << " :" << addr);
 
                     func((jvmtiEnv*)env, jni_env, (jthread)hThread, method, location);
 
-                    TRACE2("jvmti.break", "Finished local breakpoint callback: "
+                    TRACE("Finished local breakpoint callback: "
                         << method << " :" << location << " :" << addr);
                 }
             }
@@ -120,8 +121,8 @@
                    jmethodID method,
                    jlocation location)
 {
-    TRACE2("jvmti.break", "SetBreakpoint is called for method: "
-        << method << " :" << location);
+    TRACE("SetBreakpoint is called for method: " << method
+        << " :" << location);
     SuspendEnabledChecker sec;
 
     jvmtiError errorCode;
@@ -137,7 +138,7 @@
         return JVMTI_ERROR_INVALID_METHODID;
 
     Method *m = (Method*) method;
-    TRACE2("jvmti.break", "SetBreakpoint: " << method << " :" << location);
+    TRACE("SetBreakpoint: " << method << " :" << location);
 
 #if defined (__INTEL_COMPILER) 
 #pragma warning( push )
@@ -175,7 +176,7 @@
     if (!brpt_intf->add_reference(method, location, (POINTER_SIZE_INT)false))
         return JVMTI_ERROR_INTERNAL;
 
-    TRACE2("jvmti.break", "SetBreakpoint is successful");
+    TRACE("SetBreakpoint is successful");
     return JVMTI_ERROR_NONE;
 }
 
@@ -192,8 +193,8 @@
                      jmethodID method,
                      jlocation location)
 {
-    TRACE2("jvmti.break", "ClearBreakpoint is called for method: "
-        << method << " :" << location);
+    TRACE("ClearBreakpoint is called for method: " << method
+        << " :" << location);
     SuspendEnabledChecker sec;
     jvmtiError errorCode;
 
@@ -208,7 +209,7 @@
         return JVMTI_ERROR_INVALID_METHODID;
 
     Method *m = (Method*) method;
-    TRACE2("jvmti.break", "ClearBreakpoint: " << method << " :" << location);
+    TRACE("ClearBreakpoint: " << method << " :" << location);
 
 #if defined (__INTEL_COMPILER) 
 #pragma warning( push )
@@ -247,6 +248,6 @@
     if (!brpt_intf->remove_reference(bp_ref))
         return JVMTI_ERROR_INTERNAL;
 
-    TRACE2("jvmti.break", "ClearBreakpoint is successful");
+    TRACE("ClearBreakpoint is successful");
     return JVMTI_ERROR_NONE;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp Fri Apr 18 00:26:23 2008
@@ -19,7 +19,7 @@
  * @file jvmti_break_intf.cpp
  * @brief JVMTI native breakpoints API implementation
  */
-
+#define LOG_DOMAIN "jvmti.break"
 #include "cxxlog.h"
 
 #include "open/vm_method_access.h"
@@ -124,7 +124,7 @@
             return;
         }
     }
-    LDIE2("jvmti.break", 23, "{0} try to release unknown interface" << "VMBreakPoints::release_intf:");
+    LDIE(23, "{0} try to release unknown interface" << "VMBreakPoints::release_intf:");
 }
 
 VMBreakInterface*

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Fri Apr 18 00:26:23 2008
@@ -2390,7 +2390,7 @@
     IDATA status = hythread_create_ex((hythread_t)ti->event_thread, NULL, 0, 0, NULL,
         jvmti_event_thread_function, jni_env);
     if( status != TM_ERROR_NONE ) {
-        DIE("jvmti_create_event_thread: creating thread is failed!");
+        DIE(("jvmti_create_event_thread: creating thread is failed!"));
     }
     return;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_general.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_general.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_general.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_general.cpp Fri Apr 18 00:26:23 2008
@@ -21,12 +21,13 @@
 /*
  * JVMTI general API
  */
+#define LOG_DOMAIN "jvmti.general"
+#include "cxxlog.h"
 
 #include "jvmti_direct.h"
 #include "jvmti_utils.h"
 #include "jvmti_internal.h"
 #include "environment.h"
-#include "cxxlog.h"
 #include "suspend_checker.h"
 #include "jvmti_break_intf.h"
 
@@ -135,7 +136,7 @@
 jvmtiSetEnvironmentLocalStorage(jvmtiEnv* env,
                                 const void* data)
 {
-    TRACE2("jvmti.general", "SetEnvironmentLocalStorage called, data = " << data);
+    TRACE("SetEnvironmentLocalStorage called, data = " << data);
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -410,23 +411,27 @@
 
     CHECK_EVERYTHING();
 
-    // FIXME: Add removing of filters if value == false
+    char* category = "";
     switch (flag)
     {
     case JVMTI_VERBOSE_OTHER:
-        // Which is other?
         break;
     case JVMTI_VERBOSE_GC:
-        set_threshold(util::GC_LOGGER, (value) ? INFO : WARN);
-        break;
+        category = LOG_GC_INFO;
     case JVMTI_VERBOSE_CLASS:
-        set_threshold(util::CLASS_LOGGER, (value) ? INFO : WARN);
+        category = LOG_CLASS_INFO;
         break;
     case JVMTI_VERBOSE_JNI:
-        set_threshold(util::JNI_LOGGER, (value) ? INFO : WARN);
+        category = LOG_JNI_INFO;
         break;
     default:
         return JVMTI_ERROR_ILLEGAL_ARGUMENT;
+    }
+
+    if (value) {
+        log_enable_info_category(category, 0);
+    } else {
+        log_disable_info_category(category, 0);
     }
 
     return JVMTI_ERROR_NONE;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp Fri Apr 18 00:26:23 2008
@@ -21,6 +21,8 @@
 /*
  * JVMTI local variables API
  */
+#define LOG_DOMAIN "jvmti.locals"
+#include "cxxlog.h"
 
 #include "jvmti_direct.h"
 #include "jvmti_utils.h"
@@ -38,9 +40,6 @@
 #include "Class.h"
 #include "vtable.h"
 
-#define LOG_DOMAIN "jvmti.locals"
-#include "cxxlog.h"
-
 /*
  * Local Variable functions:
  *
@@ -244,7 +243,7 @@
                         depth, slot, *(int64*) p_value);
                 break;
             default:
-                DIE("Error: unrecognized local variable type");
+                DIE(("Error: unrecognized local variable type"));
         }
     }
     else
@@ -275,7 +274,7 @@
                         p_value);
                 break;
             default:
-                DIE("Error: unrecognized local variable type");
+                DIE(("Error: unrecognized local variable type"));
         }
 
         si_free(si);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp Fri Apr 18 00:26:23 2008
@@ -21,8 +21,11 @@
 /*
  * JVMTI method API
  */
-
+#define LOG_DOMAIN "jvmti.method"
+#include "cxxlog.h"
+#include "vm_log.h"
 #include <string.h>
+
 #include "open/vm_method_access.h"
 #include "Class.h"
 #include "class_member.h"
@@ -30,8 +33,6 @@
 #include "jvmti_direct.h"
 #include "object_handles.h"
 #include "jvmti_utils.h"
-#include "cxxlog.h"
-#include "vm_log.h"
 
 #include "jvmti_interface.h"
 #include "suspend_checker.h"
@@ -56,7 +57,7 @@
                    char** signature_ptr,
                    char** generic_ptr)
 {
-    TRACE2("jvmti.method", "GetMethodName called");
+    TRACE("GetMethodName called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -119,7 +120,7 @@
                              jmethodID method,
                              jclass* declaring_class_ptr)
 {
-    TRACE2("jvmti.method", "GetMethodDeclaringClass called for " << method);
+    TRACE("GetMethodDeclaringClass called for " << method);
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -155,7 +156,7 @@
                         jmethodID method,
                         jint* modifiers_ptr)
 {
-    TRACE2("jvmti.method", "GetMethodModifiers called");
+    TRACE("GetMethodModifiers called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -195,7 +196,7 @@
                   jmethodID method,
                   jint* max_ptr)
 {
-    TRACE2("jvmti.method", "GetMaxLocals called");
+    TRACE("GetMaxLocals called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -226,7 +227,7 @@
                       jmethodID method,
                       jint* size_ptr)
 {
-    TRACE2("jvmti.method", "GetArgumentsSize called");
+    TRACE("GetArgumentsSize called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -258,7 +259,7 @@
                         jint* entry_count_ptr,
                         jvmtiLineNumberEntry** table_ptr)
 {
-    TRACE2("jvmti.method", "GetLineNumberTable called");
+    TRACE("GetLineNumberTable called");
     SuspendEnabledChecker sec;
     int index,
         count;
@@ -339,7 +340,7 @@
                        jlocation* start_location_ptr,
                        jlocation* end_location_ptr)
 {
-    TRACE2("jvmti.method", "GetMethodLocation called");
+    TRACE("GetMethodLocation called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -376,7 +377,7 @@
                            jint* entry_count_ptr,
                            jvmtiLocalVariableEntry** table_ptr)
 {
-    TRACE2("jvmti.method", "GetLocalVariableTable called");
+    TRACE("GetLocalVariableTable called");
     SuspendEnabledChecker sec;
     int len,
         index,
@@ -497,7 +498,7 @@
                   jint* bytecode_count_ptr,
                   unsigned char** bytecodes_ptr)
 {
-    TRACE2("jvmti.method", "GetBytecodes called");
+    TRACE("GetBytecodes called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -561,7 +562,7 @@
                     jmethodID method,
                     jboolean* is_native_ptr)
 {
-    TRACE2("jvmti.method", "IsMethodNative called for " << method);
+    TRACE("IsMethodNative called for " << method);
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -584,7 +585,7 @@
     }
 
     *is_native_ptr = (jboolean)(reinterpret_cast<Method*>(method)->is_native()?JNI_TRUE:JNI_FALSE);
-    TRACE2("jvmti.method", "IsMethodNative(" << method << ") = " << *is_native_ptr);
+    TRACE("IsMethodNative(" << method << ") = " << *is_native_ptr);
 
     return JVMTI_ERROR_NONE;
 }
@@ -604,7 +605,7 @@
                        jmethodID method,
                        jboolean* is_synthetic_ptr)
 {
-    TRACE2("jvmti.method", "IsMethodSynthetic called");
+    TRACE("IsMethodSynthetic called");
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -647,7 +648,7 @@
                       jmethodID method,
                       jboolean* is_obsolete_ptr)
 {
-    TRACE2("jvmti.method", "IsMethodObsolete called for " << method);
+    TRACE("IsMethodObsolete called for " << method);
     SuspendEnabledChecker sec;
     /*
      * Check given env & current phase.
@@ -674,7 +675,7 @@
      */
     *is_obsolete_ptr = JNI_FALSE;
 
-    TRACE2("jvmti.method", "IsMethodObsolete(" << method << ") = " << *is_obsolete_ptr);
+    TRACE("IsMethodObsolete(" << method << ") = " << *is_obsolete_ptr);
     return JVMTI_ERROR_NONE;
 } // jvmtiIsMethodObsolete
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_pop_frame.cpp Fri Apr 18 00:26:23 2008
@@ -20,6 +20,7 @@
  */
 
 #define LOG_DOMAIN "jvmti.stack.popframe"
+#include "clog.h"
 
 #include "open/vm_method_access.h"
 
@@ -35,28 +36,27 @@
 #include "stack_iterator.h"
 #include "jvmti_break_intf.h"
 #include "cci.h"
-#include "clog.h"
 
 static void jvmti_pop_frame_callback()
 {
-    TRACE(("JVMTI PopFrame callback is called"));
+    CTRACE(("JVMTI PopFrame callback is called"));
     frame_type type =
 		m2n_get_frame_type((M2nFrame*)(p_TLS_vmthread->last_m2n_frame));
 
     // frame wasn't requested to be popped
     if (FRAME_POP_NOW != (FRAME_POP_NOW & type)) {
-        TRACE(("PopFrame callback is not FRAME_POP_NOW"));
+        CTRACE(("PopFrame callback is not FRAME_POP_NOW"));
         return;
     }
 
     // if we are in hythread_safe_point() frame is unwindable
     if (FRAME_SAFE_POINT == (FRAME_SAFE_POINT & type)) {
-        TRACE(("PopFrame callback is FRAME_SAFE_POINT"));
+        CTRACE(("PopFrame callback is FRAME_SAFE_POINT"));
         jvmti_jit_prepare_pop_frame();
 
     } else if (is_unwindable()) {
         // unwindable frame, wait for resume
-        TRACE(("PopFrame callback is FRAME_SAFE_POINT"));
+        CTRACE(("PopFrame callback is FRAME_SAFE_POINT"));
 
         // switch execution to the previous frame
         jvmti_jit_do_pop_frame();
@@ -64,7 +64,7 @@
 
     } else {
         // nonunwindable frame, raise special exception object
-        TRACE(("PopFrame callback is raising exception"));
+        CTRACE(("PopFrame callback is raising exception"));
         exn_raise_object(VM_Global_State::loader_env->popFrameException);
     }
 } //jvmti_pop_frame_callback
@@ -72,7 +72,7 @@
 jvmtiError jvmti_jit_pop_frame(jthread java_thread)
 {
     assert(hythread_is_suspend_enabled());
-    TRACE(("Called PopFrame for JIT"));
+    CTRACE(("Called PopFrame for JIT"));
 
     DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
 
@@ -98,7 +98,7 @@
     si_goto_previous(si);
     assert(! si_is_native(si));
     Method* UNREF pop_method = si_get_code_chunk_info(si)->get_method();
-    TRACE(("PopFrame is called for method %s.%s%s :%p",
+    CTRACE(("PopFrame is called for method %s.%s%s :%p",
         pop_method->get_class()->get_name()->bytes,
         pop_method->get_name()->bytes,
         pop_method->get_descriptor()->bytes,
@@ -145,7 +145,7 @@
 
 // requires stack iterator and buffer to save intermediate information
 static void jvmti_jit_prepare_pop_frame(StackIterator* si, uint32* buf) {
-    TRACE(("Prepare PopFrame for JIT"));
+    CTRACE(("Prepare PopFrame for JIT"));
     // pop native frame
     assert(si_is_native(si));
     si_goto_previous(si);
@@ -160,7 +160,7 @@
     Method* method = cci->get_method();
     Class* method_class = method->get_class();
     bool is_method_static = method->is_static();
-    TRACE(("PopFrame method %s.%s%s, stop IP: %p",
+    CTRACE(("PopFrame method %s.%s%s, stop IP: %p",
         method->get_class()->get_name()->bytes,
         method->get_name()->bytes,
         method->get_descriptor()->bytes,
@@ -186,7 +186,7 @@
     NativeCodePtr ip = si_get_ip(si);
     JIT *jit = cci->get_jit();
 
-    TRACE(("PopFrame method %s.%s%s, set IP begin: %p",
+    CTRACE(("PopFrame method %s.%s%s, set IP begin: %p",
         method->get_class()->get_name()->bytes,
         method->get_name()->bytes,
         method->get_descriptor()->bytes, ip));
@@ -200,7 +200,7 @@
 
     method = si_get_code_chunk_info(si)->get_method();
 
-    TRACE(("PopFrame method %s.%s%s, set IP end: %p",
+    CTRACE(("PopFrame method %s.%s%s, set IP end: %p",
         method->get_class()->get_name()->bytes,
         method->get_name()->bytes,
         method->get_descriptor()->bytes, ip ));
@@ -218,7 +218,7 @@
     // create stack iterator from native
     StackIterator* si = si_create_from_native();
     si_transfer_all_preserved_registers(si);
-    TRACE(("PopFrame prepare for method IP: %p", si_get_ip(si) ));
+    CTRACE(("PopFrame prepare for method IP: %p", si_get_ip(si) ));
 
     // prepare pop frame - find regs values
     uint32 buf = 0;
@@ -266,7 +266,7 @@
 
 void jvmti_jit_complete_pop_frame() {
     // Destructive Unwinding!!! NO CXX Logging put here.
-    TRACE(("Complete PopFrame for JIT"));
+    CTRACE(("Complete PopFrame for JIT"));
 
     // Find top m2n frame
     M2nFrame* top_frame = m2n_get_last_frame();
@@ -288,13 +288,13 @@
     jvmti_relocate_single_step_breakpoints(si);
 
     // transfer control
-    TRACE(("PopFrame transfer control to: %p",  (void*)si_get_ip(si) ));
+    CTRACE(("PopFrame transfer control to: %p",  (void*)si_get_ip(si) ));
     si_transfer_control(si);
 }
 
 void jvmti_jit_do_pop_frame() {
     // Destructive Unwinding!!! NO CXX Logging put here.
-    TRACE(("Do PopFrame for JIT"));
+    CTRACE(("Do PopFrame for JIT"));
 
     // Find top m2n frame
     M2nFrame* top_frame = m2n_get_last_frame();
@@ -316,7 +316,7 @@
     jvmti_relocate_single_step_breakpoints(si);
 
     // transfer control
-    TRACE(("PopFrame transfer control to: %p",  (void*)si_get_ip(si) ));
+    CTRACE(("PopFrame transfer control to: %p",  (void*)si_get_ip(si) ));
     si_transfer_control(si);
 }
 #endif // _IA32_
@@ -327,13 +327,13 @@
     M2nFrame* top_frame = m2n_get_last_frame();
     set_pop_frame_registers(top_frame, &regs);
 
-    TRACE(("entering exception_safe_point"));
+    CTRACE(("entering exception_safe_point"));
     hythread_exception_safe_point();
-    TRACE(("left exception_safe_point"));
+    CTRACE(("left exception_safe_point"));
 
-    TRACE(("entering safe_point"));
+    CTRACE(("entering safe_point"));
     hythread_safe_point();
-    TRACE(("left safe_point"));
+    CTRACE(("left safe_point"));
 
     // find frame type
     frame_type type = m2n_get_frame_type(top_frame);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp Fri Apr 18 00:26:23 2008
@@ -18,6 +18,8 @@
  * @author Pavel Rebriy
  * @version $Revision: $
  */
+#define LOG_DOMAIN "jvmti.step"
+#include "cxxlog.h"
 
 #include "open/bytecodes.h"
 #include "open/vm_method_access.h"
@@ -26,7 +28,6 @@
 #include "jvmti.h"
 #include "jthread.h"
 #include "Class.h"
-#include "cxxlog.h"
 #include "vm_log.h"
 #include "jvmti_utils.h"
 #include "jvmti_internal.h"
@@ -436,7 +437,7 @@
         // ret instruction
         case OPCODE_RET:            /* 0xa9 + u1|u2  */
             // FIXME - need to obtain return address from stack.
-            LDIE2("jvmti", 25, "SingleStepLocation: not implemented ret instruction");
+            LDIE(25, "SingleStepLocation: not implemented ret instruction");
             break;
         }
         break;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h Fri Apr 18 00:26:23 2008
@@ -221,7 +221,7 @@
         assert(0 <= *i && *i < N);
         c++;
     }
-    LOG("expected " << N << " elements, got " << c);
+    TRACE("expected " << N << " elements, got " << c);
     assert(c == N);
     for (int j = 0; j < N; j++) {
         list.push_back(j);
@@ -231,7 +231,7 @@
         assert(0 <= *i && *i < N);
         c++;
     }
-    LOG("expected " << (2*N) << "  elements, got " << c);
+    TRACE("expected " << (2*N) << "  elements, got " << c);
     assert(c == 2*N);
     assert(c == list.size());
 }
@@ -244,7 +244,7 @@
         list.push_back(j);
         c++;
     }
-    LOG("expected " << N << " elements, got " << c);
+    TRACE("expected " << N << " elements, got " << c);
     assert(c == N);
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp Fri Apr 18 00:26:23 2008
@@ -133,7 +133,7 @@
         env->ReleaseStringUTFChars(jo, strChain);
     }
 
-    LOG("Child process command-line : " << strCmnd);
+    TRACE("Child process command-line : " << strCmnd);
 
     char *strEnvp = NULL;
     // Get the array, each element of which has environment variable settings:

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp Fri Apr 18 00:26:23 2008
@@ -652,7 +652,7 @@
     unsigned method_idx = clazz->get_enclosing_method_index();
     if (method_idx) {
         unsigned c_idx = clazz->get_enclosing_class_index();
-        ASSERT(c_idx, "No class for enclosing method");
+        ASSERT(c_idx, ("No class for enclosing method"));
         Class* outer_clss = clazz->_resolve_class(VM_Global_State::loader_env, c_idx);
         if (outer_clss) 
         {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMMemoryManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMMemoryManager.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMMemoryManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMMemoryManager.cpp Fri Apr 18 00:26:23 2008
@@ -111,12 +111,12 @@
 JNIEXPORT void JNICALL Java_java_lang_VMMemoryManager_runFinalization
   (JNIEnv *, jclass)
 {
-    LOG2("ref", "Enqueueing references");
+    TRACE2("ref", "Enqueueing references");
     vm_enqueue_references();
     
     // For now we run the finalizers immediately in the context of the thread which requested GC.
     // Eventually we may have a different scheme, e.g., a dedicated finalize thread.
-    LOG2("finalize", "Running pending finalizers");
+    TRACE2("finalize", "Running pending finalizers");
     vm_run_pending_finalizers();
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMField.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMField.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMField.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMField.cpp Fri Apr 18 00:26:23 2008
@@ -90,7 +90,7 @@
         GetBooleanField(jenv, obj, field_id);
         break;
     default:
-        ASSERT(0, "Unexpected type descriptor: " << field_sig);
+        DIE(("Unexpected type descriptor: %c", field_sig));
     }
 
     return primitive_value;
@@ -270,7 +270,7 @@
 
         break;
     default:
-        ASSERT(0, "Unexpected type descriptor");
+        DIE(("Unexpected type descriptor"));
     }
 
     return;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_reflect_VMReflection.cpp Fri Apr 18 00:26:23 2008
@@ -189,7 +189,7 @@
         return NULL;
         break;
     default:
-        ABORT("Unexpected java type");
+        DIE(("Unexpected java type"));
     }
 
     return exn_raised() ? NULL : wrap_primitive(jenv, result, (char)return_type);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_lang_management_ClassLoadingMXBeanImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_lang_management_ClassLoadingMXBeanImpl.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_lang_management_ClassLoadingMXBeanImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_lang_management_ClassLoadingMXBeanImpl.cpp Fri Apr 18 00:26:23 2008
@@ -26,7 +26,7 @@
  * It contains implementation for native methods of
  * org.apache.harmony.lang.management.ClassLoadingMXBeanImpl class.
  */
-
+#define LOG_DOMAIN "management"
 #include <cxxlog.h>
 #include "environment.h"
 #include "org_apache_harmony_lang_management_ClassLoadingMXBeanImpl.h"
@@ -38,7 +38,7 @@
 JNIEXPORT jint JNICALL Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_getLoadedClassCountImpl
 (JNIEnv * env, jobject this_bean)
 {
-    TRACE2("management", "ClassLoadingMXBeanImpl_getLoadedClassCountImpl invocation");
+    TRACE("ClassLoadingMXBeanImpl_getLoadedClassCountImpl invocation");
     return (jint)
         (Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_getTotalLoadedClassCountImpl(env, this_bean)
         - Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_getUnloadedClassCountImpl(env, this_bean));
@@ -52,7 +52,7 @@
 JNIEXPORT jlong JNICALL Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_getTotalLoadedClassCountImpl
 (JNIEnv * env, jobject)
 {
-    TRACE2("management", "ClassLoadingMXBeanImpl_getTotalLoadedClassCountImpl invocation");
+    TRACE("ClassLoadingMXBeanImpl_getTotalLoadedClassCountImpl invocation");
     JavaVM * vm = NULL;
     env->GetJavaVM(&vm);
     return ((JavaVM_Internal*)vm)->vm_env->total_loaded_class_count;
@@ -66,7 +66,7 @@
 JNIEXPORT jlong JNICALL Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_getUnloadedClassCountImpl
 (JNIEnv * env, jobject)
 {
-    TRACE2("management", "ClassLoadingMXBeanImpl_getUnloadedClassCountImpl invocation");
+    TRACE("ClassLoadingMXBeanImpl_getUnloadedClassCountImpl invocation");
     JavaVM * vm = NULL;
     env->GetJavaVM(&vm);
     return ((JavaVM_Internal*)vm)->vm_env->unloaded_class_count;
@@ -80,10 +80,8 @@
 JNIEXPORT jboolean JNICALL Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_isVerboseImpl
 (JNIEnv * env, jobject)
 {
-    TRACE2("management", "ClassLoadingMXBeanImpl_isVerboseImpl invocation");
-    JavaVM * vm = NULL;
-    env->GetJavaVM(&vm);
-    return ((JavaVM_Internal*)vm)->vm_env->class_loading_verbose;
+    TRACE("ClassLoadingMXBeanImpl_isVerboseImpl invocation");
+    return log_is_info_enabled(LOG_CLASS_INFO);
 }
 
 /*
@@ -92,18 +90,13 @@
  * Signature: (Z)V
  */
 JNIEXPORT void JNICALL Java_org_apache_harmony_lang_management_ClassLoadingMXBeanImpl_setVerboseImpl
-(JNIEnv * env, jobject, jboolean new_value)
+(JNIEnv * env, jobject, jboolean value)
 {
-    TRACE2("management", "ClassLoadingMXBeanImpl_setVerboseImpl invocation");
-    JavaVM * vm = NULL;
-    env->GetJavaVM(&vm);
-    if (((JavaVM_Internal*)vm)->vm_env->class_loading_verbose != new_value) {
-        if (new_value) {
-            set_threshold(util::CLASS_LOGGER, INFO);
-        } else {
-            set_threshold(util::CLASS_LOGGER, WARN);
-        }
-        ((JavaVM_Internal*)vm)->vm_env->class_loading_verbose = new_value;
+    TRACE("ClassLoadingMXBeanImpl_setVerboseImpl invocation");
+    if (value) {
+        log_enable_info_category(LOG_CLASS_INFO, 0);
+    } else {
+        log_disable_info_category(LOG_CLASS_INFO, 0);
     }
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp Fri Apr 18 00:26:23 2008
@@ -417,9 +417,8 @@
         }
     }
 
-    ASSERT(size >= skip, "Trying to skip " << skip 
-        << " frames but there are only "
-        << size << " frames in stack");
+    ASSERT(size >= skip, ("Trying to skip %u frames but there are only %u frames in stack",
+        skip, size));
     
     assert(hythread_is_suspend_enabled());
     jclass ste = struct_Class_to_java_lang_Class_Handle(genv->java_lang_StackTraceElement_Class);



Mime
View raw message