• Jakob Gruber's avatar
    [deoptimizer] More consistent semantics of height for all frame types · 9fe6b543
    Jakob Gruber authored
    Information required for deoptimization is passed from codegen to the
    deoptimizer through so-called translations. Translations contain,
    among many other things, a 'height' field. It is used during deopts to
    calculate the unoptimized frame height (but note that it does not
    correspond exactly to the frame height itself - further calculations
    on the deopt side are needed to get to the real frame height).
    
    The height field has roughly the following data flow:
    
    1. During codegen, we serialize whatever
    FrameStateDescriptor::GetHeight() returns.
    2. During deopts, serialized translations are converted into
    TranslatedFrame objects in TranslatedState::CreateNextTranslatedFrame.
    3. These are later used to arrive at the real frame height in multiple
    spots, e.g. in DoComputeInterpretedFrame and friends.
    
    Prior to this CL, we were adding and subtracting 1 in basically random
    spots. For example, for interpreted and construct stub frames we added
    1 in step 1 and subtracted 1 in step 3. For continuation frames, we
    added 1 in step 2 and subtracted it in step 3. Argument adaptor frames
    were left untouched.
    
    This CL removes all these +-1's. The height field now contains
    locals_count() for interpreted frames, and parameters_count() for
    everything else. I also tried to make the meaning of adds/subs clearer
    through use of named constants like kTheReceiver.
    
    Bug: v8:9534
    Change-Id: I6fd26886ff5aa63930f413d879d5480578d9dc7e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1751724Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
    Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
    Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Auto-Submit: Jakob Gruber <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63238}
    9fe6b543
frame-states.cc 8.37 KB