#define INLINE_FAILURE(msg) do { \
if ((cfg->method != method) && (method->wrapper_type == MONO_WRAPPER_NONE)) { \
if (cfg->verbose_level >= 2) \
- g_print ("inline failed: %s\n", msg); \
+ printf ("inline failed: %s\n", msg); \
goto inline_failure; \
} \
} while (0)
#define GENERIC_SHARING_FAILURE(opcode) do { \
if (cfg->generic_sharing_context) { \
if (cfg->verbose_level > 2) \
- g_print ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", method->klass->name_space, method->klass->name, method->name, method->signature->param_count, mono_opcode_name ((opcode)), __LINE__); \
+ printf ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", method->klass->name_space, method->klass->name, method->name, method->signature->param_count, mono_opcode_name ((opcode)), __LINE__); \
mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); \
goto exception_exit; \
} \
if (cfg->gsharedvt) { \
cfg->exception_message = g_strdup_printf ("gsharedvt failed for method %s.%s.%s/%d opcode %s %s:%d", method->klass->name_space, method->klass->name, method->name, method->signature->param_count, mono_opcode_name ((opcode)), __FILE__, __LINE__); \
if (cfg->verbose_level >= 2) \
- g_print ("%s\n", cfg->exception_message); \
+ printf ("%s\n", cfg->exception_message); \
mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); \
goto exception_exit; \
} \
int i;
MonoInst *tree;
- g_print ("\n%s %d: [IN: ", msg, bb->block_num);
+ printf ("\n%s %d: [IN: ", msg, bb->block_num);
for (i = 0; i < bb->in_count; ++i)
- g_print (" BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
- g_print (", OUT: ");
+ printf (" BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
+ printf (", OUT: ");
for (i = 0; i < bb->out_count; ++i)
- g_print (" BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
- g_print (" ]\n");
+ printf (" BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
+ printf (" ]\n");
for (tree = bb->code; tree; tree = tree->next)
mono_print_ins_index (-1, tree);
}
#define UNVERIFIED do { \
if (cfg->gsharedvt) { \
if (cfg->verbose_level > 2) \
- g_print ("gsharedvt method failed to verify, falling back to instantiation.\n"); \
+ printf ("gsharedvt method failed to verify, falling back to instantiation.\n"); \
mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); \
goto exception_exit; \
} \
#if 0
if (from->cil_code) {
if (to->cil_code)
- g_print ("edge from IL%04x to IL_%04x\n", from->cil_code - cfg->cil_code, to->cil_code - cfg->cil_code);
+ printf ("edge from IL%04x to IL_%04x\n", from->cil_code - cfg->cil_code, to->cil_code - cfg->cil_code);
else
- g_print ("edge from IL%04x to exit\n", from->cil_code - cfg->cil_code);
+ printf ("edge from IL%04x to exit\n", from->cil_code - cfg->cil_code);
} else {
if (to->cil_code)
- g_print ("edge from entry to IL_%04x\n", to->cil_code - cfg->cil_code);
+ printf ("edge from entry to IL_%04x\n", to->cil_code - cfg->cil_code);
else
- g_print ("edge from entry to exit\n");
+ printf ("edge from entry to exit\n");
}
#endif
if (!count)
return;
if (cfg->verbose_level > 3)
- g_print ("%d item(s) on exit from B%d\n", count, bb->block_num);
+ printf ("%d item(s) on exit from B%d\n", count, bb->block_num);
if (!bb->out_scount) {
bb->out_scount = count;
- //g_print ("bblock %d has out:", bb->block_num);
+ //printf ("bblock %d has out:", bb->block_num);
found = FALSE;
for (i = 0; i < bb->out_count; ++i) {
outb = bb->out_bb [i];
/* exception handlers are linked, but they should not be considered for stack args */
if (outb->flags & BB_EXCEPTION_HANDLER)
continue;
- //g_print (" %d", outb->block_num);
+ //printf (" %d", outb->block_num);
if (outb->in_stack) {
found = TRUE;
bb->out_stack = outb->in_stack;
break;
}
}
- //g_print ("\n");
+ //printf ("\n");
if (!found) {
bb->out_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count);
for (i = 0; i < count; ++i) {
inst->cil_code = sp [i]->cil_code;
sp [i] = locals [i];
if (cfg->verbose_level > 3)
- g_print ("storing %d to temp %d\n", i, (int)locals [i]->inst_c0);
+ printf ("storing %d to temp %d\n", i, (int)locals [i]->inst_c0);
}
/*
inst->cil_code = sp [i]->cil_code;
sp [i] = locals [i];
if (cfg->verbose_level > 3)
- g_print ("storing %d to temp %d\n", i, (int)outb->in_stack [i]->inst_c0);
+ printf ("storing %d to temp %d\n", i, (int)outb->in_stack [i]->inst_c0);
}
locals = outb->in_stack;
found = TRUE;
MonoInst *tls_get = mono_get_jit_tls_intrinsic (cfg);
if (!tls_get) {
- g_printerr ("error: --debug=casts not supported on this platform.\n.");
+ fprintf (stderr, "error: --debug=casts not supported on this platform.\n.");
exit (1);
}
#endif
if (cfg->verbose_level > 2)
- g_print ("INLINE START %p %s -> %s\n", cmethod, mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+ printf ("INLINE START %p %s -> %s\n", cmethod, mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
if (!cmethod->inline_info) {
cfg->stat_inlineable_methods++;
if ((costs >= 0 && costs < 60) || inline_always) {
if (cfg->verbose_level > 2)
- g_print ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+ printf ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
cfg->stat_inlined_methods++;
return costs + 1;
} else {
if (cfg->verbose_level > 2)
- g_print ("INLINE ABORTED %s (cost %d)\n", mono_method_full_name (cmethod, TRUE), costs);
+ printf ("INLINE ABORTED %s (cost %d)\n", mono_method_full_name (cmethod, TRUE), costs);
cfg->exception_type = MONO_EXCEPTION_NONE;
mono_loader_clear_error ();
cfg->current_method = method;
if (cfg->verbose_level > 2)
- g_print ("method to IR %s\n", mono_method_full_name (method, TRUE));
+ printf ("method to IR %s\n", mono_method_full_name (method, TRUE));
param_types = mono_mempool_alloc (cfg->mempool, sizeof (MonoType*) * num_args);
if (sig->hasthis)
}
- /*g_print ("clause try IL_%04x to IL_%04x handler %d at IL_%04x to IL_%04x\n", clause->try_offset, clause->try_offset + clause->try_len, clause->flags, clause->handler_offset, clause->handler_offset + clause->handler_len);
+ /*printf ("clause try IL_%04x to IL_%04x handler %d at IL_%04x to IL_%04x\n", clause->try_offset, clause->try_offset + clause->try_len, clause->flags, clause->handler_offset, clause->handler_offset + clause->handler_len);
while (p < end) {
- g_print ("%s", mono_disasm_code_one (NULL, method, p, &p));
+ printf ("%s", mono_disasm_code_one (NULL, method, p, &p));
}*/
/* catch and filter blocks get the exception object on the stack */
if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE ||
MonoInst *dummy_use;
/* mostly like handle_stack_args (), but just sets the input args */
- /* g_print ("handling clause at IL_%04x\n", clause->handler_offset); */
+ /* printf ("handling clause at IL_%04x\n", clause->handler_offset); */
tblock->in_scount = 1;
tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*));
tblock->in_stack [0] = mono_create_exvar_for_offset (cfg, clause->handler_offset);
start_new_bblock = 0;
for (i = 0; i < bblock->in_scount; ++i) {
if (cfg->verbose_level > 3)
- g_print ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);
+ printf ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);
EMIT_NEW_TEMPLOAD (cfg, ins, bblock->in_stack [i]->inst_c0);
*sp++ = ins;
}
cfg->cbb = bblock;
for (i = 0; i < bblock->in_scount; ++i) {
if (cfg->verbose_level > 3)
- g_print ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);
+ printf ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);
EMIT_NEW_TEMPLOAD (cfg, ins, bblock->in_stack [i]->inst_c0);
*sp++ = ins;
}
int op_size = mono_opcode_size (ip, end);
g_assert (op_size > 0); /*The BB formation pass must catch all bad ops*/
- if (cfg->verbose_level > 3) g_print ("SKIPPING DEAD OP at %x\n", ip_offset);
+ if (cfg->verbose_level > 3) printf ("SKIPPING DEAD OP at %x\n", ip_offset);
if (ip_offset + op_size == bb->end) {
MONO_INST_NEW (cfg, ins, OP_NOP);
}
if (cfg->verbose_level > 3)
- g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
+ printf ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
switch (*ip) {
case CEE_NOP:
if (constrained_call) {
if (method->wrapper_type != MONO_WRAPPER_NONE) {
if (cfg->verbose_level > 2)
- g_print ("DM Constrained call to %s\n", mono_type_get_full_name (constrained_call));
+ printf ("DM Constrained call to %s\n", mono_type_get_full_name (constrained_call));
if (!((constrained_call->byval_arg.type == MONO_TYPE_VAR ||
constrained_call->byval_arg.type == MONO_TYPE_MVAR) &&
cfg->generic_sharing_context)) {
}
} else {
if (cfg->verbose_level > 2)
- g_print ("Constrained call to %s\n", mono_type_get_full_name (constrained_call));
+ printf ("Constrained call to %s\n", mono_type_get_full_name (constrained_call));
if ((constrained_call->byval_arg.type == MONO_TYPE_VAR || constrained_call->byval_arg.type == MONO_TYPE_MVAR) && cfg->generic_sharing_context) {
/*
/* Prevent inlining of methods with tail calls (the call stack would be altered) */
INLINE_FAILURE ("tail call");
- //g_print ("HIT: %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+ //printf ("HIT: %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
#ifdef MONO_ARCH_USE_OP_TAIL_CALL
/* Handle tail calls similarly to calls */
if (mini_field_access_needs_cctor_run (cfg, method, vtable) && !(g_slist_find (class_inits, vtable))) {
mono_emit_abs_call (cfg, MONO_PATCH_INFO_CLASS_INIT, vtable->klass, helper_sig_class_init_trampoline, NULL);
if (cfg->verbose_level > 2)
- g_print ("class %s.%s needs init call for ctor\n", cmethod->klass->name_space, cmethod->klass->name);
+ printf ("class %s.%s needs init call for ctor\n", cmethod->klass->name_space, cmethod->klass->name);
class_inits = g_slist_prepend (class_inits, vtable);
}
ip += 5;
if (cfg->verbose_level > 3) {
- g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
- g_print ("<box+brtrue opt>\n");
+ printf ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
+ printf ("<box+brtrue opt>\n");
}
switch (*ip) {
if (!(g_slist_find (class_inits, vtable))) {
mono_emit_abs_call (cfg, MONO_PATCH_INFO_CLASS_INIT, vtable->klass, helper_sig_class_init_trampoline, NULL);
if (cfg->verbose_level > 2)
- g_print ("class %s.%s needs init call for %s\n", klass->name_space, klass->name, mono_field_get_name (field));
+ printf ("class %s.%s needs init call for %s\n", klass->name_space, klass->name, mono_field_get_name (field));
class_inits = g_slist_prepend (class_inits, vtable);
}
} else {
GSHAREDVT_FAILURE (op);
- /* g_print ("RO-FIELD %s.%s:%s\n", klass->name_space, klass->name, mono_field_get_name (field));*/
+ /* printf ("RO-FIELD %s.%s:%s\n", klass->name_space, klass->name, mono_field_get_name (field));*/
is_const = TRUE;
switch (ro_type) {
case MONO_TYPE_BOOLEAN:
if (cfg->spvars)
mono_create_spvar_for_region (cfg, bb->region);
if (cfg->verbose_level > 2)
- g_print ("REGION BB%d IL_%04x ID_%08X\n", bb->block_num, bb->real_offset, bb->region);
+ printf ("REGION BB%d IL_%04x ID_%08X\n", bb->block_num, bb->real_offset, bb->region);
}
}
int block_num = bb->block_num;
if (cfg->verbose_level > 2)
- g_print ("\nHANDLE-GLOBAL-VREGS BLOCK %d:\n", bb->block_num);
+ printf ("\nHANDLE-GLOBAL-VREGS BLOCK %d:\n", bb->block_num);
cfg->cbb = bb;
for (; ins; ins = ins->next) {
mono_compile_create_var_for_vreg (cfg, &mono_defaults.int64_class->byval_arg, OP_LOCAL, vreg);
if (cfg->verbose_level > 2)
- g_print ("LONG VREG R%d made global.\n", vreg);
+ printf ("LONG VREG R%d made global.\n", vreg);
}
/*
if (!get_vreg_to_inst (cfg, vreg)) {
if (G_UNLIKELY (cfg->verbose_level > 2))
- g_print ("VREG R%d used in BB%d and BB%d made global.\n", vreg, vreg_to_bb [vreg], block_num);
+ printf ("VREG R%d used in BB%d and BB%d made global.\n", vreg, vreg_to_bb [vreg], block_num);
switch (regtype) {
case 'i':
#endif
if (G_UNLIKELY (cfg->verbose_level > 2))
- g_print ("CONVERTED R%d(%d) TO VREG.\n", var->dreg, vmv->idx);
+ printf ("CONVERTED R%d(%d) TO VREG.\n", var->dreg, vmv->idx);
var->flags |= MONO_INST_IS_DEAD;
cfg->vreg_to_inst [var->dreg] = NULL;
}
MonoInst *ins;
if (cfg->verbose_level > 2)
- g_print ("\nSPILL BLOCK %d:\n", bb->block_num);
+ printf ("\nSPILL BLOCK %d:\n", bb->block_num);
/* Clear vreg_to_lvreg array */
for (i = 0; i < lvregs_len; i++)
no_lvreg = FALSE;
if (G_UNLIKELY (cfg->verbose_level > 2)) {
- g_print ("\t %.3s %d", spec, ins->dreg);
+ printf ("\t %.3s %d", spec, ins->dreg);
num_sregs = mono_inst_get_src_registers (ins, sregs);
for (srcindex = 0; srcindex < num_sregs; ++srcindex)
- g_print (" %d", sregs [srcindex]);
- g_print ("\n");
+ printf (" %d", sregs [srcindex]);
+ printf ("\n");
}
/***************/
ins->inst_offset = var->inst_offset;
spec = INS_INFO (ins->opcode);
} else {
- /* g_print ("INS: "); mono_print_ins (ins); */
+ /* printf ("INS: "); mono_print_ins (ins); */
/* Create a store instruction */
NEW_STORE_MEMBASE (cfg, store_ins, store_opcode, var->inst_basereg, var->inst_offset, ins->dreg);
/* The variable is already loaded to an lvreg */
if (G_UNLIKELY (cfg->verbose_level > 2))
- g_print ("\t\tUse lvreg R%d for R%d.\n", vreg_to_lvreg [sreg], sreg);
+ printf ("\t\tUse lvreg R%d for R%d.\n", vreg_to_lvreg [sreg], sreg);
sregs [srcindex] = vreg_to_lvreg [sreg];
//mono_inst_set_src_registers (ins, sregs);
continue;
ins->opcode = OP_NOP;
sreg = ins->dreg;
} else {
- //g_print ("%d ", srcindex); mono_print_ins (ins);
+ //printf ("%d ", srcindex); mono_print_ins (ins);
sreg = alloc_dreg (cfg, stacktypes [regtype]);
}
}
fclose (file);
- /*g_print ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
+ /*printf ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
}
#endif
}
add_general (&gr, &stack_size, &cinfo->ret, TRUE);
}
- DEBUG(g_print("params: %d\n", sig->param_count));
+ DEBUG(printf("params: %d\n", sig->param_count));
for (i = pstart; i < sig->param_count; ++i) {
if ((sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
/* Prevent implicit arguments and sig_cookie from
/* Emit the signature cookie just before the implicit arguments */
add_general (&gr, &stack_size, &cinfo->sig_cookie, TRUE);
}
- DEBUG(g_print("param %d: ", i));
+ DEBUG(printf("param %d: ", i));
if (sig->params [i]->byref) {
- DEBUG(g_print("byref\n"));
+ DEBUG(printf("byref\n"));
add_general (&gr, &stack_size, cinfo->args + n, TRUE);
n++;
continue;
else
size = mini_type_stack_size_full (gsctx, simpletype, &align, FALSE);
}
- DEBUG(g_print ("load %d bytes struct\n", size));
+ DEBUG(printf ("load %d bytes struct\n", size));
align_size = size;
nwords = 0;
align_size += (sizeof (gpointer) - 1);
}
/* align stack size to 8 */
- DEBUG (g_print (" stack size: %d (%d)\n", (stack_size + 15) & ~15, stack_size));
+ DEBUG (printf (" stack size: %d (%d)\n", (stack_size + 15) & ~15, stack_size));
stack_size = (stack_size + 7) & ~7;
cinfo->stack_usage = stack_size;
ins->opcode = OP_REGOFFSET;
ins->inst_basereg = cfg->frame_reg;
if (G_UNLIKELY (cfg->verbose_level > 1)) {
- g_print ("vret_addr =");
+ printf ("vret_addr =");
mono_print_ins (cfg->vret_addr);
}
offset += sizeof(gpointer);
if (cinfo->vtype_retaddr) {
cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
if (G_UNLIKELY (cfg->verbose_level > 1)) {
- g_print ("vret_addr = ");
+ printf ("vret_addr = ");
mono_print_ins (cfg->vret_addr);
}
}
MONO_DELETE_INS (bb, ins);
continue;
} else {
- //static int c = 0; g_print ("MATCHX %s %d\n", cfg->method->name,c++);
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
ins->opcode = OP_MOVE;
ins->sreg1 = last_ins->sreg1;
}
|| last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
ins->inst_basereg == last_ins->inst_destbasereg &&
ins->inst_offset == last_ins->inst_offset) {
- //static int c = 0; g_print ("MATCHX %s %d\n", cfg->method->name,c++);
+ //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
ins->opcode = OP_ICONST;
ins->inst_c0 = last_ins->inst_imm;
g_assert_not_reached (); // check this rule
start = code;
#if DEBUG_IMT
- g_print ("building IMT thunk for class %s %s entries %d code size %d code at %p end %p vtable %p\n", vtable->klass->name_space, vtable->klass->name, count, size, start, ((guint8*)start) + size, vtable);
+ printf ("building IMT thunk for class %s %s entries %d code size %d code at %p end %p vtable %p\n", vtable->klass->name_space, vtable->klass->name, count, size, start, ((guint8*)start) + size, vtable);
for (i = 0; i < count; ++i) {
MonoIMTCheckItem *item = imt_entries [i];
- g_print ("method %d (%p) %s vtable slot %p is_equals %d chunk size %d\n", i, item->key, item->key->name, &vtable->vtable [item->value.vtable_slot], item->is_equals, item->chunk_size);
+ printf ("method %d (%p) %s vtable slot %p is_equals %d chunk size %d\n", i, item->key, item->key->name, &vtable->vtable [item->value.vtable_slot], item->is_equals, item->chunk_size);
}
#endif
mono_domain_unlock (domain);
if (user_data.method) {
char *mname = mono_method_full_name (user_data.method, TRUE);
- g_print ("IP %p is a JIT trampoline for %s\n", ip, mname);
+ printf ("IP %p is a JIT trampoline for %s\n", ip, mname);
g_free (mname);
}
else
case OP_LOCALLOC_IMM:
return OP_LOCALLOC;
default:
- g_print ("%s\n", mono_inst_name (opcode));
+ printf ("%s\n", mono_inst_name (opcode));
g_assert_not_reached ();
return -1;
}
*/
if (cfg->verbose_level >= 4) {
- g_print (" Create LVAR R%d (R%d, R%d)\n", inst->dreg, inst->dreg + 1, inst->dreg + 2);
+ printf (" Create LVAR R%d (R%d, R%d)\n", inst->dreg, inst->dreg + 1, inst->dreg + 2);
}
#ifdef MONO_ARCH_SOFT_FLOAT
int nvtypes;
gboolean reuse_slot;
- LSCAN_DEBUG (g_print ("Allocate Stack Slots 2 for %s:\n", mono_method_full_name (cfg->method, TRUE)));
+ LSCAN_DEBUG (printf ("Allocate Stack Slots 2 for %s:\n", mono_method_full_name (cfg->method, TRUE)));
scalar_stack_slots = mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * MONO_TYPE_PINNED);
vtype_stack_slots = NULL;
int pos;
gboolean changed;
- //g_print ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
+ //printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
if (!current->interval->range) {
if (inst->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))
else
pos = current->interval->range->from;
- LSCAN_DEBUG (g_print ("process R%d ", inst->dreg));
+ LSCAN_DEBUG (printf ("process R%d ", inst->dreg));
if (current->interval->range)
LSCAN_DEBUG (mono_linterval_print (current->interval));
- LSCAN_DEBUG (g_print ("\n"));
+ LSCAN_DEBUG (printf ("\n"));
/* Check for intervals in active which expired or inactive */
changed = TRUE;
if (v->interval->last_range->to < pos) {
slot_info->active = g_list_delete_link (slot_info->active, l);
slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [v->idx]));
- LSCAN_DEBUG (g_print ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
+ LSCAN_DEBUG (printf ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
changed = TRUE;
break;
}
else if (!mono_linterval_covers (v->interval, pos)) {
slot_info->inactive = g_list_append (slot_info->inactive, v);
slot_info->active = g_list_delete_link (slot_info->active, l);
- LSCAN_DEBUG (g_print ("Interval R%d became inactive\n", cfg->varinfo [v->idx]->dreg));
+ LSCAN_DEBUG (printf ("Interval R%d became inactive\n", cfg->varinfo [v->idx]->dreg));
changed = TRUE;
break;
}
slot_info->inactive = g_list_delete_link (slot_info->inactive, l);
// FIXME: Enabling this seems to cause impossible to debug crashes
//slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [v->idx]));
- LSCAN_DEBUG (g_print ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
+ LSCAN_DEBUG (printf ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
changed = TRUE;
break;
}
else if (mono_linterval_covers (v->interval, pos)) {
slot_info->active = g_list_append (slot_info->active, v);
slot_info->inactive = g_list_delete_link (slot_info->inactive, l);
- LSCAN_DEBUG (g_print ("\tInterval R%d became active\n", cfg->varinfo [v->idx]->dreg));
+ LSCAN_DEBUG (printf ("\tInterval R%d became active\n", cfg->varinfo [v->idx]->dreg));
changed = TRUE;
break;
}
count ++;
if (count == atoi (getenv ("COUNT3")))
- g_print ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
+ printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
if (count > atoi (getenv ("COUNT3")))
slot = 0xffffff;
else {
}
#endif
- LSCAN_DEBUG (g_print ("R%d %s -> 0x%x\n", inst->dreg, mono_type_full_name (t), slot));
+ LSCAN_DEBUG (printf ("R%d %s -> 0x%x\n", inst->dreg, mono_type_full_name (t), slot));
if (inst->flags & MONO_INST_LMF) {
size = sizeof (MonoLMF);
slot = 0xffffff;
if (cfg->comp_done & MONO_COMP_LIVENESS) {
- //g_print ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
+ //printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
/* expire old intervals in active */
while (slot_info->active) {
if (amv->range.last_use.abs_pos > vmv->range.first_use.abs_pos)
break;
- //g_print ("EXPIR %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs, amv->reg);
+ //printf ("EXPIR %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs, amv->reg);
slot_info->active = g_list_delete_link (slot_info->active, slot_info->active);
slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [amv->idx]));
/*
if (count == atoi (getenv ("COUNT")))
- g_print ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
+ printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
if (count > atoi (getenv ("COUNT")))
slot = 0xffffff;
else {
case MONO_PATCH_INFO_SWITCH:
return (ji->type << 8) | ji->data.table->table_size;
default:
- g_print ("info type: %d\n", ji->type);
- mono_print_ji (ji); g_print ("\n");
+ printf ("info type: %d\n", ji->type);
+ mono_print_ji (ji); printf ("\n");
g_assert_not_reached ();
return 0;
}
if (cfg->verbose_level > 2) {
if (cfg->ret) {
- g_print ("\treturn : ");
+ printf ("\treturn : ");
mono_print_ins (cfg->ret);
}
if (sig->hasthis) {
- g_print ("\tthis: ");
+ printf ("\tthis: ");
mono_print_ins (cfg->args [0]);
}
for (i = 0; i < sig->param_count; ++i) {
- g_print ("\targ [%d]: ", i);
+ printf ("\targ [%d]: ", i);
mono_print_ins (cfg->args [i + sig->hasthis]);
}
}
* absolute address.
*/
if (info) {
- //g_print ("TEST %s %p\n", info->name, patch_info->data.target);
+ //printf ("TEST %s %p\n", info->name, patch_info->data.target);
/* for these array methods we currently register the same function pointer
* since it's a vararg function. But this means that mono_find_jit_icall_by_addr ()
* will return the incorrect one depending on the order they are registered.
}
if (cfg->verbose_level > 2) {
- g_print ("\nSEQ POINT MAP: \n");
+ printf ("\nSEQ POINT MAP: \n");
}
for (i = 0; i < cfg->seq_points->len; ++i) {
sp->next = g_new (int, sp->next_len);
j = 0;
if (cfg->verbose_level > 2 && next [i]) {
- g_print ("\tIL0x%x ->", sp->il_offset);
+ printf ("\tIL0x%x ->", sp->il_offset);
for (l = next [i]; l; l = l->next) {
next_index = GPOINTER_TO_UINT (l->data);
- g_print (" IL0x%x", info->seq_points [next_index].il_offset);
+ printf (" IL0x%x", info->seq_points [next_index].il_offset);
}
- g_print ("\n");
+ printf ("\n");
}
for (l = next [i]; l; l = l->next) {
next_index = GPOINTER_TO_UINT (l->data);
if (num_holes)
holes_size = sizeof (MonoTryBlockHoleTableJitInfo) + num_holes * sizeof (MonoTryBlockHoleJitInfo);
if (G_UNLIKELY (cfg->verbose_level >= 4))
- g_print ("Number of try block holes %d\n", num_holes);
+ printf ("Number of try block holes %d\n", num_holes);
}
if (mono_security_method_has_declsec (cfg->method_to_register)) {
hole->length = (guint16)(hole_data->basic_block->native_length - start_bb_offset);
if (G_UNLIKELY (cfg->verbose_level >= 4))
- g_print ("\tTry block hole at eh clause %d offset %x length %x\n", hole->clause, hole->offset, hole->length);
+ printf ("\tTry block hole at eh clause %d offset %x length %x\n", hole->clause, hole->offset, hole->length);
}
g_assert (i == num_holes);
}
gpointer hole_end = cfg->native_code + (hole->basic_block->native_offset + hole->basic_block->native_length);
if (hole->clause == ec && hole_end == ei->try_end) {
if (G_UNLIKELY (cfg->verbose_level >= 4))
- g_print ("\tShortening try block %d from %x to %x\n", i, (int)((guint8*)ei->try_end - cfg->native_code), hole->start_offset);
+ printf ("\tShortening try block %d from %x to %x\n", i, (int)((guint8*)ei->try_end - cfg->native_code), hole->start_offset);
ei->try_end = cfg->native_code + hole->start_offset;
break;
int end = (guint8*)ei->try_end - cfg->native_code;
int handler = (guint8*)ei->handler_start - cfg->native_code;
- g_print ("JitInfo EH clause %d flags %x try %x-%x handler %x\n", i, ei->flags, start, end, handler);
+ printf ("JitInfo EH clause %d flags %x try %x-%x handler %x\n", i, ei->flags, start, end, handler);
}
}
if (cfg->disable_llvm) {
if (cfg->verbose_level >= 1) {
//nm = mono_method_full_name (cfg->method, TRUE);
- g_print ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
+ printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
//g_free (nm);
}
mono_destroy_compile (cfg);
if (getenv ("COUNT2")) {
cfg->globalra = TRUE;
if (count == atoi (getenv ("COUNT2")))
- g_print ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
+ printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
if (count > atoi (getenv ("COUNT2")))
cfg->globalra = FALSE;
}
if (cfg->disable_llvm) {
if (cfg->verbose_level >= 1) {
//nm = mono_method_full_name (cfg->method, TRUE);
- g_print ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
+ printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
//g_free (nm);
}
mono_destroy_compile (cfg);
#if 0
if (cfg->gsharedvt)
- g_print ("GSHAREDVT: %s\n", mono_method_full_name (cfg->method, TRUE));
+ printf ("GSHAREDVT: %s\n", mono_method_full_name (cfg->method, TRUE));
#endif
/* collect statistics */
/* We can't use a domain specific method in another domain */
if ((target_domain == mono_domain_get ()) || info->domain_neutral) {
code = info->code_start;
-// g_print("Discarding code for method %s\n", method->name);
+// printf("Discarding code for method %s\n", method->name);
}
}
}
}
- //g_print ("M: %s\n", mono_method_full_name (method, TRUE));
+ //printf ("M: %s\n", mono_method_full_name (method, TRUE));
mono_arch_start_dyn_call (info->dyn_call_info, (gpointer**)args, retval, buf, sizeof (buf));
else if (!strcmp (arg, "soft-breakpoints"))
debug_options.soft_breakpoints = TRUE;
else {
- g_printerr ("Invalid option for the MONO_DEBUG env variable: %s\n", arg);
- g_printerr ("Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'dont-free-domains', 'suspend-on-sigsegv', 'suspend-on-unhandled', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'init-stacks'\n");
+ fprintf (stderr, "Invalid option for the MONO_DEBUG env variable: %s\n", arg);
+ fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'dont-free-domains', 'suspend-on-sigsegv', 'suspend-on-unhandled', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'init-stacks'\n");
exit (1);
}
}
if (mono_use_llvm) {
if (!mono_llvm_load (NULL)) {
mono_use_llvm = FALSE;
- g_printerr ("Mono Warning: llvm support could not be loaded.\n");
+ fprintf (stderr, "Mono Warning: llvm support could not be loaded.\n");
}
}
if (mono_use_llvm)
#ifdef MONO_ARCH_HAVE_NOTIFY_PENDING_EXC
// This is experimental code so provide an env var to switch it off
if (getenv ("MONO_DISABLE_PENDING_EXCEPTIONS")) {
- g_print ("MONO_DISABLE_PENDING_EXCEPTIONS env var set.\n");
+ printf ("MONO_DISABLE_PENDING_EXCEPTIONS env var set.\n");
} else {
check_for_pending_exc = FALSE;
mono_threads_install_notify_pending_exc (mono_arch_notify_pending_exc);
g_hash_table_insert (assemblies, ass, ass);
if (mini_verbose > 0)
- g_print ("PRECOMPILE: %s.\n", mono_image_get_filename (image));
+ printf ("PRECOMPILE: %s.\n", mono_image_get_filename (image));
for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);