facebookexperimental/object-introspection

JLOG* api's should be present in JIT code only when enabled

Closed this issue · 3 comments

Currently we have JLOG* macros inserted into the generated code. These are life savers for debugging JIT code execution issues but outside of that they are not needed. In fact they just bloat the text size and possibly slow us down with the addition of branches (although the macros are written with branch prediction guidance).

The JLOG* macros should only be generated when jit logging is explicitly enabled (-l on oid command line).

Hmm, if we don't inject JLOG macros without -l (during codegen), wouldn't we need to regenerate caches every time we want to see debug logging? It saves a lot of time for debugging to have these in always. I'm wondering if we can mitigate the cost of these statements somehow without removing them

Yes, we'd have to regenerate the cache. We need to do the analysis to see exactly what the effects of removing these are but in general I'm very much against having code permanently in there for debugging purposes especially when in the hot path as JIT code instructions are.

This was fixed by turning jit logging into a feature flag (#183)