Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to print out bytecode for a given JS code in FireFox

43 views
Skip to first unread message

Victor

unread,
Apr 10, 2012, 1:16:25 PM4/10/12
to dev-tech-...@lists.mozilla.org
Hi,

I am wondering whether there is a way to print out the bytecode for a
given JavaScript code executed by JSEngine in Firefox.

The way I did it is change the function printSSA(*cx) in jsanalyzer.cpp
a little bit, and add it to the method compile() in Compiler.cpp,
however it doesn't work correctly (the information printed does not
match the jscode I wrote).

Does someone know how to generate the bytecode?

Thanks in advance!

Victor

Dave Mandelin

unread,
May 7, 2012, 4:04:46 PM5/7/12
to dev-tech-...@lists.mozilla.org
The shell has functions 'dis' and 'disfile' that take a function and a filename, respectively. In C++, there is js_Disassemble and friends in jsopcode.h.

Dave
0 new messages