Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 10649 invoked from network); 18 Apr 2008 07:28:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Apr 2008 07:28:24 -0000 Received: (qmail 89170 invoked by uid 500); 18 Apr 2008 07:28:25 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 89070 invoked by uid 500); 18 Apr 2008 07:28:25 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 89057 invoked by uid 99); 18 Apr 2008 07:28:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 00:28:25 -0700 X-ASF-Spam-Status: No, hits=-1999.3 required=10.0 tests=ALL_TRUSTED,FRT_LEVITRA X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Apr 2008 07:27:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 56DA51A983A; Fri, 18 Apr 2008 00:27:56 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r649391 [2/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 -0000 To: commits@harmony.apache.org From: varlax@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080418072756.56DA51A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h (original) +++ harmony/enhanced/drlvm/trunk/vm/port/include/logparams.h Fri Apr 18 00:26:23 2008 @@ -18,11 +18,13 @@ * @author Dmitry B. Yershov */ -#ifndef LOG_PARAMS_H -#define LOG_PARAMS_H +#ifndef _LOG_PARAMS_H +#define _LOG_PARAMS_H #include #include +#include +#include "open/platform_types.h" #include "port_malloc.h" using std::string; @@ -34,13 +36,13 @@ const char* def_messageId; const char* messageId; string result_string; - int prefix, message_number, is_def_messageId_set; + int prefix, message_number; public: LogParams(int pref, int mess_num) { prefix = pref; message_number = mess_num; - is_def_messageId_set = 0; + def_messageId = NULL; messageId = NULL; } @@ -51,38 +53,11 @@ VMEXPORT const char* release(); LogParams& operator<<(const char* message) { - if (!is_def_messageId_set) { + if (!def_messageId) { 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; + values.push_back(string(message)); } - } - - 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; } @@ -96,16 +71,6 @@ 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)); @@ -199,5 +164,5 @@ } }; -#endif //LOG_PARAMS_H +#endif /* _LOG_PARAMS_H */ Modified: harmony/enhanced/drlvm/trunk/vm/port/include/tl/memory_pool.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/tl/memory_pool.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/include/tl/memory_pool.h (original) +++ harmony/enhanced/drlvm/trunk/vm/port/include/tl/memory_pool.h Fri Apr 18 00:26:23 2008 @@ -14,27 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * @author Evgueni Brevnov - * @version $Revision: 1.1.2.1.4.4 $ - */ - #ifndef TL_MEMORY_POOL_H #define TL_MEMORY_POOL_H -#include -#include #include #include "open/types.h" -#include "log_macro.h" +#include "clog.h" namespace tl { class VMEXPORT MemoryPool { private: // denied functions - MemoryPool(const MemoryPool&) {ABORT("Not implemented");} - MemoryPool& operator=(const MemoryPool&) {ABORT("Not implemented"); return *this;} + MemoryPool(const MemoryPool&) {DIE(("Not implemented"));} + MemoryPool& operator=(const MemoryPool&) {DIE(("Not implemented")); return *this;} protected: apr_pool_t* pool; public: @@ -48,8 +41,8 @@ class VMEXPORT MemoryPoolMT { private: // denied functions - MemoryPoolMT(const MemoryPoolMT&) {ABORT("Not implemented");} - MemoryPoolMT& operator=(const MemoryPoolMT&) {ABORT("Not implemented"); return *this;} + MemoryPoolMT(const MemoryPoolMT&) {DIE(("Not implemented"));} + MemoryPoolMT& operator=(const MemoryPoolMT&) {DIE(("Not implemented")); return *this;} MemoryPool unsync_pool; apr_thread_mutex_t *mutex; 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/port/src/logger/logger.cpp Fri Apr 18 00:26:23 2008 @@ -14,364 +14,416 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** -* @author Alexey V. Varlamov, Dmitry B. Yershov -* @version $Revision: 1.1.2.1.4.3 $ -*/ - -// disable warning #4250 over /WX option in appach native interface for MS compiler -#if defined(_MSC_VER) && !defined (__INTEL_COMPILER) /* Microsoft C Compiler ONLY */ -#pragma warning( push ) -#pragma warning (disable:4250) //Two or more members have the same name. The one in class2 is inherited because it is a base class for the other classes that contained this member. -#endif - -#include -#include "port_malloc.h" -#include "logger.h" -#include "logparams.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include "logger.h" +#include "port_atomic.h" #include "hyport.h" -#if defined(_MSC_VER) && !defined (__INTEL_COMPILER) -#pragma warning( pop ) -#endif +/** + * A hook for int vfprintf(va_list) function. + */ +typedef int (*VfprintfHook)(FILE *fp, const char *format, va_list args); + +/** + * A hook for void exit(int) function. + */ +typedef void (*ExitHook)(int code); + +/** + * A hook for void abort() function. + */ +typedef void (*AbortHook)(); + +struct LogCategory { + const char* name; + int len; + LogState enabled; + struct LogCategory* next; +}; + +/** + * Keeps a logger instance. + */ +struct Logger { + /** + * Serves as a primary source for a dynamic memory allocation. + */ + apr_pool_t* pool; + + /** + * A pointer to vfprintf implementation. This pointer may be received via + * JNI_CreateJavaVM arguments and is used as a base for all VM + * logging. A static pointer is used when a logger instance cannot be + * accessed. + */ + VfprintfHook p_vfprintf; + + /** + * A pointer to exit implementation. This pointer may be received via + * JNI_CreateJavaVM arguments and is used for VM graceful termination. + */ + ExitHook p_exit; + + /** + * A pointer to abort implementation. This pointer may be received via + * JNI_CreateJavaVM arguments and is used for abnormal VM termination. + */ + AbortHook p_abort; + + /** + * A file to write log, stdout by default. + */ + FILE* out; + + /** + * A reference to localization library. + */ + struct HyPortLibrary* portlib; + + /** + * Format mask. + */ + LogFormat format; + + /** + * A head of a list of enabled info domains. + */ + struct LogCategory* info; + + /** + * A head of a list of enabled trace domains. + */ + struct LogCategory* trace; + + /** + * A head of a list of encountered log sites. + */ + struct LogSite* log_site; +} light_logger = { + NULL, &vfprintf, &exit, &abort, stdout, NULL, LOG_EMPTY, NULL, NULL, NULL }; + +Logger default_logger = { + NULL, &vfprintf, &exit, &abort, stdout, NULL, LOG_EMPTY, NULL, NULL, NULL }; + +static Logger* get() +{ + return &default_logger; +} + +/** + * Clears cached sites. If more sites are added in process from + * other threads, they won't be cleared. + */ +static void clear_cached_sites() +{ + LogSite *site = get()->log_site; + while(site) { + site->state = LOG_UNKNOWN; + site = site->next; + } +} -#ifdef PLATFORM_NT -#define vsnprintf _vsnprintf -#endif +static int add_category(const char* category, LogCategory** p_log_category_head, + int copy, LogState enabled) +{ + Logger* logger = get(); + if (!logger->pool) { + return 0; + } + LogCategory* log_category = *p_log_category_head; + while (log_category) { + if (strcmp(log_category->name, category) == 0) { + if (log_category->enabled == enabled) { + return 0; + } + log_category->enabled = enabled; + clear_cached_sites(); + return 1; + } + log_category = log_category->next; + } -using namespace log4cxx; -using std::string; + log_category = (LogCategory*) apr_palloc(logger->pool, sizeof(LogCategory)); + if (!log_category) { + return 0; + } -static LevelPtr trace_levelPtr; -static LoggingLevel max_level = INFO; + log_category->len = (int) strlen(category); + log_category->enabled = enabled; + if (copy) { + char* name = (char*) apr_palloc(logger->pool, log_category->len + 1); + if (!name) { + return 0; + } + strncpy(name, category, log_category->len + 1); + log_category->name = name; + } else { + log_category->name = category; + } -static LogSite unusedLogSite = {UNKNOWN, 0}; -static LogSite *lastLogSite = &unusedLogSite; + LogCategory* old_value = *p_log_category_head; + do { + log_category->next = (LogCategory*) old_value; + old_value = (LogCategory*) port_atomic_casptr( + (volatile void **) p_log_category_head, log_category, + log_category->next); + } while (old_value != log_category->next); -static void clear_cached_sites() { - //FIXME thread unsafe - LogSite *site = lastLogSite; - while(site != &unusedLogSite) { - site->state = UNKNOWN; - site = site->next; - } + clear_cached_sites(); + return 1; } -void* portlib_for_logger = NULL; +int log_enable_info_category(const char* category, int copy) +{ + return add_category(category, &get()->info, copy, LOG_ENABLED); +} -const char* LogParams::release() { +int log_enable_trace_category(const char* category, int copy) +{ + return add_category(category, &get()->trace, copy, LOG_ENABLED); +} - 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(); +int log_disable_info_category(const char* category, int copy) +{ + return add_category(category, &get()->info, copy, LOG_DISABLED); } -static LevelPtr get_log4cxx_level(LoggingLevel level) { - switch(level) { - case DIE: - return Level::getFatal(); - case WARN: - return Level::getWarn(); - case INFO: - return Level::getInfo(); - case LOG: - return Level::getDebug(); - case TRACE: - return trace_levelPtr; - default: - return Level::getWarn(); +int log_disable_trace_category(const char* category, int copy) +{ + return add_category(category, &get()->trace, copy, LOG_DISABLED); +} + +void log_init(apr_pool_t* parent_pool) +{ + apr_pool_t *pool; + apr_status_t status = apr_pool_create(&pool, parent_pool); + if (APR_SUCCESS != status) { + return; } + + Logger* logger = get(); + *logger = light_logger; + logger->pool = pool; + + log_enable_info_category(LOG_INFO, 0); } -static LoggerPtr get_logger(const char* category) { - if (strcmp(category, "root") == 0) { - return Logger::getRootLogger(); - } else { - return Logger::getLogger(category); +static void log_close() +{ + Logger* logger = (Logger*) get(); + if (stdout != logger->out) { + fclose(logger->out); + logger->out = stdout; } } -int set_locale(char* logger_locale) { +void log_shutdown() +{ + Logger* logger = (Logger*) get(); + apr_pool_t* pool = logger->pool; + log_close(); + *logger = light_logger; + clear_cached_sites(); + apr_pool_destroy(pool); +} + +/** + * Parses locale. + */ +static int set_locale(const char* logger_locale) +{ + HyPortLibrary* portlib = get()->portlib; + assert(portlib); + 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; - } - } + if (NULL == lang) { + return 0; // out of C heap } - free((void*)lang); - return 0; -} + char* region = ""; + char* variant = ""; -void init_log_system(void *portlib) { - int set_locale_success = 0; - trace_levelPtr = new Level(Level::TRACE_INT, LOG4CXX_STR("TRACE"), 7); + char* pos = strchr(lang, '_'); + if (pos == NULL) { + goto set; + } + region = pos; + region[0] = 0; + region++; + + pos = strchr(region, '.'); + if (pos == NULL) { + goto set; + } + variant = pos; + variant[0] = 0; + variant++; - LoggerPtr logger = Logger::getRootLogger(); - ConsoleAppenderPtr cap = new ConsoleAppender(new PatternLayout(LOG4CXX_STR("%m%n")),LOG4CXX_STR("System.err")); - logger->addAppender(cap); - logger->setLevel(Level::getWarn()); +set: + portlib->nls_set_locale(portlib, lang, region, variant); + free((void*)lang); + return 1; +} - LoggerPtr info_logger = get_logger("info"); - info_logger->setLevel(Level::getInfo()); +void log_set_portlib(HyPortLibrary *portlib) +{ + Logger* logger = get(); - portlib_for_logger = portlib; + logger->portlib = portlib; + if (!portlib) { + return; + } - apr_pool_t *pool; - apr_pool_create(&pool, 0); + apr_pool_t* tmp_pool; + apr_status_t status = apr_pool_create(&tmp_pool, logger->pool); + if (APR_SUCCESS != status) { + return; + } 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; - } - } + if (APR_SUCCESS == apr_env_get(&value, "LC_ALL", tmp_pool)) { + set_locale(value); + } else if (APR_SUCCESS == apr_env_get(&value, "LC_MESSAGES", tmp_pool)) { + set_locale(value); + } else if (APR_SUCCESS == apr_env_get(&value, "LANG", tmp_pool)) { + set_locale(value); } - apr_pool_destroy(pool); + apr_pool_destroy(tmp_pool); +} +HyPortLibrary* log_get_portlib() { + return get()->portlib; } -void shutdown_log_system() { - LogManager::shutdown(); +void log_set_vfprintf(void* p_vfprintf) +{ + get()->p_vfprintf = (VfprintfHook) p_vfprintf; } -void set_logging_level_from_file(const char* filename) { - string lfilename; - lfilename += filename; - try { - PropertyConfigurator::configure(lfilename); - } catch (...) { - LoggerPtr logger = get_logger("logger"); - logger->log(get_log4cxx_level(WARN), "Couldn't initialize logging levels from file", - spi::LocationInfo::LocationInfo(__FILE__, __LOG4CXX_FUNC__, __LINE__)); - } - max_level = TRACE; // Not easy to obtain actual value - clear_cached_sites(); +void log_set_exit(void* p_exit) +{ + get()->p_exit = (ExitHook) p_exit; } -void log4cxx_from_c(const char *category, LoggingLevel level, const char* message, - const char* file=0, const char* func = 0, int line=0) { - LoggerPtr logger = get_logger(category); - if (file == 0 || func == 0 || line == 0){ - logger->log(get_log4cxx_level(level), message, spi::LocationInfo::getLocationUnavailable()); - } else { - logger->log(get_log4cxx_level(level), message, spi::LocationInfo::LocationInfo(file, func, line)); - } +void log_set_abort(void* p_abort) +{ + get()->p_abort = (AbortHook) p_abort; } -void set_threshold(const char *category, LoggingLevel level) { - LoggerPtr logger = get_logger(category); - logger->setLevel(get_log4cxx_level(level)); - if (max_level < level) { - max_level = level; - } - clear_cached_sites(); +void log_set_header_format(LogFormat format) +{ + get()->format = format; } -unsigned is_enabled(const char *category, LoggingLevel level) { - LoggerPtr logger = get_logger(category); - return logger->isEnabledFor(get_log4cxx_level(level)); -} - -unsigned is_warn_enabled(const char *category) { - return (Logger::getLogger(category))->isEnabledFor(Level::getWarn()); -} -unsigned is_info_enabled(const char *category) { - return (Logger::getLogger(category))->isEnabledFor(Level::getInfo()); -} -unsigned is_log_enabled(const char *category, LogSite *logSite) { - if(!logSite->next) { - //FIXME thread unsafe - logSite->next = lastLogSite; - lastLogSite = logSite; - } - // return cached value - if (logSite->state != UNKNOWN) { - return (DISABLED != logSite->state); - } - // no cache, calculate - bool res = (max_level >= LOG) && Logger::getLogger(category)->isEnabledFor(Level::getDebug()); - logSite->state = res ? ENABLED : DISABLED; - return res; -} - -unsigned is_trace_enabled(const char *category, LogSite *logSite) { - if(!logSite->next) { - //FIXME thread unsafe - logSite->next = lastLogSite; - lastLogSite = logSite; - } - // return cached value - if (logSite->state != UNKNOWN) { - return (DISABLED != logSite->state); - } - // no cache, calculate - bool res = (max_level >= TRACE) && Logger::getLogger(category)->isEnabledFor(trace_levelPtr); - logSite->state = res ? ENABLED : DISABLED; - return res; -} - -inline static AppenderList getEffectiveAppenders(LoggerPtr logger) { - AppenderList alist; - while (logger && (alist = logger->getAllAppenders()).size() == 0 && logger->getAdditivity()) { - logger = logger->getParent(); - } - return alist; -} -void set_out(const char *category, const char* out) { - LoggerPtr logger = get_logger(category); - if (out) { - LogString lout; - helpers::Transcoder::decode(out, strlen(out), lout); - AppenderList alist = getEffectiveAppenders(logger); - LayoutPtr layout; - if (alist.size() != 0) { - layout = alist[0]->getLayout(); - } else { - layout = new PatternLayout(LOG4CXX_STR("%m%n")); - } - logger->removeAllAppenders(); - AppenderPtr fileap = new FileAppender(layout, lout, false); - logger->setAdditivity(false); - logger->addAppender(fileap); - } else { - logger->removeAllAppenders(); - logger->setAdditivity(true); - } +void log_set_out(FILE* file) +{ + log_close(); + get()->out = file; } -void set_header_format(const char *category, HeaderFormat format) { - bool header_not_empty = false; - LogString str_format; - LoggerPtr logger = get_logger(category); +APR_DECLARE(void) log_exit(int code) +{ + log_shutdown(); + get()->p_exit(code); +} - if (format & HEADER_LEVEL) { - str_format.append(LOG4CXX_STR("%-5p ")); - header_not_empty = true; - } - if (format & HEADER_THREAD_ID) { - str_format.append(LOG4CXX_STR("[%t] ")); - header_not_empty = true; - } - if (format & HEADER_TIMESTAMP) { - str_format.append(LOG4CXX_STR("[%d] ")); - header_not_empty = true; - } - if (format & HEADER_CATEGORY) { - str_format.append(LOG4CXX_STR("%c ")); - header_not_empty = true; - } - if (format & (HEADER_FILELINE | HEADER_FUNCTION)) { - str_format.append(LOG4CXX_STR("(")); - if (format & HEADER_FUNCTION) { - str_format.append(LOG4CXX_STR("%C::%M()")); - } - if (format & HEADER_FUNCTION && format & HEADER_FILELINE) { - str_format.append(LOG4CXX_STR(" at ")); - } - if (format & HEADER_FILELINE) { - str_format.append(LOG4CXX_STR("%F:%L")); - } - str_format.append(LOG4CXX_STR(") ")); - header_not_empty = true; - } +APR_DECLARE(void) log_abort() +{ + log_shutdown(); + assert(0); + get()->p_abort(); +} - if (header_not_empty) { - str_format.append(LOG4CXX_STR(": ")); - } +APR_DECLARE(int) log_printf(const char* format, ...) +{ + va_list args; + int ret; - str_format.append(LOG4CXX_STR("%m%n")); + va_start(args, format); + ret = get()->p_vfprintf(get()->out, format, args); + va_end(args); + fflush(get()->out); + return ret; +} - AppenderList alist = getEffectiveAppenders(logger); - AppenderList::iterator appender; - for (appender = alist.begin(); appender != alist.end(); appender++) - { - (*appender)->setLayout(new PatternLayout(str_format)); +APR_DECLARE(void) log_header(const char* category, const char* file_line, const char* function_name) +{ + LogFormat format = get()->format; + if (format & LOG_THREAD_ID) { + log_printf("[%p] ", apr_os_thread_current()); + } + if (format & LOG_TIMESTAMP) { + log_printf("[%umus] ", (unsigned) clock()); + } + if (format & LOG_CATEGORY && strcmp(category, LOG_INFO)) { + log_printf("[%s] ", category); + } + if (format & LOG_FUNCTION) { + log_printf("%s:", file_line); + } + if (format & LOG_FILELINE) { + log_printf("%s:", function_name); + } + fflush(get()->out); +} + +/** + * Checks if the warnings are enabled. + */ +APR_DECLARE(LogState) log_is_warn_enabled() +{ + return (get()->format & LOG_WARN) ? LOG_ENABLED : LOG_DISABLED; +} + +/** + * Finds the best matching category in the category list. + * @return if the category is enabled + */ +static LogState is_enabled(const char *category, LogCategory *log_category) { + int max_size = -1; + LogState enabled = LOG_DISABLED; + while (log_category) { + if (strncmp(log_category->name, category, log_category->len) == 0) { + if (log_category->len > max_size) { + max_size = log_category->len; + enabled = log_category->enabled; + } + } + log_category = log_category->next; } + return enabled; } -void set_thread_specific_out(const char* category, const char* pattern) { - return; +APR_DECLARE(LogState) log_is_info_enabled(const char *category) +{ + return is_enabled(category, get()->info); } -VMEXPORT const char* log_printf(const char* format, ...){ - va_list args; - va_start(args, format); - int length = 255; - char *message = (char*)STD_MALLOC(sizeof(char)*length); - while(1){ - int count = vsnprintf(message, length, format, args); - if(count > -1 && count < length) - break; - length *= 2; - message = (char*)STD_REALLOC(message, sizeof(char)*length); +APR_DECLARE(LogState) log_is_trace_enabled(const char *category) +{ + return is_enabled(category, get()->trace); +} + +/** + * Adds a site to the site list. + */ +static void add_site(LogSite* log_site) { + LogSite** p_site_head = (LogSite**) &get()->log_site; + LogSite* old_value = *p_site_head; + do { + log_site->next = (LogSite*) old_value; + old_value = (LogSite*) port_atomic_casptr( + (volatile void **) p_site_head, log_site, log_site->next); + } while (old_value != log_site->next); +} + +APR_DECLARE(LogState) log_cache(LogState enabled, struct LogSite* p_log_site) +{ + if(!p_log_site->next) { + add_site(p_log_site); } - va_end(args); - return message; + p_log_site->state = enabled ? LOG_ENABLED : LOG_DISABLED; + return enabled; } + Added: harmony/enhanced/drlvm/trunk/vm/port/src/logger/logparams.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/logger/logparams.cpp?rev=649391&view=auto ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/src/logger/logparams.cpp (added) +++ harmony/enhanced/drlvm/trunk/vm/port/src/logger/logparams.cpp Fri Apr 18 00:26:23 2008 @@ -0,0 +1,50 @@ +/* + * 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. + */ +#include "logparams.h" +#include "logger.h" +#include "hyport.h" + +const char* LogParams::release() { + HyPortLibrary *portlib = log_get_portlib(); + if (portlib) { + messageId = (char*) portlib->nls_lookup_message(portlib, + HYNLS_DO_NOT_PRINT_MESSAGE_TAG | HYNLS_DO_NOT_APPEND_NEWLINE, + prefix, message_number, def_messageId); + messageId = portlib->buf_write_text(portlib, + (const char *)messageId, (IDATA) strlen(messageId)); + } else { + messageId = def_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) { + portlib->mem_free_memory(portlib, (void*)messageId); + } + return (const char*)result_string.c_str(); +} + Propchange: harmony/enhanced/drlvm/trunk/vm/port/src/logger/logparams.cpp ------------------------------------------------------------------------------ svn:eol-style = native Modified: harmony/enhanced/drlvm/trunk/vm/port/src/malloc/port_malloc_registrar.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/malloc/port_malloc_registrar.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/src/malloc/port_malloc_registrar.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/port/src/malloc/port_malloc_registrar.cpp Fri Apr 18 00:26:23 2008 @@ -27,7 +27,6 @@ #endif #include "port_malloc_registrar.h" -#include "log_macro.h" #include "port_malloc.h" #ifdef _MEMMGR Modified: harmony/enhanced/drlvm/trunk/vm/port/src/misc/win/timer.c URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/misc/win/timer.c?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/src/misc/win/timer.c (original) +++ harmony/enhanced/drlvm/trunk/vm/port/src/misc/win/timer.c Fri Apr 18 00:26:23 2008 @@ -35,7 +35,7 @@ if (QueryPerformanceFrequency(&frequency)) { return TRUE; } else { - TRACE(("QueryPerformanceFrequency failed: %u", GetLastError())); + CTRACE(("QueryPerformanceFrequency failed: %u", GetLastError())); return FALSE; } } @@ -52,7 +52,7 @@ if (QueryPerformanceCounter(&count)) { return (apr_nanotimer_t)((double)count.QuadPart / frequency.QuadPart * 1E9); } else { - TRACE(("QueryPerformanceCounter failed: %u", GetLastError())); + CTRACE(("QueryPerformanceCounter failed: %u", GetLastError())); } } return (apr_nanotimer_t)(GetTickCount() * 1E6); Modified: harmony/enhanced/drlvm/trunk/vm/port/src/tl/memory_pool.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/tl/memory_pool.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/src/tl/memory_pool.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/port/src/tl/memory_pool.cpp Fri Apr 18 00:26:23 2008 @@ -14,25 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * @author Evgueni Brevnov - * @version $Revision: 1.1.2.1.4.4 $ - */ -#include "tl/memory_pool.h" - #define LOG_DOMAIN "tl.memory" -#include "cxxlog.h" +#include "tl/memory_pool.h" tl::MemoryPool::MemoryPool() { - apr_status_t status = apr_pool_create(&pool, NULL); - VERIFY(APR_SUCCESS == status, "Cannot create a memory pool"); + VERIFY_SUCCESS(apr_pool_create(&pool, NULL)); } tl::MemoryPool::MemoryPool(const MemoryPool * parent) { - apr_status_t status = apr_pool_create(&pool, parent->pool); - VERIFY(APR_SUCCESS == status, "Cannot create a memory pool"); + VERIFY_SUCCESS(apr_pool_create(&pool, parent->pool)); } tl::MemoryPool::~MemoryPool() @@ -52,27 +44,23 @@ tl::MemoryPoolMT::MemoryPoolMT() { - apr_status_t status = unsync_pool.create_mutex(&mutex, APR_THREAD_MUTEX_UNNESTED); - VERIFY(APR_SUCCESS == status, "Cannot create a pool lock"); + VERIFY_SUCCESS(unsync_pool.create_mutex(&mutex, APR_THREAD_MUTEX_UNNESTED)); } tl::MemoryPoolMT::MemoryPoolMT(const MemoryPoolMT * parent) : unsync_pool(&parent->unsync_pool) { - apr_status_t status = unsync_pool.create_mutex(&mutex, APR_THREAD_MUTEX_UNNESTED); - VERIFY(APR_SUCCESS == status, "Cannot create a pool lock"); + VERIFY_SUCCESS(unsync_pool.create_mutex(&mutex, APR_THREAD_MUTEX_UNNESTED)); } tl::MemoryPoolMT::MemoryPoolMT(const MemoryPool * parent) : unsync_pool(parent) { - apr_status_t status = unsync_pool.create_mutex(&mutex, APR_THREAD_MUTEX_UNNESTED); - VERIFY(APR_SUCCESS == status, "Cannot create a pool lock"); + VERIFY_SUCCESS(unsync_pool.create_mutex(&mutex, APR_THREAD_MUTEX_UNNESTED)); } tl::MemoryPoolMT::~MemoryPoolMT() { - apr_status_t status = apr_thread_mutex_destroy(mutex); - VERIFY(APR_SUCCESS == status, "Cannot destroy a pool lock"); + VERIFY_SUCCESS(apr_thread_mutex_destroy(mutex)); } void * tl::MemoryPoolMT::alloc(size_t size) Modified: harmony/enhanced/drlvm/trunk/vm/port/src/vmem/win/port_vmem.c URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/vmem/win/port_vmem.c?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/port/src/vmem/win/port_vmem.c (original) +++ harmony/enhanced/drlvm/trunk/vm/port/src/vmem/win/port_vmem.c Fri Apr 18 00:26:23 2008 @@ -16,15 +16,13 @@ */ /** * @author Alexey V. Varlamov - * @version $Revision: 1.1.2.1.4.4 $ */ - -#include "port_vmem.h" - -#undef LOG_DOMAIN #define LOG_DOMAIN "port.vmem" #include "clog.h" +#include "port_vmem.h" +#include "open/platform_types.h" + #include #include @@ -58,7 +56,7 @@ NULL, // lookup privilege on local system lpszPrivilege, // privilege to lookup &luid ) ) { // receives LUID of privilege - TRACE(("LookupPrivilegeValue error: %u", GetLastError())); + CTRACE(("LookupPrivilegeValue error: %u", GetLastError())); return FALSE; } @@ -82,7 +80,7 @@ // Call GetLastError to determine whether the function succeeded. if (GetLastError() != ERROR_SUCCESS) { - TRACE(("AdjustTokenPrivileges failed: %u", GetLastError())); + CTRACE(("AdjustTokenPrivileges failed: %u", GetLastError())); return FALSE; } @@ -101,7 +99,7 @@ if (!(OpenProcessToken (GetCurrentProcess (), TOKEN_ALL_ACCESS, &accessToken) && SetPrivilege (accessToken, "SeLockMemoryPrivilege", TRUE))) { - TRACE(("Lock Page Privilege was not set.")); + CTRACE(("Lock Page Privilege was not set.")); return 0; } @@ -109,7 +107,7 @@ m_GetLargePageMinimum = (PGetLargePageMinimum) GetProcAddress(h, "GetLargePageMinimum"); if (!m_GetLargePageMinimum) { - TRACE(("Cannot locate GetLargePageMinimum.")); + CTRACE(("Cannot locate GetLargePageMinimum.")); return 0; } return m_GetLargePageMinimum(); Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/build/vmcore.exp Fri Apr 18 00:26:23 2008 @@ -130,14 +130,16 @@ get_thread_ptr; vm_get_interface; initialize_arg_list_iterator; - init_log_system; - is_enabled; - is_info_enabled; + log_exit; + log_abort; + log_printf; + log_header; + log_is_warn_enabled; + log_is_info_enabled; + log_is_trace_enabled; + log_cache; is_it_finalize_thread; - is_log_enabled; vm_property_is_set; - is_trace_enabled; - is_warn_enabled; Java_java_lang_ClassLoader_defineClass0; Java_java_lang_ClassLoader_findLoadedClass; Java_java_lang_ClassLoader_registerInitiatedClass; @@ -467,7 +469,6 @@ jvmti_send_thread_start_end_event; jvmti_send_waited_monitor_event; jvmti_send_wait_monitor_event; - log4cxx_from_c; method_allocate_code_block; method_allocate_data_block; method_allocate_info_block; @@ -532,15 +533,9 @@ resolve_static_field; resolve_static_method; resolve_virtual_method; - set_header_format; - set_logging_level_from_file; set_native_finalizer_thread_flag; set_native_ref_enqueue_thread_flag; - set_out; vm_properties_set_value; - set_thread_specific_out; - set_threshold; - shutdown_log_system; st_alloc_frames; type_info_create_from_java_descriptor; type_info_get_class; Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/classloader.h Fri Apr 18 00:26:23 2008 @@ -31,12 +31,13 @@ #include "open/vm.h" #include "lock_manager.h" #include "environment.h" -#include "exceptions.h" #include "natives_support.h" #include "hashtable.h" #include "loggerstring.h" #include "jarfile_support.h" #include "type.h" +#include "exceptions.h" +#include "vm_log.h" class ClassTable : public MapEx {}; @@ -294,13 +295,12 @@ void FieldClearInternals(Class*); // clean Field internals in Class }; // class ClassLoader -inline LoggerString& operator << (LoggerString& log, ClassLoader::LoadingClass& lc) +inline LoggerString& operator <<(LoggerString& log, ClassLoader::LoadingClass& lc) { - log #ifdef _DEBUG - << lc.m_name->bytes + log_printf("%s", lc.m_name->bytes); #endif - << " thread: " << lc.m_defineOwner << " " << lc.m_initiatingThread; + log_printf(" thread: %p %p", lc.m_defineOwner, lc.m_initiatingThread); return log; } Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h Fri Apr 18 00:26:23 2008 @@ -311,11 +311,6 @@ unsigned unloaded_class_count; /** - * Total unloaded class count - */ - jboolean class_loading_verbose; - - /** * The initial amount of Java heap memory (bytes) */ size_t init_gc_used_memory; Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h Fri Apr 18 00:26:23 2008 @@ -23,7 +23,7 @@ #define __HASHTABLE_H__ #include -#include "log_macro.h" +#include "clog.h" #include // FIXME: we expect POINTER_SIZE_INT is already defined by some includes... @@ -145,7 +145,7 @@ // check that this hash table does not contain element for this key Elem* elem = Lookup(key); if(elem) { - ABORT("Element is inserted second time"); + DIE(("Element is inserted second time")); } } unsigned h = (*m_hashfunc)(key); @@ -203,7 +203,7 @@ } } // this table entry is empty; thus contains no data at all - ABORT("Trying to remove data which was not inserted before"); + DIE(("Trying to remove data which was not inserted before")); } unsigned GetItemCount() { return m_itemsnumber; } @@ -266,7 +266,7 @@ return &(pr.first->second); else { - ABORT( "Element was inserted second time in MapEx!"); + DIE(( "Element was inserted second time in MapEx!")); return NULL; // not reachable; to satisfy compiler warning } } 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h Fri Apr 18 00:26:23 2008 @@ -41,7 +41,7 @@ * Parses string pool size required for environment initialization. */ void parse_vm_arguments1(JavaVMInitArgs *vm_args, size_t *p_string_pool_size, - jboolean *p_is_class_data_shared, void **portlib); + jboolean *p_is_class_data_shared, apr_pool_t* pool); /** * Collects all arguments in VM properties. */ Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jni_direct.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jni_direct.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jni_direct.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jni_direct.h Fri Apr 18 00:26:23 2008 @@ -36,7 +36,7 @@ typedef struct JNIEnv_Internal JNIEnv_Internal; struct JavaVM_Internal : public JavaVM_External { - apr_pool_t * pool1; + apr_pool_t * pool; Global_Env * vm_env; APR_RING_ENTRY(JavaVM_Internal) link; void* reserved; Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_internal.h Fri Apr 18 00:26:23 2008 @@ -26,7 +26,7 @@ #include "jit_export_jpda.h" #include #include -#include "log_macro.h" +#include "clog.h" #include "lock_manager.h" #include "jvmti_dasm.h" @@ -134,7 +134,7 @@ return; } - ABORT("Can't find the element"); + DIE(("Can't find the element")); } }; @@ -284,7 +284,7 @@ return; } - ABORT("Can't find the watch"); + DIE(("Can't find the watch")); } void SetPendingNotifyLoadClass( Class *klass ); Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h Fri Apr 18 00:26:23 2008 @@ -26,7 +26,7 @@ #include #include "open/types.h" -#include "open/hythread_ext.h" +//#include "open/hythread_ext.h" #include "jni.h" #include "open/vm.h" #include "open/gc.h" @@ -332,6 +332,7 @@ #endif #endif // _OBJECT_LAYOUT_H_ + Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_log.h URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_log.h?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_log.h (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_log.h Fri Apr 18 00:26:23 2008 @@ -16,10 +16,9 @@ */ /** * @author Salikh Zakirov, Alexey V. Varlamov - * @version $Revision: 1.1.2.2.2.1.2.3 $ */ -#ifndef _VMCORE_LOG_H_ -#define _VMCORE_LOG_H_ +#ifndef _VMCORE_LOG_H +#define _VMCORE_LOG_H //#include "open/vm_log.h" #include "object_layout.h" @@ -28,6 +27,7 @@ #include "String_Pool.h" #include "class_member.h" #include "Class.h" +#include "open/hythread_ext.h" /** * @file @@ -100,4 +100,4 @@ return log; } -#endif // _VMCORE_LOG_H_ +#endif /* _VMCORE_LOG_H */ 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- 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 Fri Apr 18 00:26:23 2008 @@ -14,35 +14,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #define LOG_DOMAIN "vm.core" #include "cxxlog.h" #include "open/vm_properties.h" -#include "classloader.h" -#include "lock_manager.h" -#include "compile.h" -#include "vm_arrays.h" -#include "vm_strings.h" -#include "properties.h" -#include "vtable.h" - -#include "open/hythread_ext.h" -#include "port_mutex.h" -#include "thread_manager.h" -#include "cci.h" -#include "nogc.h" - -#include "Package.h" - #include "open/vm_type_access.h" #include "open/vm_field_access.h" #include "open/vm_method_access.h" -#include "open/vm_class_manipulation.h" #include "open/vm_class_loading.h" +#include "open/vm_class_manipulation.h" #include "open/vm_class_info.h" #include "open/vm_ee.h" -#include "jit_intf.h" + +#include "classloader.h" +#include "class_interface.h" +#include "Package.h" +#include "vtable.h" + +#include "vm_arrays.h" +#include "compile.h" +#include "port_mutex.h" +#include "cci.h" +#include "nogc.h" +#include "exceptions.h" BOOLEAN class_is_final(Class_Handle cl) { assert(cl); @@ -645,7 +639,7 @@ clss = NULL; // to allow star jit initialization break; default: - ABORT("Unknown vm data type"); // We need a better way to indicate an internal error + DIE(("Unknown vm data type")); // We need a better way to indicate an internal error } return clss; } // class_get_class_of_primitive_type @@ -726,7 +720,7 @@ case VM_DATA_TYPE_CLASS: return VM_DATA_TYPE_CLASS; default: - ABORT("Unknown vm data type"); + DIE(("Unknown vm data type")); } return VM_DATA_TYPE_INVALID; } // class_cp_get_field_type @@ -883,7 +877,7 @@ || const_pool.is_methodref(index) || const_pool.is_interfacemethodref(index))) { - ABORT("Wrong index"); + DIE(("Wrong index")); return 0; } index = const_pool.get_ref_name_and_type_index(index); @@ -899,7 +893,7 @@ || const_pool.is_methodref(index) || const_pool.is_interfacemethodref(index))) { - ABORT("Wrong index"); + DIE(("Wrong index")); return 0; } index = const_pool.get_ref_class_index(index); @@ -911,7 +905,7 @@ assert(cl); ConstantPool& const_pool = cl->get_constant_pool(); if (!const_pool.is_class(index)) { - ABORT("Wrong index"); + DIE(("Wrong index")); return 0; } return const_pool.get_utf8_chars(const_pool.get_class_name_index(index)); @@ -1142,7 +1136,7 @@ case VM_DATA_TYPE_INTPTR: case VM_DATA_TYPE_UINTPTR: default: - ABORT("Unexpected vm data type"); // We need a better way to indicate an internal error + DIE(("Unexpected vm data type")); // We need a better way to indicate an internal error break; } return clss; @@ -1435,7 +1429,7 @@ assert(msh); Method_Signature *ms = (Method_Signature *)msh; if(idx >= ms->num_args) { - ABORT("Wrong index"); + DIE(("Wrong index")); return 0; } assert(ms->arg_type_descs); @@ -1784,7 +1778,7 @@ VM_Global_State::loader_env->VmProperties()->set(key, value); break; default: - ASSERT(0, "Unknown property table: " << table_number); + DIE(("Unknown property table: %d", table_number)); } } @@ -1801,7 +1795,7 @@ break; default: value = NULL; - ASSERT(0, "Unknown property table: " << table_number); + DIE(("Unknown property table: %d", table_number)); } return value; } @@ -1827,7 +1821,7 @@ value = VM_Global_State::loader_env->VmProperties()->is_set(key); break; default: - ASSERT(0, "Unknown property table: " << table_number); + DIE(("Unknown property table: %d", table_number)); } return value ? TRUE : FALSE; } @@ -1844,7 +1838,7 @@ break; default: value = NULL; - ASSERT(0, "Unknown property table: " << table_number); + DIE(("Unknown property table: %d", table_number)); } return value; } @@ -1862,7 +1856,7 @@ break; default: value = NULL; - ASSERT(0, "Unknown property table: " << table_number); + DIE(("Unknown property table: %d", table_number)); } return value; } @@ -1960,7 +1954,7 @@ } } } - LOG("No such annotation " << antn_type->get_name()->bytes); + TRACE("No such annotation " << antn_type->get_name()->bytes); return NULL; } 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- 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 Fri Apr 18 00:26:23 2008 @@ -16,14 +16,10 @@ * limitations under the License. */ -#define LOG_DOMAIN util::CLASS_LOGGER +#define LOG_DOMAIN LOG_CLASS_INFO #include "cxxlog.h" - - #include "port_filepath.h" -#include - #include "environment.h" #include "classloader.h" #include "Class.h" @@ -356,7 +352,7 @@ value.const_value.string = cp.get_utf8_string(const_idx); break; default: - DIE("Annotation parsing internal error"); + DIE(("Annotation parsing internal error")); } } break; 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp Fri Apr 18 00:26:23 2008 @@ -19,7 +19,7 @@ * @version $Revision: 1.1.2.3.4.4 $ */ -#define LOG_DOMAIN util::CLASS_LOGGER +#define LOG_DOMAIN LOG_CLASS_INFO #include "cxxlog.h" #include "open/vm_properties.h" @@ -47,7 +47,6 @@ string_pool(string_pool_size), total_loaded_class_count(0), unloaded_class_count(0), -class_loading_verbose(false), total_compilation_time(0), bootstrapping(false), ready_for_exceptions(false) @@ -285,7 +284,7 @@ if(clss == NULL) { // print error diagnostics and exit VM LWARN(4, "Failed to load bootstrap class {0}" << s->bytes); - LOGGER_EXIT(1); + log_exit(1); } return clss; } Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp Fri Apr 18 00:26:23 2008 @@ -20,7 +20,7 @@ */ -#define LOG_DOMAIN util::CLASS_LOGGER +#define LOG_DOMAIN LOG_CLASS_INFO #include "cxxlog.h" #include @@ -105,7 +105,7 @@ sz = 8; break; default: - ABORT("Invalid type descriptor"); + DIE(("Invalid type descriptor")); } return sz; @@ -150,7 +150,7 @@ assert(OBJECT_REF_SIZE == 4); break; default: - ABORT("Unexpected type descriptor"); + DIE(("Unexpected type descriptor")); return 0; } return sz; @@ -173,7 +173,7 @@ return false; if(p_class->is_array()) return true; - ABORT("Should never be called unless p_class is an array"); + DIE(("Should never be called unless p_class is an array")); return true; } @@ -465,7 +465,7 @@ STORE_GLOBAL_REFERENCE(field_addr, str); // ------------------------------------------------------------^^ } else { - ABORT("Unexpected type descriptor"); + DIE(("Unexpected type descriptor")); } break; } @@ -1396,7 +1396,7 @@ break; default: m_vtable->array_element_shift = 65535; - ASSERT(0, "Unexpected array element size: " << m_vtable->array_element_size); + DIE(("Unexpected array element size: %d", m_vtable->array_element_size)); break; } } @@ -1422,7 +1422,7 @@ if(m_alignment != GC_OBJECT_ALIGNMENT) { // The GC will align on 4 byte boundaries by default on IA32.... #ifdef POINTER64 - ASSERT(0, "Alignment is supposed to be appropriate"); + DIE(("Alignment is supposed to be appropriate")); #endif // Make sure it is a legal mask. assert((m_alignment & CL_PROP_ALIGNMENT_MASK) <= CL_PROP_ALIGNMENT_MASK); 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Resolve.cpp Fri Apr 18 00:26:23 2008 @@ -90,7 +90,7 @@ // a class (static) method. // -#define LOG_DOMAIN util::CLASS_LOGGER +#define LOG_DOMAIN LOG_CLASS_INFO #include "cxxlog.h" #include "Class.h" Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Fri Apr 18 00:26:23 2008 @@ -19,7 +19,7 @@ * @version $Revision: 1.1.2.11.2.1.2.6 $ */ -#define LOG_DOMAIN util::CLASS_LOGGER +#define LOG_DOMAIN LOG_CLASS_INFO #include "cxxlog.h" #include "vm_log.h" @@ -242,7 +242,7 @@ assert(!exn_raised()); const String *className; - LOG2("classloader.defineclass", "Defining class " << (NULL != class_name ? class_name : "NULL") << " with loader " << this); + TRACE2("classloader.defineclass", "Defining class " << (NULL != class_name ? class_name : "NULL") << " with loader " << this); if(class_name) { className = env->string_pool.lookup(class_name); } else { @@ -574,9 +574,8 @@ Class* c = it->second; if (*c->get_class_handle()) { - DIE("FAILED on unloading classloader: \n" << (void*)m_table[i] << - "live j.l.Class of unloaded class is detected: " << c->get_name()->bytes); - assert (false); + DIE(("FAILED on unloading classloader: \n%p live j.l.Class of unloaded class is detected: %s", + (void*)m_table[i], c->get_name()->bytes)); } } #endif @@ -711,7 +710,7 @@ void ClassLoader::FailedLoadingClass(const String* className) { - LOG2("classloader", "Failed loading class " << className << " with loader " << this); + TRACE2("classloader", "Failed loading class " << className << " with loader " << this); tmn_suspend_disable(); LMAutoUnlock aulock( &m_lock ); @@ -1845,7 +1844,7 @@ exn_raise_object(new_exn); } else { assert(exn_raised()); - LOG("Failed to translate ClassNotFoundException " + TRACE("Failed to translate ClassNotFoundException " "to NoClassDefFoundError for " << className->bytes); } } @@ -1940,10 +1939,7 @@ void BootstrapClassLoader::ReportAndExit(const char* exnclass, std::stringstream& exnmsg) { - std::stringstream ss; - ss << exnclass << " : " << exnmsg.str().c_str(); - WARN(ss.str().c_str()); - LOGGER_EXIT(1); + DIE(("%s : %s", exnclass, exnmsg.str().c_str())); } Class* BootstrapClassLoader::LoadFromFile(const String* class_name) Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/java_type.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/java_type.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/java_type.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/java_type.cpp Fri Apr 18 00:26:23 2008 @@ -20,7 +20,7 @@ */ -#define LOG_DOMAIN util::CLASS_LOGGER +#define LOG_DOMAIN LOG_CLASS_INFO #include "cxxlog.h" #include @@ -81,7 +81,7 @@ return et->type_desc_create_vector(); } default: - ABORT("Bad type descriptor"); + DIE(("Bad type descriptor")); return NULL; } } @@ -141,7 +141,7 @@ return clss; default: // All other types are not Java types, so fail - ABORT("Unexpected kind"); + DIE(("Unexpected kind")); return NULL; } } Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/method.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/method.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/method.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/method.cpp Fri Apr 18 00:26:23 2008 @@ -714,11 +714,11 @@ } break; default: - ABORT("Unexpected stack state"); + DIE(("Unexpected stack state")); return; } } - ABORT("Should not get here"); + DIE(("Should not get here")); } //Method::_set_nop Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type.cpp Fri Apr 18 00:26:23 2008 @@ -156,7 +156,7 @@ case VM_DATA_TYPE_CHAR: k = K_Char; break; case VM_DATA_TYPE_VOID: k = K_Void; break; default: - ABORT("Unexpected data type"); + DIE(("Unexpected data type")); } td = new TypeDesc(k, NULL, NULL, NULL, c->get_class_loader(), c); } else if (c->is_array()) { Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type_access.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type_access.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type_access.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/type_access.cpp Fri Apr 18 00:26:23 2008 @@ -59,7 +59,7 @@ case K_MethodPointer: case K_TypedRef: default: - ABORT("Invalid vm data type"); + DIE(("Invalid vm data type")); return VM_DATA_TYPE_INVALID; } } //type_info_get_type @@ -164,7 +164,7 @@ Method_Signature_Handle type_info_get_method_sig(Type_Info_Handle UNREF tih) { - ABORT("Not implemented"); + DIE(("Not implemented")); return 0; } //type_info_get_method_sig @@ -182,7 +182,7 @@ case K_UnmanagedPointer: return td->get_pointed_to_type(); default: - ABORT("Unexpected kind"); + DIE(("Unexpected kind")); return 0; } } //type_info_get_type_info @@ -215,16 +215,16 @@ BOOLEAN type_info_is_resolved(Type_Info_Handle tih) { TypeDesc* td = (TypeDesc*)tih; switch (td->get_kind()) { - case K_Vector: - if (td->get_element_type()->is_primitive()) { - return true; - } - return type_info_is_resolved(td->get_element_type()); - case K_Object: - return td->is_loaded(); - default: - ABORT("Unexpected kind"); - return 0; + case K_Vector: + if (td->get_element_type()->is_primitive()) { + return true; + } + return type_info_is_resolved(td->get_element_type()); + case K_Object: + return td->is_loaded(); + default: + DIE(("Unexpected kind")); + return 0; } } Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_impl.cpp Fri Apr 18 00:26:23 2008 @@ -318,7 +318,7 @@ tmn_suspend_disable(); } assert(!hythread_is_suspend_enabled()); - TRACE2("exn", ("%s", "exn_throw_object(), delegating to exn_throw_for_JIT()")); + CTRACE(("%s", "exn_throw_object(), delegating to exn_throw_for_JIT()")); exn_throw_for_JIT(exc_object->object, NULL, NULL, NULL, NULL); END_RAISE_AREA; } @@ -341,14 +341,14 @@ exc_class, args, exc_message, exc_cause); if (NULL == exc_init) { - TRACE2("exn", ("%s", + CTRACE(("%s", "exn_throw_by_class(),create exception and delegating to exn_throw_for_JIT()")); jthrowable exc_object = exn_create(exc_class, exc_message, exc_cause); exn_rethrow_if_pending(); //set_unwindable(true); exn_throw_object_internal(exc_object); } else { - TRACE2("exn", ("%s", "exn_throw_by_class(), lazy delegating to exn_throw_for_JIT()")); + CTRACE(("%s", "exn_throw_by_class(), lazy delegating to exn_throw_for_JIT()")); //set_unwindable(true); // no return, so enable isn't required @@ -387,7 +387,7 @@ void exn_raise_object_internal(jthrowable exc_object) { - TRACE2("exn", ("%s", "exn_raise_object(), propagating non-destructively")); + CTRACE(("%s", "exn_raise_object(), propagating non-destructively")); tmn_suspend_disable_recursive(); p_TLS_vmthread->thread_exception.exc_object = exc_object->object; @@ -398,7 +398,7 @@ jthrowable exc_cause) { #ifdef VM_LAZY_EXCEPTION - TRACE2("exn", ("%s", "exn_raise_object(), propagating lazy & non-destructively")); + CTRACE(("%s", "exn_raise_object(), propagating lazy & non-destructively")); tmn_suspend_disable_recursive(); p_TLS_vmthread->thread_exception.exc_class = exc_class; Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/exception/exceptions_jit.cpp Fri Apr 18 00:26:23 2008 @@ -374,7 +374,7 @@ jit, method, handler->get_handler_ip()); } - TRACE2("exn", ("setting return pointer to %d", exn_obj)); + CTRACE(("setting return pointer to %d", exn_obj)); si_set_return_pointer(si, (void **) exn_obj); //si_free(throw_si); @@ -782,7 +782,7 @@ static void rth_throw_lazy(Method * exn_constr) { #if defined(_IPF_) || defined(_EM64T_) - ABORT("Lazy exceptions are not supported on this platform"); + DIE(("Lazy exceptions are not supported on this platform")); #else uint8 *args = (uint8 *) (m2n_get_args(m2n_get_last_frame()) + 1); // +1 to skip constructor args += exn_constr->get_num_arg_slots() * 4 - 4; Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/gc/stop_the_world_root_set_enum.cpp Fri Apr 18 00:26:23 2008 @@ -219,15 +219,15 @@ // *after* it releases global GC lock. // Several Reference Queues may need to be notified because the GC added References to them. Do that now. - //LOG2("ref", "Enqueueing references"); + //TRACE2("ref", "Enqueueing references"); //vm_enqueue_references(); vm_activate_ref_enqueue_thread(); // 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(); - LOG2("finalize", "Completed vm_run_pending_finalizers"); + TRACE2("finalize", "Completed vm_run_pending_finalizers"); tmn_suspend_disable(); TRACE2("vm.hint", "vm_hint_finalize() completed"); Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalize.cpp Fri Apr 18 00:26:23 2008 @@ -19,15 +19,16 @@ * @version $Revision: 1.1.2.2.4.3 $ */ -#include "vm_process.h" -#include -#include +#define LOG_DOMAIN "vm.object_queue" +#include "cxxlog.h" #include "open/types.h" #include "lock_manager.h" #include "object_layout.h" #include "jthread.h" + +#include "vm_process.h" #include "Class.h" #include "environment.h" #include "ini.h" @@ -41,14 +42,7 @@ #include "jit_import_rt.h" #include "finalizer_thread.h" /* added for NATIVE FINALIZER THREAD */ #include "ref_enqueue_thread.h" /* added for NATIVE REFERENCE ENQUEUE THREAD */ - - -#define LOG_DOMAIN "vm.object_queue" #include "classloader.h" -#undef LOG_DOMAIN - -#include "cxxlog.h" -#include "vm_log.h" #include "thread_generic.h" #ifndef USE_GC_STATIC Modified: 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?rev=649391&r1=649390&r2=649391&view=diff ============================================================================== --- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties (original) +++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/harmony.properties Fri Apr 18 00:26:23 2008 @@ -37,8 +37,8 @@ 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 \n -cp \n A '{1}' separated list of directories, jar archives,\n and zip archives to search for class file\n -client select the 'client' VM (same as -Xem:client)\n -server select the 'server' VM (same as -Xem:server)\n -D=\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:[=]\n load JVMTI agent library, library name is platform independent\n -agentpath:< library name>[=...|:]\n -ea[:...|:]\n enable assertions\n -disableassertions[:...|:]\n -da[:...|:]\n disable assertions\n -esa | -enablesystemassertions\n enable system assertions\n -dsa | -disablesystemassertions\n disable system assertions\n -? -help -h print this help message\n -X print help on non-standard options -ECHO022=\ -Xbootclasspath:\n Set bootclasspath to the specified value\n -Xbootclasspath/a:\n Append specified directories and files to bootclasspath\n -Xbootclasspath/p:\n Prepend specified directories and files to bootclasspath\n -Xms\n Set Java heap size\n -Xmx\n Set maximum Java heap size\n -Xss\n Set initial stack 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[:[:]\n Switch logging on [for specified category only\n [and log that category to a file]]\n -Xwarn[:[:]\n Switch verbose logging off [for specified category only\n [and log that category to a file]]\n -Xverboseconf: \n Set up logging via log4cxx configuration file\n -Xverboselog:\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[:[:]\n Switch debug logging on [for specified category only\n [and log that category to a file]]\n -Xtrace[:[:]\n Switch trace logging on [for specified category only\n [and log that category to a file]] +ECHO022=\ -Xbootclasspath:\n Set bootclasspath to the specified value\n -Xbootclasspath/a:\n Append specified directories and files to bootclasspath\n -Xbootclasspath/p:\n Prepend specified directories and files to bootclasspath\n -Xms\n Set Java heap size\n -Xmx\n Set maximum Java heap size\n -Xss\n Set initial stack 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:\n Switch logging on for a specified category\n (multiple categories specified via subsequent options)\n -Xnoverbose:\n Switch logging off for a specified category\n -Xwarn\n Switch warnings on\n -Xverboselog:\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=\ -Xtrace:\n Switch trace logging on for a specified category\n (multiple categories specified via subsequent options)\n -Xnotrace:\n Switch trace logging off for a specified category ECHO024=\ -Xstats:\n Generates different statistics ECHO025=\ -Xint\n Use interpreter to execute the program\n -Xgc:\n Specify gc specific options\n -Xem:\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:\n Specifies a file name for the dump\n -XX:=\n set an internal system property\n Boolean options may be turned on with -XX:+