- if (ji->method->save_lmf && 0) {
- /* only enable this when prologue stops emitting
- * normal save of s-regs when save_lmf is true.
- * Will have to sync with prologue code at that point.
- */
- memcpy (&new_ctx->sc_fpregs,
- (char*)sp - sizeof (float) * MONO_SAVED_FREGS,
- sizeof (float) * MONO_SAVED_FREGS);
- memcpy (&new_ctx->sc_regs,
- (char*)sp - sizeof (float) * MONO_SAVED_FREGS - sizeof (gulong) * MONO_SAVED_GREGS,
- sizeof (gulong) * MONO_SAVED_GREGS);
- } else if (ji->used_regs) {
- guint32 *insn;
- guint32 mask = ji->used_regs;
-
- /* these all happen before adjustment of fp */
- /* Look for sw ??, ????(sp) */
- insn = ((guint32 *)ji->code_start) + 1;
- while (!*insn || ((*insn & 0xffe00000) == 0xafa00000) || ((*insn & 0xffe00000) == 0xffa00000)) {
- int reg = (*insn >> 16) & 0x1f;
- guint32 addr = (((guint32)fp) + (short)(*insn & 0x0000ffff));
-
- mask &= ~(1 << reg);
- if ((*insn & 0xffe00000) == 0xafa00000)
- new_ctx->sc_regs [reg] = *(guint32 *)addr;
- else
- new_ctx->sc_regs [reg] = *(guint64 *)addr;
- insn++;
- }
- MONO_CONTEXT_SET_SP (new_ctx, sp);
- MONO_CONTEXT_SET_BP (new_ctx, sp);
- /* assert that we found all registers we were supposed to */
- g_assert (!mask);
- }