• franzih's avatar
    Collect type profile for DevTools · 0332bebd
    franzih authored
    Collect type information for JavaScript variables and display it
    in Chrome DevTools.
    Design Doc: https://docs.google.com/a/google.com/document/d/1O1uepXZXBI6IwiawTrYC3ohhiNgzkyTdjn3R8ysbYgk/edit?usp=sharing
    
    When debugging JavaScript, it’s helpful to know the type of
    a variable, parameter, and return values. JavaScript is
    dynamically typed, and for complex
    source code it’s often hard to infer types. With type profiling, we
    can provide type information to JavaScript developers.
    
    This CL is a proof of concept. It collects type profile for
    assignments and simply prints the types to stdout.
    
    The output looks something like this:
    
    #my_var1
      #Object
      #number
      #string
      #number
      #undefined
      #string
      #Object
      #Object
    
    We use an extra slot in the feedback vector of assignments to
    carry the list of types for that assignment. The extra slot is
    only added when the flag --type-profile is given.
    
    Missing work:
    * Collect data for parameters and return values (currently only assignments).
    * Remove duplicates from the list of collected types and use a common base class.
    * Add line numbers or source position instead of the variable name.
    
    BUG=v8:5935
    
    Review-Url: https://codereview.chromium.org/2707873002
    Cr-Commit-Position: refs/heads/master@{#43791}
    0332bebd
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...