-
Notifications
You must be signed in to change notification settings - Fork 6k
Use dart:_wasm constructs to avoid dependence on WebAssembly.Function
#46388
Use dart:_wasm constructs to avoid dependence on WebAssembly.Function
#46388
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
…o skwasm. (#135723) Some upcoming engine changes will bind to a function provided by the emscripten JS wrapper around skwasm, rather than just the wasm module itself. This will make sure not to break the benchmarks when those engine changes land. See flutter/engine#46388
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,7 +1,8 @@ | |||
| // Copyright 2013 The Flutter Authors. All rights reserved. | |||
| // Use of this source code is governed by a BSD-style license that can be | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code here (and this file in general) could use some dartdocs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments.
flutter/engine@48973d7...d203e34 2023-09-29 [email protected] Multi-view Rasterizer (flutter/engine#45512) 2023-09-29 [email protected] Roll Dart SDK from 955a3a964621 to 0931bb8a43c8 (1 revision) (flutter/engine#46423) 2023-09-29 [email protected] [Impeller] Redo simplify invert colors. (flutter/engine#46416) 2023-09-29 [email protected] Use `dart:_wasm` constructs to avoid dependence on `WebAssembly.Function` (flutter/engine#46388) 2023-09-29 [email protected] Roll Skia from 2d4045f55fd5 to a063eaeaf1e0 (6 revisions) (flutter/engine#46420) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…o skwasm. (flutter#135723) Some upcoming engine changes will bind to a function provided by the emscripten JS wrapper around skwasm, rather than just the wasm module itself. This will make sure not to break the benchmarks when those engine changes land. See flutter/engine#46388
…5776) flutter/engine@48973d7...d203e34 2023-09-29 [email protected] Multi-view Rasterizer (flutter/engine#45512) 2023-09-29 [email protected] Roll Dart SDK from 955a3a964621 to 0931bb8a43c8 (1 revision) (flutter/engine#46423) 2023-09-29 [email protected] [Impeller] Redo simplify invert colors. (flutter/engine#46416) 2023-09-29 [email protected] Use `dart:_wasm` constructs to avoid dependence on `WebAssembly.Function` (flutter/engine#46388) 2023-09-29 [email protected] Roll Skia from 2d4045f55fd5 to a063eaeaf1e0 (6 revisions) (flutter/engine#46420) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…ion` (#46388) Use the newly exposed functionality in `dart:_wasm` to fix up two different hacks we have: 1) When creating an image from an image source, use `wasm:import` instead of `@Native` and pass the image source directly as an externref. (Direct wasm binding instead of a JS interop shim, yay). 2) When binding the surface callback, previously we were wrapping the callback in a JS function, and then using `WebAssembly.Function` to create a wasm function wrapper around that. Now, we can create a `WasmFuncRef` that is a direct reference to a dart function and pass that over. Now there are no intermediary JavaScript layers when skwasm calls back to us, and we no longer are dependent on the type reflection flag in Chrome. This fixes flutter/flutter#134556

Use the newly exposed functionality in
dart:_wasmto fix up two different hacks we have:wasm:importinstead of@Nativeand pass the image source directly as an externref. (Direct wasm binding instead of a JS interop shim, yay).WebAssembly.Functionto create a wasm function wrapper around that. Now, we can create aWasmFuncRefthat is a direct reference to a dart function and pass that over. Now there are no intermediary JavaScript layers when skwasm calls back to us, and we no longer are dependent on the type reflection flag in Chrome.This fixes flutter/flutter#134556