Open Bug 1486542 Opened Last year Updated Last year

Print some indicator to CACHEIR_LOGS when attachment doesn't happen

Categories

(Core :: JavaScript Engine: JIT, enhancement, P5)

enhancement

Tracking

()

Tracking Status
firefox63 --- affected

People

(Reporter: mgaudet, Unassigned)

References

(Blocks 1 open bug)

Details

When developing Inline Caches with CacheIR, CACHEIR_LOGS is one of the debugging tools we have. 

This environment option prints to a file the log of all attempts to attache a CacheIR based inline cache. 

The log entries look like this: 

    {
      "name":"Compare",
      "file":"../jit-test/tests/cacheir/compare.js",
      "mode":0,
      "line":9,
      "column":24,
      "pc":"10606397e",
      "lhs":{
        "type":"int32",
        "value":8
      },
      "rhs":{
        "type":"int32",
        "value":30
      },
      "op":"lt",
      "attached":"Int32"
    },

The log output as it is misses one important use case: Distinguishing easily cases where the CacheIR code was unable to attach an inline cache. In some circumstances this can be indicative of a need to add an inline cache. Right now, failure to attach an Inline Cache looks like this:

    {
      "name":"SetProp",
      "file":"../jit-test/tests/cacheir/compare.js",
      "mode":0,
      "line":5,
      "column":8,
      "pc":"106063892",
      "base":{
        "type":"global",
        "value":"105d89060 (shape: 105db7970)"
      },
      "property":{
        "type":"string",
        "value":"input"
      },
      "value":{
        "type":"Array",
        "value":"105d95100 (shape: 105db0078)"
      }
    },

Exactly the same as the the successful case, except missing the "attached" key to indicate that the cache was attached. 

I propose we should instead have a key for all attempts, but simply put "attached":"false", to indicate failure. 

This would be very useful for cursory analytics with grep.
(This is perhaps less urgent now that http://tomschuster.name/cacheir-tools/ has been updated. If we do decide to change this, http://tomschuster.name/cacheir-tools/ will need to be patched to handle both old-and-new style logs)
Keywords: good-first-bug
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.