Make it easier to correlate logs with events by spewing when emitting a function to /tmp/ion.{cfg,json}

Assigned to



JavaScript Engine
5 years ago
5 years ago


(Reporter: nmatsakis, Assigned: nmatsakis)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



5 years ago
I found this particularly helpful when there are multiple recompilations of the same script, and I wanted to see what has changed in between them.

Comment 1

5 years ago
Created attachment 773496 [details] [diff] [review]
Spew when emitting a file to logs

Jandem, not sure who to ask for this, so I picked you at random.
Assignee: general → nmatsakis
Attachment #773496 - Flags: review?(jdemooij)
Comment on attachment 773496 [details] [diff] [review]
Spew when emitting a file to logs

Review of attachment 773496 [details] [diff] [review]:

Makes sense, r=me with nits addressed.

::: js/src/ion/IonSpewer.cpp
@@ +153,5 @@
>      this->graph = graph;
>      this->function = function;
> +    if (function) {
> +        IonSpew(IonSpew_Scripts, "Spew #%d: %s:%d, %p",

Either change this to IonSpew_Logs instead, or do this only if the logs channel is used: IonSpewEnabled(IonSpew_Logs)

IONFLAGS=scripts is useful to get a list of Ion-compiled scripts and if there's an extra line for every script it's harder to read if you're not interested in the spew details.

::: js/src/ion/IonSpewer.h
@@ +22,5 @@
> +// the output of IONFLAGS=logs with what's going on in the
> +// output. Also useful for setting breakpoints: find the value of the
> +// compilation you are interested in and use it to guard your
> +// breakpoint.
> +extern uint32_t spewCounter;

Either add #ifdef DEBUG / #endif around this, or move it down to the other #ifdef DEBUG block in this file. Note that everything in IonSpewer.cpp is also debug-only.

::: js/src/ion/MIR.cpp
@@ +1135,5 @@
> +    if (canBeNegativeZero())
> +        fprintf(fp, " [-0]");
> +
> +    if (canBeNegativeOverflow())
> +        fprintf(fp, " [-o]");

Maybe use -ovf or -overflow here instead? -o looks a lot like -0
Attachment #773496 - Flags: review?(jdemooij) → review+
You need to log in before you can comment on or make changes to this bug.