Commit Graph

74425 Commits

Author SHA1 Message Date
Michael Lippautz
ec09a8236c heap: Convert embedder tracing tests to unittests
test-embedder-tracing.cc -> embedder-tracing-unittest.cc

In addition
- Add heap helpers
- CHECK -> EXPECT macros

Bug: v8:12781
Change-Id: Ibd17a4e6d527c963170af54c57f6abc51cb08808
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576127
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79883}
2022-04-08 12:43:55 +00:00
Manos Koukoutos
5fbea96a92 [wasm-gc] Reserve space before decoding types
We need this because read_heap_type uses the type vector capacity as
out-of-bounds limit.

Bug: chromium:1314496, v8:7748
Change-Id: Id76c8a143c32b20b24356f361d554cb212576c09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578654
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79882}
2022-04-08 12:38:37 +00:00
Leszek Swirski
b46a3acc9a [maglev] Add basic implementations of more bytecodes
Simple implementations of:

    * Load[Immutable]CurrentContextSlot
    * Arithmetic with Smi immediate (AddSmi etc.)
    * TestEqual[Strict]

Bug: v8:7700
Change-Id: I895b60631b6a99296709bdf24709b7325a0e76e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578854
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79881}
2022-04-08 12:35:58 +00:00
Leszek Swirski
c2cfcfcfa2 [maglev] Add a reason for unsupported codegen
Bug: v8:7700
Change-Id: I4d8f6496e796de30894c5b8229610a49ddee8bb5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579142
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79880}
2022-04-08 12:34:55 +00:00
Leszek Swirski
363bc5c5b0 [maglev] Mark SFIs when failing maglev compilation
Prevent thrashing tier up attempts when maglev fails to compile.

Bug: v8:7700
Change-Id: I31f6bd331d1c5aefa0384fcdcb055203b9055f8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579143
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79879}
2022-04-08 12:14:55 +00:00
Lu Yahan
73d76e015c [riscv64][wasm] Count direct calls
Port 9ca0bfef37

Original Commit Message:

    This adds feedback collection to count the number of executions of
    call_direct instructions in Liftoff code. The purpose is better
    inlining decisions in Turbofan, which are enabled by having call
    count information for all kinds of calls.
    The new feature is gated on --wasm-speculative-inlining. While
    direct calls don't need to speculate about their target, the whole
    feedback collection infrastructure depends on that flag.

Change-Id: I91e34d765e5a08c382d678acdb0fca57d5d3fb7e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578235
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#79878}
2022-04-08 12:07:48 +00:00
Clemens Backes
f096405a0e [base] Remove ITERATE_PACK
Replace by a unary right fold using the comma operator. This also
evaluates from left to right, so has the same semantics but uses
standard C++17 syntax.

R=tebbi@chromium.org

Bug: v8:12425
Change-Id: I680800ba07b048ee85d9da4ae32c12825df14e54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576131
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79877}
2022-04-08 12:06:45 +00:00
Leszek Swirski
1deba1a29b [maglev] Allow LoadNamedGeneric to collect feedback
Use the LoadIC builtin instead of LoadICNoFeedback.

Bug: v8:7700
Change-Id: Ia7833d7f0a7165dbbf1bbdbae55f44ce213c65ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579104
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79876}
2022-04-08 11:59:15 +00:00
Leszek Swirski
7b3ef3bcba [maglev] Drop non-empty block DCHECK
It might be wrong for bytecode blocks that only juggle registers.

Bug: v8:7700
Change-Id: Idf495112d278e1899a1bbd1f92128fcc2edf6074
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579103
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79875}
2022-04-08 11:51:55 +00:00
Dominik Inführ
55f6a97366 [heap] Cleanup OLD_TO_SHARED slots in sweeper
Sweeper needs to clean up slots in the OLD_TO_SHARED remembered set
as well in the future. Unlike OLD_TO_NEW or OLD_TO_OLD this remembered
set will not be reset after a full GC. So we will have to remove from it
both during and after a full GC when sweeping.

However in the current implementation we still reset this remembered set
in a shared GC. This only works because we scan all client heaps
during a shared GC anyways to rebuild the remembered set. We will get
rid of that when all required write barriers are implemented.

Bug: v8:11708
Change-Id: Ib891a882fdf70671a483c8662408cf64e72134c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574546
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79874}
2022-04-08 11:50:15 +00:00
Leszek Swirski
e0b8ce19f3 [maglev] Allow the optimizer with --maglev --no-opt
This will need re-work but it allows us to test for now.

Bug: v8:7700
Change-Id: I4eabb7f9f8e8a4c0d23c6bab22c7f0127c7820dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579102
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79873}
2022-04-08 11:48:26 +00:00
Benedikt Meurer
088de5d391 [inspector] Speed up inspection of large BigInts.
For large BigInts, computing the decimal representation can take a
very long time, so send them as hexadecimal strings instead. Also
make sure to abbreviate the RemoteObject description for bigints
appropriately always.

Also-By: jarin@chromium.org
Fixed: chromium:1068663
Change-Id: I2f7e4e1cbd2f66ce45be307fb787e101d9a8e2a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578653
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79872}
2022-04-08 09:30:55 +00:00
Camillo Bruni
989c664158 [d8] Migrate AsyncHooksWrap to i::Managed
Bug: chromium:1297451
Change-Id: I3c33eea5ef457f1c82c6a7681fb64c9a10572dee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576128
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79871}
2022-04-08 09:01:58 +00:00
Manos Koukoutos
b09d550605 [wasm-gc] Enable runtime subtyping checks for functions
Bug: v8:7748
Change-Id: Ic65c09726994fddf73979b5f25b98f7ce4c5d6ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574556
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79870}
2022-04-08 08:19:16 +00:00
Marja Hölttä
022657040b [rab/gsab] Clean up the remaining uses of HasTypedArrayElements
Bug: v8:11111
Change-Id: I94f992f78a12a86c89924261bd64c73f935051b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576118
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79869}
2022-04-08 07:59:16 +00:00
Marja Hölttä
e921842f3b [rab/gsab] Add more checks to elements.cc
Bug: v8:11111
Change-Id: I0c2c8c28f96723b3d586f1469ed4fdd0468c5c3e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576120
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79868}
2022-04-08 07:36:55 +00:00
v8-ci-autoroll-builder
e8bd32ccf9 Update google_benchmark
Rolling v8/third_party/google_benchmark/src: 60b16f1..74ae567

Small optimization to counter map management (#1382) (Dominic Hamon)
https://chromium.googlesource.com/external/github.com/google/benchmark/+/74ae567

getting sysinfo in line with Google style (#1381) (Dominic Hamon)
https://chromium.googlesource.com/external/github.com/google/benchmark/+/3eac3b6

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

Change-Id: Ib4510c2c1d98faf9d8f7a4684b93768d1ecc34e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3577235
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@{#79867}
2022-04-08 05:45:55 +00:00
Milad Fa
35c763dc1e PPC[liftoff]: Don't cast Double to FP after copysign
Executing a frsp after copysign changes any SNaN inputs
to QNaN which causes test failures.

Change-Id: Ieab5d24fd09344e0a3108565f478fda3b5889556
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576793
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79866}
2022-04-08 02:58:32 +00:00
Manos Koukoutos
d165584174 [wasm] Do not fall back to Turbofan if --liftoff-only
If --liftoff-only is on, we should not execute Turbofan compilation, no
matter what the result of Liftoff compilation was. Right now, decoding
errors are considered bailouts, which make us fall back to Turbofan and
trigger a DCHECK.

Change-Id: Ic12591da256d92fb79578603d4778a3d2aa460ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574555
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79865}
2022-04-07 22:36:44 +00:00
Milad Fa
4dc894b982 S390[simd]: avoid using r0 as scratch during vector load/store
Passing `ip/r1` as scratch to LoadV128 anf StoreV128.

Change-Id: Ie86d3bd241065de985f98025e7bb60aba4cd42d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576132
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79864}
2022-04-07 22:12:04 +00:00
Dominik Inführ
72a11f202c [heap] Drop old-to-old slots at once after iteration
Removing slots in the Iterate() method performs an atomic CAS operation
on a cell. This is not necessary, we can simply keep slots and drop
the whole SlotSet with all buckets after iteration.

Bug: v8:12760
Change-Id: I6aeb656d21e5fea6f7e15238d4105013c84ffb2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574558
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79863}
2022-04-07 16:38:18 +00:00
Milad Fa
aacd41629b PPC/s390: [wasm] Count direct calls
Port 9ca0bfef37

Original Commit Message:

    This adds feedback collection to count the number of executions of
    call_direct instructions in Liftoff code. The purpose is better
    inlining decisions in Turbofan, which are enabled by having call
    count information for all kinds of calls.
    The new feature is gated on --wasm-speculative-inlining. While
    direct calls don't need to speculate about their target, the whole
    feedback collection infrastructure depends on that flag.

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

Change-Id: Id94a8a00e00877213b017d1ccf06ae0ea988539b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576126
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79862}
2022-04-07 16:10:14 +00:00
Jakob Kummerow
2fbb686ec5 [wasm] Tune inlining heuristics
The key idea is that we can now use call count feedback into
account consistently for all kinds of calls that support inlining.

Bug: v8:12166
Change-Id: I764b8686b6c825a9b24f0032e81f7d1217ef1371
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574554
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79861}
2022-04-07 16:04:44 +00:00
Bryant Chandler
e6e4da2ff3 Revert "[fuchsia] Use SDK provided gn templates for d8"
This reverts commit 3111db91f8.

Reason for revert: This has runtime failures because including
cmx fragments isn't working ocrrectly. Still investigating why
this wasn't discovered by CQ.

Original change's description:
> [fuchsia] Use SDK provided gn templates for d8
>
> cr_fuchsia_package is deprecated in favor of using the Fuchsia
> SDK provided rules directly.
>
> This CL adds a cmx file specifically for v8_unittests. CMX
> files define fuchsia components, see
> https://chromium-review.googlesource.com/c/chromium/src/+/3529652
> for more info.
>
> Bug: chromium:1092804
> Change-Id: Ibf1d866ec6b94a0e1a7a7c7c443a6ee80e3b1042
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3537885
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Bryant Chandler <bryantchandler@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79760}

Bug: chromium:1092804
Change-Id: Ib9a4d4f8e04c6cd7f3bd289e7c956b6115a77a25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3572004
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Bryant Chandler <bryantchandler@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79860}
2022-04-07 15:57:54 +00:00
Camillo Bruni
16e464fb21 [d8] Harden Shell::ReadFile
- Always return a MaybeLocal<String>
- Don't crash on long filenames

Bug: chromium:1311923
Change-Id: I96e10337ceb32aeafafe0b73c78651a1ac38fb9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576122
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79859}
2022-04-07 14:19:04 +00:00
henrika
ec778f9a02 [logging][profiling] Log BytecodeHandler code in JIT loggers
Local tests on Windows using the --enable-system-instrumentation flag
in combination with ETW have shown that parts of the JS stack miss
symbols and most of these missing parts comes from
code-creation,Bytecodehandler events.

The CL fixes this issue.

Bug: v8:11043
Change-Id: I77b150742e689a4002dbc5937d6daa08a0795ab9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574545
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Henrik Andreasson <henrika@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79858}
2022-04-07 14:01:05 +00:00
Jakob Gruber
6879c515d0 [osr] Enable concurrent OSR
Fixed: v8:12161
Change-Id: Ie6e83dd4f261fff2d1fa8613116e83ef6b61561f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576116
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79857}
2022-04-07 13:24:24 +00:00
Nico Hartmann
0c922d87ae [torque] Generate asserts for C++ object definitions
This CL adds the requirements to port object definitions back to C++.
A @cppObjectDefinition is introduced to annotate classes for which
Torque shall merely generate asserts to check that offsets match between
Torque and C++.

As a first object, this CL ports Oddball back to C++.

Bug: v8:12710
Change-Id: I1304d8980f6318ffccbc2ef7284cb9d46ff579e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3523046
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79856}
2022-04-07 13:22:25 +00:00
Leszek Swirski
bb5cc0d54f Revert "[osr] Add an install-by-offset mechanism"
This reverts commit 51b99213e7.

Reason for revert: Speculative revert for MSAN failure  https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/43080/overview

Original change's description:
> [osr] Add an install-by-offset mechanism
>
> .. for concurrent OSR. There, the challenge is to hit the correct
> JumpLoop bytecode once compilation completes, since execution has
> moved on in the meantime.
>
> This CL adds a new mechanism to request installation at a specific
> bytecode offset. We add a new `osr_install_target` field to the
> BytecodeArray:
>
>   bitfield struct OSRUrgencyAndInstallTarget extends uint16 {
>     osr_urgency: uint32: 3 bit;
>     osr_install_target: uint32: 13 bit;
>   }
>
>   // [...]
>   osr_urgency_and_install_target: OSRUrgencyAndInstallTarget;
>   bytecode_age: uint16;  // Only 3 bits used.
>   // [...]
>
> Note urgency and install target are packed into one 16 bit field,
> we can thus merge both checks into one comparison within JumpLoop.
> Note also that these fields are adjacent to the bytecode age; we
> still reset both OSR state and age with a single (now 32-bit)
> store.
>
> The install target is the lowest 13 bits of the bytecode offset.
> When set, every reached JumpLoop will check `is this my offset?`,
> and if yes, jump into runtime to tier up.
>
> Drive-by: Rename BaselineAssembler::LoadByteField to LoadWord8Field.
>
> Bug: v8:12161
> Change-Id: I275d468b19df3a4816392a2fec0713a8d211ef80
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571812
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Jakob Linke <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79853}

Bug: v8:12161
Change-Id: I0c47499544465c80b5b23a492c00ec1c62815caa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576121
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Owners-Override: Leszek Swirski <leszeks@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@{#79855}
2022-04-07 13:13:24 +00:00
Clemens Backes
08e514a894 [codegen][x64] Improve code for float to int64
This improves the code generated for float to int64 conversions on x64.
Instead of explicitly checking the input for specific values and
executing conditional jumps, just convert the integer back to a float
and check if this results in the rounded input. The "success value" is
then materialized via vmov + and instead of via branches.

old:
   7  c4e1fb2cd9           vcvttsd2siq rbx,xmm1
   c  ba01000000           movl rdx,0x1
  11  49ba000000000000e0c3 REX.W movq r10,0xc3e0000000000000
  1b  c441f96efa           vmovq xmm15,r10
  20  c5792ef9             vucomisd xmm15,xmm1
  24  7a08                 jpe 0x3599421714ee  <+0x2e>
  26  7408                 jz 0x3599421714f0  <+0x30>
  28  4883fb01             REX.W cmpq rbx,0x1
  2c  7102                 jno 0x3599421714f0  <+0x30>
  2e  33d2                 xorl rdx,rdx

new:
   7  c463010bf90b         vroundsd xmm15,xmm15,xmm1,0xb
   d  c4e1fb2cd9           vcvttsd2siq rbx,xmm1
  12  c4e1832ac3           vcvtqsi2sd xmm0,xmm15,rbx
  17  c4c17bc2c700         vcmpss xmm0,xmm0,xmm15, (eq)
  1d  c4e1f97ec2           vmovq rdx,xmm0
  22  83e201               andl rdx,0x1

A follow-up step would be to replace the explicitly materialized success
value by a direct jump to the code handling the error case, but that
requires more rewrite in TurboFan.

R=tebbi@chromium.org

Bug: v8:10005
Change-Id: Iaedc3f395fb3a8c11c936faa8c6e55c2dfe86cd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3560434
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79854}
2022-04-07 12:38:44 +00:00
Jakob Gruber
51b99213e7 [osr] Add an install-by-offset mechanism
.. for concurrent OSR. There, the challenge is to hit the correct
JumpLoop bytecode once compilation completes, since execution has
moved on in the meantime.

This CL adds a new mechanism to request installation at a specific
bytecode offset. We add a new `osr_install_target` field to the
BytecodeArray:

  bitfield struct OSRUrgencyAndInstallTarget extends uint16 {
    osr_urgency: uint32: 3 bit;
    osr_install_target: uint32: 13 bit;
  }

  // [...]
  osr_urgency_and_install_target: OSRUrgencyAndInstallTarget;
  bytecode_age: uint16;  // Only 3 bits used.
  // [...]

Note urgency and install target are packed into one 16 bit field,
we can thus merge both checks into one comparison within JumpLoop.
Note also that these fields are adjacent to the bytecode age; we
still reset both OSR state and age with a single (now 32-bit)
store.

The install target is the lowest 13 bits of the bytecode offset.
When set, every reached JumpLoop will check `is this my offset?`,
and if yes, jump into runtime to tier up.

Drive-by: Rename BaselineAssembler::LoadByteField to LoadWord8Field.

Bug: v8:12161
Change-Id: I275d468b19df3a4816392a2fec0713a8d211ef80
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571812
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Linke <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79853}
2022-04-07 12:21:44 +00:00
Benedikt Meurer
a90f1748d2 [inspector] De-flake inspector/debugger/get-possible-breakpoints.js.
Since the inspector does not longer hold on strongly to Script objects
after they were collected by V8, this test was relying on the GC to not
collect the scripts too eagerly in case where nothing else holds on to
the script. So explicitly adding a global object property assignment
here in those cases to ensure that the Script is kept alive.

Fixed: chromium:1314212, v8:12699
Bug: chromium:1246884, chromium:1295659
Change-Id: Ia16fcf841aeb29bf131fc6fa066f120d342f94b2
Doc: https://bit.ly/v8-inspector-script-caching
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576117
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79852}
2022-04-07 12:13:34 +00:00
Leszek Swirski
63af265fd9 [test] Fix missing GC in SingleThreadedDefaultPlatformTest
Bug: v8:12781
Change-Id: I7dfddd886571a16a180bffb8f9fc7a946d5667bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576113
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@{#79851}
2022-04-07 12:03:25 +00:00
jameslahm
8306599e9b [d8] Add unicode filename support on windows
This is a follow up CL for https://crrev.com/c/3538284.
Tests credited to https://crrev.com/c/3468352.

- Add unicode filename path test.
- Convert ansi encoded filename argv to utf8 encoded on windows. Because
the ansi encoded filename argv may lose some information for unicode
filename, and we need to use GetCommandLineW to get the actual unicode
filename argument. And we convert it to utf8 encoded to be consistent
with subsequent processing.
- Use REPLACEMENT CHARACTER to replace the characters which cannot be
encoded with sys.stdout.encoding in progress.py.

This CL should be **reverted** if new unicode filenames cause problems.

Bug: v8:12541
Change-Id: Ic5c5ae342b3a5b11c3119452af03c9165d429ed7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568926
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: 王澳 <wangao.james@bytedance.com>
Cr-Commit-Position: refs/heads/main@{#79850}
2022-04-07 11:40:34 +00:00
Leszek Swirski
3509f2da24 [sandbox] Fix sandbox initialisation in cppgc unittests
Bug: v8:12781
Change-Id: I0df1c8a17482f13d210f7d2424a15e15c71108c0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576115
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Samuel Groß <saelo@chromium.org>
Commit-Queue: Samuel Groß <saelo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79849}
2022-04-07 11:16:04 +00:00
Clemens Backes
ac2bd78f74 [base] Remove base::is_same
Use C++17's std::conjunction together with std::is_same instead.

R=leszeks@chromium.org

Bug: v8:12425
Change-Id: I75a973f14f0642b00d390aa6ab4eb1ce0208c074
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3568478
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79848}
2022-04-07 11:11:04 +00:00
Dominik Inführ
884e2749af [heap] Perform slot set DCHECKs on all pages and not just old space
We can perform these DCHECKs on all pages, not just pages in old space.

Bug: v8:12760
Change-Id: I202e1a96190d305b86c69cd6616bdb5ecc812044
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574560
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79847}
2022-04-07 11:09:34 +00:00
Jakob Kummerow
9ca0bfef37 [wasm] Count direct calls
This adds feedback collection to count the number of executions of
call_direct instructions in Liftoff code. The purpose is better
inlining decisions in Turbofan, which are enabled by having call
count information for all kinds of calls.
The new feature is gated on --wasm-speculative-inlining. While
direct calls don't need to speculate about their target, the whole
feedback collection infrastructure depends on that flag.

Bug: v8:12166
Change-Id: Ie24a988fcea631f370188dc21e60a5fac923dd3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571807
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79846}
2022-04-07 10:38:44 +00:00
Clemens Backes
0a1bf43d19 [test] Remove flag that causes contradictions
Some test variants and fuzzers set their own GC interval, so the flag
specified in the regression test causes flag contradictions.
The test failure was flaky anyway, so this change is only a slight
reduction in reproducability, and the test will still be used as seed
for the fuzzers.

R=machenbach@chromium.org

Bug: chromium:1313475
Change-Id: I7c7084ab34fe46d691b841921d42a487cc8a1cad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3576114
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79845}
2022-04-07 10:30:04 +00:00
Nikolaos Papaspyrou
f20949fa00 heap: Fix bug in minor MC heap verification
Minor MC heap verification requires heap iterability. This however was
not directly ensured. Coincidentally, there was an unrelated call to
`Heap::Verify` that ensured `Heap::MakeHeapIterable` had been called,
so the precondition was met. This call was moved to an earlier point
by https://crrev.com/c/3497318 and, because of that, some combination
of flags now results in a crash.

This CL fixes the issue by directly ensuring heap iterability. It also
moves back the call to `Heap::Verify`, so that it takes place inside
the GC safepoint.

Bug: v8:12768
Change-Id: I2c66de0d0a735b84dd9435ff503e78bb3611ce55
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3569224
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79844}
2022-04-07 09:31:44 +00:00
Clemens Backes
9f128f4e9f [base] Remove base::fold and base::all
They can be replaced by std::conjunction and c++17 folding expressions.

R=tebbi@chromium.org

Bug: v8:12425
Change-Id: I109ac904245aab431f11752eff5129fd4361de8a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3570428
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79843}
2022-04-07 09:13:49 +00:00
Georgia Kouveli
16b5fc3c57 [arm64] Remove template argument of PushCPURegList and friends
Callee saved registers do not include the LR anymore, so we can
now remove the last place where we pass a non-default template
argument to PushCPURegList/PopCPURegList (in the code generator).
This makes the template argument redundant, so we can remove the
template altogether.

Change-Id: I07f0c0a10840817df8a5afc1dc74330e290ce5bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571816
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/main@{#79842}
2022-04-07 09:12:45 +00:00
Dominik Inführ
6fb4e02c78 [heap] Turn AssertNoInvalidTypedSlots into release CHECK
Turn this assertion also on for release builds for now. This shouldn't
regress sweeping performance because we do the same work as in the last
release.

Bug: v8:12760
Change-Id: I02f78157d20780f46bb4aebf59ce96a7b52f0a27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571810
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79841}
2022-04-07 07:03:14 +00:00
Marja Hölttä
a1ff91207e [RAB/GSAB] Object.freeze: Support RAB / GSAB
Bug: v8:11111
Change-Id: I722702faa062e6083496d55cd96ee33d3952998b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3571809
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79840}
2022-04-07 06:00:44 +00:00
Camillo Bruni
440235638d [flags] Remove unused FLAG_log_handles and related code
Change-Id: I97d29623e163ceee450814f03fba745d478082ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3574550
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79839}
2022-04-07 05:59:25 +00:00
jiepan
9ba6aff285 [x64] Implement 256-bit assembler for cmp ops
Bug: v8:12228
Change-Id: Iab09881d9c8bcd851fd89bf5d6bbd3f2cfb0f3d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3303808
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#79838}
2022-04-07 04:05:23 +00:00
v8-ci-autoroll-builder
9afe4c04fe Update V8 DEPS.
Rolling v8/build: e5b74ea..38ea770

Rolling v8/buildtools/linux64: git_revision:5eb3845ec2d8296b4f41da4eca85302eb111fe69..git_revision:ab9104586734cb45aa77c70ca5042edbcc9f6aa5

Rolling v8/buildtools/third_party/libc++abi/trunk: 1850510..ac492da

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/ec5b008..5ff11ff

Rolling v8/third_party/depot_tools: b8a4c0b..ba94bbe

Rolling v8/third_party/zlib: 3b1df9d..c61f267

Rolling v8/tools/clang: bd06a4f..3436376

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

Change-Id: I74d1f9ea47a455438c1371227238bb25784775ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3573514
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@{#79837}
2022-04-07 03:58:29 +00:00
Lu Yahan
dc0230733e [riscv64][sim] Increase the simulator's stack limit margin
Port d36f596e8a

Change-Id: I13c9d23bb06841e1f6cbb07c68968fb3cc9eb01a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3573784
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#79836}
2022-04-07 02:14:25 +00:00
Corentin Pescheloche
ca51ae3ac8 [api][profiler] Get StartProfiling, StopProfiling to accept integer ID rather than string
This CL adds support for interacting with CpuProfile with their integer
id.
A String ID is problematic because it forces an allocation when stopping
or cancelling a Profiler which can happen during a GC when this
is not allowed.

Change-Id: I9a8e754bd67214be0bbc5ca051bcadf52bf71a68
Bug: chromium:1297283
Co-Authored-By: Nicolas Dubus <nicodubus@fb.com>
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3522896
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Corentin Pescheloche <cpescheloche@fb.com>
Commit-Queue: Corentin Pescheloche <cpescheloche@fb.com>
Cr-Commit-Position: refs/heads/main@{#79835}
2022-04-06 19:29:14 +00:00
David Benjamin
6cf7330a61 Polyfill GroupSse2Impl on non-x86 platforms
Bug: v8:12518
Change-Id: Ie22303416749affc0629d60fbed6f9dc4288b09d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494443
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79834}
2022-04-06 19:19:03 +00:00