* src/vm/options.c (opt_AlwaysEmitLongBranches): New variable.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Mon, 29 Sep 2008 08:56:06 +0000 (10:56 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Mon, 29 Sep 2008 08:56:06 +0000 (10:56 +0200)
* src/vm/options.h: Likewise.
* src/vm/jit/codegen-common.cpp (codegen_setup): Set long-branches
flag if requested.

src/vm/jit/codegen-common.cpp
src/vm/options.c
src/vm/options.h

index c4a4c64f827d70b9890f1a15028949df15b074a1..173c272c5b5d6eac1b21355ca05501e61a31d3fc 100644 (file)
@@ -136,7 +136,13 @@ void codegen_setup(jitdata *jd)
 
        /* initialize members */
 
-       cd->flags        = 0;
+       // Set flags as requested.
+       if (opt_AlwaysEmitLongBranches) {
+               cd->flags = CODEGENDATA_FLAG_LONGBRANCHES;
+       }
+       else {
+               cd->flags = 0;
+       }
 
        cd->mcodebase    = (u1*) DumpMemory::allocate(MCODEINITSIZE);
        cd->mcodeend     = cd->mcodebase + MCODEINITSIZE;
index ade24918c6a4304ef36fdcd4962749a7a8e36fd0..3c3bace7016621d07fa95fe0ddd201a9e4549b13 100644 (file)
@@ -160,6 +160,7 @@ int      opt_ThreadStackSize              = 0;
 
 /* Debugging options which can be turned off. */
 
+bool     opt_AlwaysEmitLongBranches       = false;
 int      opt_DebugExceptions              = 0;
 int      opt_DebugFinalizer               = 0;
 int      opt_DebugLocalReferences         = 0;
@@ -230,6 +231,7 @@ enum {
 
        /* Debugging options which can be turned off. */
 
+       OPT_AlwaysEmitLongBranches,
        OPT_DebugExceptions,
        OPT_DebugFinalizer,
        OPT_DebugLocalReferences,
@@ -283,6 +285,7 @@ option_t options_XX[] = {
 
        /* Debugging options which can be turned off. */
 
+       { "AlwaysEmitLongBranches",       OPT_AlwaysEmitLongBranches,       OPT_TYPE_BOOLEAN, "Always emit long-branches." },
        { "DebugExceptions",              OPT_DebugExceptions,              OPT_TYPE_BOOLEAN, "debug exceptions" },
        { "DebugFinalizer",               OPT_DebugFinalizer,               OPT_TYPE_BOOLEAN, "debug finalizer thread" },
        { "DebugLocalReferences",         OPT_DebugLocalReferences,         OPT_TYPE_BOOLEAN, "print debug information for local reference tables" },
@@ -615,6 +618,10 @@ void options_xx(JavaVMInitArgs *vm_args)
 
                /* Debugging options which can be turned off. */
 
+               case OPT_AlwaysEmitLongBranches:
+                       opt_AlwaysEmitLongBranches = enable;
+                       break;
+
                case OPT_DebugExceptions:
                        opt_DebugExceptions = enable;
                        break;
index c968f200b8b4ffa842a3bfe6c3779cd8bf7f48bc..1758add5c3a757ba8858a35ad51f1177f1d29667 100644 (file)
@@ -182,6 +182,7 @@ extern int      opt_ThreadStackSize;
 
 /* Debugging options which can be turned off. */
 
+extern bool     opt_AlwaysEmitLongBranches;
 extern int      opt_DebugExceptions;
 extern int      opt_DebugFinalizer;
 extern int      opt_DebugLocalReferences;