[runtime] Fix the mapping of 'int' in jit icall signatures, it should be int32 not...
authormonojenkins <jo.shields+jenkins@xamarin.com>
Thu, 19 Mar 2020 10:38:35 +0000 (06:38 -0400)
committerGitHub <noreply@github.com>
Thu, 19 Mar 2020 10:38:35 +0000 (06:38 -0400)
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
src/mono/mono/metadata/icall-signatures.h
src/mono/mono/metadata/icall.c
src/mono/mono/metadata/sgen-mono.c

index 876c427..40d2f9b 100644 (file)
@@ -199,6 +199,7 @@ ICALL_SIG (3, (object, object, ptr))                \
 ICALL_SIG (3, (object, ptr, int))              \
 ICALL_SIG (3, (object, ptr, int32))            \
 ICALL_SIG (3, (object, ptr, ptr))              \
+ICALL_SIG (3, (object, ptr, sizet))            \
 ICALL_SIG (3, (ptr, int32, ptrref))            \
 ICALL_SIG (3, (ptr, object, ptr))              \
 ICALL_SIG (3, (ptr, ptr, int))                 \
@@ -229,6 +230,8 @@ ICALL_SIG (4, (object, ptr, int, int))              \
 ICALL_SIG (4, (object, ptr, int, int32))       \
 ICALL_SIG (4, (object, ptr, int, ptr))     \
 ICALL_SIG (4, (object, ptr, ptr, int32))       \
+ICALL_SIG (4, (object, ptr, sizet, ptr))           \
+ICALL_SIG (4, (object, ptr, sizet, int32))         \
 ICALL_SIG (4, (ptr, object, int32, int32))     \
 ICALL_SIG (4, (ptr, object, ptr, ptr))         \
 ICALL_SIG (4, (ptr, ptr, int, ptr))            \
index f1889e3..1a19828 100644 (file)
@@ -9509,7 +9509,6 @@ mono_lookup_icall_symbol (MonoMethod *m)
 // Storage for these enums is pointer-sized as it gets replaced with MonoType*.
 //
 // mono_create_icall_signatures depends on this order. Handle with care.
-// It is alphabetical.
 typedef enum ICallSigType {
        ICALL_SIG_TYPE_bool     = 0x00,
        ICALL_SIG_TYPE_boolean  = ICALL_SIG_TYPE_bool,
@@ -9517,12 +9516,12 @@ typedef enum ICallSigType {
        ICALL_SIG_TYPE_float    = 0x02,
        ICALL_SIG_TYPE_int      = 0x03,
        ICALL_SIG_TYPE_int16    = 0x04,
-       ICALL_SIG_TYPE_int32    = 0x05,
-       ICALL_SIG_TYPE_int8     = 0x06,
-       ICALL_SIG_TYPE_long     = 0x07,
-       ICALL_SIG_TYPE_obj      = 0x08,
+       ICALL_SIG_TYPE_int32    = ICALL_SIG_TYPE_int,
+       ICALL_SIG_TYPE_int8     = 0x05,
+       ICALL_SIG_TYPE_long     = 0x06,
+       ICALL_SIG_TYPE_obj      = 0x07,
        ICALL_SIG_TYPE_object   = ICALL_SIG_TYPE_obj,
-       ICALL_SIG_TYPE_ptr      = ICALL_SIG_TYPE_int,
+       ICALL_SIG_TYPE_ptr      = 0x08,
        ICALL_SIG_TYPE_ptrref   = 0x09,
        ICALL_SIG_TYPE_string   = 0x0A,
        ICALL_SIG_TYPE_uint16   = 0x0B,
@@ -9530,6 +9529,7 @@ typedef enum ICallSigType {
        ICALL_SIG_TYPE_uint8    = 0x0D,
        ICALL_SIG_TYPE_ulong    = 0x0E,
        ICALL_SIG_TYPE_void     = 0x0F,
+       ICALL_SIG_TYPE_sizet    = 0x10
 } ICallSigType;
 
 #define ICALL_SIG_TYPES_1(a)                   ICALL_SIG_TYPE_ ## a,
@@ -9592,12 +9592,12 @@ mono_create_icall_signatures (void)
                m_class_get_byval_arg (mono_defaults.boolean_class), // ICALL_SIG_TYPE_bool
                m_class_get_byval_arg (mono_defaults.double_class),      // ICALL_SIG_TYPE_double
                m_class_get_byval_arg (mono_defaults.single_class),  // ICALL_SIG_TYPE_float
-               m_class_get_byval_arg (mono_defaults.int_class),         // ICALL_SIG_TYPE_int
+               m_class_get_byval_arg (mono_defaults.int32_class),       // ICALL_SIG_TYPE_int
                m_class_get_byval_arg (mono_defaults.int16_class),       // ICALL_SIG_TYPE_int16
-               m_class_get_byval_arg (mono_defaults.int32_class),       // ICALL_SIG_TYPE_int32
                m_class_get_byval_arg (mono_defaults.sbyte_class),       // ICALL_SIG_TYPE_int8
                m_class_get_byval_arg (mono_defaults.int64_class),       // ICALL_SIG_TYPE_long
                m_class_get_byval_arg (mono_defaults.object_class),      // ICALL_SIG_TYPE_obj
+               m_class_get_byval_arg (mono_defaults.int_class),         // ICALL_SIG_TYPE_ptr
                mono_class_get_byref_type (mono_defaults.int_class), // ICALL_SIG_TYPE_ptrref
                m_class_get_byval_arg (mono_defaults.string_class),      // ICALL_SIG_TYPE_string
                m_class_get_byval_arg (mono_defaults.uint16_class),      // ICALL_SIG_TYPE_uint16
@@ -9605,6 +9605,7 @@ mono_create_icall_signatures (void)
                m_class_get_byval_arg (mono_defaults.byte_class),        // ICALL_SIG_TYPE_uint8
                m_class_get_byval_arg (mono_defaults.uint64_class),      // ICALL_SIG_TYPE_ulong
                m_class_get_byval_arg (mono_defaults.void_class),        // ICALL_SIG_TYPE_void
+               m_class_get_byval_arg (mono_defaults.int_class),         // ICALL_SIG_TYPE_sizet
        };
 
        MonoMethodSignature_a *sig = (MonoMethodSignature*)&mono_icall_signatures;
index ab104aa..37e4f45 100644 (file)
@@ -2970,9 +2970,9 @@ sgen_client_init (void)
 void
 mono_gc_init_icalls (void)
 {
-       mono_register_jit_icall (mono_gc_alloc_obj, mono_icall_sig_object_ptr_int, FALSE);
-       mono_register_jit_icall (mono_gc_alloc_vector, mono_icall_sig_object_ptr_int_int, FALSE);
-       mono_register_jit_icall (mono_gc_alloc_string, mono_icall_sig_object_ptr_int_int32, FALSE);
+       mono_register_jit_icall (mono_gc_alloc_obj, mono_icall_sig_object_ptr_sizet, FALSE);
+       mono_register_jit_icall (mono_gc_alloc_vector, mono_icall_sig_object_ptr_sizet_ptr, FALSE);
+       mono_register_jit_icall (mono_gc_alloc_string, mono_icall_sig_object_ptr_sizet_int32, FALSE);
        mono_register_jit_icall (mono_profiler_raise_gc_allocation, mono_icall_sig_void_object, FALSE);
 }