• 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...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
promises-aplus Loading commit data...
simdjs Loading commit data...
test262 Loading commit data...
unittests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
bot_default.gyp Loading commit data...
bot_default.isolate Loading commit data...
default.gyp Loading commit data...
default.isolate Loading commit data...
optimize_for_size.gyp Loading commit data...
optimize_for_size.isolate Loading commit data...
perf.gyp Loading commit data...
perf.isolate Loading commit data...