* src/toolbox/list.hpp (DumpList): Made sort function accessible.
[cacao.git] / src / vm / jit / jit.cpp
index c218f05e8d14685568a3e157b3849a05e136fd28..a8ac2b160a196c7f7c1873db3e80bf196fab7e86 100644 (file)
 
 #include "md.h"
 
-#include "mm/memory.h"
+#include "mm/memory.hpp"
 
 #include "native/native.hpp"
 
-#include "toolbox/logging.h"
+#include "toolbox/logging.hpp"
 
 #include "threads/mutex.hpp"
 
@@ -45,7 +45,7 @@
 #include "vm/globals.hpp"
 #include "vm/initialize.hpp"
 #include "vm/loader.hpp"
-#include "vm/method.h"
+#include "vm/method.hpp"
 #include "vm/options.h"
 #include "vm/rt-timing.h"
 #include "vm/statistics.h"
 #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
 # include "vm/jit/python.h"
 #endif
 
-#include "vm/jit/verify/typecheck.h"
+#include "vm/jit/verify/typecheck.hpp"
 
 
 /* debug macros ***************************************************************/
@@ -316,17 +312,6 @@ 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 */
 
@@ -404,23 +389,11 @@ u1 *jit_compile(methodinfo *m)
                /* release codeinfo */
 
                code_codeinfo_free(jd->code);
-
-#if defined(ENABLE_PROFILING)
-               /* Release memory for basic block profiling information. */
-
-               if (JITDATA_HAS_FLAG_INSTRUMENT(jd))
-                       if (jd->code->bbfrequency != NULL)
-                               MFREE(jd->code->bbfrequency, u4, jd->code->basicblockcount);
-#endif
        }
        else {
                DEBUG_JIT_COMPILEVERBOSE("Running: ");
        }
 
-#if defined (ENABLE_JITCACHE)
-       jitcache_store(m);
-#endif
-
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
@@ -793,8 +766,10 @@ static u1 *jit_compile_intern(jitdata *jd)
           _must_ be done after loop optimization and register allocation,
           since they can change the basic block count. */
 
-       if (JITDATA_HAS_FLAG_INSTRUMENT(jd))
+       if (JITDATA_HAS_FLAG_INSTRUMENT(jd)) {
+               code->basicblockcount = jd->basicblockcount;
                code->bbfrequency = MNEW(u4, jd->basicblockcount);
+       }
 #endif
 
        DEBUG_JIT_COMPILEVERBOSE("Generating code: ");