From 37581cb79e71efb26a675665929a02e98eaa09b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Fri, 21 Jul 2023 17:48:38 +0000 Subject: [PATCH] [dart2wasm] Fix names of dynamic call entry functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently all closure dynamic call entries have the same name. This makes it difficult to find locations of crashes. Example: wasm-function[677]:0x1de1d: RuntimeError: illegal cast RuntimeError: illegal cast at dynamic call entry (wasm://wasm/000909b2:wasm-function[677]:0x1de1d) at method forwarder for 'call' (wasm://wasm/000909b2:wasm-function[583]:0x1b474) ... With this we now add the function name before "dynamic call entry": wasm-function[677]:0x1de1d: RuntimeError: illegal cast RuntimeError: illegal cast at C.m1 tear-off dynamic call entry (wasm://wasm/000921c6:wasm-function[677]:0x1de1d) at method forwarder for 'call' (wasm://wasm/000921c6:wasm-function[583]:0x1b474) ... Which makes it easy to find the function in .wat output as there is only one function with the name "C.m1 tear-off dyamic call entry". Change-Id: Iea726b695fc29b361a347b64194d5c09601a0999 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315440 Reviewed-by: Joshua Litt Commit-Queue: Ömer Ağacan --- pkg/dart2wasm/lib/translator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dart2wasm/lib/translator.dart b/pkg/dart2wasm/lib/translator.dart index 5fb43d8caa1..cb1954a2f05 100644 --- a/pkg/dart2wasm/lib/translator.dart +++ b/pkg/dart2wasm/lib/translator.dart @@ -739,7 +739,7 @@ class Translator with KernelNodes { w.DefinedFunction makeDynamicCallEntry() { final w.DefinedFunction function = m.addFunction( - dynamicCallVtableEntryFunctionType, "dynamic call entry"); + dynamicCallVtableEntryFunctionType, "$name dynamic call entry"); // Defer generation of the trampoline body to avoid cyclic dependency // when a tear-off constant is used as default value in the torn-off