* src/vm/options.c (opt_RegallocSpillAll): Added.
* src/vm/options.h: Likewise.
Copyright (C) 1996-2005, 2007, 2008
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+ Copyright (C) 2009 Theobroma Systems Ltd.
This file is part of CACAO.
/* macros for handling register stacks ****************************************/
-#define AVAIL_FRONT(cnt, limit) ((cnt) < (limit))
-#define AVAIL_BACK(cnt) ((cnt) > 0)
+#if !defined(NDEBUG)
+# define AVAIL_FRONT(cnt, limit) (!opt_RegallocSpillAll && ((cnt) < (limit)))
+# define AVAIL_BACK(cnt) (!opt_RegallocSpillAll && ((cnt) > 0))
+#else
+# define AVAIL_FRONT(cnt, limit) ((cnt) < (limit))
+# define AVAIL_BACK(cnt) ((cnt) > 0)
+#endif
#if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
-#define AVAIL_FRONT_INT(cnt, limit) ((cnt) < (limit) - intregsneeded)
-#define AVAIL_BACK_INT(cnt) ((cnt) > intregsneeded)
+# if !defined(NDEBUG)
+# define AVAIL_FRONT_INT(cnt, limit) (!opt_RegallocSpillAll && ((cnt) < (limit) - intregsneeded))
+# define AVAIL_BACK_INT(cnt) (!opt_RegallocSpillAll && ((cnt) > intregsneeded))
+# else
+# define AVAIL_FRONT_INT(cnt, limit) ((cnt) < (limit) - intregsneeded)
+# define AVAIL_BACK_INT(cnt) ((cnt) > intregsneeded)
+# endif
#else
-#define AVAIL_FRONT_INT(cnt, limit) AVAIL_FRONT(cnt, limit)
-#define AVAIL_BACK_INT(cnt) AVAIL_BACK(cnt)
+# define AVAIL_FRONT_INT(cnt, limit) AVAIL_FRONT(cnt, limit)
+# define AVAIL_BACK_INT(cnt) AVAIL_BACK(cnt)
#endif
#define POP_FRONT(stk, cnt, reg) do { reg = stk[cnt++]; } while (0)
int opt_ProfileGCMemoryUsage = 0;
int opt_ProfileMemoryUsage = 0;
FILE *opt_ProfileMemoryUsageGNUPlot = NULL;
+int opt_RegallocSpillAll = 0;
#if defined(ENABLE_REPLACEMENT)
int opt_TestReplacement = 0;
#endif
OPT_ProfileGCMemoryUsage,
OPT_ProfileMemoryUsage,
OPT_ProfileMemoryUsageGNUPlot,
+ OPT_RegallocSpillAll,
OPT_TestReplacement,
OPT_TraceCompilerCalls,
OPT_TraceExceptions,
{ "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" },
+ { "RegallocSpillAll", OPT_RegallocSpillAll, OPT_TYPE_BOOLEAN, "spill all variables to the stack" },
#if defined(ENABLE_REPLACEMENT)
{ "TestReplacement", OPT_TestReplacement, OPT_TYPE_BOOLEAN, "activate all replacement points during code generation" },
#endif
opt_ProfileMemoryUsageGNUPlot = file;
break;
+ case OPT_RegallocSpillAll:
+ opt_RegallocSpillAll = enable;
+ break;
+
#if defined(ENABLE_REPLACEMENT)
case OPT_TestReplacement:
opt_TestReplacement = enable;
extern int opt_ProfileGCMemoryUsage;
extern int opt_ProfileMemoryUsage;
extern FILE *opt_ProfileMemoryUsageGNUPlot;
+extern int opt_RegallocSpillAll;
#if defined(ENABLE_REPLACEMENT)
extern int opt_TestReplacement;
#endif