if (((code [-13] == 0x49) && (code [-12] == 0xbb)) || (code [-5] == 0xe8)) {
if (code [-5] != 0xe8) {
if (can_write) {
+ g_assert ((guint64)(orig_code - 11) % 8 == 0);
InterlockedExchangePointer ((gpointer*)(orig_code - 11), addr);
VALGRIND_DISCARD_TRANSLATIONS (orig_code - 11, sizeof (gpointer));
}
g_free (rgctx_null_jumps);
- /* move the rgctx pointer to the VTABLE register */
- amd64_mov_reg_reg (code, MONO_ARCH_VTABLE_REG, AMD64_ARG_REG1, sizeof(gpointer));
+ if (MONO_ARCH_VTABLE_REG != AMD64_ARG_REG1) {
+ /* move the rgctx pointer to the VTABLE register */
+ amd64_mov_reg_reg (code, MONO_ARCH_VTABLE_REG, AMD64_ARG_REG1, sizeof(gpointer));
+ }
if (aot) {
code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, g_strdup_printf ("specific_trampoline_lazy_fetch_%u", slot));