Go to file
Milad Farazmand c314cf7466 PPC/s390: [Liftoff] Improve initialization for many locals
Port a8cdda9947

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/+/1863370
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Milad Farazmand <miladfar@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#64301}
2019-10-15 17:50:29 +00:00
benchmarks
build_overrides
custom_deps
docs
gni Revert "Unconditionally enable snapshot builds and remove 'v8_use_snapshot'" 2019-10-15 14:20:52 +00:00
include Add verwaest as an API owner 2019-10-15 17:40:59 +00:00
infra Revert "Unconditionally enable snapshot builds and remove 'v8_use_snapshot'" 2019-10-15 14:20:52 +00:00
samples
src PPC/s390: [Liftoff] Improve initialization for many locals 2019-10-15 17:50:29 +00:00
test Revert "[runtime] Move Context::native_context to the map" 2019-10-15 16:31:09 +00:00
testing
third_party
tools Revert "[runtime] Move Context::native_context to the map" 2019-10-15 16:31:09 +00:00
.clang-format
.clang-tidy
.editorconfig
.flake8
.git-blame-ignore-revs
.gitattributes
.gitignore
.gn
.vpython
.ycm_extra_conf.py
AUTHORS
BUILD.gn Revert "Unconditionally enable snapshot builds and remove 'v8_use_snapshot'" 2019-10-15 14:20:52 +00:00
ChangeLog
CODE_OF_CONDUCT.md Explicitly state that the Chromium Code of Conduct also applies to V8 2016-03-02 09:51:24 +00:00
codereview.settings
COMMON_OWNERS
DEPS
ENG_REVIEW_OWNERS
INFRA_OWNERS
INTL_OWNERS
LICENSE
LICENSE.fdlibm
LICENSE.strongtalk
LICENSE.v8
LICENSE.valgrind
MIPS_OWNERS
OWNERS
PPC_OWNERS
PRESUBMIT.py
README.md
S390_OWNERS
WATCHLISTS

V8 JavaScript Engine

V8 is Google's open source JavaScript engine.

V8 implements ECMAScript as specified in ECMA-262.

V8 is written in C++ and is used in Google Chrome, the open source browser from Google.

V8 can run standalone, or can be embedded into any C++ application.

V8 Project page: https://v8.dev/docs

Getting the Code

Checkout depot tools, and run

    fetch v8

This will checkout V8 into the directory v8 and fetch all of its dependencies. To stay up to date, run

    git pull origin
    gclient sync

For fetching all branches, add the following into your remote configuration in .git/config:

    fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
    fetch = +refs/tags/*:refs/tags/*

Contributing

Please follow the instructions mentioned at v8.dev/docs/contribute.