* src/vm/jit/jit.c (jit_compile_intern) [ENABLE_REPLACEMENT]: Activate
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 24 Sep 2007 18:25:13 +0000 (20:25 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 24 Sep 2007 18:25:13 +0000 (20:25 +0200)
replacement points after code generation if testing option is given.

* src/vmcore/options.c [ENABLE_REPLACEMENT] (opt_TestReplacement): Added
replacement testing option.

* src/vmcore/options.h [ENABLE_REPLACEMENT] (opt_TestReplacement): Likewise.

src/vm/jit/jit.c
src/vmcore/options.c
src/vmcore/options.h

index 3d2ce2f32dd8c6044ece75645f5c7c295d1a04b4..08b5fdb2c893cfabeccd7c3be7e48edead6281db 100644 (file)
@@ -1503,6 +1503,13 @@ static u1 *jit_compile_intern(jitdata *jd)
 
        DEBUG_JIT_COMPILEVERBOSE("Generating code done: ");
 
+#if !defined(NDEBUG) && defined(ENABLE_REPLACEMENT)
+       /* activate replacement points inside newly created code */
+
+       if (opt_TestReplacement)
+               replace_activate_replacement_points(code, false);
+#endif
+
 #if !defined(NDEBUG)
 #if defined(ENABLE_DEBUG_FILTER)
        if (jd->m->filtermatches & SHOW_FILTER_FLAG_SHOW_METHOD)
index 13cd095ba9c6f45cc41aabcf4998afd9066acb36..0cb1540cff2f97fb79a68c5c0fec237733335c0f 100644 (file)
@@ -192,6 +192,9 @@ int      opt_PrintConfig               = 0;
 int32_t  opt_ProfileGCMemoryUsage      = 0;
 int32_t  opt_ProfileMemoryUsage        = 0;
 FILE    *opt_ProfileMemoryUsageGNUPlot = NULL;
+#if defined(ENABLE_REPLACEMENT)
+int      opt_TestReplacement           = 0;
+#endif
 int32_t  opt_ThreadStackSize           = 0;
 int32_t  opt_TraceExceptions           = 0;
 int32_t  opt_TraceJavaCalls            = 0;
@@ -225,6 +228,7 @@ enum {
        OPT_ProfileGCMemoryUsage,
        OPT_ProfileMemoryUsage,
        OPT_ProfileMemoryUsageGNUPlot,
+       OPT_TestReplacement,
        OPT_ThreadStackSize,
        OPT_TraceExceptions,
        OPT_TraceJavaCalls,
@@ -256,6 +260,9 @@ option_t options_XX[] = {
        { "ProfileGCMemoryUsage",      OPT_ProfileGCMemoryUsage,      OPT_TYPE_VALUE,   "profiles GC memory usage in the given interval, <value> is in seconds (default: 5)" },
        { "ProfileMemoryUsage",        OPT_ProfileMemoryUsage,        OPT_TYPE_VALUE,   "TODO" },
        { "ProfileMemoryUsageGNUPlot", OPT_ProfileMemoryUsageGNUPlot, OPT_TYPE_VALUE,   "TODO" },
+#if defined(ENABLE_REPLACEMENT)
+       { "TestReplacement"          , OPT_TestReplacement,           OPT_TYPE_BOOLEAN, "activate all replacement points during code generation" },
+#endif
        { "ThreadStackSize",           OPT_ThreadStackSize,           OPT_TYPE_VALUE,   "TODO" },
        { "TraceExceptions",           OPT_TraceExceptions,           OPT_TYPE_BOOLEAN, "trace Exception throwing" },
        { "TraceJavaCalls",            OPT_TraceJavaCalls,            OPT_TYPE_BOOLEAN, "trace Java method calls" },
@@ -609,6 +616,12 @@ void options_xx(JavaVMInitArgs *vm_args)
                        opt_ProfileMemoryUsageGNUPlot = file;
                        break;
 
+#if defined(ENABLE_REPLACEMENT)
+               case OPT_TestReplacement:
+                       opt_TestReplacement = enable;
+                       break;
+#endif
+
                case OPT_ThreadStackSize:
                        /* currently ignored */
                        break;
@@ -630,9 +643,9 @@ void options_xx(JavaVMInitArgs *vm_args)
                        opt_TraceJVMCalls = enable;
                        break;
 
-       case OPT_TraceLinkClass:
-               opt_TraceLinkClass = enable;
-               break;
+               case OPT_TraceLinkClass:
+                       opt_TraceLinkClass = enable;
+                       break;
 
 #if defined(ENABLE_REPLACEMENT)
                case OPT_TraceReplacement:
index 54bb47e988cb8a67bb663eaf0923f90a74dcbbb7..c64773b585e5478d53b5bb0ee8176b9e7e640995 100644 (file)
@@ -207,6 +207,9 @@ extern int      opt_PrintConfig;
 extern int32_t  opt_ProfileGCMemoryUsage;
 extern int32_t  opt_ProfileMemoryUsage;
 extern FILE    *opt_ProfileMemoryUsageGNUPlot;
+#if defined(ENABLE_REPLACEMENT)
+extern int      opt_TestReplacement;
+#endif
 extern int32_t  opt_ThreadStackSize;
 extern int32_t  opt_TraceExceptions;
 extern int32_t  opt_TraceJavaCalls;