64 #if defined(ENABLE_DEBUG_FILTER)
65 # include <sys/types.h>
93 #if defined(ENABLE_DEBUG_FILTER)
151 #if defined(ENABLE_DISASSEMBLER)
167 #if defined(ENABLE_INTRP)
230 #if defined(ENABLE_JIT)
231 # if defined(ENABLE_INTRP)
238 # if defined(ENABLE_INTRP)
253 for (i = 0; i < 5; i++) {
271 for (i = 0; (i < (5 * jd->
maxinterfaces)) && !exist; i++, mapptr++)
275 printf(
"Interface Table: (In/Outvars)\n");
282 for (i = 0; i < 5; i++) {
305 printf(
"%c%03d(", ch, regoff);
333 for (i = 0; i <
max; ++
i) {
334 printf(
" M%02d = 0x%02x(sp): ", i, i * 8);
335 for (j = 0; j < jd->
vartop; ++j) {
350 int number = code->
patchers->size();
351 printf(
"Patcher References (number=%d):\n", number);
356 #if defined(ENABLE_REPLACEMENT)
357 if (code->rplpoints) {
358 printf(
"Replacement Points:\n");
364 #if defined(ENABLE_DISASSEMBLER)
382 #if 0 && defined(ENABLE_DISASSEMBLER)
386 printf(
"\nStubs code:\n");
408 #if !defined(NDEBUG) && defined(ENABLE_INLINING)
414 printf(
"(pt %d+%d+%d st ",
455 #if defined(ENABLE_DISASSEMBLER)
459 s4 currentlinenumber;
464 #if defined(ENABLE_INTRP)
476 printf(
"======== %sL%03d ======== %s(flags: %d, bitflags: %01x, next: %d, type: ",
477 #
if defined(ENABLE_REPLACEMENT)
482 (deadcode && stage >=
SHOW_STACK) ?
"DEADCODE! " :
"",
486 switch (bptr->
type) {
545 #if defined(ENABLE_INLINING)
548 show_inline_info(jd, bptr->
inlineinfo, -1, irstage);
553 #if defined(ENABLE_SSA)
557 for (i = 0; i < bptr->phicount; i++, iptr++) {
567 for (i = 0; i < bptr->
icount; i++, iptr++) {
580 #if defined(ENABLE_DISASSEMBLER)
591 if (bptr->
next != NULL) {
595 if (currentlinenumber != linenumber) {
596 linenumber = currentlinenumber;
597 printf(
"%4d:\n", linenumber);
607 if (currentlinenumber != linenumber) {
608 linenumber = currentlinenumber;
609 printf(
"%4d:\n", linenumber);
633 #define SHOW_TARGET(target) \
634 if (stage >= SHOW_PARSE) { \
635 printf("--> L%03d ", (target).block->nr); \
638 printf("--> insindex %d ", (target).insindex); \
641 #define SHOW_INT_CONST(val) \
642 if (stage >= SHOW_PARSE) { \
643 printf("%d (0x%08x) ", (int32_t) (val), (int32_t) (val)); \
649 #define SHOW_LNG_CONST(val) \
650 if (stage >= SHOW_PARSE) \
651 printf("%" PRId64 " (0x%016" PRIx64 ") ", (val), (val)); \
655 #define SHOW_ADR_CONST(val) \
656 if (stage >= SHOW_PARSE) \
657 printf("0x%" PRINTF_INTPTR_NUM_HEXDIGITS PRIxPTR " ", (ptrint) (val)); \
661 #define SHOW_FLT_CONST(val) \
662 if (stage >= SHOW_PARSE) { \
665 printf("%g (0x%08x) ", (val), v.i); \
671 #define SHOW_DBL_CONST(val) \
672 if (stage >= SHOW_PARSE) { \
675 printf("%g (0x%016" PRIx64 ") ", (val), v.l); \
680 #define SHOW_INDEX(index) \
681 if (stage >= SHOW_PARSE) { \
682 printf("%d ", index); \
688 #define SHOW_STRING(val) \
689 if (stage >= SHOW_PARSE) { \
691 utf_display_printable_ascii( \
692 JavaString((java_handle_t*) (val)).to_utf8()); \
699 #define SHOW_CLASSREF_OR_CLASSINFO(c) \
700 if (stage >= SHOW_PARSE) { \
701 if (c.is_classref()) \
702 class_classref_print(c.ref); \
704 class_print(c.cls); \
711 #define SHOW_FIELD(fmiref) \
712 if (stage >= SHOW_PARSE) { \
713 field_fieldref_print(fmiref); \
720 #define SHOW_VARIABLE(v) \
721 show_variable(jd, (v), stage)
723 #define SHOW_S1(iptr) \
724 if (stage >= SHOW_STACK) { \
725 SHOW_VARIABLE(iptr->s1.varindex); \
728 #define SHOW_S2(iptr) \
729 if (stage >= SHOW_STACK) { \
730 SHOW_VARIABLE(iptr->sx.s23.s2.varindex); \
733 #define SHOW_S3(iptr) \
734 if (stage >= SHOW_STACK) { \
735 SHOW_VARIABLE(iptr->sx.s23.s3.varindex); \
738 #define SHOW_DST(iptr) \
739 if (stage >= SHOW_STACK) { \
741 SHOW_VARIABLE(iptr->dst.varindex); \
744 #define SHOW_S1_LOCAL(iptr) \
745 if (stage >= SHOW_STACK) { \
746 printf("L%d ", iptr->s1.varindex); \
749 printf("JavaL%d ", iptr->s1.varindex); \
752 #define SHOW_DST_LOCAL(iptr) \
753 if (stage >= SHOW_STACK) { \
754 printf("=> L%d ", iptr->dst.varindex); \
757 printf("=> JavaL%d ", iptr->dst.varindex); \
777 #if defined(SUPPORT_COMBINE_INTEGER_REGISTERS)
779 # if defined(ENABLE_JIT)
780 # if defined(ENABLE_INTRP)
796 #if defined(ENABLE_JIT)
797 # if defined(ENABLE_INTRP)
820 if (index < 0 || index >= jd->
vartop) {
821 printf(
"<INVALID INDEX:%d>", index);
837 if (index < jd->localcount) {
840 printf(
"<INVALID FLAGS!>");
850 printf(
"<INVALID FLAGS!>");
859 printf(
"%c%c%d", kind, type, index);
887 for (i=0; i<n; ++
i) {
893 else if (javalocals) {
898 printf(
"<INVALID INDEX:%d>", vars[i]);
1194 printf(
" (javaindex %d)", iptr->
sx.
s23.s3.javaindex);
1214 argp = iptr->
sx.
s23.s2.args;
1243 #if defined(ENABLE_INLINING)
1246 show_inline_info(jd, ii, opcode, stage);
1253 argp = iptr->
sx.
s23.s2.args;
1256 if ((iptr->
s1.
argcount - 1 - i) == iptr->
sx.
s23.s3.bte->md->paramcount)
1257 printf(
" pass-through: ");
1274 argp = iptr->
sx.
s23.s2.args;
1278 printf(
" pass-through: ");
1352 i = iptr->
sx.
s23.s3.tablehigh - iptr->
sx.
s23.s2.tablelow + 1;
1354 printf(
"high=%d low=%d count=%d\n", iptr->
sx.
s23.s3.tablehigh, iptr->
sx.
s23.s2.tablelow, i);
1366 printf(
"count=%d, default=L%03d\n",
1367 iptr->
sx.
s23.s2.lookupcount,
1368 iptr->
sx.
s23.s3.lookupdefault.block->nr);
1371 i = iptr->
sx.
s23.s2.lookupcount;
1374 printf(
"\t\t%d --> L%03d\n",
1407 #if defined(ENABLE_SSA)
1430 #if defined(ENABLE_DEBUG_FILTER)
1443 #define SHOW_FILTERS_SIZE 3
1453 err = regcomp(&cf->
regex, str, REG_EXTENDED | REG_NOSUB);
1455 regerror(err, &cf->
regex, err_buf,
sizeof(err_buf));
1457 "Invalid value given for %s: `%s' (%s).",
1458 description, str, err_buf
1464 cf->
flag = default_flag;
1476 "verbose call include filter"
1484 "verbose call exclude filter"
1492 "show method filter"
1554 #define STATE_IS_INITIAL() ((FILTERVERBOSECALLCTR[0] == 0) && (FILTERVERBOSECALLCTR[1] == 0))
1555 #define STATE_IS_INCLUDE() ((FILTERVERBOSECALLCTR[0] > 0) && (FILTERVERBOSECALLCTR[1] == 0))
1556 #define STATE_IS_EXCLUDE() (FILTERVERBOSECALLCTR[1] > 0)
1557 #define EVENT_INCLUDE() (m->filtermatches & SHOW_FILTER_FLAG_VERBOSECALL_INCLUDE)
1558 #define EVENT_EXCLUDE() (m->filtermatches & SHOW_FILTER_FLAG_VERBOSECALL_EXCLUDE)
1559 #define TRANSITION_NEXT_INCLUDE() ++FILTERVERBOSECALLCTR[0]
1560 #define TRANSITION_PREV_INCLUDE() --FILTERVERBOSECALLCTR[0]
1561 #define TRANSITION_NEXT_EXCLUDE() ++FILTERVERBOSECALLCTR[1]
1562 #define TRANSITION_PREV_EXCLUDE() --FILTERVERBOSECALLCTR[1]
#define SHOW_FIELD(fmiref)
void show_javalocals_array(jitdata *jd, s4 *vars, int n, int stage)
#define JITDATA_HAS_FLAG_SHOWDISASSEMBLE(jd)
#define STATE_IS_INITIAL()
void replace_show_replacement_points(codeinfo *code)
void method_print(methodinfo *m)
#define TRANSITION_NEXT_EXCLUDE()
exception_entry * exceptiontable
#define SHOW_DST_LOCAL(iptr)
void class_print(classinfo *c)
#define TRANSITION_PREV_EXCLUDE()
insinfo_inline * inlineinfo
void unresolved_class_debug_dump(unresolved_class *ref, FILE *file)
const char * c_str()
get contents of buffer as zero-terminated c-style-string This strings lifetime is tied to it's buffer...
void class_classref_or_classinfo_print(classref_or_classinfo c)
#define SHOW_FILTERS_SIZE
Dummy implementation of a mutex.
#define BBFLAG_REPLACEMENT
JNIEnv jclass jobject const char * name
#define SHOW_DBL_CONST(val)
Buffer & write_slash_to_dot(const char *)
write to buffer, replacing '/' by '.'
const char * opt_filter_show_method
static int code_is_leafmethod(codeinfo *code)
const char * opt_filter_verbosecall_exclude
static void show_filter_init(show_filter_t *cf, const char *str, u1 flag, u1 default_flag, const char *description)
void vm_abort(const char *text,...)
static void show_variable_array_intern(jitdata *jd, s4 *vars, int n, int stage, bool javalocals)
#define IS_2_WORD_TYPE(a)
#define SHOW_FILTER_FLAG_VERBOSECALL_INCLUDE
#define TRANSITION_PREV_INCLUDE()
void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
#define SHOW_S1_LOCAL(iptr)
#define SHOW_FILTER_FLAG_VERBOSECALL_EXCLUDE
#define STATE_IS_EXCLUDE()
int show_filters_test_verbosecall_exit(methodinfo *m)
void patcher_list_show(codeinfo *code)
Show the content of the whole patcher reference list for debugging purposes.
basicblock ** predecessors
void method_println(methodinfo *m)
Option< bool > enabled("DebugCompiler2","compiler with compiler2", false, option::xx_root())
static struct show_filter show_filters[SHOW_FILTERS_SIZE]
#define SHOW_FILTER_FLAG_SHOW_METHOD
#define INSTRUCTION_GET_FIELDREF(iptr, fref)
const char * show_jit_type_names[]
void show_filters_init(void)
#define IS_FLT_DBL_TYPE(a)
void class_classref_print(constant_classref *cr)
#define RETADDR_FROM_JAVALOCAL(jl)
#define TRANSITION_NEXT_INCLUDE()
classref_or_classinfo catchtype
Fieldref, Methodref and InterfaceMethodref.
int32_t * javalocals_start
void show_variable_array(jitdata *jd, s4 *vars, int n, int stage)
#define STATE_IS_INCLUDE()
union instruction::@12 sx
icmdtable_entry_t icmd_table[256]
const char * abi_registers_integer_name[]
#define INSTRUCTION_GET_METHODDESC(iptr, md)
#define FILTERVERBOSECALLCTR
#define SHOW_TARGET(target)
static void show_variable_intern(jitdata *jd, s4 index, int stage)
void show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
int show_filters_test_verbosecall_enter(methodinfo *m)
void show_variable(jitdata *jd, s4 index, int stage)
void show_filters_apply(methodinfo *m)
void method_methodref_print(constant_FMIref *mr)
void show_allocation(s4 type, s4 flags, s4 regoff)
interface_info * interface_map
LinenumberTable * linenumbertable
#define SHOW_CLASSREF_OR_CLASSINFO(c)
java_handle_t * stringconst
#define INSTRUCTION_IS_UNRESOLVED(iptr)
struct instruction::@12::@13 s23
void unlock()
Unlocks the given mutex object and checks for errors.
const parseddesc_t parseddesc
const char * opt_filter_verbosecall_include
int32_t find(methodinfo **pm, void *pc)
Search the the line number table for the line corresponding to a given program counter.
#define SHOW_INT_CONST(val)
#define SHOW_LNG_CONST(val)
#define SHOW_ADR_CONST(val)
#define INSTRUCTION_GET_METHODREF(iptr, mref)
void lock()
Locks the given mutex object and checks for errors.
#define SHOW_FLT_CONST(val)
const char show_jit_type_letters[]
#define INS_FLAG_ID_SHIFT