• jarin's avatar
    [turbofan] Add type to the allocation operator. · e97b29a4
    jarin authored
    This gives us more precise type information, so we can avoid some type
    guards to refine the type information back.
    
    The motivation for this is to help escape analysis by not introducing
    redundant type guards (which escape analysis cannot handle yet even
    though it could and should do).
    
    Motivating example:
    
    In the example below, the out-of-object property array for properties
    fld5 and fld6 gets type Any when it is created by "o.fld5 = 5" (for
    object literals, we store 4 properties in-objeca, the rest goes out
    of object).
    
    When we run load elimination for the load the out-of-object property
    array (to store 6 into o.fld6), load elimination inserts TypeGuard to
    enforce the Type::Internal() type. This makes escape analysis bail out
    on this object, and we do not eliminate the object creation.
    
    function f() {
      var o = {};
      o.fld1 = 1;
      o.fld2 = 2;
      o.fld3 = 3;
      o.fld4 = 4;
      o.fld5 = 5;
      o.fld6 = 6;
    }
    
    f();
    f();
    %OptimizeFunctionOnNextCall(f);
    f();
    
    Review-Url: https://codereview.chromium.org/2797993006
    Cr-Commit-Position: refs/heads/master@{#44470}
    e97b29a4
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...