为什么我会从 - trace-opt/ - trace-deopt和%getOptimizationStatus v8&#x27的API调用中获得不同的结果?

发布于 2025-01-31 05:33:06 字数 1964 浏览 3 评论 0 原文

这是 v8-module -trace-opt index.js 的输出。您可以看到函数的优化 COONSURRANDOM和COONMALINMJS 已完成。

...
[completed optimizing 0x2b0e0824a769 <JSFunction commonRandom (sfi = 0x2b0e081d3985)> (target TURBOFAN)]
...
[completed optimizing 0x2b0e0824a789 <JSFunction commonRandomJS (sfi = 0x2b0e081d39b9)> (target TURBOFAN)]
...

这是 v8-module -trace-deopt index.js 的输出。您可以看到函数 commonRandom和commonRandomjs 没有被解开。

[bailout (kind: deopt-soft, reason: Insufficient type feedback for compare operation): begin. deoptimizing 0x3907082827f9 <JSFunction randomMatrix (sfi = 0x3907081d39ed)>, opt id 0, bytecode offset 167, deopt exit 35, FP to SP delta 208, caller SP 0x7ffee6068410, pc 0x39070004611c]
[bailout (kind: deopt-soft, reason: Insufficient type feedback for compare operation): begin. deoptimizing 0x39070824a839 <JSFunction randomMatrix (sfi = 0x3907081d39ed)>, opt id 2, bytecode offset 249, deopt exit 28, FP to SP delta 208, caller SP 0x7ffee6068410, pc 0x390700047265]
[bailout (kind: deopt-soft, reason: Insufficient type feedback for unary operation): begin. deoptimizing 0x39070824a839 <JSFunction randomMatrix (sfi = 0x3907081d39ed)>, opt id 3, bytecode offset 349, deopt exit 23, FP to SP delta 264, caller SP 0x7ffee6068410, pc 0x390700047d5b]

我已经根据 -Trace-Opt/ - Trace-Deopt 标志。 howether, kturbofanded flag是 0 ,但是 koptimized和kmaglevved 都是 1S 。为什么是这样? kturbofanned koptimized kmaglevved 标志的含义是什么?

方向: V8版本9.9.67

This is the output of v8 --module --trace-opt index.js. You can see that optimization of functions commonRandom and commonRandomJS was completed.

...
[completed optimizing 0x2b0e0824a769 <JSFunction commonRandom (sfi = 0x2b0e081d3985)> (target TURBOFAN)]
...
[completed optimizing 0x2b0e0824a789 <JSFunction commonRandomJS (sfi = 0x2b0e081d39b9)> (target TURBOFAN)]
...

This is the output of v8 --module --trace-deopt index.js. You can see that functions commonRandom and commonRandomJS were not deopted.

[bailout (kind: deopt-soft, reason: Insufficient type feedback for compare operation): begin. deoptimizing 0x3907082827f9 <JSFunction randomMatrix (sfi = 0x3907081d39ed)>, opt id 0, bytecode offset 167, deopt exit 35, FP to SP delta 208, caller SP 0x7ffee6068410, pc 0x39070004611c]
[bailout (kind: deopt-soft, reason: Insufficient type feedback for compare operation): begin. deoptimizing 0x39070824a839 <JSFunction randomMatrix (sfi = 0x3907081d39ed)>, opt id 2, bytecode offset 249, deopt exit 28, FP to SP delta 208, caller SP 0x7ffee6068410, pc 0x390700047265]
[bailout (kind: deopt-soft, reason: Insufficient type feedback for unary operation): begin. deoptimizing 0x39070824a839 <JSFunction randomMatrix (sfi = 0x3907081d39ed)>, opt id 3, bytecode offset 349, deopt exit 23, FP to SP delta 264, caller SP 0x7ffee6068410, pc 0x390700047d5b]

I've implemented my own tracing script according to https://github.com/v8/v8/blob/207f489fc5df0cab30b9cde373181c0242c0874c/src/runtime/runtime.h#L897 %GetOptimizationStatus current implementation and used the same number of iterations as with --trace-opt/--trace-deopt flags. Howether, the kTurboFanned flag is 0, but kOptimized and kMaglevved are both 1s. Why is it so? What does kTurbofanned, kOptimized and kMaglevved flags mean then?

Verions:
V8 version 9.9.67

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

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

发布评论

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

评论(1

被翻牌 2025-02-07 05:33:06

像往常一样,V8是在积极发展的基础上。要解释9.9.67的%getOptimizationStatus 输出,请参阅Runtime.h的正确版本。 /runtime.h 。

“ Maglev”是一个新的编译器,仍在开发中,并在火花插花和Turbofan之间进行插槽。版本9.9.x还没有。

V8 is, as it has always been, under active development. To interpret 9.9.67's %GetOptimizationStatus output, refer to the correct version of runtime.h: https://github.com/v8/v8/blob/9.9.67/src/runtime/runtime.h.

"Maglev" is a new compiler, still under development, and slotting in between Sparkplug and Turbofan. Version 9.9.x didn't have it yet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文