#define OP_IS_OUTARG(op) (((op)==OP_OUTARG)||((op)==OP_OUTARG_REG)||((op)==OP_OUTARG_IMM)||((op)==OP_OUTARG_R4)||((op)==OP_OUTARG_R8)||((op)==OP_OUTARG_VT))
-#define OP_IS_CALL(op) (((op)==CEE_CALLI)||((op)==CEE_CALL)||((op)==CEE_CALLVIRT)||(((op)>=OP_VOIDCALL)&&((op)<=OP_CALL_MEMBASE)))
+#define OP_IS_CALL(op) (((op)==CEE_CALLI)||((op)==OP_CALL)||((op)==OP_CALLVIRT)||(((op)>=OP_VOIDCALL)&&((op)<=OP_CALL_MEMBASE)))
#define OP_IS_STORE(op) (((op)==CEE_STIND_REF)||((op)==CEE_STIND_I1)||((op)==CEE_STIND_I2)||((op)==CEE_STIND_I4)||((op)==CEE_STIND_I8)||((op)==CEE_STIND_R4)||((op)==CEE_STIND_R8)||((op)==CEE_STIND_I))
#define OP_IS_LOAD(op) (((op)==CEE_LDIND_REF)||((op)==CEE_LDIND_I1)||((op)==CEE_LDIND_I2)||((op)==CEE_LDIND_I4)||((op)==CEE_LDIND_U1)||((op)==CEE_LDIND_U2)||((op)==CEE_LDIND_U4)||((op)==CEE_LDIND_I8)||((op)==CEE_LDIND_R4)||((op)==CEE_LDIND_R8)||((op)==CEE_LDIND_I))
#define OP_IS_CONST(op) (((op)==OP_ICONST)||((op)==OP_I8CONST)||((op)==OP_R4CONST)||((op)==OP_R8CONST)||((op)==OP_AOTCONST))
case CEE_NEWARR:
printf ("[%s]", tree->inst_newa_class->name);
break;
- case CEE_CALL:
- case CEE_CALLVIRT:
+ case OP_CALL:
+ case OP_CALLVIRT:
case OP_FCALL:
case OP_FCALLVIRT:
case OP_LCALL:
case OP_VCALL:
case OP_VCALLVIRT:
case OP_VOIDCALL:
- case OP_VOIDCALLVIRT: {
+ case OP_VOIDCALLVIRT:
+ case OP_TRAMPCALL_VTABLE: {
MonoCallInst *call = (MonoCallInst*)tree;
if (call->method)
printf ("[%s]", call->method->name);
case OP_LOADI2_MEMBASE:
printf ("[%s] <- [%s + 0x%x]", mono_arch_regname (tree->dreg), mono_arch_regname (tree->inst_basereg), (int)tree->inst_offset);
break;
- case CEE_BR:
+ case OP_BR:
case OP_CALL_HANDLER:
printf ("[B%d]", tree->inst_target_bb->block_num);
break;
printf ("CODE FOR BB %d\n", bb_info->bb->block_num);
mono_aliasing_initialize_code_traversal (info, bb_info->bb);
- for (inst = bb_info->bb->code; inst != NULL; inst = inst->next) {
+ MONO_BB_FOR_EACH_INS (bb_info->bb, inst) {
print_tree_with_aliasing_information (info, inst);
printf ("\n");
}
} else if ((inst->opcode == OP_UNBOXCAST) || OP_IS_PCONV (inst->opcode) || OP_IS_ICONV (inst->opcode)) {
father_alias->type = context.subtree_aliases [0].type;
father_alias->variable_index = context.subtree_aliases [0].variable_index;
- } else if ((inst->opcode == CEE_LDELEMA) || (inst->opcode == OP_COMPARE) || (inst->opcode == CEE_SWITCH)) {
+ } else if ((inst->opcode == CEE_LDELEMA) || (inst->opcode == OP_COMPARE) || (inst->opcode == OP_SWITCH)) {
if (father_alias != NULL) {
father_alias->type = MONO_ALIASING_TYPE_NO_ALIAS;
}
bb_info->potential_alias_uses = NULL;
info->next_interesting_inst = NULL;
- for (inst = bb->code; inst != NULL; inst = inst->next) {
+ MONO_BB_FOR_EACH_INS (bb, inst) {
if (FOLLOW_ALIAS_ANALYSIS) {
printf ("TRAVERSING INST: ");
mono_print_tree_nl (inst);
}
}
+#if 0
static MonoLocalVariableList*
mono_aliasing_get_affected_variables_for_inst_in_bb (MonoAliasingInformation *info, MonoInst *inst, MonoBasicBlock *bb) {
MonoAliasUsageInformation *use;
g_assert_not_reached ();
return NULL;
}
+#endif
MonoLocalVariableList*
mono_aliasing_get_affected_variables_for_inst (MonoAliasingInformation *info, MonoInst *inst) {
printf ("KILLING slot %d at inst ", affected_variable->variable_index);
mono_print_tree_nl (inst);
}
- possibly_dead_assignments [affected_variable->variable_index]->opcode = CEE_NOP;
+ possibly_dead_assignments [affected_variable->variable_index]->opcode = OP_NOP;
possibly_dead_assignments [affected_variable->variable_index]->ssa_op = MONO_SSA_NOP;
possibly_dead_assignments [affected_variable->variable_index] = NULL;
}
printf ("Working on BB %d\n", bb->block_num);
}
- for (inst = bb->code; inst != NULL; inst = inst->next) {
+ MONO_BB_FOR_EACH_INS (bb, inst) {
mono_aliasing_deadce_on_inst (info, possibly_dead_assignments, inst);
- if (inst->opcode == CEE_JMP) {
+ if (inst->opcode == OP_JMP) {
/* Keep arguments live! */
for (variable_index = 0; variable_index < cfg->num_varinfo; variable_index++) {
if (cfg->varinfo [variable_index]->opcode == OP_ARG) {
//printf ("FAST DEADCE DEAD LOCAL\n");
- possibly_dead_assignments [variable_index]->opcode = CEE_NOP;
+ possibly_dead_assignments [variable_index]->opcode = OP_NOP;
possibly_dead_assignments [variable_index]->ssa_op = MONO_SSA_NOP;
}
}