From: monojenkins Date: Fri, 21 Feb 2020 22:35:41 +0000 (-0500) Subject: [metadata] Mark mono_signature_get_return_type external only (#32661) X-Git-Tag: submit/tizen/20210909.063632~9558 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43eaec400ca7ef2663b0cede8393b452db66e0e2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [metadata] Mark mono_signature_get_return_type external only (#32661) Also `mark mono_signature_get_params` external only. Runtime should use `mono_signature_get_return_type_internal` and `mono_signature_get_params_internal` Co-authored-by: Aleksey Kliger (λgeek) --- diff --git a/src/mono/mono/metadata/metadata-internals.h b/src/mono/mono/metadata/metadata-internals.h index dfa7064..38a1fc8 100644 --- a/src/mono/mono/metadata/metadata-internals.h +++ b/src/mono/mono/metadata/metadata-internals.h @@ -1223,6 +1223,12 @@ mono_assembly_get_alc (MonoAssembly *assm) return mono_image_get_alc (assm->image); } +static inline MonoType* +mono_signature_get_return_type_internal (MonoMethodSignature *sig) +{ + return sig->ret; +} + /** * mono_type_get_type_internal: * \param type the \c MonoType operated on diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index b6d6279..8768511 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -2517,11 +2517,11 @@ signature_in_image (MonoMethodSignature *sig, MonoImage *image) gpointer iter = NULL; MonoType *p; - while ((p = mono_signature_get_params (sig, &iter)) != NULL) + while ((p = mono_signature_get_params_internal (sig, &iter)) != NULL) if (type_in_image (p, image)) return TRUE; - return type_in_image (mono_signature_get_return_type (sig), image); + return type_in_image (mono_signature_get_return_type_internal (sig), image); } static gboolean @@ -2979,8 +2979,8 @@ collect_signature_images (MonoMethodSignature *sig, CollectData *data) gpointer iter = NULL; MonoType *p; - collect_type_images (mono_signature_get_return_type (sig), data); - while ((p = mono_signature_get_params (sig, &iter)) != NULL) + collect_type_images (mono_signature_get_return_type_internal (sig), data); + while ((p = mono_signature_get_params_internal (sig, &iter)) != NULL) collect_type_images (p, data); } @@ -5657,8 +5657,8 @@ mono_metadata_fnptr_equal (MonoMethodSignature *s1, MonoMethodSignature *s2, gbo return FALSE; while (TRUE) { - MonoType *t1 = mono_signature_get_params (s1, &iter1); - MonoType *t2 = mono_signature_get_params (s2, &iter2); + MonoType *t1 = mono_signature_get_params_internal (s1, &iter1); + MonoType *t2 = mono_signature_get_params_internal (s2, &iter2); if (t1 == NULL || t2 == NULL) return (t1 == t2); diff --git a/src/mono/mono/metadata/metadata.h b/src/mono/mono/metadata/metadata.h index f6646d6..c69d042 100644 --- a/src/mono/mono/metadata/metadata.h +++ b/src/mono/mono/metadata/metadata.h @@ -367,10 +367,10 @@ MONO_API mono_bool mono_type_is_pointer (MonoType *type); MONO_API mono_bool mono_type_is_reference (MonoType *type); MONO_API mono_bool mono_type_is_generic_parameter (MonoType *type); -MONO_API MonoType* +MONO_API MONO_RT_EXTERNAL_ONLY MonoType* mono_signature_get_return_type (MonoMethodSignature *sig); -MONO_API MonoType* +MONO_API MONO_RT_EXTERNAL_ONLY MonoType* mono_signature_get_params (MonoMethodSignature *sig, void **iter); MONO_API uint32_t diff --git a/src/mono/mono/mini/mini-amd64-gsharedvt.c b/src/mono/mono/mini/mini-amd64-gsharedvt.c index 03c7914..6da2539 100644 --- a/src/mono/mono/mini/mini-amd64-gsharedvt.c +++ b/src/mono/mono/mini/mini-amd64-gsharedvt.c @@ -300,8 +300,8 @@ mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_si gcinfo = caller_cinfo; } - DEBUG_AMD64_GSHAREDVT_PRINT ("source sig: (%s) return (%s)\n", mono_signature_get_desc (caller_sig, FALSE), mono_type_full_name (mono_signature_get_return_type (caller_sig))); // Leak - DEBUG_AMD64_GSHAREDVT_PRINT ("dest sig: (%s) return (%s)\n", mono_signature_get_desc (callee_sig, FALSE), mono_type_full_name (mono_signature_get_return_type (callee_sig))); + DEBUG_AMD64_GSHAREDVT_PRINT ("source sig: (%s) return (%s)\n", mono_signature_get_desc (caller_sig, FALSE), mono_type_full_name (mono_signature_get_return_type_internal (caller_sig))); // Leak + DEBUG_AMD64_GSHAREDVT_PRINT ("dest sig: (%s) return (%s)\n", mono_signature_get_desc (callee_sig, FALSE), mono_type_full_name (mono_signature_get_return_type_internal (callee_sig))); if (gcinfo->ret.storage == ArgGsharedvtVariableInReg) { /*