Skip to content
  • fpizlo@apple.com's avatar
    FTL should be able to do simple OSR exits using llvm.webkit.stackmap · ea92c209
    fpizlo@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=122538
    
    Reviewed by Oliver Hunt.
            
    This gives the FTL the ability to OSR exit using the llvm.webkit.stackmap intrinsic.
            
    - The FTL compiles all OSR exit calls as calls to llvm.webkit.stackmap with a unique
      ID, passing a requested size that is big enough for own jump replacement.
            
    - After LLVM compilation, we parse the new LLVM stackmap section.
            
    - For all llvm.webkit.stackmaps that we used for OSR exits, we do a jumpReplacement,
      which targets exit thunks that we generate.
            
    - If an exit thunk fires, it causes JSC to compile an exit off-ramp that uses a
      combination of the JSC-internal OSR exit accounting (FTL::ExitValue and friends) and
      LLVM stackmap's accounting of where data actually ended up (register, indirect,
      constant) to reconstruct bytecode state.
            
    This still has shortcomings; for example it cannot handle XMM or YMM registers. Handling
    Y...
    ea92c209