Implement gsharedvt support for constrained calls to Object.GetHashCode ().
[mono.git] / mono / mini / tramp-hppa.c
index 31e2e9f088dc9eaa9efb264f444e441f4d1b0af1..3054e8c7c61ebf16da24aa8704cd15814dc7198b 100644 (file)
@@ -63,9 +63,7 @@ mono_arch_get_unbox_trampoline (MonoGenericSharingContext *gsctx, MonoMethod *m,
        if (MONO_TYPE_ISSTRUCT (mono_method_signature (m)->ret))
                this_pos = hppa_r25;
            
-       mono_domain_lock (domain);
-       start = code = mono_code_manager_reserve (domain->code_mp, 20);
-       mono_domain_unlock (domain);
+       start = code = mono_domain_code_reserve (domain, 20);
 
        hppa_set (code, addr, hppa_r1);
        hppa_ldo (code, sizeof (MonoObject), this_pos, this_pos);
@@ -116,13 +114,13 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *p, guint8 *addr)
 }
 
 void
-mono_arch_patch_plt_entry (guint8 *code, guint8 *addr)
+mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *addr)
 {
        g_assert_not_reached ();
 }
 
 void
-mono_arch_nullify_class_init_trampoline (guint8 *code8, gssize *regs)
+mono_arch_nullify_class_init_trampoline (guint8 *code8, mgreg_t *regs)
 {
        guint32 *buf = (guint32 *)((unsigned long)code8 & ~3);
        guint32 *code = buf;
@@ -139,7 +137,7 @@ mono_arch_nullify_class_init_trampoline (guint8 *code8, gssize *regs)
 }
 
 void
-mono_arch_nullify_plt_entry (guint8 *code)
+mono_arch_nullify_plt_entry (guint8 *code, mgreg_t *regs)
 {
        g_assert_not_reached ();
 }
@@ -231,7 +229,7 @@ mono_arch_create_trampoline_code (MonoTrampolineType tramp_type)
        hppa_ldo (buf, HPPA_STACK_LMF_OFFSET, hppa_r3, hppa_r1);
        hppa_stw (buf, hppa_r1, 0, hppa_r28);
 
-       /* Call mono_magic_trampoline (gssize *regs, guint8 *code, MonoMethod *m, guint8* tramp) */
+       /* Call mono_magic_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tramp) */
        hppa_ldo (buf, HPPA_STACK_LMF_OFFSET + G_STRUCT_OFFSET (MonoLMF, regs), hppa_r3, hppa_r26);
        hppa_ldw (buf, HPPA_STACK_LMF_OFFSET + G_STRUCT_OFFSET (MonoLMF, method), hppa_r3, hppa_r24);
        if (tramp_type == MONO_TRAMPOLINE_JUMP)
@@ -321,9 +319,7 @@ mono_arch_create_class_init_trampoline (MonoVTable *vtable)
        tramp = mono_get_trampoline_code (MONO_TRAMPOLINE_CLASS_INIT);
        /* This is the method-specific part of the trampoline. Its purpose is
           to provide the generic part with the MonoMethod *method pointer. */
-       mono_domain_lock (vtable->domain);
-       code = buf = mono_code_manager_reserve (vtable->domain->code_mp, METHOD_TRAMPOLINE_SIZE);
-       mono_domain_unlock (vtable->domain);
+       code = buf = mono_domain_code_reserve (vtable->domain, METHOD_TRAMPOLINE_SIZE);
 
        hppa_stw (buf, hppa_r2, -20, hppa_sp);
        hppa_copy (buf, hppa_r3, hppa_r1);
@@ -353,8 +349,6 @@ mono_arch_create_class_init_trampoline (MonoVTable *vtable)
        /* Sanity check */
        g_assert ((buf - code) <= METHOD_TRAMPOLINE_SIZE);
 
-       mono_jit_stats.method_trampolines++;
-
        return code;
 }
 
@@ -364,9 +358,7 @@ create_specific_tramp (MonoMethod *method, guint8* tramp, MonoDomain *domain)
        guint8 *code, *buf;
        MonoJitInfo *ji;
 
-       mono_domain_lock (domain);
-       code = buf = mono_code_manager_reserve (domain->code_mp, 20);
-       mono_domain_unlock (domain);
+       code = buf = mono_domain_code_reserve (domain, 20);
 
        /* Call trampoline, with the "method" pointer in r20 */
        hppa_set (buf, tramp, hppa_r1);
@@ -384,8 +376,6 @@ create_specific_tramp (MonoMethod *method, guint8* tramp, MonoDomain *domain)
        ji->code_start = code;
        ji->code_size = buf - code;
 
-       mono_jit_stats.method_trampolines++;
-
        return ji;
 }
 
@@ -442,11 +432,3 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 encoded_offset)
        g_assert_not_reached ();
        return NULL;
 }
-
-guint32
-mono_arch_get_rgctx_lazy_fetch_offset (gpointer *regs)
-{
-       /* FIXME: implement! */
-       g_assert_not_reached ();
-       return 0;
-}