• Milad Fa's avatar
    PPC/s390: [wasm] Fix return value of lazy compile runtime function · 68ae81bf
    Milad Fa authored
    Port 22a16bda
    
    Original Commit Message:
    
        The Runtime_WasmCompileLazy function was returning a ptr-sized address,
        wrapped in an Object. This worked because no GC is triggered between the
        return from the runtime function and the point where we jump to the
        returned address.
    
        In a pointer-compressed world though, generated code assumes that all
        objects live in the same 4GB heap, so comparisons only compare the lower
        32 bit. On a 64-bit system, this can lead to collisions where a
        comparison determines that the returned address equals a heap object,
        even though the upper 32-bit differ.
    
        This happens occasionally in the wild, where the returned function entry
        pointer has the same lower half than the exception sentinel value. This
        leads to triggering stack unwinding (by the CEntry stub), which then
        fails (with a CHECK) because there is no pending exception.
    
        This CL fixes that by returning a Smi instead which is the offset in the
        jump table where the kWasmCompileLazy builtin should jump to. The
        builtin then gets the jump table start address from the instance object,
        adds the offset that the runtime function returned, and performs the
        jump.
    
        We do not include a regression test because this failure is very
        spurious and hard to reproduce.
    
    R=clemensb@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N
    
    Change-Id: I92907b97a9d44d8cf42bb356ef350a22f7c5d5e1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3666249
    Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
    Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
    Cr-Commit-Position: refs/heads/main@{#80752}
    68ae81bf
Name
Last commit
Last update
.github Loading commit data...
bazel 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...
.bazelrc 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...
.mailmap Loading commit data...
.style.yapf Loading commit data...
.vpython Loading commit data...
.vpython3 Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.bazel Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA 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...
LOONG_OWNERS 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...
RISCV_OWNERS Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
WORKSPACE Loading commit data...
codereview.settings Loading commit data...