#include "md.h"
-#include "mm/memory.h"
+#include "mm/memory.hpp"
-#include "native/native.h"
+#include "native/native.hpp"
-#include "toolbox/logging.h"
+#include "toolbox/logging.hpp"
#include "threads/mutex.hpp"
-#include "vm/class.h"
+#include "vm/class.hpp"
#include "vm/global.h"
#include "vm/globals.hpp"
-#include "vm/initialize.h"
+#include "vm/initialize.hpp"
#include "vm/loader.hpp"
-#include "vm/method.h"
+#include "vm/method.hpp"
#include "vm/options.h"
#include "vm/rt-timing.h"
#include "vm/statistics.h"
#include "vm/jit/disass.h"
#include "vm/jit/dseg.h"
#include "vm/jit/jit.hpp"
-#include "vm/jit/parse.h"
+#include "vm/jit/parse.hpp"
#include "vm/jit/reg.h"
-#include "vm/jit/show.h"
+#include "vm/jit/show.hpp"
#include "vm/jit/stack.h"
#include "vm/jit/stubs.hpp"
#endif
#if defined(ENABLE_INLINING)
-# include "vm/jit/inline/inline.h"
+# include "vm/jit/inline/inline.hpp"
#endif
#include "vm/jit/ir/bytecode.h"
# include "vm/jit/python.h"
#endif
-#include "vm/jit/verify/typecheck.h"
+#include "vm/jit/verify/typecheck.hpp"
/* debug macros ***************************************************************/
#if defined(ENABLE_OPAGENT)
if (opt_EnableOpagent)
- OprofileAgent_initialize();
+ OprofileAgent::initialize();
#endif
}
{
#if defined(ENABLE_OPAGENT)
if (opt_EnableOpagent)
- OprofileAgent_close();
+ OprofileAgent::close();
#endif
}
/* release codeinfo */
code_codeinfo_free(jd->code);
-
-#if defined(ENABLE_PROFILING)
- /* Release memory for basic block profiling information. */
-
- if (JITDATA_HAS_FLAG_INSTRUMENT(jd))
- if (jd->code->bbfrequency != NULL)
- MFREE(jd->code->bbfrequency, u4, jd->code->basicblockcount);
-#endif
}
else {
DEBUG_JIT_COMPILEVERBOSE("Running: ");
#if defined(ENABLE_OPAGENT)
if (opt_EnableOpagent)
- OprofileAgent_newmethod(m);
+ OprofileAgent::newmethod(m);
#endif
/* leave the monitor */
#if defined(ENABLE_OPAGENT)
if (opt_EnableOpagent)
- OprofileAgent_newmethod(m);
+ OprofileAgent::newmethod(m);
#endif
DEBUG_JIT_COMPILEVERBOSE("Recompiling done: ");
show_filters_apply(jd->m);
#endif
- /* Handle native methods and create a native stub. */
-
+ // Handle native methods and create a native stub.
if (m->flags & ACC_NATIVE) {
- functionptr f;
-
- f = native_method_resolve(m);
+ NativeMethods& nm = VM::get_current()->get_nativemethods();
+ void* f = nm.resolve_method(m);
if (f == NULL)
return NULL;
- code = NativeStub::generate(m, f);
+ code = NativeStub::generate(m, (functionptr) f);
/* Native methods are never recompiled. */
_must_ be done after loop optimization and register allocation,
since they can change the basic block count. */
- if (JITDATA_HAS_FLAG_INSTRUMENT(jd))
+ if (JITDATA_HAS_FLAG_INSTRUMENT(jd)) {
+ code->basicblockcount = jd->basicblockcount;
code->bbfrequency = MNEW(u4, jd->basicblockcount);
+ }
#endif
DEBUG_JIT_COMPILEVERBOSE("Generating code: ");