这是 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
发布评论
评论(1)
像往常一样,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.