• Marius Wachtler's avatar
    new frame introspection using vregs for non compiler generated names · 7b24661f
    Marius Wachtler authored
    This splits up the handling of deopts and normal frame introspection (e.g. for a traceback).
    We have to add to nearly all call sites frame introspection which makes it very important that it does not introduce much overhead over a normal call instruction.
    By always storing the user visible variables into a vregs array (layout the same as in the interpreter/bjit) we can make introspection cheaper.
    Frame introspection only needs to access user facing variables therefore we don't have to generate extra bytes for spilling variables which get clobbered in the callee because all values we need to access are inside the vregs array.
    This let's use remove the 95byte overhead and reduces the stackmap size.
    It adds a slight cost of maintaining the vregs array but we were already doing some of this work before with our manual spilling with the additional benefit of faster frame introspection.
    
    The deopts case stays pretty much the same with the exception that we don't add the user visible vars to the stackmap because they are already in the vreg.
    We could reduce the overhead by implementing a special "deopt()" function in asm which stores and restores all variables thereby we would not have to manualy spill the registers when filling the deopt IC.
    Alternatively we could handle it inside llvm by either switching to a stackmap intrinsic which already supports this case or adding it it does not exist...
    But I think it's not worth it because deopts should be uncommen...
    7b24661f
patchpoints.cpp 14.4 KB