* src/vm/class.c: Moved to C++.
[cacao.git] / src / vm / jit / jit.cpp
index 5d77f88b447ca1a9f45cee5dbecf82da2b08129b..095e9840155dba245ac7ec97a0a07909feaa1efb 100644 (file)
 
 #include "mm/memory.h"
 
-#include "native/native.h"
+#include "native/native.hpp"
 
 #include "toolbox/logging.h"
 
 #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/options.h"
@@ -176,7 +176,7 @@ void jit_init(void)
 
 #if defined(ENABLE_OPAGENT)
        if (opt_EnableOpagent)
-               OprofileAgent_initialize();
+               OprofileAgent::initialize();
 #endif
 }
 
@@ -191,7 +191,7 @@ void jit_close(void)
 {
 #if defined(ENABLE_OPAGENT)
        if (opt_EnableOpagent)
-               OprofileAgent_close();
+               OprofileAgent::close();
 #endif
 }
 
@@ -411,7 +411,7 @@ u1 *jit_compile(methodinfo *m)
 
 #if defined(ENABLE_OPAGENT)
        if (opt_EnableOpagent)
-               OprofileAgent_newmethod(m);
+               OprofileAgent::newmethod(m);
 #endif
 
        /* leave the monitor */
@@ -522,7 +522,7 @@ u1 *jit_recompile(methodinfo *m)
 
 #if defined(ENABLE_OPAGENT)
        if (opt_EnableOpagent)
-               OprofileAgent_newmethod(m);
+               OprofileAgent::newmethod(m);
 #endif
 
        DEBUG_JIT_COMPILEVERBOSE("Recompiling done: ");
@@ -569,17 +569,15 @@ static u1 *jit_compile_intern(jitdata *jd)
        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. */