- gboolean proxy = FALSE;
- gboolean need_rgctx_tramp = FALSE;
-
- m = arg;
-
- if (m == MONO_FAKE_VTABLE_METHOD) {
- int displacement;
- MonoVTable *vt = mono_arch_get_vcall_slot (code, regs, &displacement);
- if (!vt) {
- int i;
- MonoJitInfo *ji;
-
- ji = mono_jit_info_table_find (mono_domain_get (), (char*)code);
- if (ji)
- printf ("Caller: %s\n", mono_method_full_name (ji->method, TRUE));
- /* Print some debug info */
- for (i = 0; i < 32; ++i)
- printf ("0x%x ", code [-32 + i]);
- printf ("\n");
- g_assert (vt);
- }
- if (displacement > 0) {
- displacement -= G_STRUCT_OFFSET (MonoVTable, vtable);
- g_assert (displacement >= 0);
- displacement /= sizeof (gpointer);
-
- /* Avoid loading metadata or creating a generic vtable if possible */
- addr = mono_aot_get_method_from_vt_slot (mono_domain_get (), vt, displacement);
- if (addr)
- addr = mono_create_ftnptr (mono_domain_get (), addr);
- if (addr && !vt->klass->valuetype) {
- vtable_slot = mono_get_vcall_slot_addr (code, regs);
- if (mono_aot_is_got_entry (code, (guint8*)vtable_slot) || mono_domain_owns_vtable_slot (mono_domain_get (), vtable_slot)) {
- *vtable_slot = mono_get_addr_from_ftnptr (addr);
- }
-
- return addr;
- }
+ gboolean virtual, proxy = FALSE, variance_used = FALSE;
+ gpointer *orig_vtable_slot, *vtable_slot_to_patch = NULL;
+ MonoJitInfo *ji = NULL;