Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport V8 fixes for WASM on ARM64 #39337

Closed
wants to merge 7 commits into from
Closed

Conversation

targos
Copy link
Member

@targos targos commented Jul 10, 2021

  • deps: V8: cherry-pick cb4faa902e9f
  • deps: V8: cherry-pick 53784bdb8f01
  • deps: V8: cherry-pick 2b77ca200c56
  • deps: V8: cherry-pick 56fe020eec0c

Fixes #39327

Original commit message:

    Reland "[liftoff][arm64] Use 64 bit offset reg in mem op"

    This is a reland of f645d0b857bc669271adcbe95cf25e1554347dd4

    The issue was that converting an i64 to an i32 didn't clear the upper
    bits on arm64. This was not necessary before because we did the zero
    extension as part of the load operand, but this is required now that
    we use the full register.

    Original change's description:
    > [liftoff][arm64] Use 64 bit offset reg in mem op
    >
    > Accessing the Wasm memory with a 64 bit offset was truncated to 32 bit,
    > which is fine if we check bounds first, but not if we rely on the
    > trap handler to catch the OOB.
    >
    > R=clemensb@chromium.org
    >
    > Bug: v8:11587
    > Change-Id: I82a3a2906e55d9d640c30e770a5c93532e3a442c
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2808942
    > Reviewed-by: Clemens Backes <clemensb@chromium.org>
    > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#73829}

    Bug: v8:11587
    Change-Id: Ibc182475745c6f697a0ba6d75c260b74ddf8fe52
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2810846
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#73853}

Refs: v8/v8@cb4faa9
Original commit message:

    [liftoff] Handle constant memory indexes specially

    This adds detection for constant memory indexes which can statically be
    proven to be in-bounds (because the effective offset is within the
    minimum memory size). In these cases, we can skip the bounds check and
    the out-of-line code for the trap-handler.
    This often saves 1-2% of code size.

    R=ahaas@chromium.org

    Bug: v8:11802
    Change-Id: I0ee094e6f1f5d132af1d6a8a7c539a4af6c3cb5e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919827
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74825}

Refs: v8/v8@53784bd
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: nodejs#39327
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Jul 10, 2021
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jul 10, 2021

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@targos
Copy link
Member Author

targos commented Jul 10, 2021

It breaks on IBM platforms. We'll need to find the corresponding change for them

@targos
Copy link
Member Author

targos commented Jul 10, 2021

@nodejs/platform-aix @nodejs/platform-ppc

Original commit message:

    PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Original Commit Message:

        The upper 32 bits of the 64 bit offset register are not guaranteed to be
        cleared, so a zero-extension is needed. We already do the zero-extension
        in the case of explicit bounds checking, but this should also be done if
        the trap handler is enabled.

    R=thibaudm@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N

    Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661
    Reviewed-by: Junliang Yan <junyan@redhat.com>
    Commit-Queue: Milad Fa <mfarazma@redhat.com>
    Cr-Commit-Position: refs/heads/master@{#74886}

Refs: v8/v8@3805a69
Original commit message:

    [riscv64] Fix build failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Change-Id: Ie953a1d54f5529423ae35d1b1cd3ca25e8101c6e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931577
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
    Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
    Cr-Commit-Position: refs/heads/master@{#74937}

Refs: v8/v8@359d44d
Original commit message:

    [mips][wasm][liftoff] Fix compile failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Bug: v8:11809

    Change-Id: Idbbbc10d1339d6c8463686b6e701fb601a217cab
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931557
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Auto-Submit: Liu yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/master@{#74934}

Refs: v8/v8@5c76da8
@targos
Copy link
Member Author

targos commented Jul 10, 2021

I think I found the missing commits

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jul 10, 2021

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member Author

targos commented Jul 12, 2021

Landed in dbe564f...de85b1e

targos added a commit that referenced this pull request Jul 12, 2021
Original commit message:

    Reland "[liftoff][arm64] Use 64 bit offset reg in mem op"

    This is a reland of f645d0b857bc669271adcbe95cf25e1554347dd4

    The issue was that converting an i64 to an i32 didn't clear the upper
    bits on arm64. This was not necessary before because we did the zero
    extension as part of the load operand, but this is required now that
    we use the full register.

    Original change's description:
    > [liftoff][arm64] Use 64 bit offset reg in mem op
    >
    > Accessing the Wasm memory with a 64 bit offset was truncated to 32 bit,
    > which is fine if we check bounds first, but not if we rely on the
    > trap handler to catch the OOB.
    >
    > R=clemensb@chromium.org
    >
    > Bug: v8:11587
    > Change-Id: I82a3a2906e55d9d640c30e770a5c93532e3a442c
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2808942
    > Reviewed-by: Clemens Backes <clemensb@chromium.org>
    > Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#73829}

    Bug: v8:11587
    Change-Id: Ibc182475745c6f697a0ba6d75c260b74ddf8fe52
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2810846
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#73853}

Refs: v8/v8@cb4faa9

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 12, 2021
Original commit message:

    [liftoff] Handle constant memory indexes specially

    This adds detection for constant memory indexes which can statically be
    proven to be in-bounds (because the effective offset is within the
    minimum memory size). In these cases, we can skip the bounds check and
    the out-of-line code for the trap-handler.
    This often saves 1-2% of code size.

    R=ahaas@chromium.org

    Bug: v8:11802
    Change-Id: I0ee094e6f1f5d132af1d6a8a7c539a4af6c3cb5e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919827
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74825}

Refs: v8/v8@53784bd

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 12, 2021
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 12, 2021
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: #39327

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos closed this Jul 12, 2021
targos added a commit to targos/node that referenced this pull request Jul 20, 2021
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2

PR-URL: nodejs#39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit to targos/node that referenced this pull request Jul 20, 2021
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: nodejs#39327

PR-URL: nodejs#39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit to targos/node that referenced this pull request Jul 20, 2021
Original commit message:

    PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Original Commit Message:

        The upper 32 bits of the 64 bit offset register are not guaranteed to be
        cleared, so a zero-extension is needed. We already do the zero-extension
        in the case of explicit bounds checking, but this should also be done if
        the trap handler is enabled.

    R=thibaudm@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N

    Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661
    Reviewed-by: Junliang Yan <junyan@redhat.com>
    Commit-Queue: Milad Fa <mfarazma@redhat.com>
    Cr-Commit-Position: refs/heads/master@{#74886}

Refs: v8/v8@3805a69

PR-URL: nodejs#39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit to targos/node that referenced this pull request Jul 20, 2021
Original commit message:

    [riscv64] Fix build failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Change-Id: Ie953a1d54f5529423ae35d1b1cd3ca25e8101c6e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931577
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
    Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
    Cr-Commit-Position: refs/heads/master@{#74937}

Refs: v8/v8@359d44d

PR-URL: nodejs#39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit to targos/node that referenced this pull request Jul 20, 2021
Original commit message:

    [mips][wasm][liftoff] Fix compile failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Bug: v8:11809

    Change-Id: Idbbbc10d1339d6c8463686b6e701fb601a217cab
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931557
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Auto-Submit: Liu yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/master@{#74934}

Refs: v8/v8@5c76da8

PR-URL: nodejs#39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 26, 2021
Original commit message:

    [liftoff] Handle constant memory indexes specially

    This adds detection for constant memory indexes which can statically be
    proven to be in-bounds (because the effective offset is within the
    minimum memory size). In these cases, we can skip the bounds check and
    the out-of-line code for the trap-handler.
    This often saves 1-2% of code size.

    R=ahaas@chromium.org

    Bug: v8:11802
    Change-Id: I0ee094e6f1f5d132af1d6a8a7c539a4af6c3cb5e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919827
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74825}

Refs: v8/v8@53784bd

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 26, 2021
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 26, 2021
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: #39327

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 26, 2021
Original commit message:

    PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Original Commit Message:

        The upper 32 bits of the 64 bit offset register are not guaranteed to be
        cleared, so a zero-extension is needed. We already do the zero-extension
        in the case of explicit bounds checking, but this should also be done if
        the trap handler is enabled.

    R=thibaudm@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N

    Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661
    Reviewed-by: Junliang Yan <junyan@redhat.com>
    Commit-Queue: Milad Fa <mfarazma@redhat.com>
    Cr-Commit-Position: refs/heads/master@{#74886}

Refs: v8/v8@3805a69

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 26, 2021
Original commit message:

    [riscv64] Fix build failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Change-Id: Ie953a1d54f5529423ae35d1b1cd3ca25e8101c6e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931577
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
    Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
    Cr-Commit-Position: refs/heads/master@{#74937}

Refs: v8/v8@359d44d

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Jul 26, 2021
Original commit message:

    [mips][wasm][liftoff] Fix compile failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Bug: v8:11809

    Change-Id: Idbbbc10d1339d6c8463686b6e701fb601a217cab
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931557
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Auto-Submit: Liu yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/master@{#74934}

Refs: v8/v8@5c76da8

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Jul 26, 2021
richardlau pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [liftoff] Handle constant memory indexes specially

    This adds detection for constant memory indexes which can statically be
    proven to be in-bounds (because the effective offset is within the
    minimum memory size). In these cases, we can skip the bounds check and
    the out-of-line code for the trap-handler.
    This often saves 1-2% of code size.

    R=ahaas@chromium.org

    Bug: v8:11802
    Change-Id: I0ee094e6f1f5d132af1d6a8a7c539a4af6c3cb5e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919827
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74825}

Refs: v8/v8@53784bd

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: #39327

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Original Commit Message:

        The upper 32 bits of the 64 bit offset register are not guaranteed to be
        cleared, so a zero-extension is needed. We already do the zero-extension
        in the case of explicit bounds checking, but this should also be done if
        the trap handler is enabled.

    R=thibaudm@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N

    Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661
    Reviewed-by: Junliang Yan <junyan@redhat.com>
    Commit-Queue: Milad Fa <mfarazma@redhat.com>
    Cr-Commit-Position: refs/heads/master@{#74886}

Refs: v8/v8@3805a69

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [riscv64] Fix build failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Change-Id: Ie953a1d54f5529423ae35d1b1cd3ca25e8101c6e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931577
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
    Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
    Cr-Commit-Position: refs/heads/master@{#74937}

Refs: v8/v8@359d44d

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [mips][wasm][liftoff] Fix compile failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Bug: v8:11809

    Change-Id: Idbbbc10d1339d6c8463686b6e701fb601a217cab
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931557
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Auto-Submit: Liu yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/master@{#74934}

Refs: v8/v8@5c76da8

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [liftoff] Handle constant memory indexes specially

    This adds detection for constant memory indexes which can statically be
    proven to be in-bounds (because the effective offset is within the
    minimum memory size). In these cases, we can skip the bounds check and
    the out-of-line code for the trap-handler.
    This often saves 1-2% of code size.

    R=ahaas@chromium.org

    Bug: v8:11802
    Change-Id: I0ee094e6f1f5d132af1d6a8a7c539a4af6c3cb5e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919827
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74825}

Refs: v8/v8@53784bd

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: #39327

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Original Commit Message:

        The upper 32 bits of the 64 bit offset register are not guaranteed to be
        cleared, so a zero-extension is needed. We already do the zero-extension
        in the case of explicit bounds checking, but this should also be done if
        the trap handler is enabled.

    R=thibaudm@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N

    Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661
    Reviewed-by: Junliang Yan <junyan@redhat.com>
    Commit-Queue: Milad Fa <mfarazma@redhat.com>
    Cr-Commit-Position: refs/heads/master@{#74886}

Refs: v8/v8@3805a69

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [riscv64] Fix build failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Change-Id: Ie953a1d54f5529423ae35d1b1cd3ca25e8101c6e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931577
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
    Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
    Cr-Commit-Position: refs/heads/master@{#74937}

Refs: v8/v8@359d44d

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [mips][wasm][liftoff] Fix compile failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Bug: v8:11809

    Change-Id: Idbbbc10d1339d6c8463686b6e701fb601a217cab
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931557
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Auto-Submit: Liu yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/master@{#74934}

Refs: v8/v8@5c76da8

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [liftoff] Handle constant memory indexes specially

    This adds detection for constant memory indexes which can statically be
    proven to be in-bounds (because the effective offset is within the
    minimum memory size). In these cases, we can skip the bounds check and
    the out-of-line code for the trap-handler.
    This often saves 1-2% of code size.

    R=ahaas@chromium.org

    Bug: v8:11802
    Change-Id: I0ee094e6f1f5d132af1d6a8a7c539a4af6c3cb5e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919827
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74825}

Refs: v8/v8@53784bd

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [wasm][liftoff] Always zero-extend 32 bit offsets

    The upper 32 bits of the 64 bit offset register are not guaranteed to be
    cleared, so a zero-extension is needed. We already do the zero-extension
    in the case of explicit bounds checking, but this should also be done if
    the trap handler is enabled.

    R=clemensb@chromium.org
    CC=jkummerow@chromium.org

    Bug: v8:11809
    Change-Id: I21e2535c701041d11fa06c176fa683d82db0a3f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917612
    Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74881}

Refs: v8/v8@2b77ca2

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [wasm][arm64] Always zero-extend 32 bit offsets, for realz

    We've already been zero-extending 32-bit offset registers since
    https://chromium-review.googlesource.com/c/v8/v8/+/2917612,
    but that patch only covered the case where offset_imm == 0.
    When there is a non-zero offset, we need the same fix.

    Bug: chromium:1224882,v8:11809
    Change-Id: I1908f735929798f411346807fc4f3c79d8e04362
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2998582
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#75500}

Refs: v8/v8@56fe020

Fixes: #39327

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    PPC/s390: [wasm][liftoff] Always zero-extend 32 bit offsets

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Original Commit Message:

        The upper 32 bits of the 64 bit offset register are not guaranteed to be
        cleared, so a zero-extension is needed. We already do the zero-extension
        in the case of explicit bounds checking, but this should also be done if
        the trap handler is enabled.

    R=thibaudm@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
    BUG=
    LOG=N

    Change-Id: Ife3ae4f93b85fe1b2c76fe4b98fa408b5b51ed71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2929661
    Reviewed-by: Junliang Yan <junyan@redhat.com>
    Commit-Queue: Milad Fa <mfarazma@redhat.com>
    Cr-Commit-Position: refs/heads/master@{#74886}

Refs: v8/v8@3805a69

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [riscv64] Fix build failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Change-Id: Ie953a1d54f5529423ae35d1b1cd3ca25e8101c6e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931577
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
    Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
    Cr-Commit-Position: refs/heads/master@{#74937}

Refs: v8/v8@359d44d

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Jul 29, 2021
Original commit message:

    [mips][wasm][liftoff] Fix compile failed

    Port 2b77ca200c56667c68895e49c96c10ff77834f09

    Bug: v8:11809

    Change-Id: Idbbbc10d1339d6c8463686b6e701fb601a217cab
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2931557
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Auto-Submit: Liu yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/master@{#74934}

Refs: v8/v8@5c76da8

PR-URL: #39337
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backport fix of Wasm on arm64 (M1) to Node 16
5 participants