r/ProgrammingLanguages • • Jun 17 '26

V8 Engine Feedback Vector

Hello everyone,

Recently, I'm looking into v8 JavaScript Engine and found out about FeedBack Vector, which I want to investigate more about it in order to understand how the Engine assigns type at runtime after being interpreted by Ignition.

Although I tried to compile the v8 source code and it was able to run a simple script on my machine, I can't seem to be able to get the information regarding Feedback Vector and the data inside it.

So far, I have tried to use some promising flags that are available:

+ --log-feedback-vector
+ --maglev-print-feedback
+ --invocation-count-for-feedback-allocation=1
+ --no-lazy-feedback-allocation

None of them are working - no output to the terminal after I ran it.

I followed this (old and maybe outdated) article:
- An Introduction to Speculative Optimization in V8

With the same code, I can not retrieve the same BinaryOp which I believe have changed after many updates. I want to avoid any "natives syntax", in general, but even when I included it (e.g. %DebugPrint(add);), it does not seem to give me the information that I wanted like in the article.

My goal is to analyse JavaScript's V8 bytecode and output the correct possible types of variables (similar to what Mytype do). So if I can have another way to work around this, it would be very appreciated!

I don't know if this is the right place to ask these kind of question. Therefore, I'm sorry in advanced if this caused any confusion.

Thank you everyone for your time.

6 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/sleepydevxd Jun 19 '26

It now comes to me a bit clearer that what I can and should do.

I'm indeed aiming at static analysis/type inference and definitely want to stay at bytecode level and above rather than going in deeper layers like what you mentioned, although the speculation, after you summarised it, now make me very curious. I totally agree that the dynamic type nature of JavaScript is very complicated.

Thank you for your time and such useful insights.