• wenqin.yang's avatar
    [Interpreter]Elide redundant load context bytecode · c4a0e4a1
    wenqin.yang authored
    We found there are redundant load context operations in
    some bytecode array.
    
    like this:
    LdaImmutableCurrentContextSlot [1]
    Star0
    ......   (don’t edit accumulator)
    LdaImmutableCurrentContextSlot [1]
    Star1
    Add r1
    
    In that case, we could modify this bytecode array as:
    LdaImmutableCurrentContextSlot [1]
    Star0
    ......   (don’t edit accumulator)
    Add r0
    
    This CL will elide these redundant bytecodes
    (LdaImmutableCurrentContextSlot and Star1), because there is no
    side effect for loading context, and this context slot is immutable.
    
    Change-Id: Ia26f4b934d3bd1d48c50c0c4699ba7942939991c
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3816221Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
    Commit-Queue: Shu-yu Guo <syg@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82641}
    c4a0e4a1
ElideRedundantLoadOperationOfImmutableContext.golden 686 Bytes