• 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
..
api Loading commit data...
asmjs Loading commit data...
base Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
heap Loading commit data...
interpreter Loading commit data...
libplatform Loading commit data...
wasm Loading commit data...
zone Loading commit data...
BUILD.gn Loading commit data...
DEPS Loading commit data...
cancelable-tasks-unittest.cc Loading commit data...
char-predicates-unittest.cc Loading commit data...
counters-unittest.cc Loading commit data...
eh-frame-iterator-unittest.cc Loading commit data...
eh-frame-writer-unittest.cc Loading commit data...
locked-queue-unittest.cc Loading commit data...
object-unittest.cc Loading commit data...
register-configuration-unittest.cc Loading commit data...
run-all-unittests.cc Loading commit data...
source-position-table-unittest.cc Loading commit data...
test-utils.cc Loading commit data...
test-utils.h Loading commit data...
unicode-unittest.cc Loading commit data...
unittests.gyp Loading commit data...
unittests.isolate Loading commit data...
unittests.status Loading commit data...
value-serializer-unittest.cc Loading commit data...