Commit Graph

79464 Commits

Author SHA1 Message Date
a27f18e36b [-] important document removal
[*] Update readme

(Last aurora commit: 6bf47ddb)
2023-01-25 11:06:50 +00:00
6bf47ddb53 [*] Repeat old source check patch hack: remove SerializedCodeSanityCheckResult::kSourceMismatch
[+] Expose codegen cpu featureset as an API

(Previous hack: 95d8a9fdcc)
(Last real aurora commit: 21824f3e)
2023-01-24 23:38:44 +00:00
9fb9e65111 [*] fuck off incompetent google c++ shitters
last aurora commit: 21824f3e (fuck off wasm sympathizers)
2023-01-23 12:47:27 +00:00
d7609f5d92 [*] fuck off wasm sympathizers 2022-12-20 11:55:41 +00:00
21824f3e2b Merge v11.1 (more int64 optimizations). Last aurora commit: 87a8ef4a 2022-12-20 10:49:50 +00:00
v8-ci-autoroll-builder
fd98802746 Update V8 DEPS (trusted)
Rolling v8/build: e8612da..8b3f134

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/50ee8ff..1e43416

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20221218.2.1..version:11.20221219.3.1

Rolling v8/tools/clang: 7356f69..cab032b

Change-Id: I48016983878fc3ae79f8c848d76d9e3afb042771
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4117873
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84951}
2022-12-20 08:13:10 +00:00
Michael Lippautz
8d4af46404 [heap] Convert unittest to avoid using deprecated APIs
- Converts tests in EmbedderTracingTest to UnifiedHeapTest
- Move EmbedderRootsHandler tests to their own file
- Adds support for CppHeap in ManualGCScope
- Drive-by fix typo

Reland: Fix issue with attaching a CppHeap while incremental marking
is already running.

This reverts commit d90a98edc1.

Change-Id: Ifafa9145df3103578c4c7f1b3b0336b4bd9f34dd
Bug: v8:13207
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110941
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84950}
2022-12-20 08:12:07 +00:00
Michael Lippautz
5373b52f01 [heap] Remove outdated map space compaction test
Change-Id: Ieb25f9f1255aa911e5d761a52b580094f15c6399
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110943
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84949}
2022-12-20 08:11:02 +00:00
Michael Achenbach
3d46a713bb Revert "[turbofan] Simplifying (x+k1)==k2 into x==(k2-k1)"
This reverts commit e9333ebd3c.

Reason for revert:
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20UBSan/24520/overview

Original change's description:
> [turbofan] Simplifying (x+k1)==k2 into x==(k2-k1)
>
>
> Change-Id: I234da79e1f53fa0fc15494fe6d31742d4e6eea97
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4055393
> Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84947}

Change-Id: I9e86f6f9653efff0fd0da439e270df5c7da29b20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111953
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84948}
2022-12-20 07:38:49 +00:00
JianxiaoLuIntel
e9333ebd3c [turbofan] Simplifying (x+k1)==k2 into x==(k2-k1)
Change-Id: I234da79e1f53fa0fc15494fe6d31742d4e6eea97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4055393
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84947}
2022-12-20 02:15:51 +00:00
JianxiaoLuIntel
99eba76742 [test] Fix RunInt64AddShift
Change-Id: I1972b65c75f08130ecda45d36edc4c1431c3ea8d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4100665
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84946}
2022-12-20 01:54:39 +00:00
Fanchen Kong
e967e6c46e [turbofan] Reduce BitcastWord32ToWord64 with truncated word32 input
This change reduce the TruncateInt64ToInt32 and BitcastWord32ToWord64 pair at machine operator reducer, since the upper 32 bits are not important.

With this change, a reduncant mov can be avoid e.g. at,

  // script
  function func() {
    a = [];
    for (j = 0; j < 13; j++) {
      a[j] = j + 1;
    }
    return a;
  }

  // Assembly
  // ...
  movl rdi,[r8+0xb]
  movl rbx,[r8+0xb] // can be removed
  REX.W movq r9,rdi
  sarl r9, 1
  // ...

Change-Id: I6a128d9606c093df50fe9286201c1b979900864d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4115155
Commit-Queue: Fanchen Kong <fanchen.kong@intel.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84945}
2022-12-20 01:31:28 +00:00
Shu-yu Guo
b41df346db [ShadowRealm] Make CallSite#getFunction/getThis throw
ShadowRealms have a callable boundary: there cannot be any edges between
objects in the ShadowRealm and those from other realms. V8's
prepareCallStack API breaks this invariant via getFunction() and
getThis(). This CL makes those functions throw when called inside
ShadowRealms.

See also
https://docs.google.com/document/d/1aXEy4YCC9CduxLs7MGw-UOm0P4OuG7W-cScBnLG3ALI/edit?usp=sharing

Bug: v8:11989
Change-Id: I5a2b8fa735c0f10583c8cede4062645986b2d914
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4108810
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84944}
2022-12-19 20:13:27 +00:00
Toon Verwaest
ea1bac5386 [maglev] Drop values flowing into resumable loops
All IFS values of resumable loops are loop phis, so values from before
the loop can safely be dropped. In fact, if we don't drop them we might
not be able to restore them and crash in a safety check. Eagerly
dropping the values allows us to keep the safety check.

Bug: v8:7700
Change-Id: I99ef80e35db5aba965dc1c5c9d78f1d085e589fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110940
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84943}
2022-12-19 18:52:19 +00:00
pthier
0621c2d553 [string] Copy when sharing strings that are not in shared space
Usually sharable strings are automatically promoted to shared old space
and can be shared in-place.
There are currently two exceptions:
- When using a non-moving GC (e.g. minor MC)
- Strings in LO space
Account for these exceptions by copying strings to the respective shared
space when sharing them.

Bug: chromium:1400048
Change-Id: I20713b5f32f449c14febd848e289b5767530a257
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110752
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84942}
2022-12-19 16:28:22 +00:00
Michael Lippautz
d90a98edc1 Revert "[heap] Convert unittest to avoid using deprecated APIs"
This reverts commit 6a892e14f9.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN%20-%20stress-incremental-marking/10329/overview

Original change's description:
> [heap] Convert unittest to avoid using deprecated APIs
>
> - Converts tests in EmbedderTracingTest to UnifiedHeapTest
> - Adds support for CppHeap in ManualGCScope
> - Drive-by fix typo
>
> Bug: v8:13207
> Change-Id: Ic50333f141ec9766c9db5250463461832dfe6d17
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110749
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84940}

Bug: v8:13207
Change-Id: I926f5b5078b8995f8352a827c946cbbe5b18a259
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4116791
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84941}
2022-12-19 16:27:19 +00:00
Michael Lippautz
6a892e14f9 [heap] Convert unittest to avoid using deprecated APIs
- Converts tests in EmbedderTracingTest to UnifiedHeapTest
- Adds support for CppHeap in ManualGCScope
- Drive-by fix typo

Bug: v8:13207
Change-Id: Ic50333f141ec9766c9db5250463461832dfe6d17
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110749
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84940}
2022-12-19 15:24:10 +00:00
Vasili Skurydzin
aee5fb0990 Reland "Use BigInts in processor.mjs and related code to avoid unsafe ints in calculations"
This is a reland of commit efc1a98c53

Changes since revert:
- Handle "shared-library", "code-{deopt,move,delete}", "feedback-vector", "sfi-move" events

Original change's description:
> Use BigInts in processor.mjs and related code to avoid unsafe ints in
calculations
>
> Bug: v8:13440
> Change-Id: Ie03b831b511a49fb475b9f303ef8662189bdaf3d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4017455
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84698}

Change-Id: If45d38526cab887a59f60e3becfbcb084c3d41d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4086641
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Cr-Commit-Position: refs/heads/main@{#84939}
2022-12-19 15:15:48 +00:00
Jakob Linke
0b9fa062f0 Reland "[maglev] Fix %OptimizeOsr when called from Maglev frames"
This is a reland of commit 833731b20b

Original change's description:
> [maglev] Fix %OptimizeOsr when called from Maglev frames
>
> This (test-only) runtime function only supported unoptimized frames as
> callers. Add support for Maglev frames as well by extracting the
> relevant BytecodeArray and bytecode offset.
>
> This reverts commit 955de73ee5.
>
> Bug: chromium:1400549,v8:7700
> Change-Id: I80f80f8736ff0400d6d47e355add2a07cdc4559e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111851
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84931}

Bug: chromium:1400549,v8:7700
Change-Id: I79fadaa0a82314a3fdd4970e9429d83ab06aff09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111950
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84938}
2022-12-19 14:30:33 +00:00
Michael Lippautz
1f4ad47be7 [heap] Remove unused TemporaryEmbedderHeapTracerScope
Bug: v8:13207
Change-Id: I2b70d47b2d62861df9c1e42f1e7c035cfb2676af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110753
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84937}
2022-12-19 13:40:41 +00:00
Dominik Inführ
374b94d1b3 [heap, execution] Do not park while waiting for concurrent tasks
There is no need to park the main thread while waiting for
concurrent tasks to finish. In case they allocate threads know from
the TEAR_DOWN state and the shutdown flag in CollectionBarrier that
no further GC is going to happen.

Bug: v8:13267
Change-Id: I19f8cf8a71c2fb91618ed0be5ab82cf134edb9ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111446
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84936}
2022-12-19 13:38:54 +00:00
Manos Koukoutos
99d23cf06f Revert "[maglev] Fix %OptimizeOsr when called from Maglev frames"
This reverts commit 833731b20b.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Mac64%20GC%20Stress/25836/overview

Original change's description:
> [maglev] Fix %OptimizeOsr when called from Maglev frames
>
> This (test-only) runtime function only supported unoptimized frames as
> callers. Add support for Maglev frames as well by extracting the
> relevant BytecodeArray and bytecode offset.
>
> This reverts commit 955de73ee5.
>
> Bug: chromium:1400549,v8:7700
> Change-Id: I80f80f8736ff0400d6d47e355add2a07cdc4559e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111851
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84931}

Bug: chromium:1400549,v8:7700
Change-Id: Ia2e04d66cb38047e90524b577db3f65bcd412e07
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110754
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Owners-Override: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84935}
2022-12-19 13:30:22 +00:00
Manos Koukoutos
8972c42a39 [wasm-gc] Reject too large supertypes
We use 0xffffffff as a sentinel for "no supertype". Therefore we
should reject it as we parse it. We implement this by rejecting
supertypes outside V8's type definition limit.

Bug: v8:7748
Change-Id: I7942d94073d8f7350528fb0e364e91f7359c8cec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110750
Auto-Submit: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84934}
2022-12-19 12:59:41 +00:00
Jakob Kummerow
9235ec6302 [wasm-gc] Optimize struct field offsets
Aligning struct fields to multiples of their own size can leave gaps
between them, e.g. when i8 and i32 fields alternate. This patch
introduces a simple optimization: it keeps track of the most recent
such gap, and attempts to use it for later fields that are small enough.

Bonus changes:
- Cap field alignment to 4 bytes (because we only have 4-byte object
  alignment anyway).
- Don't re-compute field offsets when canonicalizing types. Instead,
  re-use the original type's offsets.

Bug: v8:7748
Change-Id: Iabfc8e7cda94f16d196ed4429f3aa92d249b3b72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4092494
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84933}
2022-12-19 12:58:37 +00:00
Omer Katz
0a7e7383ec [heap] Gate heap verification behind runtime flag
Most verification calls are gated behined both a build flag and a
runtime flag. Some calls were missing the runtime flag.

Bug: v8:12612
Change-Id: I482bf7cd3900e860f9db1932f9490d1af9b19df1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4085007
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84932}
2022-12-19 12:30:37 +00:00
Jakob Linke
833731b20b [maglev] Fix %OptimizeOsr when called from Maglev frames
This (test-only) runtime function only supported unoptimized frames as
callers. Add support for Maglev frames as well by extracting the
relevant BytecodeArray and bytecode offset.

This reverts commit 955de73ee5.

Bug: chromium:1400549,v8:7700
Change-Id: I80f80f8736ff0400d6d47e355add2a07cdc4559e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111851
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84931}
2022-12-19 11:59:14 +00:00
Jakob Linke
ebbfe97850 [maglev] Ensure we properly emit the deopt_reason for OSR deopts
Maglev OSR uses the deopt_reason to tell the deoptimizer not to
invalidate optimized code on deopt (since we deopted not because of a
failed assumption, but just as part of the OSR procedure). This deopt
reason must always be emitted for the code to work as expected.

Bug: v8:7700
Change-Id: I96b09eef52b2b90c6c491ffec3f87538124cdc88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111165
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84930}
2022-12-19 10:51:54 +00:00
Victor Gomes
5a486deea3 [maglev][arm64] Add Checked/Truncate/Int32/Float64 IRs
Bug: v8:7700
Change-Id: I3a94cc3d4902b7296a9be93b9998d4cfa9b3153b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111162
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84929}
2022-12-19 10:46:05 +00:00
Jakob Linke
de5df9aebc Reland "[maglev] Prevent lazy deopts during maglev's JumpLoop (=OSR)"
This is a reland of commit 5d95bd39ca

Original change's description:
> [maglev] Prevent lazy deopts during maglev's JumpLoop (=OSR)
>
> The problem was that synchronous Maglev OSR potentially caused
> code deoptimization during compilation dependency finalization; this
> led to a lazy deopt when returning from the call to
> Runtime_CompileOptimizedOSRFromMaglev. However, a lazy deopt is
> disallowed at this point, since a) Maglev doesn't support marking an opcode as both lazy- and eager deopt, and b) the JumpLoop opcode
> is already marked as eager deopt since that's how OSR is implemented
> under the hood. See also the comment in runtime-compiler.cc.
>
> We fix this by changing synchronous Maglev-to-Turbofan OSR
> behavior s.t. actual OSR compilation is triggered from Ignition
> (and not from Maglev). In other words, when synchronous OSR is
> requested:
>
>  1. trigger an eager deopt from Maglev to Ignition by returning a
>     non-null code object from Runtime_CompileOptimizedOSRFromMaglev.
>  2. Ignition handles the pending OSR compile request (through
>     osr_urgency).
>
> This CL also reverts previous partial fixes:
>
> This reverts commit 21969e8e24.
> This reverts commit 6bcbcfed5c.
>
> Bug: chromium:1394279,v8:13585,v8:7700
> Change-Id: I3d64aa39575ad806ba2623102092176ca160ef0b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110740
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84922}

Bug: chromium:1394279,v8:13585,v8:7700
Change-Id: Id9d1a1ab2dc36e481287a1a25863b45bf281920c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110746
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84928}
2022-12-19 10:44:14 +00:00
Victor Gomes
ba056a8c98 [maglev][arm64] Add StringAt
... and other nodes needed for testing it.

Bug: v8:7700
Change-Id: I2e71916112bf9ac5ab336adb819aad4c4c5c6f8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111161
Commit-Queue: Patrick Thier <pthier@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84927}
2022-12-19 10:39:45 +00:00
Daniel Lehmann
559e6659d1 [wasm] Pre-allocate vectors in WasmFullDecoder
Small optimization: We can save about 10% of the calls to
`FastZoneVector::Grow` during validation of large modules (e.g.,
psweb_2021_09.wasm: before 237k, after 215k calls to Grow) by
pre-allocating the `stack_` and `control_` vectors (which are unlikely
to remain empty for most functions). The runtime doesn't improve much
though (before 69.08ms validation time, after 68.45ms), but I guess it
is still worth the fewer re-allocations+copies.

I tried different amounts of pre-allocation as well (8, 16, 32, 64
elements). For both value and control stack 16 was the sweet spot: It
reduced more re-allocations than 8, but after 16 the number of Grow
calls plateaus and instead runtime increases slightly.

Change-Id: Idc57e0a31c6fa1bbdc98bfd4ffd5522d34f09e81
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4107389
Commit-Queue: Daniel Lehmann <dlehmann@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84926}
2022-12-19 10:38:40 +00:00
Manos Koukoutos
06a53cc0fa Revert "[maglev] Prevent lazy deopts during maglev's JumpLoop (=OSR)"
This reverts commit 5d95bd39ca.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20gc%20stress/2101/overview

Original change's description:
> [maglev] Prevent lazy deopts during maglev's JumpLoop (=OSR)
>
> The problem was that synchronous Maglev OSR potentially caused
> code deoptimization during compilation dependency finalization; this
> led to a lazy deopt when returning from the call to
> Runtime_CompileOptimizedOSRFromMaglev. However, a lazy deopt is
> disallowed at this point, since a) Maglev doesn't support marking an opcode as both lazy- and eager deopt, and b) the JumpLoop opcode
> is already marked as eager deopt since that's how OSR is implemented
> under the hood. See also the comment in runtime-compiler.cc.
>
> We fix this by changing synchronous Maglev-to-Turbofan OSR
> behavior s.t. actual OSR compilation is triggered from Ignition
> (and not from Maglev). In other words, when synchronous OSR is
> requested:
>
>  1. trigger an eager deopt from Maglev to Ignition by returning a
>     non-null code object from Runtime_CompileOptimizedOSRFromMaglev.
>  2. Ignition handles the pending OSR compile request (through
>     osr_urgency).
>
> This CL also reverts previous partial fixes:
>
> This reverts commit 21969e8e24.
> This reverts commit 6bcbcfed5c.
>
> Bug: chromium:1394279,v8:13585,v8:7700
> Change-Id: I3d64aa39575ad806ba2623102092176ca160ef0b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110740
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84922}

Bug: chromium:1394279,v8:13585,v8:7700
Change-Id: Ib82d06ab8281f0e59a2af2b631bf93b25064df1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110745
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84925}
2022-12-19 09:44:49 +00:00
Dominik Inführ
0b36f43e9e Revert "[heap] Also promote strings in large objects into shared heap"
Revert of the CLs: https://crrev.com/c/4098831,
https://crrev.com/c/4110739, https://crrev.com/c/4108649.

Promoting large objects into shared space during GC is not really
needed, we can always promote such objects on-demand as well.

Bug: v8:13267, chromium:1400048
Change-Id: Icc01a3bac2698ea442409dec0a86bd7c0c5bf74e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111850
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84924}
2022-12-19 09:20:43 +00:00
Stephan Hartmann
15d123009b GCC: fix selection of IMMEDIATE_CRASH
immediate_crash.h still uses V8_CC_GCC define to determine which
IMMEDIATE_CRASH macro is used. This should be V8_CC_GNU instead.
Otherwise weird compile errors are happening with turboshaft.

Bug: chromium:819294
Change-Id: Id77fe7406ae16a804e1e466844f81d6c728ec008
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111849
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84923}
2022-12-19 09:16:59 +00:00
Jakob Linke
5d95bd39ca [maglev] Prevent lazy deopts during maglev's JumpLoop (=OSR)
The problem was that synchronous Maglev OSR potentially caused
code deoptimization during compilation dependency finalization; this
led to a lazy deopt when returning from the call to
Runtime_CompileOptimizedOSRFromMaglev. However, a lazy deopt is
disallowed at this point, since a) Maglev doesn't support marking an opcode as both lazy- and eager deopt, and b) the JumpLoop opcode
is already marked as eager deopt since that's how OSR is implemented
under the hood. See also the comment in runtime-compiler.cc.

We fix this by changing synchronous Maglev-to-Turbofan OSR
behavior s.t. actual OSR compilation is triggered from Ignition
(and not from Maglev). In other words, when synchronous OSR is
requested:

 1. trigger an eager deopt from Maglev to Ignition by returning a
    non-null code object from Runtime_CompileOptimizedOSRFromMaglev.
 2. Ignition handles the pending OSR compile request (through
    osr_urgency).

This CL also reverts previous partial fixes:

This reverts commit 21969e8e24.
This reverts commit 6bcbcfed5c.

Bug: chromium:1394279,v8:13585,v8:7700
Change-Id: I3d64aa39575ad806ba2623102092176ca160ef0b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110740
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84922}
2022-12-19 09:13:06 +00:00
Lu Yahan
e4b6eaf837 [riscv] Fix qfma test fail
Change-Id: Ie61c0312e1a4da1f7408e30a61732c8bc6520c7d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4114558
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#84921}
2022-12-19 04:59:24 +00:00
v8-ci-autoroll-builder
e2a9b050cf Update V8 DEPS (trusted)
Rolling v8/build: b683128..e8612da

Rolling v8/buildtools: 8e56b48..600a615

Rolling v8/buildtools/third_party/libc++/trunk: 3ec88a9..7b20455

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20221213.1.1..version:11.20221218.2.1

Change-Id: Ied088651391efbeb8d16ef9756199d661066d75b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4115012
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84920}
2022-12-19 03:47:47 +00:00
Andreas Haas
51bdde997e [wasm] Add filter to NativeModule::RemoveCompiledCode
There was a concurrency issue `WasmEngine::EnterDebuggingForIsolate`
which gets fixed by this CL. When multiple isolates entered debugging
concurrently, then only the first CL that changes the debug state of
a NativeModule would remove all compiled code from the NativeModule.
However, changing the debug state and removing the compiled code would
not happen atomically inside a lock. Instead, first the debug state
gets changed inside the lock, and then the compiled code gets removed
outside the lock. The concurrency issue is now the following.

Assume isolate A enters debugging. It takes the lock, and then changes
the debug state. As it changes the debugging state, it is the task of
isolate A to delete all code. Concurrently isolate B also enters
debugging. It sees that the debug state is already changed to debug
state and therefore just continues execution without removing code
first. In the following execution of isolate B non-debug code may get
executed if isolate A is slow with removing the code.

This CL fixes the issue by adding a filter to `RemoveCompiledCode`, and
then letting all isolates remove compiled code according to the filter.
This means that isolate B would also iterate over all the code and
remove all functions which are non-debug functions. This guarantees
that isolate B does not execute non-debug code that existed before
isolate B entered debugging.

R=clemensb@chromium.org

Bug: v8:13541
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel
Change-Id: If688c7f9b15f78e6cd6898123a321e577d32365f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111524
Auto-Submit: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84919}
2022-12-18 16:44:01 +00:00
v8-ci-autoroll-builder
2ad612fdf6 Update V8 DEPS (trusted)
Rolling v8/build: 758773e..b683128

Rolling v8/buildtools: 6db3615..8e56b48

Rolling v8/buildtools/third_party/libc++/trunk: ca7508e..3ec88a9

Change-Id: Ia194d2c047150681a2bddf998e89d20e350aec66
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4115006
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84918}
2022-12-18 03:48:47 +00:00
v8-ci-autoroll-builder
3c540601cc Update V8 DEPS (trusted)
Rolling v8/build: c72e275..758773e

Rolling v8/buildtools: 80c045e..6db3615

Rolling v8/buildtools/third_party/libc++/trunk: 2948540..ca7508e

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/c6c2247..50ee8ff

Change-Id: If48e15d2f8b97bcd3f27acd73813e66b7045a449
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4113264
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84917}
2022-12-17 04:09:56 +00:00
Shu-yu Guo
43e60711f7 [shared-struct] Fix using shared objects as prototypes more
The previous fix from
https://chromium-review.googlesource.com/c/v8/v8/+/4086127 was
insufficient. It prevented shared objects from being optimized as
prototypes, but callers of OptimizeAsPrototype also assume that all
JSObjects can track prototype users via prototype_info on the map.

This CL attempts a broader fix where shared objects are not considered
optimizable as prototypes at all. When used as a prototype, shared
objects are treated like non-JSObjects (e.g. JSProxy, WasmObject).

Bug: chromium:1401295, v8:12547
Change-Id: I9886e9ccac9e597e7dd34a09083a096ff4e3bf16
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4112150
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84916}
2022-12-17 01:22:25 +00:00
Milad Fa
b51e75a608 PPC/s390: [relaxed-simd] Fix ordering of relaxed FMA/FNMA operands
Port b0c2b7797a

Original Commit Message:

    New ordering and rationale described here:
    https://github.com/WebAssembly/relaxed-simd/issues/27#issuecomment-1190859982

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

Change-Id: I551bcd97555ec8f9dd7a8840b88be6cc3670697c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4113263
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#84915}
2022-12-17 00:35:37 +00:00
Adam Klein
f3c984297d Skip cctest/test-serialize/CreateIsolateFromReadOnlySnapshot on mac debug
Bug: v8:13598
Change-Id: I1a3924f40d2b46ada0dc4f5f63730012c3d4d987
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4114276
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Adam Klein <adamk@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#84914}
2022-12-16 19:20:39 +00:00
Deepti Gandluri
b0c2b7797a [relaxed-simd] Fix ordering of relaxed FMA/FNMA operands
New ordering and rationale described here:
https://github.com/WebAssembly/relaxed-simd/issues/27#issuecomment-1190859982

Bug: v8:12284
Change-Id: I61829617b55ee92642485c18400523e659dc0349
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4109474
Reviewed-by: Ilya Rezvov <irezvov@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84913}
2022-12-16 19:12:44 +00:00
Jakob Kummerow
c38e2ce46e [wasm] Make disassembler more robust for invalid modules
This fixes a segfault encountered when disassembling a particular
flavor of invalid module using wami's --full-hexdump mode.

Change-Id: I5fbb97c2359d14ce9d4b6830b55a75cc34e964a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3919231
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84912}
2022-12-16 17:52:54 +00:00
Leszek Swirski
f9406a7f4b [x64] Optimize PatchConstPool
Optimize the multimap iteration in ConstPool::PatchEntries to not use
equal_range/upper_bound to iterate over sub-ranges, but instead iterate
over the multimap directly, switching between sub-ranges as we detect
changes in the key.

Change-Id: I861123542f940c4d05e1a7877f41a92373f859a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110829
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84911}
2022-12-16 17:00:37 +00:00
Clemens Backes
076740d203 [x64] Minor tweaks to the {Assembler} implementation
This changes a few implementation details in the {Assembler} class on
x64, to make clang generate better code for it. This might also result
in slightly faster performance when generating code, especially in
baseline tiers.

R=jkummerow@chromium.org

Bug: v8:13565
Change-Id: I47e1bc559a5589e0f618ef1ced94966cf6538df5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110922
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84910}
2022-12-16 16:52:19 +00:00
Igor Sheludko
072e2723b2 [ext-code-space] Improve code range allocation logic
This CL adds a more thorough way of trying to allocate code range
closer to .text section. It can be enabled by
--better-code-range-allocation flag which is off by default.

Add --trace-code-range-allocation flag to trace the code range
allocation process.

Add --abort-on-far-code-range flag to issue a fatal error if the code
range ended up allocated too far away from .text section.

Bug: v8:11880, chromium:1400973
Change-Id: Ie16f9bf64b48a815be771e3c02e2c1c6dcdb20eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4110760
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84909}
2022-12-16 16:33:55 +00:00
Qifan Pan
b53f4d8247 [turbofan] Optimize BigInt64 array store/load
This CL avoids unnecessary heap allocation for BigInt64 array
store/load by

- setting the output representation of a load to word64, and
- propagating word64 truncation to the source of a store.

This CL introduces a simplified operator SpeculativeToBigInt
which is applied to the source of a store to a BigInt64 array to
deopt on a non-bigint input.

Bug: v8:9407
Change-Id: I48ce13761bc4cf742d5b18cec4476dc9ad131414
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4101011
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Qifan Pan <panq@google.com>
Cr-Commit-Position: refs/heads/main@{#84908}
2022-12-16 16:20:11 +00:00
Jakob Kummerow
b1e8e2d811 [wasm] Move Int64Lowering to a later point
Certain optimization phases are more convenient to write when they
can run before Int64Lowering. So this patch moves Int64Lowering
from graph building to a later point in the pipeline.
The logic itself is not changed, and no impact on performance or
behavior is expected.

Change-Id: I3597498e8f3bb9e6fa8c3b36dcfcc735440f80b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4111237
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84907}
2022-12-16 16:17:36 +00:00