+/**
+ * Fix up register locations in the case where control is transferred to an
+ * exception handler block via normal control flow (no exception).
+ */
+static void fixup_exc_handler_interface(jitdata *jd, basicblock *bptr)
+{
+ // Exception handlers have exactly 1 in-slot
+ assert(bptr->indepth == 1);
+ varinfo *var = VAR(bptr->invars[0]);
+ int32_t d = codegen_reg_of_var(0, var, REG_ITMP1_XPTR);
+ emit_load(jd, NULL, var, d);
+ // Copy the interface variable to ITMP1 (XPTR) because that's where
+ // the handler expects it.
+ emit_imove(jd->cd, d, REG_ITMP1_XPTR);
+}