• bmeurer's avatar
    [turbofan] Reland "Add new JSFrameSpecialization reducer." and "Perform OSR... · ef661b08
    bmeurer authored
    [turbofan] Reland "Add new JSFrameSpecialization reducer." and "Perform OSR deconstruction early and remove type propagation.".
    
    We have to reland these two commits at once, because the first breaks
    some asm.js benchmarks without the second. The change was reverted
    because of bogus checks in the verifier, which will not work in the
    presence of OSR (and where hidden because of the type back propagation
    hack in OSR so far). Original messages are below:
    
    [turbofan] Add new JSFrameSpecialization reducer.
    
    The JSFrameSpecialization specializes an OSR graph to the current
    unoptimized frame on which we will perform the on-stack replacement.
    This is used for asm.js functions, where we cannot reuse the OSR
    code object anyway because of context specialization, and so we could as
    well specialize to the max instead.
    
    It works by replacing all OsrValues in the graph with their values
    in the JavaScriptFrame.
    
    The idea is that using this trick we get better performance without
    doing the unsound backpropagation of types to OsrValues later. This
    is the first step towards fixing OSR for TurboFan.
    
    [turbofan] Perform OSR deconstruction early and remove type propagation.
    
    This way we don't have to deal with dead pre-OSR code in the graph
    and risk optimizing the wrong code, especially we don't make
    optimistic assumptions in the dead code that leaks into the OSR code
    (i.e. deopt guards are in dead code, but the types propagate to OSR
    code via the OsrValue type back propagation).
    
    BUG=v8:4273
    LOG=n
    R=jarin@chromium.org
    
    Review URL: https://codereview.chromium.org/1226673005
    
    Cr-Commit-Position: refs/heads/master@{#29486}
    ef661b08
compiler.cc 60.1 KB