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

OPCODE GENERATION

48 views
Skip to first unread message

sandeepr...@gmail.com

unread,
Oct 28, 2012, 6:45:37 PM10/28/12
to
Hi,

I wanted to generate entire log of opcodes generated as a particular website is loaded in the browser.I know that js shell provides 'dis' and 'dissrc' but I greatly help me to generate traces dynamically(traces not in sense of tracemonkeyJIT traces but entire opcodes created). Any help is appreciated.

Thanks

Dave Mandelin

unread,
Oct 29, 2012, 7:20:28 PM10/29/12
to
On Sunday, October 28, 2012 3:45:37 PM UTC-7, sandeepr...@gmail.com wrote:
> Hi,
>
> I wanted to generate entire log of opcodes generated as a particular website is loaded in the browser.I know that js shell provides 'dis' and 'dissrc' but I greatly help me to generate traces dynamically(traces not in sense of tracemonkeyJIT traces but entire opcodes created). Any help is appreciated.

You could do it by instrumenting the interpreter, and then running the browser with only the interpreter on. To force interpreter only, set these prefs in about:config :

javascript.options.ion.content false
javascript.options.methodjit.chrome false
javascript.options.methodjit.content false

In the interpreter (jsinterp.cpp) you can search for the label advance_pc: with the call to TypeCheckNextBytecode. That function should already get called for each bytecode, so you can add instrumentation code near there.

Dave
Dave

Nicolas B. Pierron

unread,
Oct 30, 2012, 2:37:55 PM10/30/12
to
Hi,

On 10/28/2012 03:45 PM, sandeepr...@gmail.com wrote:
> I wanted to generate entire log of opcodes generated as a particular website is loaded in the browser.I know that js shell provides 'dis' and 'dissrc' but I greatly help me to generate traces dynamically(traces not in sense of tracemonkeyJIT traces but entire opcodes created). Any help is appreciated.

You can have a look at all opcodes used by enabling the PCCount stats and
looking at the results after. PCCount gives a per pc output and annotate
bytecode.

The CodeInspector addon might give you such information, otherwise you can
just look at the sources and reverse engineer it. If it doesn't do what you
want, you might want to look at [1], which is a small demo inspired from the
CodeInspector code but it should no longer work with recent versions.

[1] http://people.mozilla.com/~npierron/js-profile/

--
Nicolas B. Pierron
0 new messages