Commit Graph

78787 Commits

Author SHA1 Message Date
Manos Koukoutos
30c19f3292 [wasm] Fast path for ref.func
We do not need to go through the builtin when the function reference is
already set.
For faster checks, we ensure that
{WasmInstanceObject::wasm_internal_functions} is set at instance
object instantiation time. Therefore it does not need to be optional.

Change-Id: Ie0a6564c171c6a6e3424c3cc0eeae3c83929e616
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4005823
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84095}
2022-11-07 15:19:53 +00:00
Manos Koukoutos
ccddc6d605 [wasm] Fix interaction of catch and loops
We should invoke {LoadContextIntoSsa} just after the {IfException}
node after a call, rather than at the catch/cathcall point.
This way, we ensure that this is done before {BuildNestedLoopExits},
and we create a {LoopExitValue} node for the reloaded memory start/
size. Also, we only need to do so for Call and not Throw nodes.

Bug: chromium:1380646
Change-Id: Ibaa8fd7e39869c38c33cf62b1b6caf9238ced969
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4008578
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84094}
2022-11-07 15:03:23 +00:00
Daniel Lehmann
6d551ef34e [wasm] test disassembler for custom name section
This adds a separate test module and output expectation for names in
the custom "name" section in Wasm binaries.

Also fixes a small inconsistency: The index of both data and element
segments is now printed as a comment, in case one prints their name
(as we do for functions, globals, etc.)

Data segment names are currently not printed for consistency with
legacy behavior.

Change-Id: I8900f54b02e031a811dfd9be8326d6f63d26d4a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004717
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Daniel Lehmann <dlehmann@chromium.org>
Auto-Submit: Daniel Lehmann <dlehmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84093}
2022-11-07 14:45:23 +00:00
Leszek Swirski
c5b52e798a [maglev] Fix FunctionPrototypeCall for empty args
The builtin inlining for FunctionPrototypeCall has to consider the case
where there is no new receiver to the call. It now does this by
considering the new call args to be kNullOrUndefined instead of kAny.

Drive-by cleanup of CallArguments to always consider the register count
and not the argument count, unifying the with/without receiver
correction for the list-of-regs and RegList cases.

Bug: v8:7700
Change-Id: I7e8cb7e9d654fdfcbb8add80e7a0a01a39d36504
Fixed: chromium:1381663, chromium:1381665
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4008638
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84092}
2022-11-07 14:08:34 +00:00
Clemens Backes
75dc4a9cf4 [wasm][atomics] Fix assumption
The assumption in {DecodeAtomicOpcode} (added in
https://crrev.com/c/3990654) is only true for valid opcodes. Since
Atomic opcodes are variable-length encoded, it's possible to create
out-of-bounds atomic opcodes which violate the assumption.

This CL fixes that by checking for such out-of-bounds opcodes early in
the method. This replaces the assumption, which the compiler can now
derive from the if-statement.

R=ahaas@chromium.org

Bug: chromium:1381330
Change-Id: Ifaaceb0c8a765811fe2f934be1920bcb14675f36
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4008538
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84091}
2022-11-07 13:51:53 +00:00
Michael Achenbach
98551cf4a2 [infra] Update configs to compilator/orchestrator names
This used the production builder names in MB and test configs
after the orchestrator roll-out.

This can first land after:
https://crrev.com/c/4002978

Bug: chromium:890222
Change-Id: I7215fdb86e7ddddac5c2d3172fb112b30a373141
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4006615
Reviewed-by: Liviu Rau <liviurau@google.com>
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84090}
2022-11-07 12:56:53 +00:00
Darius M
0c9ca252b8 [turboshaft] Refactor OptimizationPhaseImpl
OptimizationPhaseImpl is now called GraphVisitor. Its ReduceXXX
methods are now called VisitXXX, to avoid name conflicts with
Assembler/Reducer methods.

Its non-template-dependent fields have been moved out to a separate
class (which will be easier to use in some contexts).

Assembler now inherits from GraphVisitor (ex OptimizationPhaseImpl),
which allows it to trigger visitation of Blocks or Operations.


Bug: v8:12783
Change-Id: I14f57621c62fc83f27fae1169be514a400396ecd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3985908
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84089}
2022-11-07 12:44:13 +00:00
Clemens Backes
bbcf8b6c3a [wasm] Fix BytecodeIterator
The {BytecodeIterator} that also read locals declarations had a weird
fallback path to allow decoding of locals to fail, and just assume no
locals, decoding all bytes as code.

This CL removes that, and modifies the test that needs this
functionality to prepend a zero byte for encoding "0 locals".

R=jkummerow@chromium.org

Change-Id: I609e2bf6986eeb6380d65b03bf8512f0b09af764
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003078
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84088}
2022-11-07 12:10:33 +00:00
Clemens Backes
9b950a4e31 [wasm] Add a few more VALIDATE uses
The decoder can only fail if validation is enabled. Wrapping the {ok()}
or {failed()} checks in the {VALIDATE} macro adds likely/unlikely
annotations and removes branches in non-validating uses.

Note that the same effect cannot be achieved by overwriting {ok()} and
{failed()} in the {WasmDecoder} class (where we have access to the
{ValidationTag}). It seems like the {V8_LIKELY} annotation gets lost
when inlining.

R=jkummerow@chromium.org

Change-Id: I4e19f95b9837797e42d244f867210af0f2c05985
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4006140
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84087}
2022-11-07 12:04:04 +00:00
Marja Hölttä
11e9aef00b [torque] Direct a detailed type assertion error message to stderr
Having the printout (including object addresses) in stdout confuses the
correctness fuzzer and makes it unable to dedupe bugs properly.

Drive-by: make %GlobalPrint handle its arguments gracefully.

Change-Id: I30cad408527b549dc15963e692a760f53174a951
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3999281
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84086}
2022-11-07 11:31:23 +00:00
Juan José Arboleda
4a51a7f23e [test] reuse logic in heap test iterators
Change-Id: I04af777de055be267c8c970781d351e091538c31
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3988972
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Auto-Submit: Juan José <soyjuanarbol@gmail.com>
Cr-Commit-Position: refs/heads/main@{#84085}
2022-11-07 11:24:43 +00:00
Daniel Lehmann
e28d3d191d [wasm] fix printing of float literals in disassembler
Previously, some float literals were printed with loss of information by
the Wasm disassembler, e.g., `1234567.5` was printed as `1234568`,
which is clearly wrong.

With this fix, the disassembler will always preserve information in its
output, i.e., it will print the correct `1234567.5`.
However, unfortunately, it will now print the binary representation of
`0.1` as `0.100000001`, since 0.1 can actually not be represented
exactly as a binary fraction.
Ideally, we would print the smallest representation of a float that,
when parsed again (e.g., by `wat2wasm`), produces the same float.
Unfortunately, there is currently no easy way to implement this.

There are several options, but they are either incorrect in other ways
or not available here:
- `DoubleToCString`: output will be even longer for decimal fractions
that cannot be represented in binary, since it will just round to the
nearest double instead.
- `printf` + `%g` format specifier: still prints `0.1` as `0.100000001`.
- `std::format`: C++20 only.
- `std::to_char`: C++17, but this particular header is not yet allowed.
- `absl::to_char`: Abseil is not available in V8.

It seems we have to choose either between losing information (such that
the output of the disassembler would not round-trip if assembled to a
binary again), or to have those ugly, long outputs.

Change-Id: Id40044a1724aeb115309688cbf05f71aa4745c6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004957
Commit-Queue: Daniel Lehmann <dlehmann@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84084}
2022-11-07 11:20:13 +00:00
Michael Lippautz
b28d72b5ef cppgc: Use default page allocator when no allocator is provided
Use the `PageAllocator` that is generated/provided via
`cppgc::InitializePlatform()`.

Bug: v8:13442
Change-Id: I7f3a83ae3fe9000b430ab085929f98646585164f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4000486
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84083}
2022-11-07 10:43:03 +00:00
Clemens Backes
20de6a70fe [wasm] Add validation for exotic streaming path
In the case that an invalid module gets compiled twice concurrently, one
thread might get a prefix cache hit but then later not find the
corresponding cache entry (because the module is invalid, so the prefix
sentinel was deleted again). It then enters the non-streaming async
compilation path at the {PrepareAndStartCompile} phase. This phase
assumes that all functions have been validated already, though. Thus add
explicit validation on that specific path.

R=ahaas@chromium.org

Bug: v8:13361
Change-Id: Iddef130ba791753a818222c2802177a6b326b204
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3999840
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84082}
2022-11-07 10:38:46 +00:00
Clemens Backes
dea8a134b1 Make .ycm_extra_conf owned by COMMON_OWNERS
No need for intra review on this file (as brought up in
https://crrev.com/c/3980257).

R=machenbach@chromium.org

No-Try: true
Change-Id: I21179ebe0e44be0079a664b8f408b31b190be398
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004744
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84081}
2022-11-07 09:51:53 +00:00
Leszek Swirski
099f438647 [test] Fix assertOptimized function name printing
In assertOptimized and assertUnoptimized, we can optionally pass in the
function name. We also used to pass in an optional 'sync' parameter, to
decide whether to wait for background compilations to finish before
checking state.

The sync parameter was removed in favour of explicit intrinsics, so fix
callers of assertOptimized to no longer try to set it. Also, use
function.name as the function name when no name was passed.

Change-Id: I8e98d4d02e2d097d059989ad78bf46b97b57bdca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4000480
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84080}
2022-11-07 09:40:03 +00:00
Fanchen Kong
f8e7c7ad7a [turbofan] Generalize optimization on CallWithArrayLike when target is Math.min/max
With this change, ReduceJSCallMathMinMaxWithArrayLike will work on both PACKED_DOUBLE_ELEMENTS and HOLEY_DOUBLE_ELEMETNS kind.

It will also work when the opcode of arguments_list is JSCreateEmptyLiteralArray to deal with following use cases.

    var array = [];
    array.push(num1); // add elements
    array.push(num2);
    console.log(Math.min.apply(Math, array));

Change-Id: I39840a17607c31baea2c6b1d33218700f723d760
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4007927
Commit-Queue: Fanchen Kong <fanchen.kong@intel.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84079}
2022-11-07 09:05:53 +00:00
v8-ci-autoroll-builder
1d28608ec0 Update V8 DEPS (trusted)
Rolling v8/third_party/fuchsia-sdk/sdk: version:10.20221103.1.1..version:10.20221106.2.1

Change-Id: Ib1adff5164a5b61dd6e1c079a9818d76eae05b2f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4006743
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@{#84078}
2022-11-07 03:51:02 +00:00
v8-ci-autoroll-builder
e915adc8d3 Update V8 DEPS (trusted)
Rolling v8/build: 6e915bd..07e7b8e

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/559a73e..a1cc425

Rolling v8/tools/clang: f1b8b5a..b65f30f

Change-Id: I356ea6969f9359c965ec6a144d1e35fc18913525
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4006742
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@{#84077}
2022-11-06 03:52:21 +00:00
Omer Katz
21bf269395 [heap] Refactor new space shrinking/growing
Restructure such that we only either shrink or grow the space, and only
at the end of the GC.

Bug: v8:12612
Change-Id: I7671e139b6023cd04f438f48401cf392d4549b8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3980253
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84076}
2022-11-05 19:54:51 +00:00
v8-ci-autoroll-builder
b87bd3077d Update V8 DEPS (trusted)
Rolling v8/build: 1119b5a..6e915bd

Rolling v8/buildtools: 404e2d0..737c572

Rolling v8/buildtools/third_party/libc++/trunk: 08ea445..0232707

Rolling v8/buildtools/third_party/libc++abi/trunk: 8dd4051..a89eb5a

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/67ccd32..559a73e

Rolling v8/third_party/depot_tools: 7738a7a..03b187d

Rolling v8/tools/clang: e95c0f2..f1b8b5a

Change-Id: I6411b3338d6745c014cfea65cb653b68a4befb53
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4006739
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@{#84075}
2022-11-05 03:53:30 +00:00
Adam Klein
76ae4f56df [cleanup] Remove Wasm exception-handling runtime flag
It's been enabled by default since Chromium M95.

Also removes duplicate setup code for WebAssembly.Tag JS API
from WasmJs::InstallConditionalFeatures, since we're guaranteed
to set it up via the non-conditional WasmJs::Install.

Bug: v8:8091
Change-Id: Ic500feb655ad4fc0703ed226504847ca6d940537
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3996810
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84074}
2022-11-04 22:50:50 +00:00
Frank Tang
8e3b455f53 [Temporal] Sync to PR2395 Address calendar case sensitivity
This cl only convert the part for calendar in PR2395.
The part to cover TimeZone change will be coded in another cl.
Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal-isbuiltincalendar

Spec change https://github.com/tc39/proposal-temporal/pull/2395

PR2395 achieved consensus at the September 2022 TC39 meeting.

Also merge unnecessary const std::string& id version of IsBuiltinCalendar to the Handle<String> version and remove the unnecessary version.

Bug: v8:11544
Change-Id: Idb711d48dbcf929059b71c48681c03b30089adb0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3901200
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84073}
2022-11-04 22:11:00 +00:00
Shu-yu Guo
cd31c5bdcc [debug] Fix locals blocklist reuse outside of closures
Bug: chromium:1363561
Change-Id: I50c1448d79cc64f7de456f20941de0add8c464c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004801
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84072}
2022-11-04 22:05:00 +00:00
Shu-yu Guo
c82f221882 [shared-struct] Throw on duplicate field names
Bug: v8:12547, chromium:1380826
Change-Id: I02d662844d4598e29b994ac0e888c496bb8935ca
Fixed: chromium:1380826
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4006375
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84071}
2022-11-04 19:58:19 +00:00
Milad Fa
3cb0bbdd13 [wasm] Disassembler: handle inf values under ImmF32Immediate
In AIX inf/-inf values are printed to stdout in capital letters
which causes a test failure after this cl: crrev.com/c/4001769

This Cl forces a lower case print to stout similar to how it is
already handled by ImmF64Immediate.

Change-Id: I7df7c2f03d000f72dd43a8ac09ae5501d76b5a06
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003040
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84070}
2022-11-04 16:06:46 +00:00
Simon Zünd
8ab1c88c01 [debug] Add 'new.target' to the materialized stack locals for evaluate
This CL adds "new.target" to the ScopeObject with the materialized
stack local variables. It's only available if the parser actually
allocates a variable for it, otherwise we currently throw a
ReferenceError.

The added test also ensures that "new.target" is only included for
debug-evaluate, but NOT for the scope view. Having ".new.target"
show up there would be more confusing than helpful.

Drive-by: Remove bogus DCHECK. The context we try to lookup
"new.target" can be anything, not just a `with` context.

R=bmeurer@chromium.org, leszeks@chromium.org

Bug: chromium:1246863
Change-Id: Id4f99b3336044904e3dc76912f65b6f63f092258
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003039
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84069}
2022-11-04 16:03:16 +00:00
Michael Lippautz
42d4209e9c Reland "[handles] Return node blocks for traced handles"
This is a reland of commit 7caf58b5fd

Fixes:
- Do not free empty blocks when sweeping is running as Oilpan
  destructors may invoke Reset() which requires a block to work.
- List remove while iterate.

Original change's description:
> [handles] Return node blocks for traced handles
>
> Return empty node blocks back to the OS. Keep one block around to
> support local allocation/deallocation patterns for up to 256 nodes.
>
> Bug: v8:13372
> Change-Id: Ib9e3a1b9a70fa4ad2b52e8479cc46e3c7316cd18
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3973270
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#84011}

Bug: v8:13372
Change-Id: I83de3335ee7678dca14397a08ae69442f7325cdb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4000483
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84068}
2022-11-04 15:47:56 +00:00
Leszek Swirski
74c690fee1 [maglev] Fix FunctionPrototypeCall receiver mode
We have to change the receiver mode to Any when adapting the call
arguments for FunctionPrototypeCall.

Bug: v8:7700
Change-Id: Idfb4773565bb6128a617e27fd96246c479342691
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003042
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84067}
2022-11-04 14:57:36 +00:00
Leszek Swirski
1370b3c97e [maglev] Pass a scratch reg to StringFromCharCode
We were moving the char_code value into a scratch register before calling StringFromCharCode, in case it aliases the result register and
is clobbered by result allocation.

However, there is also a fast direct jump into StringFromCharCode for
one-byte strings. This jump will jump over the move into the scratch
register.

Instead, pass the scratch register into StringFromCharCode explicitly,
and let it do the moving of the char_code where necessary.

Additionally, move around some debug code asserts to increase their
coverage.

Bug: v8:7700
Change-Id: I5e5800ac643cae3efef35be181d02770c14a3020
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003077
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84066}
2022-11-04 13:32:06 +00:00
Clemens Backes
ab504cf26b [wasm] Simplify DecodeSingleFunctionForTesting
Do not use the {ValidateFunctionBody} method on the Decoder, but
{wasm::ValidateFunctionBody} directly.
The {ValidateFunctionBody} method will be removed in a follow-up CL.

R=ahaas@chromium.org

Bug: v8:13447
Change-Id: Iec88a0fe01a08fe6c8482d8cbf65f04984454ba2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004868
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84065}
2022-11-04 12:35:06 +00:00
Mikhail Khokhlov
237d0cd642 [Tracing w/Perfetto SDK] Fix tracing timestamp type
We're migrating Chrome tracing to Perfetto SDK, which requires
the timestamp type to be uint64_t. This CL fixes compilation
errors when building with v8_use_perfetto = true.

Bug: chromium:1006766
Change-Id: I25e872a049bb8537c695fe7a7c0987349d543854
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003198
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/main@{#84064}
2022-11-04 11:40:26 +00:00
Frank Lemanschik
3d5e0ee107 [d8] Fix typo
Add missing "W" (orker -> Worker).

Change-Id: Ie4d8937085c2d2c6132e5d3c499ee3565c7b8b9b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004719
Auto-Submit: Frank Lemanschik <frank@dspeed.eu>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84063}
2022-11-04 11:38:46 +00:00
Nico Hartmann
8dbd587446 [turbofan] Improve boolean type hint for SLVerifier
Bug: v8:12619, chromium:1380337
Change-Id: I6395b69daec9fdd5929505e8425ceb90ab33a7c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003157
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84062}
2022-11-04 11:08:56 +00:00
Andreas Haas
c18fc60ed9 [wasm] Remove unnecessary default parameter
R=clemensb@chromium.org

Bug: v8:12926
Change-Id: I426f06ca159c109109b0390494d8f1b5e274c888
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004400
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84061}
2022-11-04 10:49:40 +00:00
Clemens Backes
ee7f2f24da [wasm] Decouple decoding and validation
We were validation while decoding the code section. There is no
performance benefit in doing so, and decoupling this allows us to
parallelize validation in a second step.

R=ahaas@chromium.org

Bug: v8:13447
Change-Id: I061946f0bfd4829685cd25783c932d0ade38c6ea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003159
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84060}
2022-11-04 10:48:36 +00:00
Victor Gomes
e82b4339aa [maglev] Do not reduce/optimize calls with break points
Bug: v8:7700
Change-Id: Ied1e81097787dc54658b14cc36e7243b5e68d7d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004179
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84059}
2022-11-04 10:43:06 +00:00
Victor Gomes
627194b8e7 [maglev] Reduce FunctionPrototypeCall
Also:
- Rename InlineBuiltin to ReduceBuiltin
- Create a list of supported builtin and have separated
TryReduce functions for each.

Bug: v8:7700
Change-Id: Ife4c730b8d4e5fe74c2c1fd80adceb828c238b78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004404
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84058}
2022-11-04 09:51:16 +00:00
Michael Lippautz
1d1010ba45 [handles] Fix TracedHandles list management
Fixes doubly-linked list management.

Drive-by: Refactor some accessors to be more readable.

Bug: v8:13372
Change-Id: Idb057ad8d719230c2b9b7495d7bcaf8ad34bc8f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004718
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84057}
2022-11-04 08:52:16 +00:00
Leszek Swirski
8ddac25e16 [maglev] Encode 'clobbered' as 'free+blocked'
Rather than encoding clobbering with a separate reglist, use the
concept of being "free and blocked" for clobbering. This makes sure that
clobbered registers are not used in later input allocations, and that
two clobbering inputs don't alias. Probably in the future we want to
process clobbering inputs first, before non-clobbering ones, to make
sure that no clobbering input can alias a non-clobbering input (even if
the non-clobbering input is an earlier one).

Also add some documentation to RegisterFrameState to explain these
different states.

Bug: v8:7700
Change-Id: I328e707539be301db50a29f606c15e7eddfe778b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003160
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84056}
2022-11-04 08:44:26 +00:00
v8-ci-autoroll-builder
0527094a05 Update V8 DEPS (trusted)
Rolling v8/build: c977012..1119b5a

Rolling v8/buildtools: 33b52ea..404e2d0

Rolling v8/buildtools/third_party/libc++/trunk: fc6bbc5..08ea445

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/3ffa6b2..67ccd32

Rolling v8/third_party/depot_tools: b52683f..7738a7a

Rolling v8/third_party/fuchsia-sdk/sdk: version:10.20221102.0.1..version:10.20221103.1.1

Rolling v8/third_party/zlib: cff7208..74a5a82

Rolling v8/tools/clang: b147cbb..e95c0f2

Rolling v8/tools/luci-go: git_revision:765f51c332c38e9b8d7981f23640b9df59371cd5..git_revision:f8f64a8c560d2bf68a3ad1137979d17cffb36d30

Rolling v8/tools/luci-go: git_revision:765f51c332c38e9b8d7981f23640b9df59371cd5..git_revision:f8f64a8c560d2bf68a3ad1137979d17cffb36d30

Change-Id: I727dafa0d459fbe62b3d924be10b546ed0403e45
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003583
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@{#84055}
2022-11-04 03:52:46 +00:00
Marja Hölttä
28545f7aea [rab/gsab] Fix toPrimitive resizing the backing store
Bug: v8:11111,chromium:1381064
Change-Id: Id4f5f56758f0ec7999fe523a0849dd26d84ecc47
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4002208
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84054}
2022-11-03 23:30:36 +00:00
Marja Hölttä
0a28d7eb3a [rab/gsab] Fix GetByteLength in a corner case
It's possible that memory stats access the byte length right after
a JSArrayBuffer object has been allocated but before it's attached to a
BackingStore.

Regression test omitted, since triggering this corner case is tedious.

Bug: v8:11111,chromium:1378318
Change-Id: Id2ad4b5a2a044dbea86eb2f9509348884e34876b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4001521
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Marja Hölttä <marja@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84053}
2022-11-03 23:18:36 +00:00
Shu-yu Guo
4ac96c3ff8 [debug] Use context isolate when creating PropertyIterator
Objects in the shared heap do not have a usable Isolate (i.e. it cannot
execute code or have HandleScopes). PropertyIterator should be using the
currently executing Isolate via the Context instead.

Bug: chromium:1379616
Change-Id: I7ac87519ef4aa901ef7b71e00f98c2cba66e725b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3997702
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84052}
2022-11-03 19:37:55 +00:00
Andreas Haas
49afdd90b2 [wasm] Do bounds check before BigInt allocation in atomic.wait
A failing memory bounds check is a debugging event. At debugging events
the value stack is observable and therefore has to match the speced
value stack. In Atomic.Wait the value stack got modified before the
bounds. With this CL memory bounds check gets moved to the beginning.

R=clemensb@chromium.org

Bug: chromium:1380498
Change-Id: I4a5fe4d49f05d5376cb717f3dc7ecca4fdcbd998
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3998816
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84051}
2022-11-03 17:32:26 +00:00
Daniel Lehmann
9e06d4dd53 [wasm] test disassembler for Wasm MVP features
Tests the disassembler output for all instructions and section types
from Wasm MVP (extensions such as reference types, SIMD, name section,
etc. will come in separate CL(s) and module(s), since they contain a
lot of additional instructions).

Also fixes a small issue in `MultiLineStringBuilder` found by ASAN.

The test checks the output of the disassembler against the text input
given to `wat2wasm` which generates the module given to the
disassembler.
The module in this test includes all non-extension instructions from
https://webassembly.github.io/spec/core/appendix/index-instructions.html
and module sections from
https://webassembly.github.io/spec/core/text/modules.html
at least once (and sometimes multiple times in case there are
variants).

Change-Id: Iaa8791cfc51431fb436f42b98604e83cd9258d06
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4001769
Auto-Submit: Daniel Lehmann <dlehmann@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84050}
2022-11-03 17:11:46 +00:00
Victor Gomes
7ab1dc6a9a [maglev] Unify BuildCall
... using a CallArguments class that abstract receiver and
interpreter register logic.

Bug: v8:7700
Change-Id: I06e3fed2700c0e1bde5e0802889e9c05ebc55257
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003217
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84049}
2022-11-03 16:57:55 +00:00
Victor Gomes
10483f7a40 [maglev] Add assert code in LoadSingleCharacterString
Bug: v8:7700
Change-Id: I1a0bf7229137930b5ecaaba9d1cae4f814af3625
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4003158
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84048}
2022-11-03 16:48:15 +00:00
Shu-yu Guo
0dcbdfa016 [shared-struct] Fix for-in enumeration
for-in enumeration creates an EnumCache, which is currently incorrectly
allocated in the per-thread heap. This CL preallocates the enum cache at
SharedStructType-creation time.

Also drive-by fixes typos in the enum cache code.

Bug: v8:12547, chromium:1379616
Change-Id: I1930f88844eca5ccfeebd8dfdcce4ad0bd80ee38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3997701
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84047}
2022-11-03 16:38:15 +00:00
Leszek Swirski
9838067e85 [maglev] Fix --trace-maglev-regalloc unparking
Make sure to try to unpark when printing nodes, so that
--trace-maglev-regalloc can print nodes with object parameters.

Bug: v8:7700
Change-Id: I7db87f824bef7825b37b489e6ede2e8cea717e5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4002689
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84046}
2022-11-03 15:56:25 +00:00