}
}
+/*
+ * mono_call_inst_add_outarg_vt:
+ *
+ * Register OUTARG_VT as belonging to CALL.
+ */
+void
+mono_call_inst_add_outarg_vt (MonoCompile *cfg, MonoCallInst *call, MonoInst *outarg_vt)
+{
+ call->outarg_vts = g_slist_append_mempool (cfg->mempool, call->outarg_vts, outarg_vt);
+}
+
static void
resize_spill_info (MonoCompile *cfg, int bank)
{
} RegTrack;
#ifndef DISABLE_LOGGING
+
+static const char* const patch_info_str[] = {
+#define PATCH_INFO(a,b) "" #a,
+#include "patch-info.h"
+#undef PATCH_INFO
+};
+
+void
+mono_print_ji (const MonoJumpInfo *ji)
+{
+ switch (ji->type) {
+ case MONO_PATCH_INFO_RGCTX_FETCH: {
+ MonoJumpInfoRgctxEntry *entry = ji->data.rgctx_entry;
+
+ printf ("[RGCTX_FETCH ");
+ mono_print_ji (entry->data);
+ printf (" - %s]", mono_rgctx_info_type_to_str (entry->info_type));
+ break;
+ }
+ case MONO_PATCH_INFO_METHODCONST: {
+ char *s = mono_method_full_name (ji->data.method, TRUE);
+ printf ("[METHODCONST - %s]", s);
+ g_free (s);
+ break;
+ }
+ default:
+ printf ("[%s]", patch_info_str [ji->type]);
+ break;
+ }
+}
+
void
mono_print_ins_index (int i, MonoInst *ins)
{
printf (" R%d", ((MonoInst*)ins->inst_p0)->dreg);
break;
case OP_REGOFFSET:
+ case OP_GSHAREDVT_ARG_REGOFFSET:
printf (" + 0x%lx", (long)ins->inst_offset);
break;
default:
case OP_IAND_IMM:
case OP_IOR_IMM:
case OP_IXOR_IMM:
+ case OP_SUB_IMM:
printf (" [%d]", (int)ins->inst_imm);
break;
case OP_ADD_IMM:
case OP_VCALL2_MEMBASE:
case OP_VOIDCALL:
case OP_VOIDCALL_MEMBASE:
- case OP_VOIDCALLVIRT: {
+ case OP_VOIDCALLVIRT:
+ case OP_TAILCALL: {
MonoCallInst *call = (MonoCallInst*)ins;
GSList *list;
char *full_name = mono_method_full_name (call->method, TRUE);
printf (" [%s]", full_name);
g_free (full_name);
+ } else if (call->fptr_is_patch) {
+ MonoJumpInfo *ji = (MonoJumpInfo*)call->fptr;
+
+ printf (" ");
+ mono_print_ji (ji);
} else if (call->fptr) {
MonoJitICallInfo *info = mono_find_jit_icall_by_addr (call->fptr);
if (info)
case OP_GC_LIVENESS_USE:
printf (" R%d", (int)ins->inst_c1);
break;
+ case OP_SEQ_POINT:
+ printf (" il: %x", (int)ins->inst_imm);
+ break;
default:
break;
}
}
}
#else
+
+void
+mono_print_ji (const MonoJumpInfo *ji)
+{
+}
+
void
mono_print_ins_index (int i, MonoInst *ins)
{
g_assert (bank < MONO_NUM_REGBANKS);
- DEBUG (printf ("\tstart regmask to assign R%d: 0x%08" G_GUINT64_FORMAT " (R%d <- R%d R%d R%d)\n", reg, (guint64)regmask, ins->dreg, ins->sreg1, ins->sreg2, ins->sreg3));
+ DEBUG (printf ("\tstart regmask to assign R%d: 0x%08llu (R%d <- R%d R%d R%d)\n", reg, (unsigned long long)regmask, ins->dreg, ins->sreg1, ins->sreg2, ins->sreg3));
/* exclude the registers in the current instruction */
num_sregs = mono_inst_get_src_registers (ins, sregs);
for (i = 0; i < num_sregs; ++i) {
DEBUG (printf ("\t\texcluding dreg %s\n", mono_regname_full (ins->dreg, bank)));
}
- DEBUG (printf ("\t\tavailable regmask: 0x%08" G_GUINT64_FORMAT "\n", (guint64)regmask));
+ DEBUG (printf ("\t\tavailable regmask: 0x%08llu\n", (unsigned long long)regmask));
g_assert (regmask); /* need at least a register we can free */
sel = 0;
/* we should track prev_use and spill the register that's farther */
free_up_hreg (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, MonoInst *ins, int hreg, int bank)
{
if (G_UNLIKELY (bank)) {
- if (!(cfg->rs->free_mask [1] & (regmask (hreg)))) {
+ if (!(cfg->rs->free_mask [bank] & (regmask (hreg)))) {
bank = translate_bank (cfg->rs, bank, hreg);
DEBUG (printf ("\tforced spill of R%d\n", cfg->rs->symbolic [bank] [hreg]));
spill_vreg (cfg, bb, last, ins, cfg->rs->symbolic [bank] [hreg], bank);
def->inst_c0 = spill;
def->inst_c1 = bank;
mono_bblock_insert_after_ins (bb, store, def);
- *last = def;
}
}
int fpstack [8];
int sp = 0;
#endif
- int num_sregs;
+ int num_sregs = 0;
int sregs [MONO_MAX_SRC_REGS];
if (!bb->code)
MONO_INST_NEW (cfg, fxch, OP_X86_FXCH);
fxch->inst_imm = sp - 1 - i;
- prev->next = fxch;
- fxch->next = ins;
+ mono_bblock_insert_after_ins (bb, prev, fxch);
prev = fxch;
tmp = fpstack [sp - 1];
MONO_INST_NEW (cfg, fxch, OP_X86_FXCH);
fxch->inst_imm = 1;
- prev->next = fxch;
- fxch->next = ins;
+ mono_bblock_insert_after_ins (bb, prev, fxch);
prev = fxch;
tmp = fpstack [sp - 1];
MONO_INST_NEW (cfg, fxch, OP_X86_FXCH);
fxch->inst_imm = sp - 1 - i;
- prev->next = fxch;
- fxch->next = ins;
+ mono_bblock_insert_after_ins (bb, prev, fxch);
prev = fxch;
tmp = fpstack [sp - 1];
MONO_INST_NEW (cfg, fxch, OP_X86_FXCH);
fxch->inst_imm = sp - 1 - i;
- prev->next = fxch;
- fxch->next = ins;
+ mono_bblock_insert_after_ins (bb, prev, fxch);
prev = fxch;
tmp = fpstack [sp - 1];
switch (cmp_opcode) {
case OP_ICOMPARE:
case OP_ICOMPARE_IMM:
- case OP_LCOMPARE_IMM:
return CMP_TYPE_I;
default:
return CMP_TYPE_L;
return FALSE;
case MONO_TYPE_VALUETYPE:
return FALSE;
+ default:
+ return FALSE;
}
- return FALSE;
}
#ifndef DISABLE_JIT