• Milad Farazmand's avatar
    PPC/s390: [Liftoff] Improve initialization for many locals · c314cf74
    Milad Farazmand authored
    Port a8cdda99
    
    Original Commit Message:
    
        WebAssembly locals are specified to be zero on function entry. Liftoff
        implements this by just storing the constant 0 in the virtual stack for
        integer types, and using one floating point register initialized to
        zero for all floating point types.
        For big counts of locals this leads to problems (manifesting as huge
        blocks of code being generated) once we hit a merge point: All those
        constants (for int) and all duplicate register uses (for floats) need to
        be fixed up, by using separate registers for the locals or spilling to
        the stack if no more registers are available. All this spilling
        generates a lot of code, and can even happen multiple times within a
        function.
    
        This CL optimizes for such cases by spilling all locals to the stack
        initially. All merges within the function body get much smaller then.
        The spilled values rarely have to be loaded anyway, because the initial
        zero value is usually overwritten before the first use.
    
        To optimize the code size for initializing big numbers of locals on the
        stack, this CL also introduces the platform-specific
        {FillStackSlotsWithZero} method which uses a loop for bigger local
        counts.
    
        This often saves dozens of kilobytes for very big functions, and shows
        an overall code size reduction of 4-5 percent for big modules.
    
    R=clemensb@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
    BUG=
    LOG=N
    
    Change-Id: I2459080a1f6acfdd212e9a93a868d028980c5554
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1863370Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
    Reviewed-by: 's avatarMilad Farazmand <miladfar@ca.ibm.com>
    Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
    Cr-Commit-Position: refs/heads/master@{#64301}
    c314cf74
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni 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...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython 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...
COMMON_OWNERS Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS 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...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...