Closed Bug 1632067 Opened 9 months ago Closed 9 months ago

Generate a CacheIR spewer for JitSpew


(Core :: JavaScript Engine: JIT, task, P1)




Tracking Status
firefox77 --- fixed


(Reporter: jandem, Assigned: jandem)


(Blocks 1 open bug)



(6 files)

Now that we have CacheIROps.yaml and code generation for it (bug 1629791) we can use it to generate a text spewer for the warp-snapshots channel. Output looks like this:

      GuardShape                    objId 0, shapeOffset 0
      LoadEnclosingEnvironment      objId 0, resultId 1
      GuardShape                    objId 1, shapeOffset 8
      LoadDynamicSlotResult         objId 1, offsetOffset 16

We can also improve the JSON spewer a bit.

I also have various follow-up cleanups for bug 1629791 that I'll post here.

This was used for reused stub fields.

"operand" is a bit confusing for this considering not all operands are OperandIds.

'args' matches CacheIROpFormat::ArgLengths.

Depends on D71900

This changes the JSON spewer to include a bit more information. I'm not sure if
this breaks anything that's actively being used, but it should be easy to fix.

Most of the enums are just converted to an integer, but we could now easily dump
a string representation for them like what we do for JSOp.

Hopefully this won't affect code size too much. JS_CACHEIR_SPEW is only defined in
debug and Nightly builds so there should be no effect on beta/release builds.

Depends on D71901

Define the lengths directly in the Python script. Make CacheIRWriter assert the
written arguments match this information to ensure everything stays in sync.

Depends on D71903

Blocks: 1632127
Pushed by
part 1 - Remove unused FieldOffset. r=iain
part 2 - Make *Id in the YAML file consistent with *OperandId. r=iain
part 3 - Rename operands to args. r=iain
part 4 - Generate spewer code and use it for text and JSON spewers. r=iain
part 5 - Move CacheIrOpNames definition to the cpp file. r=iain
part 6 - Simplify arguments length code. r=iain
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.