mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 14:32:24 +00:00
[dart2wasm] Don't generate duplicate selectors for dynamic calls
Change-Id: I8c41e8289400c4673d1268826bfe1cbc161a4d90 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332402 Reviewed-by: Aske Simon Christensen <askesc@google.com> Commit-Queue: Ömer Ağacan <omersa@google.com>
This commit is contained in:
parent
c349f992a6
commit
3a8d3cdf2f
1 changed files with 6 additions and 6 deletions
|
@ -237,13 +237,13 @@ class DispatchTable {
|
|||
final Map<int, SelectorInfo> _selectorInfo = {};
|
||||
|
||||
/// Maps member names to getter selectors with the same member name.
|
||||
final Map<String, List<SelectorInfo>> _dynamicGetters = {};
|
||||
final Map<String, Set<SelectorInfo>> _dynamicGetters = {};
|
||||
|
||||
/// Maps member names to setter selectors with the same member name.
|
||||
final Map<String, List<SelectorInfo>> _dynamicSetters = {};
|
||||
final Map<String, Set<SelectorInfo>> _dynamicSetters = {};
|
||||
|
||||
/// Maps member names to method selectors with the same member name.
|
||||
final Map<String, List<SelectorInfo>> _dynamicMethods = {};
|
||||
final Map<String, Set<SelectorInfo>> _dynamicMethods = {};
|
||||
|
||||
/// Contents of [wasmTable]. For a selector with ID S and a target class of
|
||||
/// the selector with ID C, `table[S + C]` gives the reference to the class
|
||||
|
@ -305,11 +305,11 @@ class DispatchTable {
|
|||
selector.paramInfo.merge(paramInfo);
|
||||
if (calledDynamically) {
|
||||
if (isGetter) {
|
||||
(_dynamicGetters[member.name.text] ??= []).add(selector);
|
||||
(_dynamicGetters[member.name.text] ??= {}).add(selector);
|
||||
} else if (isSetter) {
|
||||
(_dynamicSetters[member.name.text] ??= []).add(selector);
|
||||
(_dynamicSetters[member.name.text] ??= {}).add(selector);
|
||||
} else {
|
||||
(_dynamicMethods[member.name.text] ??= []).add(selector);
|
||||
(_dynamicMethods[member.name.text] ??= {}).add(selector);
|
||||
}
|
||||
}
|
||||
return selector;
|
||||
|
|
Loading…
Reference in a new issue