如何使用D8获得WebAssembly的功能优化状态?

发布于 2025-02-03 03:50:51 字数 241 浏览 2 评论 0原文

在JavaScript %getOptimizationStatus函数中存在,它返回编译管道中功能的当前状态。 另外,- trace-opt/ - trace-deopt/ - Trace-Baseline与JavaScript源代码正常工作。

webassebmly优化状态,另一方面似乎不可能使用这些技术进行研究。我如何看到WebAssembly功能成功地通过了升降机/涡轮汇款?

In JavaScript %GetOptimizationStatus function exists, which returns the current status of a function in a compilation pipeline.
Also, --trace-opt/--trace-deopt/--trace-baseline work fine with JavaScript source code.

WebAssebmly optimization statuses, on the other side seem to be impossible to research with those techniques. How can I see that the WebAssembly function successfully passed Liftoff/Turbofan?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他不在意 2025-02-10 03:50:51

%isliftoffunction(自然仅适用于JS可见的函数,即导出的功能),并且有- trace-wasm-compilation-times

通常,当开发人员(1)需要它时,追踪功能将建立,并且(2)假设将来将足够有用,可以实际降落代码,而不是仅在几个中进行黑客攻击。 printfs在本地,然后在解决了手头问题时丢弃它们。 WASM执行模型非常简单(目前),以至于为其构建跟踪并不需要太多。 (而且它曾经更简单,直到几个月前我们打开动态层。)


截至今天(2022-05-29,这部分可能不会很好地老化),在默认配置中:

  • 所有功能都是在执行第一个功能之前,用升降机(WASM基线编译器)编译。 (唯一的例外是希望稀有的缺少硬件支持的案例,例如使用非SSE4.1 x86硬件上的SIMD说明的功能:它们立即与Turbofan一起编译。大量的工作,不紧急。)
  • 当功能运行足够长的时间时,它会通过TurboFan进行优化,并且在下次称为时使用了优化的代码。
  • 没有OSR,没有DEOPTS,也没有回到未取代的代码(除非您开始使用DevTools进行调试)。

There's %IsLiftoffFunction (which naturally only works for functions visible to JS, i.e. exported functions), and there's --trace-wasm-compilation-times.

Generally, tracing functionality gets built when a developer (1) has a need for it, and (2) assumes that it'll be sufficiently useful in the future to actually land the code, as opposed to just hacking in a few printfs locally and then discarding them when the issue at hand has been solved. The Wasm execution model is so simple (for now) that there hasn't been much need to build tracing for it. (And it used to be even simpler, until we turned on dynamic tiering a few months ago.)


As of today (2022-05-29, this part probably won't age very well), in the default configuration:

  • All functions are compiled with Liftoff (the Wasm baseline compiler) before execution of the first function starts. (The only exception to this are hopefully-rare cases of missing hardware support, such as functions using SIMD instructions on non-SSE4.1 x86 hardware: they get compiled with Turbofan right away. I'd like to see that fixed, but it's a lot of work and not urgent.)
  • When a function runs long enough, it's optimized with Turbofan, and the optimized code is used the next time it's called.
  • There is no OSR, no deopts, no going back to unoptimized code (unless you start debugging with DevTools).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文