Commit Graph

80010 Commits

Author SHA1 Message Date
Matthias Liedtke
d43139d41d [wasm-gc] Subtyping: Fix dcheck for nofuncref in type union
Follow-up CL for e9024ad26c.

Bug: v8:7748
Change-Id: I3a05b6acb382f51cccf87022a59278a16a464255
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4177100
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85368}
2023-01-18 15:25:54 +00:00
Manos Koukoutos
e9024ad26c [wasm-gc] Fix and extend type union
Bug: v8:7748
Change-Id: Ia0486dd543bdb2c9eb42899fd57aae22297f8cd2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4177095
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85367}
2023-01-18 14:23:57 +00:00
Camillo Bruni
e3c6e32ec0 [mjsunit] Mark regress-1353555 as non-predictable
Bug: v8:13670
Change-Id: Iebf17dcdb2b843f0e6f2820f045f3c5879a7d8d1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174086
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85366}
2023-01-18 14:16:52 +00:00
Andreas Haas
10f3039bdb [wasm] Implementation of code flushing with explicit call
This CL introduces an initial implementation of code flushing, which
can be triggered from JavaScript with an explicit runtime call. The
runtime call allows easier testing. So far all Liftoff code gets
deallocated at a code flushing event. Experiments will show if this is
a good strategy.

Bug: chromium:1407659
Change-Id: I2c19a25ab5da1cf3b6d027d14cc6e719f33e300b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171627
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85365}
2023-01-18 13:14:53 +00:00
Matthias Liedtke
b0cd98500d [wasm] Fix static out of bounds check in decoder
Bug: chromium:1408337
Change-Id: Id6026097bf6a367601ec2837d11754d784212f30
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4176734
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85364}
2023-01-18 13:11:32 +00:00
Camillo Bruni
8eed79319a JSON Parser micro optimisations
- Dehandlify more code
- Added FieldIndex::ForDetails helper

Bug: chromium:808503
Change-Id: Ib531f6c87e4a191cba162376636b0238e7e97e7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4115749
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85363}
2023-01-18 12:00:47 +00:00
Nico Hartmann
8331582414 [turboshaft] Remove weak liveness from dead code elimination
Bug: v8:12783, chromium:1407349
Change-Id: If90c5323e36641c2fe7ae6ea79985dc09cf9e2eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4176736
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85362}
2023-01-18 11:24:20 +00:00
Nico Hartmann
f5b98ee39b [turboshaft] Implement ReduceInputGraph mechanism
With this new mechanism, all operations in the input graph are passed
through the reducer stack's ReduceInputGraphXyz operations that have
direct access to the original operation and index. This allows for
analysis results (computed for the input graph) to be used in a simple
way. At the bottom of the stack, all ReduceInputGraphXyz calls are
forwarded to AssembleOutputGraphXyz in the OptimizationPhase, which
calls through the stack's ReduceXyz methods as before.

Bug: v8:12783
Change-Id: Ib5662d1fa72284bd1dd763a4a6c01e590fea945f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4165600
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85361}
2023-01-18 10:53:03 +00:00
Leszek Swirski
dd7b9aa51a [assembler] Fix formatting of NOOP_UNLESS_DEBUG_CODE
NOOP_UNLESS_DEBUG_CODE conditionally either declares or defines as
empty, a debug-only method in assemblers (predominantly AssertFoo
methods). The macro confuses clang-format though, which doesn't know
that the macro terminates the member function declaration, and the
indentation after it gets weird.

This can be fixed by adding a semi-colon after the macro (so that it
looks like a trailing function annotation to clang-format), but doing
this naively causes "Extra ';' in class definition" errors for the
case where the method is defined inline. These can be resolved by
swallowing that semicolon using a dummy `static_assert(true)` after
the function body.

Change-Id: I2032e68eafeca29524da2fe7ba7873c11f63d5e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4176735
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85360}
2023-01-18 10:41:29 +00:00
Leszek Swirski
df88d60a4a [maglev] Make sure kContextRegister isn't clobbered
... on arm64 budget/stack check interrupts.

Bug: v8:7700
Change-Id: Iae7162d1edab688bd7b211e70112a498a252cbb9
Fixed: chromium:1407930
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4176732
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85359}
2023-01-18 10:22:32 +00:00
Michael Lippautz
ba401bb42b [heap] Remove LocalEmbedderHeapTracer
Bug: v8:13207
Change-Id: I54c6f501337a502407f8c137ec59f55a6f8d3416
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174081
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85358}
2023-01-18 09:36:32 +00:00
Clemens Backes
c9b183f27d [trap-handler] Add more owners
Make mark@ and mseaborn@ owners of the trap-handler directory.

R=ahaas@chromium.org
CC=mark@chromium.org, mseaborn@chromium.org

Change-Id: I0de583218895245527e8da4c2b6a8506dd007266
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171632
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85357}
2023-01-18 09:14:04 +00:00
Clemens Backes
9d1e0f9b8c [wasm] Use lazy compilation for debugging
There is another place where the {is_in_debug_state} flag has precedence
over {lazy_module}. This should be the other way around: For lazy
modules, we should not eagerly compile Liftoff code.

R=ahaas@chromium.org

Bug: v8:13224
Change-Id: I8da8280bd2e2ea08f83cb1bc5697b8f76795f403
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4168412
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85356}
2023-01-18 09:12:28 +00:00
Clemens Backes
a1ab1271a0 Add a WATCHLIST entry for trap-handler
Changes to the trap-handler directory need special security review. Add
a WATCHLIST to make it less likely that security review is ignored.
The watch list has ahaas and clemensb as V8-side owners and mark and
mseaborn as security reviewers.

R=ahaas@chromium.org, mark@chromium.org, mseaborn@chromium.org

Change-Id: I3af3eee5797d20353c39a33de009f39df85e98a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4165617
Reviewed-by: Mark Seaborn <mseaborn@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85355}
2023-01-18 09:00:37 +00:00
Jakob Linke
c53c026e6e Rename CodeDataContainer to Code
This completes the big Code/CodeDataContainer name shuffle.

Bug: v8:13654
Change-Id: If033e9153e751ab0d2a38572da2ce2f7029bc359
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173569
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85354}
2023-01-18 08:44:08 +00:00
Liu Yu
08aa1e2891 [loong64][mips64] Rename Code to InstructionStream
Port commit 2c7272fdde

Bug: v8:13654
Change-Id: I06b714c21db9e688ee7955f32061dd99c9374278
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173355
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#85353}
2023-01-18 07:46:59 +00:00
Andreas Haas
589591026a [wasm][cleanup] Clean up signature of WasmTierUpFunction
The runtime function took two parameters, the instance and the function
index. The function index, however, seems to be unnatural information,
as the function index is a value that only has meaning with the binary
format of a wasm module, and not for the embedder of a wasm module.

This CL changes the signature of the runtime function to a single
parameter, the wasm function that should be optimized.

R=manoskouk@chromium.org

Bug: v8:12926
Change-Id: I6802cb6c8ffc586f4997a4a069735785ce59583d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171625
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85352}
2023-01-18 07:10:47 +00:00
Liu Yu
6d40296e5a [loong64][mips64] Replace JumpToOffHeapInstructionStream with
functions from the TurboAssembler class

JumpTableAssembler inherits from TurboAssembler class instead of
MacroAssembler class, so its function cannot directly use
JumpToOffHeapInstructionStream.

Change-Id: Id87901157202443440cc8ff658b098d1db1a6865
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173347
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85351}
2023-01-18 06:56:14 +00:00
v8-ci-autoroll-builder
dc4497d013 Update V8 DEPS (trusted)
Rolling v8/build: 8eddf35..e831815

Rolling v8/buildtools: a1adda9..d843e69

Rolling v8/buildtools/clang_format/script: 8b525d2..f97059d

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/a4c8178..7a311fe

Rolling v8/third_party/depot_tools: 1757677..86cfa62

Rolling v8/third_party/fuchsia-sdk/sdk: version:11.20230112.1.1..version:11.20230114.0.1

Rolling v8/third_party/ninja: version:2@1.8.2.chromium.3..version:2@1.11.1.chromium.6

Change-Id: I0f3f07dadc4a8d82737e147bd0ff7b1836f5e0d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174855
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@{#85350}
2023-01-18 04:04:33 +00:00
Clemens Backes
dbeb7ed3cc [wasm] Remove redundant set_function_validated
Liftoff will only be called on valid functions, but does not validate
itself. So we should not set the function to "validated" after executing
Liftoff compilation. Instead, we can DCHECK that the function was
validated before.

This requires a few changes to tests and fuzzers to correctly set the
{function_was_validated} bit.

R=ahaas@chromium.org

Change-Id: I669fca77724189c83d78bdfda9f08df9f7fd63f4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4168411
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85349}
2023-01-17 17:20:27 +00:00
Omer Katz
0a94bc6d3e [heap] Fix race with promoted page iteration
This is a followup to crrev.com/c/4165084.
Using relaxed atomic is not sufficient since the tasks are still running
and thus are not synced with the main thread.
This CL switches to using acquire-release semantics instead.

Bug: v8:13668
Change-Id: I613e56d423926d990aa22b3bd762a51af34737b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174078
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85348}
2023-01-17 17:09:56 +00:00
Paolo Severini
11a63fa8d2 [sandbox] Reduce max size of ExternalPointerTable on Android
Bug: v8:13661
Change-Id: Iec08bc81fc2d42b728a05bbbe51c765d3982427c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173595
Reviewed-by: Samuel Groß <saelo@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#85347}
2023-01-17 16:58:54 +00:00
Manos Koukoutos
0033691b2a [wasm-gc] Move and simplify AssertNotNull optimization
We used to optimize the pattern of a {WasmTypeCast} followed by an
{AssertNotNull} in the wasm typer, by moving the latter before the
former. This has caused multiple bugs in the past.
Now that we have null-trapping casts, we can simplify the optimization
by changing the return type of the type cast to non-nullable, thus
making it trap on null, and removing the explicit null assertion. We
also move it to the WasmGCOperatorReducer, which is more appropriate.

Bug: v8:7748
Change-Id: I756543090145c71e998042607437a5bad3fd19da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4172731
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85346}
2023-01-17 16:08:10 +00:00
Dominik Inführ
4abbe5deeb [test] Mark shared memory tests as unpredictable
Tests with shared memory are non-deterministic and shall not be
run with --predictable.

Bug: v8:13267, v8:13669
Change-Id: I65c9e1b273ff96ea73acd817a297c08f83ba615f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174076
Commit-Queue: Patrick Thier <pthier@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Auto-Submit: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85345}
2023-01-17 15:47:36 +00:00
Clemens Backes
d2119c0b68 Annotate some SmallVector methods as V8_PRESERVE_MOST
SmallVectors are assumed to be small most of the time. Hence the {Grow}
method and others will most of the time not be called. So mark them
{V8_PRESERVE_MOST} to make caller code slimmer and faster.

R=dlehmann@chromium.org

Bug: v8:13565
Change-Id: Ia2bdcdff7e415b1d8a2717849c74604677a9dade
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4168413
Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85344}
2023-01-17 15:05:51 +00:00
Clemens Backes
79ed179625 [wasm] Relax a DCHECK for validation
We sometimes validate functions in the background, e.g. when inlining in
TurboFan. This had a slight chance of triggering a DCHECK when we were
validating the same function explicitly in another thread.
This would only happen in non-default configurations, if some functions
get eagerly compiled with TurboFan and other functions get lazily
compiled, and therefore validated explicitly.
Since listing all such conditions is tricky, we just return early if we
detect that a function was already validated.

R=ahaas@chromium.org

Bug: v8:13659
Change-Id: Ie75b2638e86e263406edfbc41cc4f404b3b98e68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171623
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85343}
2023-01-17 14:52:54 +00:00
Toon Verwaest
1d8f2517e3 [parser] Don't lazy compile CreateDynamicFunction functions
Bug: chromium:1407080
Change-Id: I9b0c30a9ab8fb66510e627ab276eb1c9b3146aa0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4174072
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85342}
2023-01-17 14:50:21 +00:00
Michael Achenbach
2a20b228ef [gcmole] Run gcmole on bots with matching architecture
This does:
- Move gcmole runs to bots with matching arch.
- Update mb_configs to enable gcmole on the bots that run it.
- Add a GN target that extracts some compiler flags from a
ninja file of one of V8's other targets.
- Use the extracted flags in the gcmole script and remove other
hard-coded arch-specific flags.

This is done for DEFINES and includes for now. Other compiler flags
are still a TODO.

Bug: v8:9287
Change-Id: Icba9ce59e0bfffd138d9207b1c2ad64d42bf6a91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4055629
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85341}
2023-01-17 13:56:18 +00:00
Victor Gomes
6350ef168c [maglev][arm64] Fix lack of scratch registers in ExceptionHandlerTrampolineBuilder
Not enough scratch registers to materialize results.

Fixed: chromium:1407928
Bug: v8:7700
Change-Id: I90c60bd4f8607d223d577344f8452fedfc6774af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173573
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85340}
2023-01-17 13:49:10 +00:00
Milad Fa
e2edd1c992 [codet] Fix decoding of KindField on big endian
KindField seems to be a 2 byte value (rather than 4).
Loading 32 bits would read an incorrect value on BE and fails
runtime assertions.

Behaviour does not change on little endian as only the low-order
4 bits are used.

Change-Id: I0933a00e6fb5259785f894a838933791d411edba
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4168418
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#85339}
2023-01-17 13:23:33 +00:00
Olivier Flückiger
0f4a6a500c [runtime] StringEqual check in larger chunks
SeqStrings are now zero padded. This allows us to check equality in
chunks of 32, or 64 bytes. Makes StringEqual about 2x as fast for
strings larger than 4-8 bytes.

Bug: v8:13664
Change-Id: Ic5e21bbef97b401a6d28a76bcb164a88739a68a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4156058
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85338}
2023-01-17 13:15:58 +00:00
Jakob Linke
2c7272fdde Rename Code to InstructionStream
.. as part of the big Code/CodeDataContainer name shuffle.  In the
next step, CodeDataContainer will be renamed to Code.

Bug: v8:13654
Change-Id: Ia80ac984d46dd6c2a108098055a5cd60e22a837c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171628
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85337}
2023-01-17 12:45:45 +00:00
Leszek Swirski
503b56efdf [maglev] Check maps in TryBuildFastInstanceOf
Add a map check for the RHS of instanceof checks (i.e. the class) when
loading its hasInstance method. We were previously confirming the value
of the RHS, to make sure that it's a constant, but not considering the
case that the map of that class could change (e.g. because of a
prototype change or field definition).

Bug: v8:7700
Change-Id: Ia2923b99dd0524670bebcc57e4c0c209f8835d04
Fixed: chromium:1407959
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173568
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85336}
2023-01-17 12:13:38 +00:00
Matthias Liedtke
04f19e973e [wasm-gc] Module decoder: Remove template to save binary size
Bug: v8:7748
Change-Id: Ic2eb981b28b6f5af926c7f8889da8bb9a71188ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171636
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85335}
2023-01-17 11:34:49 +00:00
Alexander Schulze
b26a55b88f Revert "[test] ownership"
This reverts commit c96177a04a.

Original change's description:
> [test] ownership
>
> edit
>
> Bug: chromium:1
> No-Try: true
> Change-Id: I1b946aaf9eb47c04c18b1e8c61aa06e744bbc2b2
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173576
> Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#85333}

Bug: chromium:1
Change-Id: I5fccdc73f1e75c90e600f8947c977018f8715406
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173667
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Reviewed-by: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#85334}
2023-01-17 11:28:27 +00:00
Liviu Rau
c96177a04a [test] ownership
edit

Bug: chromium:1
No-Try: true
Change-Id: I1b946aaf9eb47c04c18b1e8c61aa06e744bbc2b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4173576
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85333}
2023-01-17 11:25:31 +00:00
Marja Hölttä
7be93470c7 [performance|regexp] Avoid unnecessary JSArray creation
Matches were transmitted in a JSArray, although a FixedArray is
enough.

Change-Id: I71145c6b55d57a15e330a3865f00d038e613dde3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171631
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85332}
2023-01-17 11:18:42 +00:00
Victor Gomes
9bd7c5e1bd [maglev] Fix visiting stack in StackGuard call
The RegisterInput (NewTarget) was not correctly visited by the GC.
This:
- Creates a sentinel safepoint to indicate that the stack is not
fully created (we are in the stack guard call).
- Generalises RegisterInputs (we assumed only NewTarget before) and
save them in the graph.
- Pass the register input count via tagged_register_indexes in
this case.

Fixed: chromium:1407606
Bug: v8:7700
Change-Id: I8f599f8c1a992ee6fd886eec1e289454649dfec8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171626
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85331}
2023-01-17 10:27:40 +00:00
Michael Lippautz
943d82bfa9 [heap] Fix worklist segment capacity in --predictable
Actual worklist segment capacity may vary depending on allocator
internals. Varying capacity can result in different push/pop order
even in single-threaded execution which is incompatible with
--predictable.

As a fix, rely on minimum capacity for --predictable.

Bug: v8:13614
Change-Id: Icbf093b31c32f4eb20476954572b3731f5c8ef88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171641
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85330}
2023-01-17 10:04:49 +00:00
Michael Lippautz
fb8b0d2ab5 [heap] Remove LocalEmbedderHeapTracer methods for incremental tracing
Remove unused methods in the incremental marker.

Bug: v8:13207
Change-Id: I7ddb986c54e8534e46f6731ced60a82cb97d4ff9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171633
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85329}
2023-01-17 09:38:09 +00:00
Leszek Swirski
01135ec0f2 [maglev] Split element load
Split tagged and double element loads (LoadTagged/DoubleElement) into
loads of the elements array, and a load from the Fixed[Double]Array.
This will allow us to potentially re-use elements array loads, as well
as use the more generic FixedArray load for other FixedArrays.

Bug: v8:7700
Change-Id: I382132585a709ab1351666fd820156148b35bc42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4168414
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85328}
2023-01-17 08:51:31 +00:00
Lu Yahan
b692796f75 [riscv][codet] Remove the CodeT=Code implementation
Port commit 177b6be920
Port commit 651d4d9748
Port commit dd38db94df
Port commit 3e43010abb

Change-Id: I88cf4fb58e53f8ab2f3c0a26a0886b8c172ca1b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4166713
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@{#85327}
2023-01-17 07:45:47 +00:00
v8-ci-autoroll-builder
44b8ca4eab Update V8 DEPS (trusted)
Rolling v8/build: 396e122..8eddf35

Rolling v8/tools/clang: 9f2d780..c042194

Change-Id: I39091f29ea1959d8602f8e13ca923cbc17e366db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4172487
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@{#85326}
2023-01-17 04:02:55 +00:00
Jakob Linke
dd38db94df [codet] Remove the CodeT type alias
.. now that it unconditionally refers to CodeDataContainer. All
previous references to 'CodeT' (the type and as part of names) are
now updated to 'CodeDataContainer', including 'codet', 'CODET', etc.

Bug: v8:13654
Change-Id: I7abbba040091eddf3ef09028a891aed460363929
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4165619
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85325}
2023-01-16 16:25:02 +00:00
Liviu Rau
dab4bb5ccc Add instrumenter builders for PGO
Bug: chromium:1382471
Change-Id: Iacb0eb5275d48a2ce4bef1783c55bef9bbb598db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171629
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#85324}
2023-01-16 15:52:56 +00:00
Olivier Flückiger
f813dd4d34 [static-roots] Use static roots in C++
Use the static root pointers to generate better code for C++ builtins.

First, comparisons like `IsUndefined` should only consider the
compressed pointer. The change ensures that comparisons compile to:

```
; IsUndefined
cmp    DWORD PTR [rbx+r14*1],0x22e1
```

Further, storing into a tagged field should be just one instruction as
well. To avoid complicating stores we opt for ensuring clang can
optimize `compress(decompress(cage_base, 0x42)) -> 0x42`. To that end
`DecompressTaggedPointer` has to be slightly rewritten, as
using the base as `Address` makes clang ignore the specified alignment
(see https://godbolt.org/z/f1ajneW1P).

With this optimization also stores are compiled to one instruction:

```
; map.set_prototype(roots.null()):
DWORD PTR [rax+0x13],0x22c5
```

Bug: v8:13466
Change-Id: I5355dc21cf7cb459f5dc3718f8facefc1d04e229
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4130075
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85323}
2023-01-16 15:27:17 +00:00
Dominik Inführ
aa7b01698a [d8] Terminate workers before quit() in shared space isolate
Bug: v8:13267, chromium:1406471
Change-Id: I58aebcde81568837372463ec1a7cc0888ba22dc4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4161763
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85322}
2023-01-16 15:05:23 +00:00
yangwenming
7df371b2d5 [parser] Avoid function declarations being covered.
In some cases, a declaration of a function may be covered by
variables with a same name and thus bound to one parameter. This
CL records variables which should not be bound to the parameter,
are skipped when inserting shadowing variable binding initilizers.

Bug: v8:13459
Change-Id: Id7d147392450b177d219bfd04245b47d9e58c20e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4130416
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85321}
2023-01-16 14:11:43 +00:00
Michael Lippautz
0c64368134 [heap] Remove some LocalEmbedderHeapTracer accessors
Support the following through CppHeap:
- ShouldFinalizeIncrementalMarking()
- SupportsIncrementalEmbedderSteps()

Bug: v8:13207
Change-Id: I22db34aa9e98f6d61f66cbf3042409688175f434
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4165618
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85320}
2023-01-16 14:09:39 +00:00
Dominik Inführ
e7a336d72b [objects] Use NotifyObjectSizeChange for BigInt right-trimming
Use the bottleneck for right-trimming of objects also for BigInts.

Change-Id: I82fcb38143f939fdd3d7763c9c60d2e9003196eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4165614
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85319}
2023-01-16 14:07:43 +00:00