|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
OpenJIT_compile(struct methodblock *mb) {
|
|
COMPILE_LOCK(); /* for multi-threading */
|
|
if
(COMPILE_ON_THE_WAY(mb)) {
|
|
/* avoid from double
compiling */
|
|
COMPILE_UNLOCK();
|
|
mb->invoker(...); /* invoke interpreter */
|
|
return;
|
|
}
|
|
SET_COMPILE_ON_THE_WAY(mb);
|
|
/* this method should be
temporarily interpreted */
|
mb->invoker = gJDKfs
invokerh;
|
|
COMPILE_UNLOCK();
|
|
/* compilation process */
|
|
c
|
|
/* next time, compiled code
is direct called */
|
|
mb->invoker =
gcompiled codeh;
|
|
RESET_COMPILE_ON_THE_WAY(mb);
|
|
mb->invoker(c); /* jump into compiled code
*/
|
|
}
|
|