• 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...
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...