From e1256b9939be7e08fcf58d42ffac6f0666cb5c4c Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Mon, 31 Oct 2022 16:25:17 +0000 Subject: [PATCH] [vm/corelib] Make sure _Closure.call is not tree-shaken _Closure.call is implicitly used in the VM to implement function calls. It should never be tree-shaken even if there are no explicit calls to _Closure.call. TEST=Manually patched in https://dart-review.googlesource.com/c/sdk/+/265962 which removes remaining dynamic calls to 'call' from core library and verified that 'Hello world' works in AOT mode. Change-Id: Ifd6803c98892f38e037abb0aa0ea1eb810621a58 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266423 Commit-Queue: Alexander Markov Reviewed-by: Slava Egorov --- sdk/lib/_internal/vm/lib/function.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/lib/_internal/vm/lib/function.dart b/sdk/lib/_internal/vm/lib/function.dart index ff8a0e05e0b6..99b18ae933ce 100644 --- a/sdk/lib/_internal/vm/lib/function.dart +++ b/sdk/lib/_internal/vm/lib/function.dart @@ -18,6 +18,7 @@ class _Closure implements Function { return _hash; } + @pragma("vm:entry-point") _Closure get call => this; @pragma("vm:external-name", "Closure_computeHash")