• rmcilroy's avatar
    [Interpreter] Optimize BytecodeArrayBuilder and BytecodeArrayWriter. · b11a8b4d
    rmcilroy authored
    This CL optimizes the code in BytecodeArrayBuilder and
    BytecodeArrayWriter by making the following main changes:
    
     - Move operand scale calculation out of BytecodeArrayWriter to the
    BytecodeNode constructor, where the decision on which operands are
    scalable can generally be statically decided by the compiler.
     - Move the maximum register calculation out of BytecodeArrayWriter
    and into BytecodeRegisterOptimizer (which is the only place outside
    BytecodeGenerator which updates which registers are used). This
    avoids the BytecodeArrayWriter needing to know the operand types
    of a node as it writes it.
     - Modify EmitBytecodes to use individual push_backs rather than
    building a buffer and calling insert, since this turns out to be faster.
     - Initialize BytecodeArrayWriter's bytecode vector by reserving 512
    bytes,
     - Make common functions in Bytecodes constexpr so that they
    can be statically calculated by the compiler.
     - Move common functions and constructors in Bytecodes and
    BytecodeNode to the header so that they can be inlined.
     - Change large static switch statements in Bytecodes to const array
    lookups, and move to the header to allow inlining.
    
    I also took the opportunity to remove a number of unused helper
    functions, and rework some others for consistency.
    
    This reduces the percentage of time spent in making BytecodeArrays
     in  CodeLoad from ~15% to ~11% according to perf. The
    CoadLoad score increase by around 2%.
    
    BUG=v8:4280
    
    Review-Url: https://codereview.chromium.org/2351763002
    Cr-Commit-Position: refs/heads/master@{#39599}
    b11a8b4d
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/binutils 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...