Skip to content

Commit

Permalink
[vm/corelib] Make sure _Closure.call is not tree-shaken
Browse files Browse the repository at this point in the history
_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 <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
  • Loading branch information
alexmarkov authored and Commit Queue committed Oct 31, 2022
1 parent 85a841e commit e1256b9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sdk/lib/_internal/vm/lib/function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class _Closure implements Function {
return _hash;
}

@pragma("vm:entry-point")
_Closure get call => this;

@pragma("vm:external-name", "Closure_computeHash")
Expand Down

0 comments on commit e1256b9

Please sign in to comment.