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

get replayable trace from JavaScript execution

4 views
Skip to first unread message

Yan Huang

unread,
Nov 4, 2009, 2:28:37 PM11/4/09
to

Is there a way to collect replayable traces from running JS programs?
By replayable, I mean the trace should capture enough information for
reproducing the same computation, although it might require developing
additional tools to "replay" the computation.

Obviously, my next closely related question is, what is the most
convenient way to develop such a replay tool?

Any suggestions and ideas are very welcome! I appreciate it.

Thanks,
Yan

Wes Garland

unread,
Nov 4, 2009, 2:38:37 PM11/4/09
to Yan Huang, dev-tech-...@lists.mozilla.org
Yan:

You won't be able generate traces for entire programs. The JIT works by
tracing through hot loops and generating multiple code fragments for each by
permuting for variable type change.

That said, you can get both LIR and native code for all the traces generated
by your program sent to stdout by running a debug build of tracemonkey with
the TMFLAGS=full environment variable set.

Wes

> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>

--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102

Yan Huang

unread,
Nov 4, 2009, 2:49:56 PM11/4/09
to
On Nov 4, 2:38 pm, Wes Garland <w...@page.ca> wrote:
> Yan:
>
> You won't be able generate traces for entire programs.  The JIT works by
> tracing through hot loops and generating multiple code fragments for each by
> permuting for variable type change.
>
> That said, you can get both LIR and native code for all the traces generated
> by your program sent to stdout by running a debug build of tracemonkey with
> the TMFLAGS=full environment variable set.
>
> Wes
>
I could, as well as prefer to work with intermediate representations
used by any particular JS engine, such as
the bytecode used in Spidermonkey. So JIT shouldn't pose problems for
my goal.

What do you mean by LIR?

Thanks,
-- Yan

Boris Zbarsky

unread,
Nov 4, 2009, 3:57:49 PM11/4/09
to
On 11/4/09 2:38 PM, Wes Garland wrote:
> You won't be able generate traces for entire programs. The JIT works by
> tracing through hot loops and generating multiple code fragments for each by
> permuting for variable type change.

Yan is talking about trace not in the tracing jit sense but in the "log
of opcodes executed and their operands, so that the program execution
can be replayed" sense.

-Boris

David Mandelin

unread,
Nov 4, 2009, 8:51:37 PM11/4/09
to
On 11/4/09 11:28 AM, Yan Huang wrote:
>
> Is there a way to collect replayable traces from running JS programs?
> By replayable, I mean the trace should capture enough information for
> reproducing the same computation, although it might require developing
> additional tools to "replay" the computation.

I would certainly think so, but I'm curious what 'level' you would like
to replay at. For example, any program (JS or not) can be replayed if
you record the input, results of system calls, and context switches. But
I'm guessing that's not what you want to do. The natural thing that
occurs to me would be to record the bytecodes executed and some info
about the input and system call results. If you could give some more
description of what you want to do I might be able to give more concrete
ideas.

> Obviously, my next closely related question is, what is the most
> convenient way to develop such a replay tool?
>
> Any suggestions and ideas are very welcome! I appreciate it.
>
> Thanks,
> Yan

--
Dave

0 new messages