From db589dd64e390424188a3f63756fa4ec8fdb8c46 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 5 May 2021 23:19:00 -0400 Subject: [PATCH] [mono][aot] Avoid compiling huge (> 100K IL) methods with llvm on wasm. (#52346) The compile times are too long (> 10 minutes). --- src/mono/mono/mini/mini-llvm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 7abb8b5..755a059 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -11631,6 +11631,14 @@ emit_method_inner (EmitContext *ctx) return; } +#ifdef TARGET_WASM + if (ctx->module->interp && cfg->header->code_size > 100000) { + /* Large methods slow down llvm too much */ + set_failure (ctx, "il code too large."); + return; + } +#endif + header = cfg->header; for (i = 0; i < header->num_clauses; ++i) { clause = &header->clauses [i]; -- 2.7.4