how to disassemble JS for an entire program?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to disassemble JS for an entire program?

George-36
In the documentation of spidermonkey's JS shell, it says the following
about dissrc command:

dissrc([function])
Disassembles the JavaScript bytecode for the entire program, or for
the specified function, showing the source lines. This function only
works with programs loaded from files, either using the -f flag on
launching the shell, or by using the load() function.

But I am not very clear how can I use dissrc to disassemble the entire
program. The example given only demos how to disassemble a function
object. How could I achieve similar things on entire programs? Or is
this a misleading explanation in the document?

Thanks,
Yan Huang
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: how to disassemble JS for an entire program?

dermitteiler
On Wednesday, October 28, 2009 at 3:38:43 AM UTC+1, Yan Huang wrote:

> In the documentation of spidermonkey's JS shell, it says the following
> about dissrc command:
>
> dissrc([function])
> Disassembles the JavaScript bytecode for the entire program, or for
> the specified function, showing the source lines. This function only
> works with programs loaded from files, either using the -f flag on
> launching the shell, or by using the load() function.
>
> But I am not very clear how can I use dissrc to disassemble the entire
> program. The example given only demos how to disassemble a function
> object. How could I achieve similar things on entire programs? Or is
> this a misleading explanation in the document?
>
> Thanks,
> Yan Huang

Hello,

I am interested in the exact same problem: Disassembling a whole program using dissrc rather than just a single function. Does anybody have some pointers for this?

Thanks!
Leon
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: how to disassemble JS for an entire program?

dermitteiler
On Saturday, April 14, 2018 at 10:43:27 AM UTC+2, [hidden email] wrote:

> On Wednesday, October 28, 2009 at 3:38:43 AM UTC+1, Yan Huang wrote:
> > In the documentation of spidermonkey's JS shell, it says the following
> > about dissrc command:
> >
> > dissrc([function])
> > Disassembles the JavaScript bytecode for the entire program, or for
> > the specified function, showing the source lines. This function only
> > works with programs loaded from files, either using the -f flag on
> > launching the shell, or by using the load() function.
> >
> > But I am not very clear how can I use dissrc to disassemble the entire
> > program. The example given only demos how to disassemble a function
> > object. How could I achieve similar things on entire programs? Or is
> > this a misleading explanation in the document?
> >
> > Thanks,
> > Yan Huang
>
> Hello,
>
> I am interested in the exact same problem: Disassembling a whole program using dissrc rather than just a single function. Does anybody have some pointers for this?
>
> Thanks!
> Leon

Update: I couldn't get dis/dissrc to work, but the functionality I was asking for is given by: "./js -D ~/code.js".
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine