Hi Paddy,

On 08/01/2012 01:46 PM, Paddy Mullen wrote:
 From firefox how do I know what type inferences are being picked up for my 
javascript code?  How do I see the generated assembly?  Do I have to use a raw 
build of ionmonkey?

From Firefox, I will recommend use to use the Code (JIT) Inspector made by Brian Hackett, This is a Firefox extension which can display more information about your javascript. Sadly we have no good UI to clarify its output.

If you want to see the byte code then you might use the function used by this extension.

           const Ci = Components.interfaces;
            var utils = window
                .QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIDOMWindowUtils);

            utils.startPCCountProfiling();
            … some code to profile …
            utils.stopPCCountProfiling();

            var count = utils.getPCCountScriptCount();
            for (var i = 0; i < count; i++) {
                var summary = JSON.parse(utils.getPCCountScriptSummary(i));
                var detail = JSON.parse(utils.getPCCountScriptContents(i));
                …
            }
            utils.purgePCCounts();

The previous technique does not work yet with IonMonkey. Once Bug 771118 is fixed, the previous extension might work with ion monkey too.

If you want to have a look in the details of IonMonkey, I won't recommend you to look at the assembly first, but at the codegen and at the output of iongraph[1]. When you run the shell with IONFLAGS=logs, IonMonkey will send some spew in a temporary file which is retrieved by iongraph.

If you absolutely want to look at the assembly, I will recommend you to use gdb to disassemble the code which is produced by IonMonkey.

[1] https://github.com/sstangl/iongraph

--
Nicolas B. Pierron
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to