Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -8981,6 +8981,10 @@ mono_ee_interp_init (const char *opts)
set_context (NULL);

interp_parse_options (opts);

const char *env_opts = g_getenv ("MONO_INTERPRETER_OPTIONS");
if (env_opts)
interp_parse_options (env_opts);
/* Don't do any optimizations if running under debugger */
if (mini_get_debug_options ()->mdb_optimizations)
mono_interp_opt = 0;
Expand Down
10 changes: 6 additions & 4 deletions src/mono/mono/mini/interp/transform-opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3124,6 +3124,7 @@ interp_cprop (TransformData *td)
ins->data [2] = GINT_TO_UINT16 (ldsize);

interp_clear_ins (ins->prev);
td->var_values [ins->dreg].def = ins;
}
if (td->verbose_level) {
g_print ("Replace ldloca/ldobj_vt pair :\n\t");
Expand Down Expand Up @@ -3204,6 +3205,7 @@ interp_cprop (TransformData *td)
ins->data [2] = vtsize;

interp_clear_ins (ins->prev);
td->var_values [ins->dreg].def = ins;

// MINT_MOV_DST_OFF doesn't work if dreg is allocated at the same location as the
// field value to be stored, because its behavior is not atomic in nature. We first
Expand Down Expand Up @@ -3400,9 +3402,11 @@ interp_super_instructions (TransformData *td)
current_liveness.bb_dfs_index = bb->dfs_index;
current_liveness.ins_index = 0;
for (InterpInst *ins = bb->first_ins; ins != NULL; ins = ins->next) {
int opcode = ins->opcode;
int opcode;
if (bb->dfs_index >= td->bblocks_count_no_eh || bb->dfs_index == -1 || (ins->flags & INTERP_INST_FLAG_LIVENESS_MARKER))
current_liveness.ins_index++;
retry_ins:
opcode = ins->opcode;
if (MINT_IS_NOP (opcode))
continue;

Expand Down Expand Up @@ -3801,9 +3805,7 @@ interp_super_instructions (TransformData *td)
g_print ("superins: ");
interp_dump_ins (ins, td->data_items);
}
Copy link
Preview

Copilot AI Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new goto retry_ins no longer adjusts ins (original code did ins = ins->prev) so the intended behavior of re-evaluating the previous instruction is lost. Consider restoring ins = ins->prev before retry or clarifying the control flow to avoid changing logic or introducing infinite loops.

Suggested change
}
}
ins = ins->prev; // Adjust to re-evaluate the previous instruction

Copilot uses AI. Check for mistakes.

// The newly added opcode could be part of further superinstructions. Retry
ins = ins->prev;
continue;
goto retry_ins;
}
}
}
Expand Down
Loading