Skip to content

Commit

Permalink
Remove unnecessary intrinsics in mono/mini/intrinsics.c (#55806)
Browse files Browse the repository at this point in the history
- 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 dotnet/roslyn#38239 and should no longer be relevant
  • Loading branch information
akoeplinger committed Jul 16, 2021
1 parent 87a2b50 commit 1575030
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/mono/mono/mini/intrinsics.c
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit 1575030

Please sign in to comment.