forked from firka/flutter
d7ce346fba22869c58dbb69cb395bd905434af54
js_util.{jsify,dartify}() in dart2wasm for converting to JS wrappers (flutter/engine#51375)
The `js_util.jsify()` related code shows up in CPU profile of wonderous. => Any `SkwasmObjectWrapper` object invokes this logic in the constructor and dispose method. This PR * makes `DomFinalizationRegistryExtension` accept `JSAny` types instead of Dart types and internally converting => Callsites can call more precise `<>.toJS*` extension methods => Will avoids extra type checks on the objects when we can call `Object.toJSBox` directly * makes us use a `toJSWrapper` / `fromJSWrapper` which will not delegate to a recursive `jsify()` but simply externalize the wasm gc object => We cannot use `Object.toJSBox` due to it being slower to create JS boxes as it semantically does something different atm (see issue below) => Instead use conditional import of `dart:_wasm` which provides the necessary primitives => Similar for going from JS to Dart. * Avoid converting from Dart object to `JSAny` more than needed (we did the operation twice for each registration and once for unregistration) Issue https://github.com/dart-lang/sdk/issues/55183
[web] Avoid using
js_util.{jsify,dartify}() in dart2wasm for converting to JS wrappers (flutter/engine#51375)
Description
No description provided
Languages
Dart
75.4%
C++
16.4%
Objective-C++
2.7%
Java
2.7%
Objective-C
0.6%
Other
1.8%