• Benedikt Meurer's avatar
    [turbofan] Fix missing `break` in EscapeAnalysis. · 444f83d9
    Benedikt Meurer authored
    In the case of LoadElement in EscapeAnalysis we accidentally always set
    the object as escaping, even in the case where the index was a constant
    (or had a constant type).
    
    This forced us to always allocate array backing stores even in the
    trivial cases like swapping, i.e.
    
    ```js
    function foo(a, b) {
      [a, b] = [b, a];
      return a - b;
    }
    ```
    
    Now with this change we do proper scalar replacement again, even for the
    array backing stores.
    
    Bug: v8:9183
    Change-Id: I3b2dcade23e47df032087778aca1292c8b0d69d4
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1612907Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#61521}
    444f83d9
escape-analysis.cc 30.7 KB