Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12704,16 +12704,31 @@ mono_llvm_check_method_supported (MonoCompile *cfg)
{
#ifdef TARGET_WASM
if (mono_method_signature_internal (cfg->method)->call_convention == MONO_CALL_VARARG) {
mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
cfg->exception_message = g_strdup ("vararg callconv");
cfg->disable_llvm = TRUE;
return;
}

if (mono_method_signature_internal (cfg->method)->param_count >= 1000 - 10) {
mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR);
cfg->exception_message = g_strdup ("param count");
cfg->disable_llvm = TRUE;
return;
}

// workaround for https://github.com/dotnet/runtime/issues/117557
MonoClass *klass = cfg->method->klass;
if(klass->nested_in
&& !strcmp(m_class_get_name_space (klass->nested_in), "System.Text.RegularExpressions.Symbolic")
&& !strcmp(m_class_get_name (klass->nested_in), "SymbolicRegexBuilder`1")
&& !strcmp(m_class_get_name (klass), "NodeCacheKey")
&& !strcmp(cfg->method->name, "Equals")) {
mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED);
cfg->exception_message = g_strdup ("too complex");
cfg->disable_llvm = TRUE;
return;
}
#endif

if (cfg->llvm_only)
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -3319,7 +3319,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
error_init (cfg->error);

if (cfg->compile_aot && !try_generic_shared && (method->is_generic || mono_class_is_gtd (method->klass) || method_is_gshared)) {
cfg->exception_type = MONO_EXCEPTION_GENERIC_SHARING_FAILED;
mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED);
return cfg;
}

Expand Down
Loading