X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fjit%2Fjit.cpp;h=09c9e862eb6798d7cdffc17aa234b89e7b861da2;hb=0698bb7e6153d5892e5ccdb9d9770999b1e1c217;hp=095e9840155dba245ac7ec97a0a07909feaa1efb;hpb=da9b19998d720859c525f94db4ca3d8da73d6295;p=cacao.git diff --git a/src/vm/jit/jit.cpp b/src/vm/jit/jit.cpp index 095e98401..09c9e862e 100644 --- a/src/vm/jit/jit.cpp +++ b/src/vm/jit/jit.cpp @@ -65,6 +65,10 @@ #include "vm/jit/stack.h" #include "vm/jit/stubs.hpp" +#if defined(ENABLE_JITCACHE) +# include "vm/jit/jitcache.hpp" +#endif + #if defined(ENABLE_OPAGENT) #include "vm/jit/oprofile-agent.hpp" #endif @@ -312,6 +316,17 @@ u1 *jit_compile(methodinfo *m) STATISTICS(count_methods++); +#if defined (ENABLE_JITCACHE) + + if (jitcache_load (m)) + { + m->mutex->unlock(); + + return m->code->entrypoint; + } + +#endif + #if defined(ENABLE_STATISTICS) /* measure time */ @@ -402,6 +417,10 @@ u1 *jit_compile(methodinfo *m) DEBUG_JIT_COMPILEVERBOSE("Running: "); } +#if defined (ENABLE_JITCACHE) + jitcache_store(m); +#endif + #if defined(ENABLE_STATISTICS) /* measure time */