/* src/vm/jit/jit.cpp - Just-In-Time compiler
- Copyright (C) 1996-2005, 2006, 2007, 2008
+ Copyright (C) 1996-2011
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
#include "vm/class.hpp"
#include "vm/global.h"
#include "vm/globals.hpp"
+#include "vm/hook.hpp"
#include "vm/initialize.hpp"
#include "vm/loader.hpp"
#include "vm/method.hpp"
#include "vm/jit/stack.h"
#include "vm/jit/stubs.hpp"
-#if defined(ENABLE_OPAGENT)
-#include "vm/jit/oprofile-agent.hpp"
-#endif
-
#include "vm/jit/allocator/simplereg.h"
#if defined(ENABLE_LSRA) && !defined(ENABLE_SSA)
# include "vm/jit/allocator/lsra.h"
#else
intrp_md_init();
#endif
-
-#if defined(ENABLE_OPAGENT)
- if (opt_EnableOpagent)
- OprofileAgent::initialize();
-#endif
}
void jit_close(void)
{
-#if defined(ENABLE_OPAGENT)
- if (opt_EnableOpagent)
- OprofileAgent::close();
-#endif
+ /* nop */
}
compilingtime_stop();
#endif
-#if defined(ENABLE_OPAGENT)
- if (opt_EnableOpagent)
- OprofileAgent::newmethod(m);
-#endif
+ // Hook point just after code was generated.
+ Hook::jit_generated(m, m->code);
/* leave the monitor */
compilingtime_stop();
#endif
-#if defined(ENABLE_OPAGENT)
- if (opt_EnableOpagent)
- OprofileAgent::newmethod(m);
-#endif
+ // Hook point just after code was generated.
+ Hook::jit_generated(m, m->code);
DEBUG_JIT_COMPILEVERBOSE("Recompiling done: ");
*p = (uintptr_t) newpv;
+#if !defined(JIT_COMPILER_VIA_SIGNAL)
/* Flush both caches. */
+ /* This might have been necessary before we had the compiler trap, but now
+ * it's not. I don't care enough about the (broken) non-signal case to
+ * investigate this. */
md_cacheflush(pa, SIZEOF_VOID_P);
+#endif
return newpv;
}