• 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
..
OWNERS Loading commit data...
ast-expression-rewriter.cc Loading commit data...
ast-expression-rewriter.h Loading commit data...
ast-function-literal-id-reindexer.cc Loading commit data...
ast-function-literal-id-reindexer.h Loading commit data...
ast-numbering.cc Loading commit data...
ast-numbering.h Loading commit data...
ast-traversal-visitor.h Loading commit data...
ast-type-bounds.h Loading commit data...
ast-types.cc Loading commit data...
ast-types.h Loading commit data...
ast-value-factory.cc Loading commit data...
ast-value-factory.h Loading commit data...
ast.cc Loading commit data...
ast.h Loading commit data...
compile-time-value.cc Loading commit data...
compile-time-value.h Loading commit data...
context-slot-cache.cc Loading commit data...
context-slot-cache.h Loading commit data...
modules.cc Loading commit data...
modules.h Loading commit data...
prettyprinter.cc Loading commit data...
prettyprinter.h Loading commit data...
scopes.cc Loading commit data...
scopes.h Loading commit data...
variables.cc Loading commit data...
variables.h Loading commit data...