* src/vm/jit/jit.cpp: Eliminate one instance of useless cache flushing.
[cacao.git] / src / vm / jit / python.c
index 0192e68fb567fa727ef4225a1e2263e7adf056a0..32fb401e2e8b3d18d43764b3dc886aeeca34e8c5 100644 (file)
 
 #include "vm/global.h"
 #include "vm/jit/python.h"
-#include "vm/jit/show.h"
+#include "vm/jit/show.hpp"
 #if defined(ENABLE_THREADS)
-# include "threads/lock-common.h"
+# include "threads/mutex.hpp"
 #endif
 
 #if defined(ENABLE_THREADS)
-static java_object_t *python_global_lock;
+static Mutex *python_global_mutex;
 #endif
 
 /*
@@ -869,7 +869,7 @@ CLASS_FUNC(fieldinfo_func) {
                                case F_NAME:
                                        return get_string(arg->get.result, fi->name->text);
                                case F_KLASS:
-                                       return get_obj(arg->get.result, classinfo_func, state->root, fi->class);
+                                       return get_obj(arg->get.result, classinfo_func, state->root, fi->clazz);
                        }
        }
 
@@ -1402,7 +1402,7 @@ CLASS_FUNC(methodinfo_func) {
                                case F_NAME:
                                        return get_string(arg->get.result, m->name->text);
                                case F_KLASS:
-                                       return get_obj(arg->get.result, classinfo_func, state->root, m->class);
+                                       return get_obj(arg->get.result, classinfo_func, state->root, m->clazz);
                                case F_PARAM_TYPES:
                                        return get_iter(arg->get.result, param_types_iter_func, state->root, m);
                                case F_PARAMS:
@@ -1825,8 +1825,7 @@ void pythonpass_init() {
        }
 
 #if defined(ENABLE_THREADS)
-       python_global_lock = NEW(java_object_t);
-       LOCK_INIT_OBJECT_LOCK(python_global_lock);
+       python_global_mutex = Mutex_new();
 #endif
 
 }
@@ -1847,7 +1846,7 @@ int pythonpass_run(jitdata *jd, const char *module, const char *function) {
        int success = 0;
        root_state root;
 
-       LOCK_MONITOR_ENTER(python_global_lock);
+       Mutex_lock(python_global_mutex);
 
        pymodname = PyString_FromString(module);
        pymod = PyImport_Import(pymodname);
@@ -1888,7 +1887,7 @@ int pythonpass_run(jitdata *jd, const char *module, const char *function) {
        Py_XDECREF(pyret);
        Py_XDECREF(objcache);
 
-       LOCK_MONITOR_EXIT(python_global_lock);
+       Mutex_unlock(python_global_mutex);
 
        return (success == 1 ? 1 : 0);
 }