* src/vm/jit/jit.cpp: Eliminate one instance of useless cache flushing.
[cacao.git] / src / vm / jit / show.cpp
index f224cc24b9d15b4f5f99a52dc6d9d5aa23e6412d..6210c59b98da1b3f56bb2926af711d5d27f9b20b 100644 (file)
@@ -30,9 +30,9 @@
 
 #include "vm/types.h"
 
-#include "mm/memory.h"
+#include "mm/memory.hpp"
 
-#include "threads/lock-common.h"
+#include "threads/lock.hpp"
 
 #include "vm/global.h"
 #include "vm/jit/builtin.hpp"
@@ -45,7 +45,7 @@
 #include "vm/jit/show.hpp"
 #include "vm/jit/disass.h"
 #include "vm/jit/stack.h"
-#include "vm/jit/parse.h"
+#include "vm/jit/parse.hpp"
 
 #if defined(ENABLE_DEBUG_FILTER)
 # include <sys/types.h>
@@ -192,7 +192,7 @@ void show_method(jitdata *jd, int stage)
        }
 
        if (stage >= SHOW_PARSE) {
-               printf("Exceptions (Number: %d):\n", jd->exceptiontablelength);
+               printf("Exceptions (number=%d):\n", jd->exceptiontablelength);
                for (ex = jd->exceptiontable; ex != NULL; ex = ex->down) {
                        printf("    L%03d ... ", ex->start->nr );
                        printf("L%03d  = ", ex->end->nr);
@@ -214,7 +214,7 @@ void show_method(jitdata *jd, int stage)
                for (i = 0; i < jd->localcount; i++) {
                        printf("   %3d: ", i);
 
-#if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
+#if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
                        if (!opt_intrp) {
 # endif
@@ -225,7 +225,7 @@ void show_method(jitdata *jd, int stage)
 # if defined(ENABLE_INTRP)
                        }
 # endif
-#endif /* defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER) */
+#endif /* defined(ENABLE_JIT) */
                }
                printf("\n");
        }
@@ -311,18 +311,14 @@ void show_method(jitdata *jd, int stage)
                int max;
 
                max = rd->memuse;
-               printf("Stack slots: (memuse=%d", rd->memuse);
+               printf("Stack slots (memuse=%d", rd->memuse);
                if (irstage >= SHOW_CODE) {
                        printf(", stackframesize=%d", cd->stackframesize);
                        max = cd->stackframesize;
                }
-               printf(")\n");
+               printf("):\n");
                for (i = 0; i < max; ++i) {
-#if defined(HAS_4BYTE_STACKSLOT)
-                       printf("    M%02d = 0x%02x(sp): ", i, i * 4);
-#else
                        printf("    M%02d = 0x%02x(sp): ", i, i * 8);
-#endif
                        for (j = 0; j < jd->vartop; ++j) {
                                varinfo *v = VAR(j);
                                if ((v->flags & INMEMORY) && (v->vv.regoff == i)) {
@@ -337,6 +333,13 @@ void show_method(jitdata *jd, int stage)
                printf("\n");
        }
 
+       if (!code->patchers->empty()) {
+               int number = code->patchers->size();
+               printf("Patcher References (number=%d):\n", number);
+               patcher_list_show(code);
+               printf("\n");
+       }
+
 #if defined(ENABLE_REPLACEMENT)
        if (code->rplpoints) {
                printf("Replacement Points:\n");
@@ -577,8 +580,7 @@ void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
 
                        if (bptr->next != NULL) {
                                for (; pc < (void *) (code->mcode + cd->dseglen + bptr->next->mpc);) {
-                                       currentlinenumber =
-                                               linenumbertable_linenumber_for_pc(&m, code, pc);
+                                       currentlinenumber = code->linenumbertable->find(&m, pc);
 
                                        if (currentlinenumber != linenumber) {
                                                linenumber = currentlinenumber;
@@ -590,8 +592,7 @@ void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
                        }
                        else {
                                for (; pc < (void *) (code->mcode + code->mcodelength);) {
-                                       currentlinenumber =
-                                               linenumbertable_linenumber_for_pc(&m, code, pc);
+                                       currentlinenumber = code->linenumbertable->find(&m, pc);
 
                                        if (currentlinenumber != linenumber) {
                                                linenumber = currentlinenumber;
@@ -799,7 +800,7 @@ void show_allocation(s4 type, s4 flags, s4 regoff)
 
 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
        if (IS_2_WORD_TYPE(type)) {
-# if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
+# if defined(ENABLE_JIT)
 #  if defined(ENABLE_INTRP)
                if (opt_intrp)
                        printf("%3d/%3d", GET_LOW_REG(regoff),
@@ -816,7 +817,7 @@ void show_allocation(s4 type, s4 flags, s4 regoff)
        } 
 #endif /* defined(SUPPORT_COMBINE_INTEGER_REGISTERS) */
 
-#if defined(ENABLE_JIT) && defined(ENABLE_DISASSEMBLER)
+#if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
        if (opt_intrp)
                printf("%3d", regoff);