• franzih's avatar
    [type profile] Collect return types. · de04df74
    franzih authored
    Collect type information of return values.
    
    Use *one* feedback slot per function for all its return
    statements. For assignments, we currently use
    several slots per function, because not all
    assignments refer to the same variable.
    
    Instead of the variable names, pass the
    source location and print the function name.
    
    Add an integration test for --type-profile that checks
    for crashes.
    
    Remove type feedback for assignments for now as it convolutes the output.
    
    ************ Function with 2 return statements ********
    function testFunction(param, flag) {
      // We want to test 2 different return positions in one function.
      if (flag) {
        var first_var = param;
        return first_var;
      }
      var second_var = param;
      return second_var;
    }
    
    testFunction({});
    testFunction(123, true);
    testFunction('hello');
    testFunction(undefined);
    *******************************************************
    
    ************* Sample Output ***************************
    Function: testFunction
    424: Object
    374: number
    424: string
    424: undefined
    *******************************************************
    
    Missing work:
    * Handle fall-off returns
    * Collect types for parameters
    * Remove duplicates from the list of collected types and use a common base class.
    
    BUG=v8:5935
    
    Review-Url: https://codereview.chromium.org/2755973002
    Cr-Commit-Position: refs/heads/master@{#43956}
    de04df74
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...