[maglev] Don't constant-fold an Int32 multiply whose product is -0

TryFoldInt32BinaryOperation(int32_t, int32_t) folded cst_left *
cst_right whenever the product did not overflow, including cases such as
-1 * 0, whose result must be -0 rather than +0.

Bail out of the fold when the product is a negative zero, letting
Int32MultiplyWithOverflow handle the deopt instead, matching what the
kNegate sibling fold in a6b7238b3b6 does.

TAG=agy

Fixed: 563238900
Change-Id: If111ecd213af8935f91dba27bf982b5d6a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8423789
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Marco Vitale <mrcvtl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109978}
2 files changed
tree: a36029b6ba4e8ef16a2536f38e4dadfe8a23eb2b
  1. .github/
  2. agents/
  3. bazel/
  4. build_overrides/
  5. custom_deps/
  6. docs/
  7. gni/
  8. include/
  9. infra/
  10. samples/
  11. src/
  12. test/
  13. testing/
  14. third_party/
  15. tools/
  16. .bazelrc
  17. .clang-format
  18. .clang-tidy
  19. .editorconfig
  20. .flake8
  21. .git-blame-ignore-revs
  22. .gitattributes
  23. .gitignore
  24. .gn
  25. .mailmap
  26. .style.yapf
  27. .ycm_extra_conf.py
  28. AUTHORS
  29. BUILD.bazel
  30. BUILD.gn
  31. CODE_OF_CONDUCT.md
  32. codereview.settings
  33. COMMON_OWNERS
  34. DEPS
  35. DIR_METADATA
  36. ENG_REVIEW_OWNERS
  37. INFRA_OWNERS
  38. INTL_OWNERS
  39. LICENSE
  40. LICENSE.fdlibm
  41. LICENSE.strongtalk
  42. LICENSE.v8
  43. LOONG_OWNERS
  44. MIPS_OWNERS
  45. MODULE.bazel
  46. OWNERS
  47. PPC_OWNERS
  48. PRESUBMIT.py
  49. pyrightconfig.json
  50. README.md
  51. RISCV_OWNERS
  52. S390_OWNERS
  53. SECURITY.md
  54. vpython.toml
  55. vpython.toml.uv.lock
  56. WATCHLISTS
README.md

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 Chromium, 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.