* Removed all Id tags.
[cacao.git] / src / vm / jit / jit.c
index 2cea02d434c6f7cf9e82fcd1c1847d2688588af9..b8d8cdc2e36c6080ff19684e74aff8934b453390 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jit.c 7575 2007-03-25 20:30:50Z twisti $
-
 */
 
 
 #include "vm/types.h"
 
 #include "mm/memory.h"
+
 #include "native/native.h"
+
 #include "toolbox/logging.h"
 
-#if defined(ENABLE_THREADS)
-# include "threads/native/lock.h"
-#else
-# include "threads/none/lock.h"
-#endif
+#include "threads/lock-common.h"
+#include "threads/threads-common.h"
 
 #include "vm/global.h"
 #include "vm/initialize.h"
 # include "vm/jit/optimizing/ssa.h"
 #endif
 
+#if defined(ENABLE_INLINING)
+# include "vm/jit/inline/inline.h"
+#endif
+
 #include "vm/jit/loop/analyze.h"
 #include "vm/jit/loop/graph.h"
 #include "vm/jit/loop/loop.h"
 
 #include "vm/jit/verify/typecheck.h"
 
-#if defined(ENABLE_THREADS)
-# include "threads/native/threads.h"
-#endif
-
 #include "vmcore/class.h"
 #include "vmcore/loader.h"
 #include "vmcore/method.h"
@@ -1284,6 +1281,10 @@ static u1 *jit_compile_intern(jitdata *jd)
 
        DEBUG_JIT_COMPILEVERBOSE("Compiling: ");
 
+#if defined(ENABLE_DEBUG_FILTER)
+       show_filters_apply(jd->m);
+#endif
+
        /* handle native methods and create a native stub */
 
        if (m->flags & ACC_NATIVE) {
@@ -1298,7 +1299,7 @@ static u1 *jit_compile_intern(jitdata *jd)
                f = NULL;
 #endif
 
-               code = codegen_createnativestub(f, m);
+               code = codegen_generate_stub_native(m, f);
 
                assert(!m->code); /* native methods are never recompiled */
                m->code = code;
@@ -1458,7 +1459,7 @@ static u1 *jit_compile_intern(jitdata *jd)
 #endif /* defined(ENABLE_JIT) */
        RT_TIMING_GET_TIME(time_alloc);
 
-#if defined(ENABLE_PROFLING)
+#if defined(ENABLE_PROFILING)
        /* Allocate memory for basic block profiling information. This
           _must_ be done after loop optimization and register allocation,
           since they can change the basic block count. */
@@ -1492,7 +1493,7 @@ static u1 *jit_compile_intern(jitdata *jd)
        } else
 # endif
                {
-                       if (!codegen(jd)) {
+                       if (!codegen_generate(jd)) {
                                DEBUG_JIT_COMPILEVERBOSE("Exception while generating code: ");
 
                                return NULL;
@@ -1510,20 +1511,25 @@ static u1 *jit_compile_intern(jitdata *jd)
        DEBUG_JIT_COMPILEVERBOSE("Generating code done: ");
 
 #if !defined(NDEBUG)
-       /* intermediate and assembly code listings */
+#if defined(ENABLE_DEBUG_FILTER)
+       if (jd->m->filtermatches & SHOW_FILTER_FLAG_SHOW_METHOD)
+#endif
+       {
+               /* intermediate and assembly code listings */
                
-       if (JITDATA_HAS_FLAG_SHOWINTERMEDIATE(jd)) {
-               show_method(jd, SHOW_CODE);
-       }
-       else if (JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
+               if (JITDATA_HAS_FLAG_SHOWINTERMEDIATE(jd)) {
+                       show_method(jd, SHOW_CODE);
+               }
+               else if (JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)) {
 # if defined(ENABLE_DISASSEMBLER)
-               DISASSEMBLE(code->entrypoint,
-                                       code->entrypoint + (code->mcodelength - cd->dseglen));
+                       DISASSEMBLE(code->entrypoint,
+                                               code->entrypoint + (code->mcodelength - cd->dseglen));
 # endif
-       }
+               }
 
-       if (opt_showddatasegment)
-               dseg_display(jd);
+               if (opt_showddatasegment)
+                       dseg_display(jd);
+       }
 #endif
 
        DEBUG_JIT_COMPILEVERBOSE("Compiling done: ");