* src/vm/options.c: Added -XX:+AlwaysMmapFirstPage to enable it again.
* src/vm/options.h: Likewise.
/* src/vm/jit/trap.cpp - hardware traps
- Copyright (C) 2008
+ Copyright (C) 2008, 2009
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
Copyright (C) 2009 Theobroma Systems Ltd.
*/
void trap_init(void)
{
-#if !(defined(__ARM__) && defined(__LINUX__))
- /* On arm-linux the first memory page can't be mmap'ed, as it
- contains the exception vectors. */
-
- int pagesize;
-
- /* mmap a memory page at address 0x0, so our hardware-exceptions
- work. */
+ TRACESUBSYSTEMINITIALIZATION("trap_init");
- pagesize = os::getpagesize();
+ /* If requested we mmap a memory page at address 0x0,
+ so our hardware-exceptions work. */
- (void) os::mmap_anonymous(NULL, pagesize, PROT_NONE, MAP_PRIVATE | MAP_FIXED);
-#endif
-
- TRACESUBSYSTEMINITIALIZATION("trap_init");
+ if (opt_AlwaysMmapFirstPage) {
+ int pagesize = os::getpagesize();
+ (void) os::mmap_anonymous(NULL, pagesize, PROT_NONE, MAP_PRIVATE | MAP_FIXED);
+ }
#if !defined(TRAP_INSTRUCTION_IS_LOAD)
# error TRAP_INSTRUCTION_IS_LOAD is not defined in your md-trap.h
/* Debugging options which can be turned off. */
bool opt_AlwaysEmitLongBranches = false;
+bool opt_AlwaysMmapFirstPage = false;
int opt_CompileAll = 0;
char* opt_CompileMethod = NULL;
char* opt_CompileSignature = NULL;
/* Debugging options which can be turned off. */
OPT_AlwaysEmitLongBranches,
+ OPT_AlwaysMmapFirstPage,
OPT_CompileAll,
OPT_CompileMethod,
OPT_CompileSignature,
/* Debugging options which can be turned off. */
{ "AlwaysEmitLongBranches", OPT_AlwaysEmitLongBranches, OPT_TYPE_BOOLEAN, "Always emit long-branches." },
+ { "AlwaysMmapFirstPage", OPT_AlwaysMmapFirstPage, OPT_TYPE_BOOLEAN, "Always mmap memory page at address 0x0." },
{ "CompileAll", OPT_CompileAll, OPT_TYPE_BOOLEAN, "compile all methods, no execution" },
{ "CompileMethod", OPT_CompileMethod, OPT_TYPE_VALUE, "compile only a specific method" },
{ "CompileSignature", OPT_CompileSignature, OPT_TYPE_VALUE, "specify signature for a specific method" },
opt_AlwaysEmitLongBranches = enable;
break;
+ case OPT_AlwaysMmapFirstPage:
+ opt_AlwaysMmapFirstPage = enable;
+ break;
+
case OPT_CompileAll:
opt_CompileAll = enable;
opt_run = false;
/* Debugging options which can be turned off. */
extern bool opt_AlwaysEmitLongBranches;
+extern bool opt_AlwaysMmapFirstPage;
extern int opt_CompileAll;
extern char* opt_CompileMethod;
extern char* opt_CompileSignature;