* src/toolbox/list.hpp (DumpList): Made sort function accessible.
[cacao.git] / src / vm / jit / jit.cpp
index baaf5900f62eeedcb16ce7aee9dbaa6e9ce91ac1..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"
 
@@ -389,14 +389,6 @@ 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: ");
@@ -774,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: ");