• ssanfilippo's avatar
    [Interpreter] Refactor bytecode generator test suite. · 6ae03059
    ssanfilippo authored
    Bytecode expectations have been moved to external (.golden) files,
    one per test. Each test in the suite builds a representation of the
    the compiled bytecode using BytecodeExpectationsPrinter. The output is
    then compared to the golden file. If the comparision fails, a textual
    diff can be used to identify the discrepancies.
    
    Only the test snippets are left in the cc file, which also allows to
    make it more compact and meaningful. Leaving the snippets in the cc
    file was a deliberate choice to allow keeping the "truth" about the
    tests in the cc file, which will rarely change, as opposed to golden
    files.
    
    Golden files can be generated and kept up to date using
    generate-bytecode-expectations, which also means that the test suite
    can be batch updated whenever the bytecode or golden format changes.
    
    The golden format has been slightly amended (no more comments about
    `void*`, add size of the bytecode array) following the consideration
    made while converting the tests.
    
    There is also a fix: BytecodeExpectationsPrinter::top_level_ was left
    uninitialized, leading to undefined behaviour.
    
    BUG=v8:4280
    LOG=N
    
    Review URL: https://codereview.chromium.org/1717293002
    
    Cr-Commit-Position: refs/heads/master@{#34285}
    6ae03059
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs 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/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn 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...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...