You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[web] Avoid using js_util.{jsify,dartify}() in dart2wasm for converting to JS wrappers (#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 dart-lang/sdk#55183
0 commit comments