Home > Enterprise >  Why do I get differend results from --trace-opt/--trace-deopt and %GetOptimizationStatus V8's A
Why do I get differend results from --trace-opt/--trace-deopt and %GetOptimizationStatus V8's A

Time:05-23

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

CodePudding user response:

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.

  • Related