Commit Graph

74001 Commits

Author SHA1 Message Date
Frank Tang
2144c5357a [Temporal] Implement Temporal.Now.*
Bug: v8:11544
Change-Id: I5dda2845618cc7c709fb9ddac337472e112407e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3374281
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79359}
2022-03-04 02:25:31 +00:00
Frank Tang
326a63a984 [intl] NumberFormat v3 mark unimplement for string
Add unimplementation macro for String case till the resolution of
https://github.com/tc39/proposal-intl-numberformat-v3/pull/82

Bug: v8:10776
Change-Id: Ic59d532bb78a9f56a0c121e71e0f9e585bb8c9d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497619
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79358}
2022-03-04 02:08:01 +00:00
Camillo Bruni
ecc3cd256a [tools] Improve gcmole part II
Prepare gcmole.cc for the next update:
- Print possible GC locations when discovering stale/dead variables
- Make error messages less confusing for the modern V8 engineer
- Prepare gcmole to read suspects.allowlist instead of .whitelist
- Use more readable variable names
- Only log non-found types with --verbose
- Change the currently unusued gccauses format in gcmole.py and
  support loading it back in gcmole.cc
- Implemented first basic gc call-chain printing (disabled by default)

GCmole packaging:
- Add debug mode to bootstrap.sh build script
- Update gcmole.py run instructions in bootstrap.sh and package.sh

Bug: v8:10009
Change-Id: I369d48baa2980455d2e8f57e7a803d0384fe83f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3480095
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79357}
2022-03-04 01:06:11 +00:00
legendecas
8e18ea3913 [builtins] Fix binding function with native data property accessors
When the function is created with FunctionTemplate and set name with
native data property accessors, binding the function should throw
immediately if the native accessor throws.

Bug: v8:11989
Change-Id: Ief282202aa5b8515f581fd5478886ed5f001fd4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3492966
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Chengzhong Wu <legendecas@gmail.com>
Cr-Commit-Position: refs/heads/main@{#79356}
2022-03-04 00:50:51 +00:00
Deepti Gandluri
a0b25ebd75 [wasm-relaxed-simd] Prototype relaxed min/max for ARM
Prototype F32x4Relaxed(Min/Max) and F64x2Relaxed(Min/Max)
operations for ARM. F32x4 variants map directly to vmin/vmax
hardware instructions which are also used for F32x4(Min/Max)
operations. The F64x2 variants are mapped in this implementation
to Pmin/Pmax instructions as detailed in the github issue.
https://github.com/WebAssembly/relaxed-simd/issues/33

Bug: v8:12284
Change-Id: I5ea939385fa0ae97bbdf776fc0b763cabb1b293c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3501347
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79355}
2022-03-03 22:37:19 +00:00
Nico Hartmann
aaedd8b788 Revert "[turbofan] Enable --verify-simplified-lowering in debug"
This reverts commit 23b178b540.

Reason for revert: Speculative revert due to https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/945522/overview

Original change's description:
> [turbofan] Enable --verify-simplified-lowering in debug
>
> Bug: v8:12619
> Change-Id: I3b9f82a21c9454ff37036e8abcf73862e38f1fc9
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494243
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79338}

Bug: v8:12619
Change-Id: Ia879b53e1b0a07109f0420fdf954b110f45abf58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497339
Auto-Submit: Nico Hartmann <nicohartmann@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@{#79354}
2022-03-03 18:04:11 +00:00
Jakob Gruber
995217a31b [maglev] Add a skeleton MaglevConcurrentDispatcher impl
A dispatcher that currently does nothing, installed on the Isolate.

The implementation is close to the baseline concurrent compiler; but
boilerplate is short enough that a common base class is not worth the
additional complexity.

Bug: v8:7700
Change-Id: Ia34781e24cb6b1f72e5560fb0afe107bb0486092
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497690
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79353}
2022-03-03 17:32:21 +00:00
Deepti Gandluri
eda743d06b [wasm-relaxed-simd-arm] Prototype relaxed lane select
With the previous change to using the mask as the first
input to the node, the lane select ARM codegen is equivalent
to V128Select. Also enable cctests to run on ARM.

Bug: v8:12284
Change-Id: I5572f4845307ff20cc2a0a58d3ccf162caa436b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500655
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79352}
2022-03-03 17:16:51 +00:00
David Benjamin
3561874da1 Use numpy 1.2x.supported.1 in V8
This fixes 'fetch v8' on Arm Macs.

Bug: chromium:1295840
Change-Id: Ifa7a07eef508c0e0203de8ea8d54ddcd31815fe8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494442
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79351}
2022-03-03 15:21:21 +00:00
Marja Hölttä
fe479fe793 [rab/gsab] RAB/GSAB support in TA.p.subarray
Bug: v8:11111
Change-Id: I58b76ce0ad47eb47ccbd0244b110f7cb0450ced8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3468349
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79350}
2022-03-03 15:05:15 +00:00
Manos Koukoutos
2ba409389c [turbofan] Fix optimization of traps after if-nodes
A TrapUnless after an IfTrue, and conversely, a TrapIf after an IfFalse,
should not optimize away the respective Branch node.

Bug: v8:12624
Change-Id: I250b2f84c38295ca35e440589901ed5a58bb4e75
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500303
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79349}
2022-03-03 15:04:12 +00:00
Camillo Bruni
4db43bfa2f [tools] Improve gcmole part I: command line
- Convert gcmole to python3-ish code
  - use local Path implementation for future full migration
- Use optparse and explicit arguments for gcmole
  - Add explicit directories flags
  - Use backwards compatible env vars as fallbacks
- Add gn target v8_gcmole_files to avoid issues with missing or
  incompatible generated files

Drive-by-fixes for running gcmole without ignored files:
- Disable gcmole in Isolate::UnwindAndFindHandle
- Partially disable gcmole in V8HeapExplorer::AddEntry

Bug: v8:10009
Change-Id: I5b4d1c6554db300190226361b6c518419109ff3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497320
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79348}
2022-03-03 15:01:15 +00:00
Camillo Bruni
0794551156 [gcmole] Disable gcmole for Isolate::UnwindAndFindHandler
Temporary fix to allow running gcmole on isolate.cc

Bug: v8:12676
Change-Id: I0b625e6e0419885cf20758f22d897dc2532c2606
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497335
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79347}
2022-03-03 13:08:30 +00:00
Michael Lippautz
7bda2df688 Move utils/pointer-with-payload.h -> base/pointer-with-payload.h
The utility type is independent of V8 and useful for cppgc as well.
Move to base/ to allow reusing.

Change-Id: I9de9b4a87bb113fb4c2232d90253afb0f38faa68
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497336
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79346}
2022-03-03 11:44:23 +00:00
Benoît Lizé
bceaab28a2 [heap] V8_OS_MACOSX -> V8_OS_MACOS
This renaming was missed in
https://chromium-review.googlesource.com/c/v8/v8/+/3468577, because the
code adding these #ifdef blocks landed in-between the renaming change
being uploaded and landed.

Bug: chromium:1298417
Change-Id: I8c2e951099dafcce7e19a59e40e36f308e2ed867
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3498349
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Benoit Lize <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79345}
2022-03-03 11:09:52 +00:00
Leszek Swirski
31abbcfb4d [maglev] Use RegList for free registers
Store the free registers as a RegList rather than stack of Register
values. This allows us to simplify some of the register freeing logic,
including passing the current free set to nodes for use as temporaries.

Drive-by: Replace ALWAYS_ALLOCATABLE_GENERAL_REGISTERS with
ALLOCATABLE_GENERAL_REGISTERS, which is the more general list (the former
is an implementation detail for optionally reserving a register for
the cage register).

Bug: v8:7700
Change-Id: I666e9a7547c2f4f4e578fbcbb4bd3fe3cb06dac5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497767
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79344}
2022-03-03 10:33:44 +00:00
jameslahm
89f02d7808 [builtins] add fast path GetProperty for function template
having cached_property_name

When call function_template accessor in Generic/NoFeedback,
if the function template has cached_property_name,
the holder will have data property with the cached_property_name,
we can use GetProperty to get it rather than bailout.

Bug: v8:10179
Change-Id: I8b878fff969d05eeab1c95fc4b73df6079496840
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3492396
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79343}
2022-03-03 10:10:03 +00:00
jameslahm
28371a5781 [destructuring assignment] add CopyDataPropertiesWithExcludedProperties intrinsic
- add CopyDataPropertiesWithExcludedProperties intrinsic
- add CopyDataPropertiesWithExcludedProperties_Baseline intrinsic

Bug: v8:11614
Change-Id: Ie6a3db4c9edda40ecf84b8d1107e70fd7ff0d5fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3470349
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79342}
2022-03-03 10:05:02 +00:00
jameslahm
a523f5ca69 [runtime] Delete thread local keys in Isolate::DisposeOncePerProcess
Isolate::isolate_key_ and Isolate::per_isolate_thread_data_key_ are
created in Isolate::InitializeOncePerProcess() and should be deleted in
Isolate::DisposeOncePerProcess().

Bug: v8:11914
Change-Id: Ic3000d21f86a9d419373ef7c777c21661f544fee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3490712
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79341}
2022-03-03 10:00:26 +00:00
Jakob Gruber
cfcac7a2ad [sparkplug] Invert the ENABLE_SPARKPLUG condition formulation
Now that only ppc lacks support, state that explicitly s.t. it's clear
which platforms are still missing.

Bug: v8:11420
Change-Id: I22a91270aaa389fc27ce5c7a3f8e8b9c44f01eb4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497544
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79340}
2022-03-03 09:58:52 +00:00
Leszek Swirski
3fd2428c94 [maglev] Remove LiveNodeInfo, store its data directly on ValueNode
LiveNodeInfo was stored in a Node->LiveNodeInfo map, which was never
copied or merged alongside control flow. Lookups in this map were a bit
part of register allocation time, and it was mostly duplicating data
that was already in the ValueNode.

So, instead of a separate LiveNodeInfo, store the current register
allocation state directly on the ValueNode. This involves a bit of
clobbering of state (in particular, we have to clobber the next_use id),
but that doesn't matter since regalloc is a forward pass and with this
change, it's less memory and zero map lookups.

Measuring on a (very large) function, this reduces compile time from
300ms to 200ms.

Bug: v8:7700
Change-Id: I02620f1a795bd308d1de03d694c102cb5ea3ff50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500617
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79339}
2022-03-03 09:36:00 +00:00
Nico Hartmann
23b178b540 [turbofan] Enable --verify-simplified-lowering in debug
Bug: v8:12619
Change-Id: I3b9f82a21c9454ff37036e8abcf73862e38f1fc9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494243
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79338}
2022-03-03 09:25:25 +00:00
haoyuintel
35ddae0a27 [x64] Fix suboptimal instruction selection for mov reg, Smi
The movq instruction with 8 immediate bytes is used for moving negative
Smi to register previously. This CL reduce the immediate bytes by using
mov imm32 with sign extension.

To move a Smi of -1 to register, the disassembly before the commit is as:
48b8feffffffffffffff   REX.W movq rax, 0xfffffffffffffffe

The disassembly after the commit is as:
48c7c0feffffff         REX.W movq rax, 0xfffffffe

Change-Id: Ib54a4fbe66f59f86b9f13a72431ceb38470f1017
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500205
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Haoyu Zhang <haoyu.zhang@intel.com>
Cr-Commit-Position: refs/heads/main@{#79337}
2022-03-03 07:38:50 +00:00
v8-ci-autoroll-builder
1324c70fee Update V8 DEPS.
Rolling v8/build: aabb6b9..e6ef2e3

Rolling v8/buildtools: 893aa03..113dd1b

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/d62cc7b..1ec1fe1

Rolling v8/third_party/depot_tools: a255e40..b65bfd5

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

Change-Id: I8d3607b351e49ccf49c172bf03fcf5793e8cbdfe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3499565
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@{#79336}
2022-03-03 03:56:40 +00:00
Shu-yu Guo
8d99624454 Revert "Reland "heap: Force incremental marking in C++ only workloads""
This reverts commit 7d4c264e0e.

Reason for revert: Blocking chromium roll, failures in ASAN unittests:
https://ci.chromium.org/ui/p/chromium/builders/try/linux_chromium_asan_rel_ng/1104768/test-results

Original change's description:
> Reland "heap: Force incremental marking in C++ only workloads"
>
> This is a reland of commit 4fde332811
>
> Most recent fix made Oilpan aware of --single-threaded-gc which
> is necessary as GCs are more eagerly scheduled in tests.
>
> Original change's description:
> > heap: Force incremental marking in C++ only workloads
> >
> > ... when above a certain minimum threshold. This is to guard against
> > memory running away in scenarios where the JS heap is empty and
> > there's only high throughput C++ allocations that don't allow for a
> > memory reducer GC to kick in.
> >
> > This logic should be revisited after Oilpan's young generation
> > collector is implemented which may allow switching to a more efficient
> > shrinking strategy for initial heap setup.
> >
> > Bug: chromium:1029379, chromium:1300028, chromium:1300492
> > Change-Id: I93924fc2fe77d6226c29358d3afb1cc9d6fbf3b1
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3484319
> > Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> > Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#79255}
>
> Bug: chromium:1029379, chromium:1300028, chromium:1300492
> Change-Id: Ia0c443248b951240cce6dbe1f68581ff1061a7d9
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500301
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79327}

Bug: chromium:1029379, chromium:1300028, chromium:1300492
Change-Id: I3fd0a5d4ded7d3ce7cd74a50a11b3a0367477d06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500656
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Owners-Override: Shu-yu Guo <syg@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@{#79335}
2022-03-03 00:14:10 +00:00
Michael Lippautz
6b197b0ac1 cppgc: Refactor prefinalizers
- Add a comment on the macro that registers a prefinalizer.
- Refactor the API to avoid exposing internal types needlessly.

Change-Id: Ia88e786304616848556263410a8f5398c5374533
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497766
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79334}
2022-03-02 19:14:39 +00:00
Camillo Bruni
2fa1f0457a [profiler] Partially disable GCmole in V8HeapExplorer::AddEntry
GetConstructorName might allocate and thus triggers gcmole warnings.
This is a temporary workaround until the called function is cleanly
fixed.

Bug: v8:12674
Change-Id: I43bd190d887abcd79116e8c328ceedfb0c9fad79
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497769
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79333}
2022-03-02 19:02:50 +00:00
Jakob Gruber
32634b571c Add target code kind to --trace-opt output
.. to distinguish between Maglev and Turbofan targets. Also move one
tracing function to tiering-manager. We may want to move all
--trace-opt code into one place in the future (it's currently split
between here and compiler.cc).

Bug: v8:7700
Change-Id: I9756460124b14fc3213296d083071f338421966a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500612
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79332}
2022-03-02 15:25:22 +00:00
Seth Brenith
c2fa5fccb1 Use outer language mode when storing streamed script in isolate cache
Currently, a streamed script which specifies 'use strict' is stored in
the isolate script cache with a key indicating that it is strict mode.
However, the keys should be based on the context executing the script,
not the content of the script, so that the next lookup can find the
entry without having to parse the script first.

Bug: v8:12668
Change-Id: Iaa76c00c431ad54a86ffd18b61cb4f67dc457b03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3498220
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#79331}
2022-03-02 15:01:29 +00:00
Omer Katz
6c3d4ddd3e cppgc: Objects with prefinalizers should not reside on compactable
spaces.

Change-Id: I454c719519452f1c33a7a8b0b6393ed61c8f819d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497742
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79330}
2022-03-02 14:23:02 +00:00
Camillo Bruni
656675313c [tools] Improve system analyzer
Profiler:
  - Track profiler tick durations
  - Various speedups due to low-level hacking
Improve code-panel:
  - Better register highlighting
  - Added address navigation and highlighting
  - Removed obsolete inline source-view
Improve script-panel:
  - Keep current source position focused when showing related entries
  - Better tool-tip with buttons to focus on grouped entries per
    source postion
  - Focus by default on other views when showing related entries
Improve timeline-panel:
  - Initialise event handlers late to avoid errors
  - Lazy initialise chunks to avoid errors when zooming-in and trying to
    create tooltips at the same time


Change-Id: I3f3c0fd51985aaa490d62f786ab52a4be1eed292
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3492521
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79329}
2022-03-02 13:41:32 +00:00
Jakob Gruber
123c38a5aa [maglev] Basic tiering to Maglev
When --maglev is set, tier up to Maglev from unoptimized tiers based on
--interrupt-budget-for-maglev, initially set to 40KB (which should very
roughly by 1/10th of the time until the TF tierup decision is made).
On the first interrupt, a non-concurrent optimization to Maglev is
requested, which the next call to the marked function will perform.

- There is no support for tiering from Maglev to TF yet.
- Maglev's language support is minimal and tests are not expected to
  pass with --maglev.
- Disable --maglev by default for now.

Drive-by: fixes related to Maglev flag definitions.

Bug: v8:7700
Change-Id: I121bb3f4f3830fdd20e1d4a12d3e04f08a99be38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500302
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79328}
2022-03-02 13:35:32 +00:00
Michael Lippautz
7d4c264e0e Reland "heap: Force incremental marking in C++ only workloads"
This is a reland of commit 4fde332811

Most recent fix made Oilpan aware of --single-threaded-gc which
is necessary as GCs are more eagerly scheduled in tests.

Original change's description:
> heap: Force incremental marking in C++ only workloads
>
> ... when above a certain minimum threshold. This is to guard against
> memory running away in scenarios where the JS heap is empty and
> there's only high throughput C++ allocations that don't allow for a
> memory reducer GC to kick in.
>
> This logic should be revisited after Oilpan's young generation
> collector is implemented which may allow switching to a more efficient
> shrinking strategy for initial heap setup.
>
> Bug: chromium:1029379, chromium:1300028, chromium:1300492
> Change-Id: I93924fc2fe77d6226c29358d3afb1cc9d6fbf3b1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3484319
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79255}

Bug: chromium:1029379, chromium:1300028, chromium:1300492
Change-Id: Ia0c443248b951240cce6dbe1f68581ff1061a7d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500301
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79327}
2022-03-02 12:48:50 +00:00
Jakob Gruber
22bbb73dbf [tiering] Centralize the optimization decision
OptimizationDecision holds the optimization {reason, code kind,
concurrency mode}. We centralize it to avoid having to recalculate in
Optimize when we already know everything in ShouldOptimize.

Bug: v8:7700
Change-Id: Ifcd902e86f844ce045bcefd4ae72ac17b42acb3a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500300
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79326}
2022-03-02 11:08:32 +00:00
Jakob Gruber
5cdac4b8c4 [tiering] Centralize interrupt budget decisions
.. by moving them all to TieringManager.

Bug: v8:7700
Change-Id: I03eb2d1607b06ece84a1ca98ebc723788dbc0cde
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3500220
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79325}
2022-03-02 09:16:20 +00:00
v8-ci-autoroll-builder
9923a6c269 Update V8 DEPS.
Rolling v8/build: 27d089d..aabb6b9

Rolling v8/buildtools/linux64: git_revision:e3f114f46537152cfbdb553015518d1db1b812fd..git_revision:d7c2209cebcfe37f46dba7be4e1a7000ffc342fb

Rolling v8/buildtools/third_party/libunwind/trunk: 2ea265b..d1c7f92

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/2cfdaa8..d62cc7b

Rolling v8/third_party/depot_tools: 2bad9f0..a255e40

Rolling v8/tools/luci-go: git_revision:582e828c5a8aaf5cdd0ad1d5465fb9092b71eab8..git_revision:a1616e207f0d9c24beefe848ee899b7a73efcb70

Rolling v8/tools/luci-go: git_revision:582e828c5a8aaf5cdd0ad1d5465fb9092b71eab8..git_revision:a1616e207f0d9c24beefe848ee899b7a73efcb70

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

Change-Id: Ief20092d545bbd6f48d8dda10164832cb180810d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3499125
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@{#79324}
2022-03-02 03:58:31 +00:00
Nico Hartmann
e40c8a3a32 Regression test for 1208805
Bug: chromium:1208805
Change-Id: Ia211d74f8de1dd031d5bda9885ec567e2d56b4cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2897089
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79323}
2022-03-01 22:46:29 +00:00
Manos Koukoutos
6a6c116843 [wasm-gc] Merge anyref and externref
According to the latest changes in wasm-gc, externref will be renamed
to anyref, and will be assigned as the top of the reference type
hierarchy. Since in the current wasm type system funcref is not a
subtype of anyref, subtyping is now dependent on whether wasm-gc is
enabled.

Bug: v8:7748
Change-Id: I0c0ae3dd5523e624d4490ca33d1fba4c2ae59393
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3468345
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79322}
2022-03-01 22:12:59 +00:00
Michael Lippautz
8d55cd6c0e cppgc-js: Respect --single-threaded-gc
Before this CL Oilpan would schedule concurrent marking and sweeping
even in the presence of --single-threaded-gc. This e.g. flakily breaks
Blink tests that do not set up a thread-pool in certain configurations
where they pass --single-threaded (implying --single-threaded-gc).

Bug: chromium:1300492
Change-Id: I64f0c6a20f9c29d689a62e63cc5a8d024962ff2c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497760
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79321}
2022-03-01 17:12:59 +00:00
Leszek Swirski
d7d01a9cca [maglev] Fix spill slots for InitialValue
InitialValue needs to have a spill slot (e.g. for deopts) but shouldn't
emit an actual spill (since they're already on stack).

Drive-by, fix printing of Checkpoint and CheckMaps parameters.

Bug: v8:7700
Change-Id: I3c1acfce6638b1ad604f7c7a1938694814c326ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497371
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@{#79320}
2022-03-01 17:01:21 +00:00
Leszek Swirski
22dbf68679 [maglev] Don't reduce free register count in GetFreeRegisters
GetFreeRegisters is supposed to find some number of free registers that
the current node can use as safe temporaries, but they shouldn't be
considered "allocated", as they will be free as soon as the node's code
completes.

Now we no longer decrement free_register_count_ in GetFreeRegisters, to
avoid leaking registers allocated for temporaries.

Bug: v8:7700
Change-Id: I485607fedec79fbeca4675781923b7ad3a6bfc6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497381
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79319}
2022-03-01 14:47:22 +00:00
Jakob Gruber
aad3e727ea Refactor tiering-related JSFunction methods
- Add the Isolate as an explicit param (we already have it at all
  callsites)
- Pass an explicit CodeKind param to MarkForOptimization in preparation
  for Maglev.
- Split EnsureFeedbackVector into that, plus
  CreateAndAttachFeedbackVector for when we know it has to be created.

Bug: v8:7700
Change-Id: Ie9022deccd31d472d6df3d442b25583af5569ab0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3497383
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79318}
2022-03-01 14:33:09 +00:00
Pierre Langlois
6f16737f87 [arm64] Fix BlockPoolsScope when generating debug messages.
When running with the simulator, Assembler::debug() can record an inline
comment to be printed when the simulator encounters it. We need to make
sure pools are not emitted while the comment is recorded in the code
stream.

However the BlockPoolsScope was missing its margin argument to tell it
how much code we're going to generate, and could forget to emit pools
when it should have, causing crashes later on when a branch cannot jump
over the code comment.

Bug: v8:12637
Change-Id: I39e50f176d87c781c865b81fb9aca57d69c8c019
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494544
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/main@{#79317}
2022-03-01 11:07:29 +00:00
Michael Lippautz
f1f7cafe61 Fix TrackBumpPointerAllocations for single generation
Single generation doesn't have a young generation, so we cannot check
whether it's inline allocation is enabled.

Bug: v8:12615
Change-Id: I145e7c3ff225dc0099136289c9aef4ddd28b3578
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3487993
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79316}
2022-03-01 10:57:48 +00:00
Victor Gomes
9fad59907a [maglev] Implement LoadNamedGeneric IR
Bug: v8:7700
Change-Id: I117f0ed7df60eff145b0ecd509ffa7debc137038
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494239
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79315}
2022-03-01 10:27:59 +00:00
Jakob Gruber
487f840e1c [maglev] Remove UNREACHABLE from constexpr functions
gcc builds seem to have troubles with this:

 error: call to non-constexpr function

Remove the UNREACHABLE() calls for now but keep a TODO to
potentially re-enable them again once we've figured this out.

Bug: v8:7700,v8:12667
Change-Id: I9628a1326c1c4200b90aad25cd2eabfeb06608fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494237
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79314}
2022-03-01 09:16:31 +00:00
Igor Sheludko
d693117f18 [ext-code-space] Fix two more TSAN issues
1) add relaxed version of Code::main_cage_base accessors and use them
   from in those cases where they can be called from backround thread,
2) pass the main cage base value to IsCode() predicate to avoid
   accessing non-acomic Heap pointer value in page headers from
   background compilation thread.

Drive-by cleanup: use MarkingVerifier::cage_base() instead of
Code::main_cage_base().

Bug: v8:11880, v8:12611
Change-Id: I9fd28c1a3babb862d08fec09f6cfc369beaad231
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494238
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79313}
2022-03-01 08:46:59 +00:00
Lu Yahan
f41ba08c61 [riscv64] Port [safepoints] Various refactors
Change-Id: I55fa83f403464522ee8cebb8dd79e9aecdcc23a4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3492398
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@{#79312}
2022-03-01 07:09:48 +00:00
Benedikt Meurer
7eb22c894c [inspector] Simplify script end position logic.
Don't expose the line end table logic to V8DebuggerScript, but instead
use the existing Script::GetPositionInfo() logic to resolve end line and
column numbers for scripts. This also avoids having to copy (the
potentially huge) line ends tables to std::vector's twice per script.

Bug: chromium:1162229
Change-Id: I03365d42c320d462360bacc444f7fa97904a9748
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3494240
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79311}
2022-03-01 06:54:08 +00:00
jameslahm
8f8e037548 [riscv64] use SafepointTableBuilder::Safepoint in
LiftoffAssembler::RecordSpillsInSafepoint

use Safepoint will be mistaken for v8::internal::Safepoint,
which cause build failure on riscv64, change it to use
SafepointTableBuilder::Safepoint

Bug: v8:12665
Change-Id: I597ea04b0c8b466c2f5a322d22ed989d00bedc5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3492397
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79310}
2022-03-01 04:15:58 +00:00