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

[v18.x] deps: V8: cherry-pick d15d49b09dc7 #52337

Closed
wants to merge 1 commit into from

Conversation

Bo98
Copy link

@Bo98 Bo98 commented Apr 2, 2024

Original commit message:

Make bitfields only as wide as necessary for enums

clang now complains when a BitField for an enum is too wide.
We could suppress this, but it seems kind of useful from an
uninformed distance, so I made a few bitfields smaller instead.

(For AddressingMode, since its size is target-dependent, I added
an explicit underlying type to the enum instead, which suppresses
the diag on a per-enum basis.)

This is without any understanding of the code I'm touching.
Especially the change in v8-internal.h feels a bit risky to me.

Bug: chromium:1348574
Change-Id: I73395de593045036b72dadf4e3147b5f7e13c958
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3794708
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82109}

Refs: v8/v8@d15d49b
Fixes: #52230

(Note that this change is already in the baseline v8 of v20.x and newer, hence why this is a v18-only cherry-pick)

I carefully combed through this patch. The NodeState changes (include/v8-internal.h and src/handles/global-handles.cc) are not included, as the enum on v18.x is slightly larger (v18.x vs at time of v8 patch) so the current 3 bits is correct. And just to check: make jstest was able to catch this correctly.

I can confirm this patch fixes the build on Xcode 15.3.

We also have advance notice that this will be a hard error in LLVM Clang 19 (later this year) so -Wno-enum-constexpr-conversion would not have been a long-term fix:

The warning -Wenum-constexpr-conversion is now also enabled by default on system headers and macros. It will be turned into a hard (non-downgradable) error in the next Clang release.

https://releases.llvm.org/18.1.0/tools/clang/docs/ReleaseNotes.html

Original commit message:

    Make bitfields only as wide as necessary for enums

    clang now complains when a BitField for an enum is too wide.
    We could suppress this, but it seems kind of useful from an
    uninformed distance, so I made a few bitfields smaller instead.

    (For AddressingMode, since its size is target-dependent, I added
    an explicit underlying type to the enum instead, which suppresses
    the diag on a per-enum basis.)

    This is without any understanding of the code I'm touching.
    Especially the change in v8-internal.h feels a bit risky to me.

    Bug: chromium:1348574
    Change-Id: I73395de593045036b72dadf4e3147b5f7e13c958
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3794708
    Commit-Queue: Nico Weber <thakis@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Reviewed-by: Hannes Payer <hpayer@chromium.org>
    Auto-Submit: Nico Weber <thakis@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82109}

Refs: v8/v8@d15d49b
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/v8-update

@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. v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch. v8 engine Issues and PRs related to the V8 dependency. labels Apr 2, 2024
@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 3, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 3, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

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

richardlau pushed a commit that referenced this pull request Apr 17, 2024
Original commit message:

    Make bitfields only as wide as necessary for enums

    clang now complains when a BitField for an enum is too wide.
    We could suppress this, but it seems kind of useful from an
    uninformed distance, so I made a few bitfields smaller instead.

    (For AddressingMode, since its size is target-dependent, I added
    an explicit underlying type to the enum instead, which suppresses
    the diag on a per-enum basis.)

    This is without any understanding of the code I'm touching.
    Especially the change in v8-internal.h feels a bit risky to me.

    Bug: chromium:1348574
    Change-Id: I73395de593045036b72dadf4e3147b5f7e13c958
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3794708
    Commit-Queue: Nico Weber <thakis@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Reviewed-by: Hannes Payer <hpayer@chromium.org>
    Auto-Submit: Nico Weber <thakis@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82109}

Refs: v8/v8@d15d49b
PR-URL: #52337
Fixes: #52230
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@richardlau
Copy link
Member

Landed in 678641f.

@richardlau richardlau mentioned this pull request May 16, 2024
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. v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants