From 15750305fc8773c17efe4f4224c52bf1b90b35b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 16 Jul 2021 15:53:05 +0200 Subject: [PATCH] Remove unnecessary intrinsics in mono/mini/intrinsics.c (#55806) - System.Environment.IsRunningOnWindows doesn't exist in the dotnet/runtime corelib - Microsoft.CodeAnalysis.CompilerServer.MemoryHelper.IsMemoryAvailable was used to workaround a bug that was fixed 2 years ago with https://github.com/dotnet/roslyn/pull/38239 and should no longer be relevant --- src/mono/mono/mini/intrinsics.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/mono/mono/mini/intrinsics.c b/src/mono/mono/mini/intrinsics.c index 90c45fd6700b..f91a8a659b5c 100644 --- a/src/mono/mono/mini/intrinsics.c +++ b/src/mono/mono/mini/intrinsics.c @@ -1623,16 +1623,6 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } return ins; } - } else if (in_corlib && - (strcmp (cmethod_klass_name_space, "System") == 0) && - (strcmp (cmethod_klass_name, "Environment") == 0)) { - if (!strcmp (cmethod->name, "get_IsRunningOnWindows") && fsig->param_count == 0) { -#ifdef TARGET_WIN32 - EMIT_NEW_ICONST (cfg, ins, 1); -#else - EMIT_NEW_ICONST (cfg, ins, 0); -#endif - } } else if (in_corlib && (strcmp (cmethod_klass_name_space, "System.Reflection") == 0) && (strcmp (cmethod_klass_name, "Assembly") == 0)) { @@ -1941,15 +1931,6 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } } - /* Workaround for the compiler server IsMemoryAvailable. */ - if (!strcmp ("Microsoft.CodeAnalysis.CompilerServer", cmethod_klass_name_space) && !strcmp ("MemoryHelper", cmethod_klass_name)) { - if (!strcmp (cmethod->name, "IsMemoryAvailable")) { - EMIT_NEW_ICONST (cfg, ins, 1); - ins->type = STACK_I4; - return ins; - } - } - // Return false for IsSupported for all types in System.Runtime.Intrinsics.* // if it's not handled in mono_emit_simd_intrinsics if (in_corlib &&