• Benedikt Meurer's avatar
    [turbofan] Constant-fold keyed loads of sealed properties. · 7816413f
    Benedikt Meurer authored
    We can constant-fold JSLoadProperty(o, i) when o is a known object (i.e.
    TurboFan's context specialization provides a known non-null/-undefined
    constant value for it), i is a known array index and o["i"] is an
    element on the receiver, that is non-configurable and non-writable (i.e.
    o was frozen using Object.freeze earlier, or o is a String object).
    
    This significantly reduces execution time of the tagged templates
    micro-benchmarks (ES6 and Babel transpiled), when combined with the
    CL https://chromium-review.googlesource.com/c/v8/v8/+/677462, it goes
    from
    
      templateStringTagES5: 4552 ms.
      templateStringTagES6: 14185 ms.
      templateStringTagBabel: 7626 ms.
    
    to
    
      templateStringTagES5: 4550 ms.
      templateStringTagES6: 616 ms.
      templateStringTagBabel: 589 ms.
    
    so overall a solid 23x improvement on the ES6 benchmark. This is
    representative of the six-speed-templatestringtag-es6 benchmark.
    
    Bug: v8:6819, v8:6820, v8:6831
    Change-Id: Ia45fbdf92977bfbe7400cfa60bd362b78086dc26
    Reviewed-on: https://chromium-review.googlesource.com/677603Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48131}
    7816413f
js-native-context-specialization.cc 112 KB