88886 Commits
Author SHA1 Message Date
NotAlexNoyle 7aceeee3ad Update canonical Gitea links 2026-11-03 10:46:44 -05:00
NotAlexNoyle 0a4af991ef Clear the field 2024-06-12 10:55:38 -04:00
Matthias Liedtke 291f350165 [deoptimizer][wasm] Add minimal test case
It doesn't test anything new, just as a minimal test case to debug if
all wasm deopts tests fail.

This might also be helpful for anybody (including me) having to port
the deoptimization entry to other platforms than the already
implemented x64 builtin.

Bug: 42204618
Change-Id: I97f1da3e6723c107579211921f9473a22c0cf3e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5623151
Reviewed-by: Daniel Lehmann <dlehmann@chromium.org>
Commit-Queue: Daniel Lehmann <dlehmann@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94392}
2024-06-12 11:13:54 +00:00
Hao Xu 45f0512cc2 [maglev] Avoid duplicated sign extension in LoadTaggedFieldByFieldIndex
Change-Id: Id9ede5a54edcdbadf4ec3a4989a37158bd954d88
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5625369
Commit-Queue: Hao A Xu <hao.a.xu@intel.com>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94391}
2024-06-12 10:23:02 +00:00
Igor Sheludko 46d7ec6f7d [api] Fix typo in v8::FunctionCallbackInfo<T>::Data()
Somehow Clang is able to compile the call to GetFunctionTemplateData()
even though it was defined in "api_internal" namespace (the change
was made here: https://crrev.com/c/5587862).
This CL adds a missing namespace prefix.

Bug: 326505377
Change-Id: If880e576a65a1e125b71ebdb2176976a3f37b85f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5623375
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94390}
2024-06-12 09:50:01 +00:00
Michael Lippautz e578e5adda Reland "Retrieve native context from known fields"
This is a reland of commit be4d52e12f

Original change's description:
> Retrieve native context from known fields
>
> When using `typeof %LeakHole()` in testing code we would try to
> generate a stack trace via `Runtime_Abort()` without setting the
> native context on the Isolate. However, all the places that need the
> native context have it already available in some form. Fix these
> callsites.
>
> Bug: 345970375
> Change-Id: Idab1ba5416cb8e931056cb3f7aded1c526096e91
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5617530
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#94370}

Bug: 345970375
Change-Id: I3d2b50f70307dadedda54a1fdfd0dada0b793250
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5623373
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94389}
2024-06-12 09:10:36 +00:00
Marja Hölttä 196b18a7bc [maglev] Follow up to jump threading: fix exception handlers
Don't try to replace exception handlers with other blocks.

Bug: v8:7700, 346617164
Change-Id: I82177c793ed6c9ce981a2755164beae9fb2df35f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621355
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94388}
2024-06-12 08:50:10 +00:00
Dominik Inführ c027bc3d2b [heap] Remove AlwaysAllocateScopes for GCs
GCs do not need to set up an AlwaysAllocateScope anymore to ignore
current allocation limits.
Heap::ShouldExpandOldGenerationOnSlowAllocation already always
allows GC allocations.

Bug: chromium:1480975
Change-Id: I49dc580ab8257f468c7af8ca337819e7d46a8315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5611831
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94387}
2024-06-12 08:24:26 +00:00
Jakob Kummerow a6f1ecd6ff [wasm][sandbox] Check signature of inlining candidate
A corrupted sandbox might confuse the type feedback processor
into inlining the wrong function, so the inlining mechanism
should check to make sure the inlining candidate's signature
is compatible with the call.

Bug: 336507783
Change-Id: I5fb99b7894f060a2bcc754349175e2570b5a6045
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621153
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94386}
2024-06-12 08:05:55 +00:00
Adam Klein 0ba42aeb3a Revert "Retrieve native context from known fields"
This reverts commit be4d52e12f.

Reason for revert: breaks Blink web_tests, blocking roll:
https://crrev.com/c/5622693
https://ci.chromium.org/ui/p/chromium/builders/try/mac-rel/1819303/overview

Original change's description:
> Retrieve native context from known fields
>
> When using `typeof %LeakHole()` in testing code we would try to
> generate a stack trace via `Runtime_Abort()` without setting the
> native context on the Isolate. However, all the places that need the
> native context have it already available in some form. Fix these
> callsites.
>
> Bug: 345970375
> Change-Id: Idab1ba5416cb8e931056cb3f7aded1c526096e91
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5617530
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#94370}

Bug: 345970375
Change-Id: I1dcfe4a6d8dc6af18b15638672a57e412740b88e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621594
Auto-Submit: Adam Klein <adamk@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@{#94385}
2024-06-11 20:32:12 +00:00
Adam Klein 03dbdef1b3 [parser] Remove AST/Parser support for JS Runtime calls
JS runtime calls are a vestige of the days when V8 had part
of its runtime implemented in JavaScript. This cleanup CL
removes parser/AST support JS runtime calls and removes the
special-casing for those slots in native contexts.

There are still two uses of CallJSRuntime in the interpreter, but
they hardcode their context indices. This CL updates the unittests
to hardcode the same indices for printing bytecode expectations.

Change-Id: I05756bf6575bcb93b0e9a89407a7239fb0f5b30d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5590413
Commit-Queue: Adam Klein <adamk@chromium.org>
Auto-Submit: Adam Klein <adamk@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94384}
2024-06-11 18:05:36 +00:00
Marja Hölttä c1067a57c9 [maglev] Implement jump threading
If a block we'd be jumping to is uninteresting (empty + just an
unconditional jump to some other block + no phis or register
merges + ...), we replace the jump with a jump to its successor.

Bug: v8:7700

Change-Id: Idfcfd9c3f68f3219ca308683861d4fb984e69246
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5606424
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94383}
2024-06-11 17:52:24 +00:00
Jakob Kummerow e25efe6cf2 [wasm][sandbox] Verify signatures in js-to-wasm wrappers
This ports the recently introduced signature verification from
call_ref to compiled (i.e. non-generic) js-to-wasm wrappers, to
prevent escaping from a corrupted sandbox by calling broken Wasm
functions from JS.

Bug: 336507783
Change-Id: I2946424b39ca345ab6f6d31ad8308327cd5be1e5
Fixed: 336009921
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5622490
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94382}
2024-06-11 17:35:02 +00:00
v8-ci-autoroll-builder 7797d5e8ae Update V8 DEPS (trusted)
Rolling build: https://chromium.googlesource.com/chromium/src/build/+log/6358ecc..0eb0935

Rolling buildtools/win: git_revision:b3a0bff47dd81073bfe67a402971bad92e4f2423..git_revision:b2afae122eeb6ce09c52d63f67dc53fc517dbdc8

Rolling third_party/zlib: https://chromium.googlesource.com/chromium/src/third_party/zlib/+log/209717d..887bb57

Roll created at https://cr-buildbucket.appspot.com/build/8745412633367940641

Change-Id: I5208b8613df8b22b7ae4019d4da5a5f3d9685fc8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5622118
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@{#94381}
2024-06-11 17:27:17 +00:00
Thibaud Michaud 7aea96892a [wasm] Do not generate import-specific export wrappers
The signature-specific export wrappers load the target and ref from the
import dispatch table or from the function data depending on whether the
target is a re-exported import or an internal function. But the target
and ref from the function data is more generic and also works for
re-exported imports.

In fact wrapper tier-up may accidentally replace an export wrapper
compiled for an import with an export wrapper compiled for an internal
function, but we did not notice it because the latter still works.

However the other way around does not work. The wrapper compiled for a
re-exported import uses the dispatch table, which breaks if the target
is not an import. This happens if we try to enable the generic wrapper
for re-exported imports.

Remove the import-specific path entirely since the other one is more
generic, which allows us to use the generic wrapper for re-exported
imports and will reduce the number of wrappers that we need to compile.

R=jkummerow@chromium.org

Bug: 343772336
Change-Id: I54446f38971167a5128521027939707ac20d1a86
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5604484
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94380}
2024-06-11 16:35:28 +00:00
Leszek Swirski e1a61acd40 [api] Pass WriteOptions to Utf8Value cstr
... and make it replace REPLACE_INVALID_UTF8 by default, so that
Utf8Value holds, by default, a valid utf8 value.

Bug: 339141099
Change-Id: Icae9f33d389ee64abed4ac8536620e3b4f8ddfd1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621893
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94379}
2024-06-11 16:06:31 +00:00
Nikolaos Papaspyrou 47cfd36173 [handles] Migration to direct handles, part 4
This CL migrates a large number of handles to direct handles. The
changes are only relevant for builds with v8_enable_direct_handle=true.

Affected directories: test.

Bug: 42203211
Change-Id: Ie9fb3d5b3c66ea9ffa0092d928256aa3891c9a9a
Cq-Include-Trybots: luci.v8.try:v8_linux64_css_dbg
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5622011
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94378}
2024-06-11 15:56:42 +00:00
Michael Lippautz efa2db35b9 [api] Configure embedder fields of ABs and AB views via gn
Allow configuring the number of embedder fields ArrayBuffer and
ArrayBufferView objects have. Blink doesn't need these extra fields
anymore and we can save some space and speed up GC processing. Retain
ability for embedders to use the fields though via gn arg.

Bug: 346350847
Change-Id: I48e56de316ae932a43012c0736fd36ea6e9c80ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621990
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94377}
2024-06-11 15:55:15 +00:00
Thibaud Michaud d7b8e6d2c4 [wasm] Pass missing module for wasm-to-js tierup of a WasmFuncRef
This tier-up path assumed that we don't have an instance. However this
is only true when the WasmFuncRef was created for a WebAssembly.Function
object.

For call refs to an internal wasm function, we do have an instance, and
the signature may contain indexed ref types, which requires that we pass
the module to the wrapper graph builder.

This will also allow some simplifications when we enable the generic
wrapper for re-exported imports again.

R=ahaas@chromium.org

Bug: 343917751
Change-Id: I23d69f0db98edd43494bcd08763b4bef9c7f0e0c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621892
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94376}
2024-06-11 15:17:59 +00:00
Olivier Flückiger 9453211e40 [maglev] Fix node type dcheck
The node type can be more generic than the static type of a smi in case
we had to convert it to a number.

Fixde: 346411878
Change-Id: I1a07cc7d68773e78c93a0504720b6ca660780c68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621894
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94375}
2024-06-11 15:14:56 +00:00
Dominik Inführ 358e33c644 [api] Use "don't query" mode by default in EmbedderRootsHandler
This is the mode we use in Chromium. The other mode will soon be
deprecated and eventually removed.

Bug: 340098917
Change-Id: I29582d27ed4aad7fd723ade353e4f049e0bbb338
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621890
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94374}
2024-06-11 14:24:08 +00:00
Leszek Swirski ed013264d9 [tagged] Introduce a Union type
Add a variadic templated C++ union type similar to torque's unions,
which encapsulates a value that is one of a limited set of V8 types.
Tagged pointers to a Union type can be cast (casted?) to one of the
types in the Union in order to access that value, or indeed to a
sub-Union if necessary.

Unions are connected to their types using the `is_subtype` type_trait,
which is substantially expanded to keep working (in trivial cases)
when its types are only forward declared. The sub-type relation for
a Union and another type defines a partial order, as one would expect,
where:

  1. Union<T...> is a subtype of U if all T are subtypes of U
  2. U is a subtype of Union<T...> if for any T, U is a subtype of T

This type is used, initially, as follows:

  1. Torque union types now generate a Union<...> instead of deferring
     to the parent class
  2. C++ defines typedefs for Number, Numeric, JSPrimitive, JSAny, and
     JSCallable. Notably, Object is not (yet?) a Union of Smi and
     HeapObject, as we need to decide what to do with the static
     methods on the Object class.
  3. Union<...> subsumes the UnionT<T,U> types in TNodes and
     Turboshaft.

The bulk of the changes in this patch are propagations of types
necessary to satisfy newly strict requirements of torque-generated
functions (in particular, setters). There is also a partial progress on
making Object::NumberValue take a Number rather than an Object, as a
proof-of-concept for Number.

Change-Id: I87868f65eba43a3b5cbda6c0bf5e16e62a8225c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5600543
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94373}
2024-06-11 14:09:50 +00:00
Andreas Haas 77723b5bdb [msan] Fix msan false-positive in the simulator
Bug: 344654370
Change-Id: I0d4cbc7c873ede056d0835b04a008af45c27ddab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5622010
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94372}
2024-06-11 14:02:36 +00:00
Zhao Jiazhong 8b4dc9f062 [loong64][mips64] Drop unnecessary MacroAssembler::kCountIncludesReceiver
Port commit 492a1d8e2a

Change-Id: Ie34ec734bb921e8c6f7bc5252fe1f47475d80b2c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5606549
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#94371}
2024-06-11 12:42:52 +00:00
Michael Lippautz be4d52e12f Retrieve native context from known fields
When using `typeof %LeakHole()` in testing code we would try to
generate a stack trace via `Runtime_Abort()` without setting the
native context on the Isolate. However, all the places that need the
native context have it already available in some form. Fix these
callsites.

Bug: 345970375
Change-Id: Idab1ba5416cb8e931056cb3f7aded1c526096e91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5617530
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94370}
2024-06-11 12:41:49 +00:00
Darius Mercadier 7cb0b5b8e9 [turboshaft] Maglev-to-ts: fix race with SharedFunctionInfo
flags2 can be set by the mainthread during a deopt request, while the
background thread tries to read it for the
function_context_independent_compiled bit.

This usually cannot happen because both Maglev and Turbofan read this
field on the main thread. However, in the Maglev->Turboshaft
translation, this is read in the background.

This CL fixes this by avoiding re-reading this field and instead using
the already computed specialize_to_function_context field of the
Turbofan OptimizedCompilationInfo.

Fixed: chromium:346358298
Change-Id: I13d80c30430e7953280a14b3a164879f92e919fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621030
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Auto-Submit: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94369}
2024-06-11 12:34:19 +00:00
Jakob Kummerow 2b431212d6 [wasm] Increase maximum number of canonicalized types
By no longer encoding canonicalized types in {ValueType}s,
we can support more of them.

Change-Id: I0bdb0a3319e422dad76d7a0bbd03001d25346690
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615591
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94368}
2024-06-11 11:49:18 +00:00
Igor Sheludko 718d9b613a [api] Remove deprecated v8::Object[Template]::SetAccessor(..)
... and a notion of "special data property" which used to represent
JavaScript spec compliant native data properties. Now all data
properties in V8 are spec-compliant.

Drive-by:
 - remove deprecated typedefs v8::AccessorGetterCallback and
   v8::AccessorSetterCallback,
 - start deprecation of v8::AccessControl enum.

Bug: 336325111
Change-Id: Ie31ac57b40a4fdd5277aaa6e0283a68fb4a0daac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5607994
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94367}
2024-06-11 11:22:50 +00:00
Victor Gomes fe1e217032 Reland "[maglev] Fix VirtualObject refactoring"
This is a reland of commit 86bc438834

Fix: we don't have a map for the rest parameter, so we only
allow to forward the arguments object if the map is a JSArray
and elements array is ArgumentsElements.

Original change's description:
> [maglev] Fix VirtualObject refactoring
>
> - VirtualObject::slot_count does not include the Map. We need to add +1
> when the map count should be included.
>
> - We forgot to patch the nested allocations back to the object
> graph.
>
> Fixed: 346042378
> Change-Id: I54e06a82a9324a55902b720e8188b6b8ec2c22bd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5614730
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#94341}

Change-Id: Iaf6cd204c73ae6bd0b495af5196d1232b7d72ef9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5621050
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94366}
2024-06-11 11:19:32 +00:00
Toon Verwaest 935280ab43 [parser] Allocate function ids for arrow functions and their params
This ensures that functions always precede their inner functions in the SFI table.

Change-Id: I1910281d2f89fbf00f3c7b951edd58c2c81e36a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615412
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94365}
2024-06-11 11:18:21 +00:00
Olivier Flückiger a9b5cdf4ac [maglev] Fix to allow more than one loop to be peeled
After loop peeling we accidentally never reset allow_loop_peeling_.

+1.4% on maglev only crypto

Bug: v8:7700
Change-Id: I6efdcda8f6480f72d292babfedd040042651a44f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5604546
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94364}
2024-06-11 10:44:02 +00:00
Nikolaos Papaspyrou 82f85a3919 [handles] Migration to direct handles, part 3
This CL migrates a large number of handles to direct handles. The
changes are only relevant for builds with v8_enable_direct_handle=true.

Affected source directories: ast, baseline, codegen, compiler, d8,
diagnostics, extensions, ic, init, interpreter, logging, maglev,
parsing, profiler.

Bug: 42203211
Change-Id: I3ca12892acfe45f8458d19aa4cbd56ad01842c0a
Cq-Include-Trybots: luci.v8.try:v8_linux64_css_dbg
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615411
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94363}
2024-06-11 10:11:58 +00:00
Olivier Flückiger 3c095e99f8 [map] Fix MapUpdater to pick the correct field type
Due to a typo we would not pick the correct generalized FieldType in
UpdateField. Only when following side-step transitions it can happen
that a more generalized field type is needed.

Fixed: 346411877
Change-Id: I35d1073a253a1917a09aea0c3e62dc6e46036168
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5620971
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94362}
2024-06-11 10:09:57 +00:00
Igor Sheludko 03202a5fe0 [builtins] Optimize and simplify CallApiCallbackXXX builtins
Simplification:
 - a tighter intergration with the ApiCallbackExitFrame's layout,
   where the v8::FunctionCallbackInfo<T> object and its fields have
   dedicated locations addressable via fp,
 - unification of the Generic and Optimized versions of the builtin,
 - don't store the number of bytes to drop on the stack, use
   FunctionCallbackInfo::length_ instead,
 - cleaner code,
 - it's no longer necessary to attach a frame state when inlining an
   Api call into optimized code in order to support
   --experimental-stack-trace-frames.

Optimization:
 - avoid passing argc and v8::FunctionTemplateInfo twice to the Generic
   version,
 - less code for both generic and optimized versions.

Bug: 326505377
Change-Id: I426459f2784e42c0b1bfcb39259fd04e3512feea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5587866
Reviewed-by: Patrick Thier <pthier@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94361}
2024-06-11 10:07:21 +00:00
Dominik Inführ 0c7ef0e42c [heap] Allow trusted-to-shared trusted pointers
This CL supports trusted-to-shared-trusted pointers by adding a
write barrier for such stores. The GC tracks such references in the
TRUSTED_TO_SHARED_TRUSTED remembered set.

Shared GCs will iterate those remembered sets for all client
isolates. This is not necessary for the main isolate because here we
anyways mark the whole heap. However, the main isolate still records
those slots in the same remembered set and the heap verifier also
checks that the slots are properly recorded. This should increase
test coverage for the write barrier.

In addition this CL also enables sweeping for the trusted space. So
far pages in the trusted space were never swept by accident.

Bug: 338342768
Change-Id: I1722e52a10806408b85f6eb12f92e1b668e1dfff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5599196
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94360}
2024-06-11 09:45:59 +00:00
Andreas Haas c736affc77 [bazel] Replace hard reference with placeholder
R=victorgomes@chromium.org

Bug: 336711943
Change-Id: I081147fe80bb2d8be8afe996c78dc805e4afd4c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5620290
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94359}
2024-06-11 07:54:08 +00:00
Lu Yahan 442192e304 [riscv] Fix Zbb simulator and disassembler error
Change-Id: I3d88f8c307e0acb87be773ca60233dec35dea67a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5619020
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#94358}
2024-06-11 07:41:37 +00:00
Dominik Inführ b689f838ba [heap] Fix --gc-interval command line flag
This CL fixes the --gc-interval command line flag which was
supposed to trigger GCs more frequently. Since this was not really
happening, we might now trigger GCs in more locations and thus
might flush out some pre-existing issues.

In the linked bug --gc-interval was not triggering GCs because
AllocateRawWith() was invoking AllocateRaw() twice without performing
a GC in-between. Assuming allocation_timeout_ was 1 before the first
call to AllocateRaw(), the first call to AllocateRaw() decreased the
counter to 0. AllocateRawWith() then invokes AllocateRaw() again at
the beginning of AllocateRawWithLightRetrySlowPath(). In the second
call allocation_timeout_ is then 0, AllocateRaw() therefore assumes
the allocation timeout is disabled and the second allocation
subsequently succeeds.

This CL fixes this by turning allocation_timeout_ into
base::Optional<int>. With this change both invocations of
AllocateRaw() observe the allocation timeout as enabled and both
invocations let the allocation fail because of this.

Bug: 346197733
Change-Id: Ic5987a9fb83320a145b04271e5631e50410c3572
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5613990
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94357}
2024-06-11 07:36:09 +00:00
Andreas Haas adcee10b9d [fastapi] Move deprecated APIs from V8_DEPRECATE_SOON to V8_DEPRECATED
Bug: 41492790
Change-Id: I1a46d50b83977d29794bcf34f3b6c136ae8a2dc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5614371
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94356}
2024-06-11 07:22:31 +00:00
Matthias Liedtke 846febf19a [compiler][wasm] Fix --trace-turbo for wasm wrapper compilation
The wrappers seem to use the flag IsWasmBuiltin(), IsWasm() returns
false.

Fixed: 345393147
Change-Id: Id8c08ee2e826dc50c0e50465bbe4d8154ede7f75
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615491
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94355}
2024-06-11 07:09:55 +00:00
Lu Yahan 526c962953 [riscv] Fix store kHolderV2Index
Change-Id: I794447b144a3ec67e64247bcc80dde329ec0ea42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5619033
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#94354}
2024-06-11 07:01:03 +00:00
v8-ci-autoroll-builder 470b998266 Update ICU (trusted)
Rolling third_party/icu: https://chromium.googlesource.com/chromium/deps/icu/+log/98f2494..43953f5

Fix a crash in locid.cpp. (David Yeung)
https://chromium.googlesource.com/chromium/deps/icu/+/43953f5

Roll created at https://cr-buildbucket.appspot.com/build/8745456048320963249

Change-Id: I20b1d8ed887a5a73365e2f5a79f3c5c1083993f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5618196
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@{#94353}
2024-06-11 05:02:42 +00:00
v8-ci-autoroll-builder 6a7432bc04 Update V8 DEPS (trusted)
Rolling build: https://chromium.googlesource.com/chromium/src/build/+log/3ec0079..6358ecc

Rolling third_party/catapult: https://chromium.googlesource.com/catapult/+log/0a2c28e..c63cfff

Rolling third_party/depot_tools: https://chromium.googlesource.com/chromium/tools/depot_tools/+log/954a8d7..e30d8fa

Rolling third_party/libunwind/src: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind/+log/ab43b1d..c8f1d81

Rolling third_party/re2/src: https://chromium.googlesource.com/external/github.com/google/re2/+log/e29afa1..33eba10

Rolling tools/clang: https://chromium.googlesource.com/chromium/src/tools/clang/+log/989902b..686f88c

Roll created at https://cr-buildbucket.appspot.com/build/8745457935344290961

Change-Id: I68f5be3302148eadb1ed46f687f8d6225911d1cd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5618195
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@{#94352}
2024-06-11 04:38:12 +00:00
JialuZhang-intel de18d5d292 Reland "[maglev] Avoid call to ObjectPrototypeHasOwnProperty builtin
if possible."

This is a reland of commit aabb0de7fe

Original change's description:
> [maglev] Avoid call to ObjectPrototypeHasOwnProperty builtin if
> possible.
>
> If the input "key" of the "object.prototype.hasownproperty" JSCall
> comes from enum cache and the receiver is a heap constant, then we
> can replace the ObjectPrototypeHasOwnProperty builtin call with some
> compare and jump instructions.
>
> This CL can bring ~50% improvement on this micro case below:
> (just run maglev code with "--no-turbofan" flag)
> -----------------------------------
> const RESERVED_PROPS = {
>     key: true,
>     ref: true,
>     __self: true,
>     __source: true,
> };
>
> function foo(config) {
>     let i = 0;
>     let propName;
>     const props = {};
>     for (propName in config) {
>         if (!RESERVED_PROPS.hasOwnProperty(propName)) {
>             i = i + 1;
>         }
>     }
>     return i;
> }
> -----------------------------------

Change-Id: I49329a1955c593e440da995ae17fe287b483e739
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5602113
Commit-Queue: Jialu Zhang <jialu.zhang@intel.com>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94351}
2024-06-11 04:01:35 +00:00
Lu Yahan 9a3b526ea4 [riscv] Port Turboshaft InstructionSelector part5
Fix Switch Central Stack error

Change-Id: Id60c33273dfd65219c4e7f3c8fe4eb766264c47d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5574671
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#94350}
2024-06-11 01:43:56 +00:00
Levi Zim a3cc8522a4 [riscv] avoid cpu probing in li_ptr
CPU probing is an expensive thing to do and we should avoid doing it upon every li_ptr call.

Fixes performance regresion bisected in https://github.com/riscv-forks/electron/issues/1

Change-Id: Ib5ff89b2a730e08de6735123ae60adeffe811ed8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5612950
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94349}
2024-06-11 01:10:31 +00:00
Adam Klein 3c208b559d Revert "[maglev] Fix VirtualObject refactoring"
This reverts commit 86bc438834.

Reason for revert: DCHECK failures blocking the roll:
https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1844915/overview

Original change's description:
> [maglev] Fix VirtualObject refactoring
>
> - VirtualObject::slot_count does not include the Map. We need to add +1
> when the map count should be included.
>
> - We forgot to patch the nested allocations back to the object
> graph.
>
> Fixed: 346042378
> Change-Id: I54e06a82a9324a55902b720e8188b6b8ec2c22bd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5614730
> Commit-Queue: Victor Gomes <victorgomes@chromium.org>
> Auto-Submit: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#94341}

Change-Id: Ib2aa97735cc79e9462296deef6f3f1eeade71d6c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5617613
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94348}
2024-06-10 21:56:23 +00:00
Liviu Rau cf789633c1 Whitespace to test a recipe change
Change-Id: Ife01e2956196ca81fcd25f6b97241d91e9f61999
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615490
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#94347}
2024-06-10 19:08:21 +00:00
Adam Klein 36317d9596 Revert "Update V8 DEPS (trusted)"
This reverts commit e58b70c52a.

Reason for revert: breaks mac builds; upstream build change already reverted (see https://crbug.com/346174900)

Original change's description:
> Update V8 DEPS (trusted)
>
> Rolling build: https://chromium.googlesource.com/chromium/src/build/+log/3ec0079..d587a4e
>
> Roll created at https://cr-buildbucket.appspot.com/build/8745503229097120769
>
> Change-Id: I97d8368242da30ae845027d8ccd1856c2acf553a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615910
> 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@{#94345}

Change-Id: I133c9490cbdd732499d2c75e60ebabcc17a68073
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5616190
Auto-Submit: Adam Klein <adamk@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@{#94346}
2024-06-10 16:40:10 +00:00
v8-ci-autoroll-builder e58b70c52a Update V8 DEPS (trusted)
Rolling build: https://chromium.googlesource.com/chromium/src/build/+log/3ec0079..d587a4e

Roll created at https://cr-buildbucket.appspot.com/build/8745503229097120769

Change-Id: I97d8368242da30ae845027d8ccd1856c2acf553a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5615910
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@{#94345}
2024-06-10 16:31:18 +00:00