• Kevin Modzelewski's avatar
    Use patchpoints to skip decref jit overhead · c83f33a3
    Kevin Modzelewski authored
    Represent decref/xdecref operations as opaque functions calls.
    I think the ideal solution would be to add a custom llvm intrinsic,
    but I spent a small amount of time looking into that and had trouble
    figuring out how to do that.
    
    So instead, just emit them as patchpoints, and then patch them afterwards
    with a fixed code sequence.
    
    This commit only does this for decref/xdecref because:
    - they occur much more frequently
    - they are much more expensive to jit since they involve control flow
    - forcing the op to fit a C-calling-convention isn't that much overhead,
      since the register allocator probably would have done that anyway due
      to the (potential) dealloc call.
    c83f33a3
patchpoints.h 6.3 KB