• Jakob Linke's avatar
    [maglev] Implement Maglev-to-Turbofan OSR · ed90ea5c
    Jakob Linke authored
    This implementation sticks closely to what Ignition-to-Turbofan (and now
    Sparkplug-to-TF) does. OSR is detected in the TieringManager by having
    optimized code available, without having entered it. The osr_urgency is
    increased to enable OSR for increasing loop depths. When a candidate
    JumpLoop backedge is reached, we call into runtime to trigger OSR
    compilation.
    
    JumpLoop also detects the availability of cached OSR'd code. When a
    matching OSR code object is available, Maglev 1) deoptimizes s.t. the
    unoptimized frame layout is reconstructed, and 2) delegates the actual
    OSR tierup to the unoptimized tier. For purposes of 1), we add a new
    DeoptimizeReason that causes a one-time eager deopt without invalidating
    any code.
    
    Drive-by: Annotate OSR for more --trace-opt output.
    
    Todo: Refactor non-Sparkplug-specific bits of the BaselineAssembler
    into a generic spot that both SP and ML can use.
    
    Bug: v8:7700
    Change-Id: I6ebab2df8b87f9f70ffb78162a3c1226ec545468
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3859850Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Commit-Queue: Jakob Linke <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82816}
    ed90ea5c
deoptimizer.cc 81.4 KB