Changes: Edwin Steiner
- $Id: jit.c 941 2004-03-06 17:27:56Z jowenn $
+ $Id: jit.c 991 2004-03-29 11:22:34Z stefan $
*/
methodptr jit_compile(methodinfo *m)
{
+ static bool jitrunning;
s4 dumpsize;
s8 starttime = 0;
s8 stoptime = 0;
count_methods++;
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- pthread_mutex_lock(&compiler_mutex);
+ compiler_lock();
#endif
#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
log_text(logtext);
#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* enable interrupts again */
+#endif
+ jitrunning = false;
+#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+ compiler_unlock();
#endif
return (methodptr) do_nothing_function; /* return empty method */
}
class_init(m->class);
}
+ if (jitrunning)
+ panic("Compiler lock recursion");
+ jitrunning = true;
+
/* initialisation of variables and subsystems */
isleafmethod = true;
#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
intsRestore(); /* enable interrupts again */
#endif
-
+ jitrunning = false;
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- pthread_mutex_unlock(&compiler_mutex);
+ compiler_unlock();
#endif
/* return pointer to the methods entry point */
-
+
LOG_STEP("Done compiling");
return m->entrypoint;
}