• marja@chromium.org's avatar
    Re-enable Parser::symbol_cache_ (after a long time!) · 0a01afda
    marja@chromium.org authored
    The Parser never used the symbol stream produced by the PreParser for anything
    useful, due to a bug introduced 3.5 years ago by
    https://codereview.chromium.org/3356010/diff/7001/src/parser.cc.
    
    The bug is that calling Initialize on symbol_cache_ doesn't change its
    length. So the length remains 0, and the "if" in Parser::LookupSymbol is always
    true, and Parser::LookupCachedSymbol is never called and symbol_cache_ never
    filled.
    
    This bug also masked a bug that the symbol stream produced by PreParser doesn't
    match what Parser wants to consume. The repro case is the following:
    
    var myo = {if: 4}; print(myo.if);
    
    PreParser doesn't log a symbol for the first "if", but in the corresponding
    place, Parser consumes one symbol from the symbol stream. Since the consumed
    symbols were never really used, this mismatch went unnoticed.
    
    This CL also fixes that bug.
    
    BUG=
    R=ulan@chromium.org
    
    Review URL: https://codereview.chromium.org/172753002
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    0a01afda
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE 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...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...