* src/vm/vm.c (vm_printconfig): Made static.
(vm_create): Call vm_printconfig after the VM is initialized.
* src/vm/vm.h (vm_printconfig): Removed.
* src/vmcore/linker.c (TRACELINKCLASS): New macro.
(link_class_intern): Use TRACELINKCLASS.
* src/vmcore/options.c (linkverbose): Removed.
(opt_TraceLinkClass): Added.
(options_xx): OPT_PrintConfig: Don't call vm_printconfig,
OPT_TraceLinkClass: Added.
* src/vmcore/options.h (linkverbose): Removed.
(opt_TraceLinkClass): Added.
case OPT_VERBOSE:
opt_verbose = true;
loadverbose = true;
- linkverbose = true;
break;
default:
}
-void vm_printconfig(void)
+static void vm_printconfig(void)
{
puts("Configure/Build options:\n");
puts(" ./configure: "VERSION_CONFIGURE_ARGS"");
vm_initializing = false;
+#if !defined(NDEBUG)
+ /* Print the VM configuration after all stuff is set and the VM is
+ initialized. */
+
+ if (opt_PrintConfig)
+ vm_printconfig();
+#endif
+
/* everything's ok */
return true;
/* function prototypes ********************************************************/
void usage(void);
-void vm_printconfig(void);
bool vm_createjvm(JavaVM **p_vm, void **p_env, void *vm_args);
bool vm_create(JavaVMInitArgs *vm_args);
#include "vmcore/options.h"
#include "vmcore/rt-timing.h"
+
+/* debugging macros ***********************************************************/
+
+#if !defined(NDEBUG)
+# define TRACELINKCLASS(c) \
+ do { \
+ if (opt_TraceLinkClass) { \
+ log_start(); \
+ log_print("[Linking "); \
+ class_print((c)); \
+ log_print("]"); \
+ log_finish(); \
+ } \
+ } while (0)
+#else
+# define TRACELINKCLASS(c)
+#endif
+
+
/* #include "vm/resolve.h" */
/* copied prototype to avoid bootstrapping problem: */
classinfo *resolve_classref_or_classinfo_eager(classref_or_classinfo cls, bool checkaccess);
RT_TIMING_GET_TIME(time_start);
-#if !defined(NDEBUG)
- if (linkverbose)
- log_message_class("Linking class: ", c);
-#endif
+ TRACELINKCLASS(c);
/* the class must be loaded */
FREE(wi, method_worklist);
}
-#if !defined(NDEBUG)
- if (linkverbose)
- log_message_class("Linking done class: ", c);
-#endif
-
RT_TIMING_TIME_DIFF(time_start ,time_resolving ,RT_TIMING_LINK_RESOLVE);
RT_TIMING_TIME_DIFF(time_resolving ,time_compute_vftbl,RT_TIMING_LINK_C_VFTBL);
RT_TIMING_TIME_DIFF(time_compute_vftbl,time_abstract ,RT_TIMING_LINK_ABSTRACT);
bool compileall = false;
bool loadverbose = false;
-bool linkverbose = false;
bool initverbose = false;
bool opt_verboseclass = false;
int32_t opt_TraceJavaCalls = 0;
int32_t opt_TraceJNICalls = 0;
int32_t opt_TraceJVMCalls = 0;
+int32_t opt_TraceLinkClass = 0;
#if defined(ENABLE_REPLACEMENT)
int32_t opt_TraceReplacement = 0;
#endif
OPT_TraceJavaCalls,
OPT_TraceJNICalls,
OPT_TraceJVMCalls,
+ OPT_TraceLinkClass,
OPT_TraceReplacement
};
{ "TraceJavaCalls", OPT_TraceJavaCalls, OPT_TYPE_BOOLEAN, "trace Java method calls" },
{ "TraceJNICalls", OPT_TraceJNICalls, OPT_TYPE_BOOLEAN, "trace JNI method calls" },
{ "TraceJVMCalls", OPT_TraceJVMCalls, OPT_TYPE_BOOLEAN, "TODO" },
+ { "TraceLinkClass", OPT_TraceLinkClass, OPT_TYPE_BOOLEAN, "trace class linking" },
#if defined(ENABLE_REPLACEMENT)
{ "TraceReplacement", OPT_TraceReplacement, OPT_TYPE_VALUE, "trace on-stack replacement with the given verbosity level (default: 1)" },
#endif
break;
case OPT_PrintConfig:
- vm_printconfig();
+ opt_PrintConfig = enable;
break;
case OPT_ProfileGCMemoryUsage:
opt_TraceJVMCalls = enable;
break;
+ case OPT_TraceLinkClass:
+ opt_TraceLinkClass = enable;
+ break;
+
#if defined(ENABLE_REPLACEMENT)
case OPT_TraceReplacement:
if (value == NULL)
extern bool compileall;
extern bool loadverbose; /* Print debug messages during loading */
-extern bool linkverbose;
extern bool initverbose; /* Log class initialization */
extern bool opt_verboseclass;
extern int32_t opt_TraceJavaCalls;
extern int32_t opt_TraceJNICalls;
extern int32_t opt_TraceJVMCalls;
+extern int32_t opt_TraceLinkClass;
#if defined(ENABLE_REPLACEMENT)
extern int32_t opt_TraceReplacement;
#endif