Commit Graph

75588 Commits

Author SHA1 Message Date
Igor Sheludko
3fa8fb0d59 [ext-code-space] Fix Code with non-Code object comparisons
... which might fail because usual operator== for tagged values compares
only lower 32 bits of the pointer.

Bug: v8:11880, v8:12958
Change-Id: I0978d6c510424aecfee2f044c40ea424b6cb3ab9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695593
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81096}
2022-06-13 09:46:39 +00:00
Andreas Haas
5e3abf4464 [wasm] Decrement current_int_param_slot only once for reftypes
R=thibaudm@chromium.org

Bug: chromium:1335523
Change-Id: I194915b37ea27b3d7d1a9f2367b6935b8a3bff39
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3702233
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81095}
2022-06-13 09:12:20 +00:00
Tobias Tebbi
fcca2eaf1f [turboshaft] workaround for bug in GCC 7 (again)
Bug: v8:12783
Change-Id: I2d02b4466edb1da48512b1f2d2bc14f6d5cb8dc0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3701596
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81094}
2022-06-13 08:24:02 +00:00
Clemens Backes
61a6fd84e1 [wasm] Rename "OnModuleCompiled" and related callbacks
Already after enabling Liftoff, the name did not match the semantics any
more. The callback was called after top-tier finished, not after initial
compilation of the module finished.
With dynamic tiering, the name is even less fitting.

This CL renames the "OnModuleCompiled" callback in the API to
"MoreFunctionsCanBeSerialized", which makes it more obvious what the
API should be used for. It also internally renames all related typedefs
and methods accordingly.

One call of the callback in the streaming decoder was already wrong
before this CL and is being removed.

R=jkummerow@chromium.org, cbruni@chromium.org

Bug: v8:12899
Change-Id: I95c0fc9e32442383e47e4370e31277cc065bf0fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3687689
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81093}
2022-06-13 08:13:00 +00:00
Clemens Backes
6723438813 [API] Deprecate LegacyOOMErrorCallback
Deprecate the LegacyOOMErrorCallback in the 10.5 branch. Embedders are
expected to switch to OOMErrorCallback.
The deprecated LegacyOOMErrorCallback will then be removed in the 10.6
branch.

R=mlippautz@chromium.org

Bug: chromium:1323177
Change-Id: I83001bec760848ef39f0638ed5c5c9eaa7cdb6eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3646014
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81092}
2022-06-13 07:58:36 +00:00
Leszek Swirski
de56e52987 Revert "Avoid use of x18 register on arm64"
This reverts commit c2f254548a.

Reason for revert: CFI build failures: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20CFI/11255/overview

Original change's description:
> Avoid use of x18 register on arm64
>
> This causes crashes on Windows, as x18 is the "platform register",
> holding a pointer to thread-local storage.
>
> R=​jkummerow@chromium.org
> CC=​seth.brenith@microsoft.com
>
> Bug: v8:12959
> Change-Id: I20b8bee145d4ab3a40d8d140d98572df8300251c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695569
> Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#81090}

Bug: v8:12959
Change-Id: Id239ccb55e0a2d29051f402af64a855a8fd2d23b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3702231
Owners-Override: Leszek Swirski <leszeks@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#81091}
2022-06-13 07:57:32 +00:00
Clemens Backes
c2f254548a Avoid use of x18 register on arm64
This causes crashes on Windows, as x18 is the "platform register",
holding a pointer to thread-local storage.

R=jkummerow@chromium.org
CC=seth.brenith@microsoft.com

Bug: v8:12959
Change-Id: I20b8bee145d4ab3a40d8d140d98572df8300251c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695569
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81090}
2022-06-13 07:22:11 +00:00
v8-ci-autoroll-builder
22708eafcc Update V8 DEPS.
Rolling v8/build: 8ac7b3a..eb941d4

Rolling v8/third_party/fuchsia-sdk/sdk: version:8.20220610.3.1..version:8.20220612.1.1

Rolling v8/tools/clang: 8c95aed..2b3af06

R=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com

Change-Id: I3145586bec136a2ee98f1d2c6d10170a35743c7b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3701217
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@{#81089}
2022-06-13 03:45:50 +00:00
v8-ci-autoroll-builder
6a66b3afcd Update V8 DEPS.
Rolling v8/build: 36d2c30..8ac7b3a

Rolling v8/third_party/fuchsia-sdk/sdk: version:8.20220610.2.1..version:8.20220610.3.1

R=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com

Change-Id: Ib61ca93d3d6047172ddc017d95e22951447dc302
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3701215
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@{#81088}
2022-06-12 03:57:59 +00:00
Andy Wingo
f03814f83e [stringrefs] Implement stringview_wtf16.slice
Bug: v8:12868
Change-Id: Ib92cbf7eae8e4b7bc76bc918011be747254d931f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3700075
Commit-Queue: Andy Wingo <wingo@igalia.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81087}
2022-06-11 11:46:33 +00:00
v8-ci-autoroll-builder
f1ecc25952 Update V8 DEPS.
Rolling v8/build: 2fdb9a9..36d2c30

Rolling v8/third_party/depot_tools: a9467d8..6fbb744

Rolling v8/third_party/fuchsia-sdk/sdk: version:8.20220609.0.1..version:8.20220610.2.1

Rolling v8/tools/clang: 2f657cf..8c95aed

R=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com

Change-Id: Ie75126d6536441ebd96dc1846ccc053cb2cc9f32
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3700894
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@{#81086}
2022-06-11 03:55:18 +00:00
jameslahm
bc7d49e72d [test] Fix get resources for interpreter expectation files
... in unittests/testcfg.py on android.

Bug: v8:12781
Change-Id: I7a7f4edbae4f4fe646063d048f5132c401422be4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3697864
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#81085}
2022-06-11 02:02:28 +00:00
Seth Brenith
a6d7f261e6 Let script compilation cache keys outlive their values
This is a partial reland of https://crrev.com/c/3597106

With this change, an old entry in the script compilation cache is not
completely removed by CompilationCacheScript::Age(). Instead, its value
is replaced with undefined. In that way, the Script is still accessible
from the table until the garbage collector destroys it and clears the
weak pointer.

Bug: v8:12808
Change-Id: Ib494674e67d0fec455e1fed40499c5cca3b7c0a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3673426
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#81084}
2022-06-10 20:18:34 +00:00
Igor Sheludko
7445a4fd2a [runtime] Inline Foreign fields into CallHandlerInfo
... to avoid additional indirection on every access.

Bug: v8:12949
Change-Id: I16840ac0517e86f1f70252153112ca3475527416
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3693707
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81083}
2022-06-10 18:26:57 +00:00
Andy Wingo
ea6bedaeb1 [stringrefs] Implement stringview_wtf16.get_codeunit
Bug: v8:12868
Change-Id: I5fb5dccb5ff6b691348a519253de338fa91e8be1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695269
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Andy Wingo <wingo@igalia.com>
Cr-Commit-Position: refs/heads/main@{#81082}
2022-06-10 18:00:48 +00:00
Danylo Boiko
659d106af0 [turbolizer] Phases layer initial commit
- Added separate layer for phases
- Moved json parsing logic to new layer

Change-Id: I16289b1f4f62d011c1801fbc37bac49ff911e61e
Bug: v8:7327
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695566
Commit-Queue: Danylo Boiko <danielboyko02@gmail.com>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81081}
2022-06-10 17:06:07 +00:00
Joyee Cheung
dd6d96c8cd [api] add v8::Module::GetStalledTopLevelAwaitMessage()
Adds Module::GetStalledTopLevelAwaitMessage() API which searches for
modules that have no pending async dependencies but have not yet
resolved. An embedder may call this API when they are about to exit
to check if TLA evaluation has stalled and provide a better error
message.

Change-Id: I3b88802f70cc84c973551f13d73ef3e3d06f4027
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2341765
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81080}
2022-06-10 16:46:57 +00:00
Seth Brenith
693db0a383 Use AddGCPrologueCallback for Isolate compilation cache
Minor refactoring; shouldn't affect behavior.

This is a partial reland of https://crrev.com/c/3597106

Bug: v8:12808
Change-Id: Ibcc683317a6a85bb332dc96b212275f832cc59d8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3665263
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#81079}
2022-06-10 16:44:23 +00:00
Frank Tang
2ace4e1a35 [intl] Optimize NumberFormatv3
Remove internal slot of LocalizedNumberRangeFormatter
in NumberFormat and PluralRules and converted from
LocalizedNumberFormatter on the calls require it instead.

Bug: chromium:1307699, chromium:1307698
Change-Id: I9be1b7dd1c931f273d845359ca4de1273ea837a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3555261
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81078}
2022-06-10 16:43:20 +00:00
Leszek Swirski
f0fbdfeca4 [maglev] Add representation dependency for double fields
Use the field index to look up the descriptor for double fields, and add
a dependency on them.

Drive-by, fix store field optimisation to only emit the optimised direct
store for tagged fields, so that we don't accidentally insert
HeapNumbers into double fields (making them mutable).

Bug: v8:7700
Change-Id: I699c2a2e4e13194045139b9c995d05eb138c0e7c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3700071
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81077}
2022-06-10 15:29:38 +00:00
Nico Hartmann
239f223fb6 [turbofan] Release store context in new JSFunction
Bug: v8:12786
Change-Id: I0c53f9d7027c6b457186b2a04ab65daf7d6e0f85
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3698554
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81076}
2022-06-10 15:28:24 +00:00
Vasili Skurydzin
c41b0205d4 Aix: Prevent main thread from getting terminated with SIGPROF when
profiling is enabled

Bug: v8:12952

Change-Id: Ie3c3de71c5ca4be8256ac87e60b183bc45e47cf6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3696481
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Vasili Skurydzin <vasili.skurydzin@ibm.com>
Cr-Commit-Position: refs/heads/main@{#81075}
2022-06-10 15:20:07 +00:00
Tobias Tebbi
77ba98ef32 [turboshaft] add support for all JS machine-level operators
In particular, this CL adds support for:
- exception handling
- source positions
- OSR
- various numeric operations and conversions

Since the test suite now passes with `--turboshaft`, this also adds a
new variant for Turboshaft and enables it on some bots.

Bug: v8:12783
Change-Id: Ia2dd2e16f56fc955d49e51f86d050218e70cb575
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3669251
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81074}
2022-06-10 15:17:20 +00:00
Dominik Inführ
c1a1c11378 [heap] Only run MarkTransitiveClosureLinear() with serial marking
This method was intended to run single-threaded, so with parallel
marking disabled. While correctness isn't an issue here (simply because
we will later run this method single-threaded as well), some CHECKs do
not hold when parallel marking is active.

Bug: chromium:1325628
Change-Id: Iedebcf6241835011982217b1452271e38a36ce9d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3700074
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81073}
2022-06-10 14:59:18 +00:00
Leszek Swirski
b621958cf2 [tools] Add a roll_merge using the Gerrit API
roll_merge.py manually checks out V8 into a temporary directory, locally
builds a cherrypick, and uploads this to Gerrit. However, Gerrit has its
own REST API which allows cherrypicking. Using this API directly has two
advantages:

  1) We don't need to perform any local checkouts, so it's much faster,
     and
  2) The cherry-picked commit is marked as a cherry-pick by Gerrit,
     which means Rubber-Stamper-Bot will treat it as a cherry-pick.

The implementation for now is very simple, and doesn't support things
like cherry-picking multiple revisions or applying an additional local
patch. It does, however, increment the patch value in v8-version.h, and
tries to set Owners-Override +1.

Bug: v8:12849
Change-Id: Ie242dbec6b3d24f5118d601e9d326465d190a8f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3644609
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81072}
2022-06-10 14:38:28 +00:00
Clemens Backes
436f088944 [wasm][streaming] Check for illegal section code
Add a missing check to reject illegal sections.

The test is added in three forms, to give fuzzers more food: A fuzzer
regression test for the streaming fuzzer, a unit test for the streaming
decoder, and an mjsunit test for streaming compilation.

Drive-by: Remove a redundant line in the synchronous decoder (this is
already handled by the following statement.

R=ahaas@chromium.org

Bug: chromium:1335023
Change-Id: Ic8c3b301f1b58981c7d68eafcffc89531ed2c64c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3698549
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81071}
2022-06-10 14:23:07 +00:00
Tobias Tebbi
85b4b5d719 [compiler] only enable MidTierRegisterAllocator for Wasm
The mid-tier register allocator keeps values in stack slots for too
long. This is incompatible with left-trimming, therefore we cannot
enable it for JS functions.

Bug: chromium:1335054
Change-Id: I61ab97d4fbfcbb81319e611a64a6454e050a1d65
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695266
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81070}
2022-06-10 14:01:48 +00:00
jameslahm
eab795f377 [test] Fix FlagsJitlessImplications test in
... flag-definitions-unittest.

We should setup the isolate to get the correct Flag_*.
This CL fixes the breakage in https://ci.chromium.org/p/v8/g/ports/console including https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm%20-%20sim%20-%20lite and https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm%20-%20sim%20-%20lite%20-%20debug etc.

Bug: v8:12781
Change-Id: Ifca84c02f8458f0a906948f4a7e0f999af429abf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3697865
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#81069}
2022-06-10 13:52:11 +00:00
jameslahm
1a06c0077d [test] Move test/cctest/test-platform to test/unittests/
... base/platform/platform-unittest.

Bug: v8:12781
Change-Id: I05902bfa5ad6f391f7b7ffa8b22b46627c244fef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3688893
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81068}
2022-06-10 13:14:00 +00:00
Anton Bikineev
64936c8859 cppgc: Fix the age-table unittest
Bug: chromium:1325007
Change-Id: I6adb06c4b15e5656f2b2c47b49d6a225750a6b2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695572
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81067}
2022-06-10 13:11:19 +00:00
jameslahm
1f2fc0851e [test] Move cctest/test-thread-termination to unittests/
... execution/thread-termination-unittest.

Bug: v8:12781
Change-Id: I772ad8550e242eae66f76c5785aeb7f1e4425fae
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3688894
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81066}
2022-06-10 12:38:01 +00:00
Milad Fa
9dfac00a1d PPC: skip slow tests on the ppc simulator
This CL splits two mjsunit files and skips the ones
which take the longest on the simulator and cause a timeout.

Change-Id: I89be764dc2d7684b401690a23bf53a3ef6384d16
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3693667
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81065}
2022-06-10 12:03:17 +00:00
Igor Sheludko
0addc195b9 [runtime] Merge VisitExternalReference and VisitExternalPointer
... into VisitExternalPointer(HeapObject, ExternalPointerSlot,
                              ExternalPointerTag).

Drive-by: introduce ExternalPointerSlot - a slot containing an
ExternalPointer_t value.

This cleanup is a prerequisite for inlining Foreign object fields into
field's holder objects.

Bug: v8:12949
Change-Id: Ifd74ed285796b0952d7d06de82b56c63fd1f7f3e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695361
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81064}
2022-06-10 12:00:29 +00:00
Jose Dapena Paz
0fc6592cf8 GCC: fix compilation of NEON64 extract_first_nonzero_index
GCC fails to compile extract_first_nonzero_index because of the
signedness type mismatch in the NEON intrinsics.

Bug: chromium:819294
Change-Id: I9b73e5fa1d5fbf161740ab1b5d77f5c494369dfa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3693709
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#81063}
2022-06-10 11:39:07 +00:00
Leszek Swirski
ecad9dc2c4 [string] Add missing two-to-one byte conversion
Use the "convert" parameter to SequentialStringKey to construct one-byte
strings out of two-byte input vectors, where appropriate.

Change-Id: I8a214b3960c677614d6f82ed3b29405e2e493e81
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557981
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81062}
2022-06-10 10:40:38 +00:00
Lu Yahan
3975045cc8 [riscv64] Fix mem segment fault in simulator
Run mem in simulator may be occurs segments fault. This cl to fix it.
If value of reg is small int, it should be smi.

Change-Id: I60b4eb8c959bc9f86ae28718ff6dd54ecf40a6ec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3698757
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#81061}
2022-06-10 10:16:57 +00:00
Thibaud Michaud
b5e9eab6d0 [wasm] Fix module prefix hash for streaming decoder
The module's "prefix hash" is based on a prefix of the module bytes that
starts at the beginning of the module and stops at the code section.

In the case of the streaming decoder, if the code section is empty,
`AsyncStreamingProcessor::ProcessCodeSectionHeader()` is never called,
and we keep accumulating bytes in the hash after the code section. Fix
this by always calling into the streaming processor even if the code
section is empty.

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

Bug: chromium:1334651
Change-Id: Id2a03468b355867868e589523c994c268c7b4eaf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695564
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81060}
2022-06-10 09:52:18 +00:00
Anton Bikineev
ae41f7dfd9 cppgc: Fix caged-heap reservation when pointer compression is enabled
Currently, PageAllocator assumes that FreePages(start, size) will always
be called on the same region that was passed to AllocatePages(start,
size). This assumption is made in:
1) leak-sanitizer (LsanPageAllocator) that checks it explicitly,
2) on Windows, FreePages() calls VirtualFree() with zero-size and
   MEM_RELEASE, which causes the entire reservation to be freed.

The CL temporarily fixes the bot failures just by holding the unneeded
half and adds a TODO to return the unneded part back to the OS.

Bug: chromium:1325007
Change-Id: I2bd878876d43d693cf2138020f410ffe1615b4e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695363
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81059}
2022-06-10 09:11:37 +00:00
jameslahm
b61ee5f34a [web snapshot] Support static methods, static async methods,
... static generator methods and static async generator methods
for Class.

Bug: v8:11525
Change-Id: I58e8059c95e8a24e1a09d84aea84b82d35f5e2d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3688891
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81058}
2022-06-10 09:05:12 +00:00
jameslahm
b3d004aaf9 [test] Move cctest/interpreter to unittests
... /interpreter.

This CL moves cctest/interpreter/{bytecode-expectations-printer,
test-bytecode-generator, test-interpreter-intrinsics,
interpreter-tester, test-interpreter, test-source-positions,
source-position-matcher} to unittests/interpreter/{
bytecode-expectations-printer, bytecode-generator-unittest,
interpreter-intrinsics-unittest, interpreter-tester,
interpreter-unittest, source-positions-unittest, source-position-matcher}.

Bug: v8:12781
Change-Id: I187583bd34f709dd0d7dfc0f92e18f191da0e30f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3609752
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81057}
2022-06-10 08:37:10 +00:00
Anton Bikineev
04c1cbb8c9 cppgc: Support compaction only for uncompressed pointers
Compaction currently considers only backing store pointers as slots and
those are uncompressed. The CL fixes the tests to use raw pointers
instead of Members.

Bug: chromium:1325007
Change-Id: I2ddfffeeab396552bb7cf31b2bd8502ebc2921fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695590
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81056}
2022-06-10 07:55:37 +00:00
Camillo
26999f997b [runtime] Throw error if RCS runtime function is used without RCS
%GetAndResetRuntimeCallStats(...) is changed to throw:
- if the RCS compile-time flag was not set
- if --runtime-call-stats / tracing RCS is not enabled

This avoids a few debug cycles when trying to get RCS with official
release builds that don't ship it.

Change-Id: I92b1271b34b76439c2a5cddff853619c983549bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695563
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81055}
2022-06-10 07:39:26 +00:00
v8-ci-autoroll-builder
3614c8609d Update V8 DEPS.
Rolling v8/build: a789781..2fdb9a9

Rolling v8/buildtools/linux64: git_revision:fd6cae41bd7d5d255dc2fb96004a8bf74ac9d972..git_revision:2ecd43a10266bd091c98e6dcde507c64f6a0dad3

Rolling v8/buildtools/third_party/libc++abi/trunk: 11395e5..013bcd8

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/8a8c0b9..ba0a827

Rolling v8/third_party/depot_tools: b3579d4..a9467d8

Rolling v8/third_party/fuchsia-sdk/sdk: version:8.20220608.4.1..version:8.20220609.0.1

R=v8-waterfall-sheriff@grotations.appspotmail.com,mtv-sf-v8-sheriff@grotations.appspotmail.com

Change-Id: I304eecaae92c311e7c5500a9c11de0fed69af561
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695971
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@{#81054}
2022-06-10 03:52:04 +00:00
Frank Tang
25c264f894 [Temporal] Add with to ZonedDateTime
Add AOs: ToTemporalOffset and InterpretISODateTimeOffset

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.zoneddatetime.prototype.with
https://tc39.es/proposal-temporal/#sec-temporal-totemporaloffset
https://tc39.es/proposal-temporal/#sec-temporal-interpretisodatetimeoffset

Bug: v8:11544
Change-Id: I8b757386596d0d73a73e8e9aa2d52cd72b90a95a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3692939
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81053}
2022-06-09 20:21:53 +00:00
Manos Koukoutos
a8fad3884d [wasm-gc][bug] Insert TypeGuards as appropriate
Insert TypeGuard nodes for the result of br_on_non_null and the Forward
decoder interface function.
Also, add debug checks when inlining to check real vs. formal argument
types, because that is where the bug manifested.

Bug: v8:7748
Change-Id: I9bd8415a1f10c22ff1cabaa3949749b9495225d1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695588
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81052}
2022-06-09 19:11:03 +00:00
Camillo
6a0889817d [api] Make CanHaveInternalField inlineable
Drive-by-fix: Reduce one branch in the type compairison since
JS_OBJECT_TYPE and JS_FIRST_API_INSTANCE_TYPE are adjacent.

Bug: v8:11476
Change-Id: I621ef2df4da2858cb1652276f800ccedba4e3015
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695562
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81051}
2022-06-09 18:42:25 +00:00
Danylo Boiko
c5f878482e [turbolizer] Initial TS code refactoring
- basic file movement
- dependencies update
- grammar fix
- refactoring common files (from new folder 'common')

Change-Id: Ie47d565202aefe247ef6fd9e64108926e467d533
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3695385
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Danylo Boiko <danielboyko02@gmail.com>
Cr-Commit-Position: refs/heads/main@{#81050}
2022-06-09 18:03:03 +00:00
Georgia Kouveli
fb235844dc [arm64] Fix CFI issue with short builtin calls
The allowlist used for `Deoptimizer::IsValidReturnAddress` depends on
fixed embedded builtin addresses. Pass a pointer to the isolate to
this method, so that it can discover the actual builtin code start
(which may have been remapped) and calculate the offset from the start
of the builtins' code in order to check if the return address is
allowed.

After this change, do not disable short builtin calls when CFI is
enabled.

There's an important TODO for this change:
Since the builtin code pointer that's used to check whether a return
address is allowed is now writable, we should use pointer authentication
to protect it.

Bug: v8:10026
Change-Id: Iafd31d3ad7e10cb17faf33e76e78d3df36edeefd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3667506
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/main@{#81049}
2022-06-09 17:29:15 +00:00
Hisham Muhammad
0f748aac3e [wasm][c-api] Add handle scope to fix wasm_module_validate
This adds a handle scope to Module::validate in C API
so that the wasm_module_validate can be usable from C.

Without the added handle scope, attempting to call
wasm_module_validate function from C code fails with:

    #
    # Fatal error in v8::HandleScope::CreateHandle()
    # Cannot create a handle without a HandleScope
    #

Bug: v8:12941
Change-Id: I2b4d5dccdaed9501f31447158ebf8e7906a1f8f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3692020
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81048}
2022-06-09 16:46:23 +00:00
Dominik Inführ
a537be463f [heap] Track unprotected chunks in LocalHeap
CodePageCollectionMemoryModificationScope now increases a per-thread
counter and inserts unprotected code chunks into a thread-local set
of chunks. This information is moved from Heap into LocalHeap.

We can't use kMaxWriteUnprotectCounter on the unprotect counter on the
MemoryChunk anymore, since e.g. for concurrent Sparkplug N threads might
now allocate a code object on the same page and since
CodePageCollectionMemoryModificationScope doesn't know about the
other threads anymore, each thread has to increase that counter by 1.
We DCHECK that nesting depth now in the scope's constructor instead.

We still need to remove chunks from `unprotected_memory_chunks_` when
freeing an executable MemoryChunk during GC. Fortunately we can still do
this, since all threads are in a safepoint during GC and we can remove
the chunk from each thread-local set without any synchronization.

Bug: chromium:1330887
Change-Id: Icefc61b8d8de113d8dcfb1cf64122d12dd9798c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3688516
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81047}
2022-06-09 16:35:23 +00:00