andrewiggins / v8-deopt-viewer

View deoptimizations of your JavaScript in V8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`unknown code state: ^`

wincent opened this issue Β· comments

Not sure if this is a bug, something specific to the NodeJS version I'm using (v16.13.2), or I am simply doing it wrong. 😁

I've been trying to process this v8.log file, produced with:

node --log-ic --logfile=v8.log --no-logfile-per-isolate lib/benchmark-static-lexer.js

and running this command on it:

npx v8-deopt-viewer -i v8.log

v8-deopt-viewer runs to completion and outputs its output files, but the console shows a bunch of errors along the way, of the form:

v8-deopt-parser - Error parsing V8 log file: line 4546: parse: unknown ic code state: 66
Error: parse: unknown ic code state: 66
    at parseIcState (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-parser/src/propertyICParsers.js:51:10)
    at DeoptLogReader.LogReader.dispatchLogRow_ (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-parser/src/v8-tools-core/logreader.js:206:25)
    at DeoptLogReader.LogReader.processLogLine_ (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-parser/src/v8-tools-core/logreader.js:243:12)
    at DeoptLogReader.LogReader.processLog_ (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-parser/src/v8-tools-core/logreader.js:229:10)
    at DeoptLogReader.LogReader.processLogChunk (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-parser/src/v8-tools-core/logreader.js:106:8)
    at parseV8Log (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-parser/src/index.js:12:12)
    at run (file:///home/wincent/.npm/_npx/bff88035e4613431/node_modules/v8-deopt-viewer/src/index.js:114:29)

The line it's complaining about looks like this:

StoreIC,0xe1ea49ea41e,117600,515,66,X,X,0x000000000000,listener,,

Looking in v8-deopt-viewer's output files, no deopts are reported, but there definitely are deopts happening, according to:

node --trace-opt --trace-deopt lib/benchmark-static-lexer.js

Which shows me a number of deopt-related messages, like:

[bailout (kind: deopt-soft, reason: Insufficient type feedback for compare operation): begin. deoptimizing 0x124d1da43da1 <JSFunction lex (sfi = 0xa32975ca889)>, opt id 0, bytecode offset 2046, deopt exit 104, FP to SP delta 104, caller SP 0x7ffcbf4dfea8, pc 0x7f788271b456]
[marking 0x124d1da43da1 <JSFunction lex (sfi = 0xa32975ca889)> for optimized recompilation, reason: hot and stable]
[compiling method 0x124d1da43da1 <JSFunction lex (sfi = 0xa32975ca889)> (target TURBOFAN) using TurboFan]
[optimizing 0x124d1da43da1 <JSFunction lex (sfi = 0xa32975ca889)> (target TURBOFAN) - took 1.395, 13.765, 0.044 ms]
[completed optimizing 0x124d1da43da1 <JSFunction lex (sfi = 0xa32975ca889)> (target TURBOFAN)]
[bailout (kind: deopt-eager, reason: out of bounds): begin. deoptimizing 0x124d1da43da1 <JSFunction lex (sfi = 0xa32975ca889)>, opt id 2, bytecode offset 55, deopt exit 76, FP to SP delta 104, caller SP 0x7ffcbf4dfea8, pc 0x7f7882722a9a]

This is fixed by #36 , but that isn't out to npm yet.

Excellent, thanks @marvinhagemeister. I'll close this to reduce clutter.