Commit Graph

70681 Commits

Author SHA1 Message Date
Jakob Kummerow
dcc6bd76a9 [bigint] Two more fixes for fast .toString()
Firstly, the fast path checking for applicability of the equality
"A/B = 0 with remainder A" must use the condition "A<B", not "A<=B".
Secondly, *all* early return paths must ensure that enough padding
'0' characters are written.

Fixed: chromium:1236694
Bug: v8:11515
Change-Id: I3fa7e17f5f3969ddbb5417b53abf3bff3fc1355b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3075365
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76139}
2021-08-06 17:08:05 +00:00
Leszek Swirski
a12c6fa2ea Revert "[counters] Fix reentrant timers for V8.Execute"
This reverts commit fffcbaea55.

Reason for revert: Breaks in Chromium (e.g. https://ci.chromium.org/p/v8/builders/ci/Linux%20V8%20FYI%20Release%20%28NVIDIA%29)

Original change's description:
> [counters] Fix reentrant timers for V8.Execute
>
> This CL fixes a long standing issue where reentering TimedHistograms
> scopes would cause spurious measurements. Only the non-nested scopes
> yielded correct results.
>
> Due to the changed numbers, the V8.Execute histogram is renamed to
> V8.ExecuteMicroSeconds. Note that this histogram is also guarded
> behind the --slow-histograms flag due to the additional overhead.
>
> Unlike before, it does no longer include time for external callbacks
> and only measures self time. The following example illustrates the
> new behaviour:
>
> 1. Enter V8:           |--+.......+--| self-time: 4 units (reported)
> 2. Exit V8 (callback):    |-+...+-|    self-time: 2 units (ignored)
> 3. Re-enter V8:             |---|      self-time: 3 units (reported)
>
> This would result in 2 histogram entries with 4 time units for the first
> V8 slice and 3 units for the nested part. Note that the callback time
> itself is ignored.
>
> This CL attempts to clean up how TimedHistograms work:
> - Histogram: the base class
> - TimedHistograms: used for time-related histograms that are not nested
> - NestedTimeHistograms: Extends TimedHistograms and is used for nested
>   histograms
>
> This CL changes Histograms to not measure time themselves. Measurements
> happen in the *HistogramScopes:
> - BaseTimedHistogramScope: Base functionality
> - TimedHistogramScope: For non-nested measurements
> - NestedTimedHistogramScope: For nested measurements
> - PauseNestedTimedHistogramScope: Ignore time during a given scope.
>   This is used to pause timers during callbacks.
>
> Additional changes:
> - ExternalCallbackScope now contains a PauseNestedTimedHistogramScope
>   and always sets VMState<EXTERNAL>
>
> Bug: v8:11946
> Change-Id: I45e4b7ff77b5948b605dd50539044cb26222fa21
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3001345
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#76111}

Bug: v8:11946
Change-Id: I954de1afbabf101fb5d4f52eca0d3b80a723385b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077153
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Owners-Override: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76138}
2021-08-06 14:31:44 +00:00
Rakhim Khismet
7810ce0468 [fuzzer][wasm] Add support for reftypes in test generator
We add support for struct and arraytypes in wasm-fuzzer-common.
Also, we add addStruct and addArray while generating tests.
Other OptRef types like eqref/anyref have been supported.
Adding struct and arraytypes in wasm-compile has been placed
at the beginning in order to generate them in addSignature.

Bug: v8:11954
Change-Id: Ibe468dd4df70ad40367196c88353b28b7654f086
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074463
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Rakhim Khismet <khismet@google.com>
Cr-Commit-Position: refs/heads/master@{#76137}
2021-08-06 14:22:35 +00:00
Victor Gomes
9b19cc5ca2 [cleanup] Rename CompilerDispatcher
We would like to use the name CompilerDispatcher for dispatcher base
class to be used by Sparkplug and OptimizingCompileDispatcher.

Bug: v8:12054
Change-Id: Id69955101c1f46fc2f79b6f77b05c92ed8a31edb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077150
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76136}
2021-08-06 13:36:39 +00:00
Jakob Kummerow
d314be6730 [wasm-gc] Experiment: accept types with explicit inheritance
This patch makes V8 accept the binary format produced by Binaryen
after https://github.com/WebAssembly/binaryen/pull/3933 when the
--experimental-wasm-gc-experiments flag is present. The explicit
inheritance information is not used for anything. Validation is
performed only insofar as explicit supertypes must be valid types.

Bug: v8:7748
Change-Id: Id5b5050aa03591281632e3a2a161aa93422e10bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071406
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76135}
2021-08-06 13:35:37 +00:00
Clemens Backes
fee168ce06 [wasm] Check correctness of thread-local write protection
We make an undocumented assumption in {CodeSpaceWriteScope} that a
single thread will only work on one module at a time. If this is
violated, the thread-local {code_space_write_nesting_level_} would
prevent the second module from being switched to writable.

This CL adds a second thread local (in debug only) to check that if
there is already a {CodeSpaceWriteScope} open that it contains the same
{NativeModule} as any nested scope.

R=jkummerow@chromium.org

Change-Id: I43fa886d9d0fdf0e1846137dc411745fcca471fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074477
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76134}
2021-08-06 13:34:34 +00:00
Santiago Aboy Solanes
4a7abdc32a [sab] Make TypedArraySlice FastCopy atomic for SABs
Bug: chromium:1237153
Change-Id: If3c17d46cf53ba73cd6c199703b2854eb55fb68d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077145
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76133}
2021-08-06 13:14:16 +00:00
Junliang Yan
674517a2cc ppc: [liftoff] Add cp to kLiftoffAssemblerGpCacheRegs list
Change-Id: Iec59381ae9111de130070197c26212a8f9c18159
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3076061
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76132}
2021-08-06 12:43:55 +00:00
Junliang Yan
06f7ed704a ppc: [liftoff] Fix AndU64 issue with signed value
Change-Id: Id8ac0df2ac107c1bfc68b852f47e5928b0fe098e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3076062
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76131}
2021-08-06 12:32:21 +00:00
Liviu Rau
d36199d2ae Revert "Make autoroll account owner of auto-updated files"
This reverts commit 09249d123e.

Reason for revert: closes the tree with "gclient runhooks" on https://cr-buildbucket.appspot.com/build/8839654272213578577 V8 Presubmit from 09249d123e

Original change's description:
> Make autoroll account owner of auto-updated files
>
> Bug: v8:12049
> Change-Id: Iff1d09a17c3e0bbcd7b62baae7766d3745d0b084
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071212
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Liviu Rau <liviurau@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#76129}

Bug: v8:12049
Change-Id: Id21c3ef4ea99b29f3c458508da8e27ce0d687d65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077148
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76130}
2021-08-06 10:40:25 +00:00
Liviu Rau
09249d123e Make autoroll account owner of auto-updated files
Bug: v8:12049
Change-Id: Iff1d09a17c3e0bbcd7b62baae7766d3745d0b084
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071212
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76129}
2021-08-06 10:29:15 +00:00
Derek Tu
8c5b3bed17 [riscv64] Add RISC-V C-Extension Logic to macro-assembler
Lets the macro-assembler compile RISC-V C-Extension instructions
when the corresponding flag is set during runtime.

Change-Id: I443d026653b9945ac7ccff41b0ca3f7db9b65775
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3039384
Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/master@{#76128}
2021-08-06 07:33:40 +00:00
v8-ci-autoroll-builder
892af6645f Update V8 DEPS.
Rolling v8/base/trace_event/common: 1169114..3da1e2f

Rolling v8/build: e360729..1ed6f53

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/cb61e19..2e0d77d

Rolling v8/third_party/depot_tools: 0a4dd41..bbf0599

Rolling v8/tools/clang: dd02422..6a8e571

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

Change-Id: I2f211928dd79fb0b8ffd6282acc16f8ce1faa8f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077639
Reviewed-by: 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/master@{#76127}
2021-08-06 03:50:09 +00:00
Adenilson Cavalcanti
948dd6b15a [pac][bti] Activate branch protection flag for ARM64
Verify if Chromium's flag was enabled and toggle the flag
for V8, enabling support for PAC (Pointer Authentication Code)
and BTI (Branch Target Identification).

Bug: v8:10026, chromium:1145581, chromium:919548
Change-Id: I7c40674d2f9c8512639a7320b491006697420e28
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3072158
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76126}
2021-08-05 18:17:30 +00:00
Camillo Bruni
81814ed445 [promise] Avoid stack overflow with context promise hooks in C++
This was handled in JS but not in C++.

Bug: chromium:236703, v8:11025
Change-Id: Ic9adc4ceb4d2af2614427fec459c3e950654572f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074460
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76125}
2021-08-05 16:08:16 +00:00
Camillo Bruni
f9ff62d295 [modules] Fix --trace-module-status
Make sure we update the module status before accessing it's code object
in PrintStatusTransition.

Bug: v8:11949
Change-Id: Ide1745eeeb0d5612034a42680d99fb97a9b110ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3075361
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76124}
2021-08-05 16:06:59 +00:00
Thibaud Michaud
7696ae836b [wasm][fuzzer] Generate test before compilation
Generate the test case before compilation, so that we can generate it
even if compilation crashes.
We can only do this when require_valid is true. Otherwise the test case
depends on whether the module compiles or not.

R=ahaas@chromium.org
CC=​khismet@google.com

Bug: v8:11954
Change-Id: I944e867cc7ca631bff749bd67c4b8baff1df1fa9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074476
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76123}
2021-08-05 15:02:21 +00:00
Victor Gomes
208854bb14 [baseline] Skip fix reference if no GC
If no GC happens when we grow the assembler buffer (this could happen
since we allocate a new Code object), we do not need to fix references
to full-embedded-objects.

Bug: v8:11872
Change-Id: I11fb1abcb4c53e124bb7659c9f9995ccb18cf296
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3073741
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76122}
2021-08-05 13:58:58 +00:00
Junliang Yan
aba716e6df ppc: [liftoff] optimize FillStackSlotsWithZero
Change-Id: Ic2576da8adff6935758ecae14ce5441d8af6428b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3075123
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76121}
2021-08-05 12:57:18 +00:00
Junliang Yan
c5faf5bab1 ppc: [liftoff] fix fp64 and simd handling
Change-Id: I3d75f2e5fdb9c43b4795dee80377725318ee271f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3075122
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76120}
2021-08-05 12:54:38 +00:00
Jakob Gruber
e7d8e978b9 [compiler] Change all JS operators to hold TinyRefs instead of handles
Bug: v8:7790
Change-Id: Ia5903364a774bd49db1a646b3066b9972deac725
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074465
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76119}
2021-08-05 12:32:38 +00:00
Jakob Gruber
b460a69d0b [compiler] Introduce TinyRef and use it in CreateArrayParameters
Bug: v8:7790
Change-Id: I299678102254ffb7d68be3d5cad11b4a4161492f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3068947
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76118}
2021-08-05 12:11:28 +00:00
Jakob Gruber
f247702386 Reenable test-cpu-profiler/DetailedSourcePositionAPI_Inlining
Forgot to do this in crrev.com/c/3067226.

Bug: v8:7790,v8:12030
Change-Id: Ic6fbf3feb07e8d08f0fd83d76d54535387c7a27c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074464
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76117}
2021-08-05 11:18:41 +00:00
Andreas Haas
5edf595773 [wasm] Limit the reservation for shared wasm memory on 32-bit systems
This CL limits the amount of address space we reserve for shared
WebAssembly memory. Up until now we just reserved either the defined
maximum size of the memory or the V8-defined maximum memory size,
depending on whether the maximum size is defined or not. This could
cause OOMs easily on 32-bit systems due to address space exhaustion.
With this CL we limit the amount of address space we reserve for shared
WebAssembly memory.
1) We try to reserve at least the initial size;
2) If no maximum size is defined, we reserve 1GB by default;
3) If a maximum size is defined, then we reserve that maximum size
   but at most 1GB.

Note that the handling of shared memory here is different than the
handling of not-shared memory because for shared memory it is not
possible to grow with realloc.

R=clemensb@chromium.org

Bug: v8:12038
Change-Id: I00493b330ee00588d65cbffa6f042e039106736e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071206
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76116}
2021-08-05 11:17:38 +00:00
Mythri A
dae3e24b33 [sparkplug] Update DCHECK to work with fuzzers
There was a DCHECK to ensure tests don't miss enabling either bytecode
or baseline code flushing along with stress-flush-code. Fuzzers use
different combination of flags so there we should allow
stress-flush-code without bytecode / baseline code flushing.

Bug: chromium:1236614,v8:11947
Change-Id: I86190b6336015e37288cffffc05de2fa21f496ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074462
Commit-Queue: Mythri Alle <mythria@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Mythri Alle <mythria@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76115}
2021-08-05 11:06:48 +00:00
Jakob Gruber
e09d77a237 Trigger full source position collection when needed
Optimizing compilation can no longer collect source positions on demand
since it may now run concurrently without serialization.

Instead, we now collect full source positions when any component that
needs them is enabled (profiler, debugger).

Bug: v8:7790,v8:12030
Change-Id: I6a2a82eb2b0d3e92121e101b4d9bf330c1f6c065
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3067226
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76114}
2021-08-05 10:29:21 +00:00
Jakob Gruber
05797b097c [compiler] Remove kSerializedHeapObject and CreateDataFunctors
ObjectDataKind::kSerializedHeapObject is no longer in use.

Remove the CreateDataFunctors since creation code is now simple
and uniform enough to inline.

Bug: v8:7790
Change-Id: I90009373b4f6b5e1b0ed90c7ccff323dc9821ed8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3073740
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76113}
2021-08-05 10:08:38 +00:00
Camillo Bruni
2ff27b4633 [profiler] Minor CollectSourcePositionsForAllBytecodeArrays improvement
Skip over SFIs that already have source position available.

Bug: v8:7790
Change-Id: Iaea51fe1e4cec9e3291a258a1c60b2354afa8525
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3074239
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76112}
2021-08-05 10:06:48 +00:00
Camillo Bruni
fffcbaea55 [counters] Fix reentrant timers for V8.Execute
This CL fixes a long standing issue where reentering TimedHistograms
scopes would cause spurious measurements. Only the non-nested scopes
yielded correct results.

Due to the changed numbers, the V8.Execute histogram is renamed to
V8.ExecuteMicroSeconds. Note that this histogram is also guarded
behind the --slow-histograms flag due to the additional overhead.

Unlike before, it does no longer include time for external callbacks
and only measures self time. The following example illustrates the
new behaviour:

1. Enter V8:           |--+.......+--| self-time: 4 units (reported)
2. Exit V8 (callback):    |-+...+-|    self-time: 2 units (ignored)
3. Re-enter V8:             |---|      self-time: 3 units (reported)

This would result in 2 histogram entries with 4 time units for the first
V8 slice and 3 units for the nested part. Note that the callback time
itself is ignored.

This CL attempts to clean up how TimedHistograms work:
- Histogram: the base class
- TimedHistograms: used for time-related histograms that are not nested
- NestedTimeHistograms: Extends TimedHistograms and is used for nested
  histograms

This CL changes Histograms to not measure time themselves. Measurements
happen in the *HistogramScopes:
- BaseTimedHistogramScope: Base functionality
- TimedHistogramScope: For non-nested measurements
- NestedTimedHistogramScope: For nested measurements
- PauseNestedTimedHistogramScope: Ignore time during a given scope.
  This is used to pause timers during callbacks.

Additional changes:
- ExternalCallbackScope now contains a PauseNestedTimedHistogramScope
  and always sets VMState<EXTERNAL>

Bug: v8:11946
Change-Id: I45e4b7ff77b5948b605dd50539044cb26222fa21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3001345
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76111}
2021-08-05 10:03:08 +00:00
Jakob Gruber
549eff77b4 [compiler] Fix ref construction in SFIRef::scope_info
It was missing an AssumeMemoryFence.

Bug: v8:7790,chromium:1236612
Change-Id: Icd3ed9f9979b0ba287c9dff7f4f8722ac06e859a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3073739
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76110}
2021-08-05 09:44:58 +00:00
Thibaud Michaud
51f566481d [wasm][eh] Add WebAssembly.Tag.toStringTag()
R=jkummerow@chromium.org

Bug: v8:11992
Change-Id: I4229a6fff8d956a5baa9ab9d5028f9abc20d4039
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071405
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76109}
2021-08-05 09:17:58 +00:00
Thibaud Michaud
2ae50a3458 [wasm][eh] Fix initial map for W.Exception
Just re-use the error constructor's initial map for the
WebAssembly.Exception constructor, instead of creating a new one.

R=jkummerow@chromium.org

Bug: v8:11992
Change-Id: If1ee53a1e9492c9ab4b59e363b388260ff097cf5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071211
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76108}
2021-08-05 09:11:58 +00:00
Liu Yu
12b81e8ea5 [mips][liftoff] Add code comments for large stack checks
Port 9e0e2c150c

Bug: v8:12017
Change-Id: Ie722834291a3e23a391da741b17f84f3179bcdaf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3070386
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#76107}
2021-08-05 08:31:48 +00:00
Liu Yu
821e02d89c [mips][wasm] Use a consistent limit for large frames
Port f7de8c8062

Bug: v8:12017
Change-Id: I5099254936e2402d4dcf19a52c8ca8726d07f621
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3070384
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#76106}
2021-08-05 08:22:48 +00:00
Liu Yu
ec7b99d5c6 [mips][baseline] Retry compiling on-heap when growing buffer
Port fb4f89aede

Bug: v8:11872

Change-Id: I662394f7bc0e7f7563b6a8939e5badfa2895f37e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3072323
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#76105}
2021-08-05 07:17:41 +00:00
Jakob Gruber
4371d88d9d Don't attempt to create source positions for unfinalized scripts
For streaming compilation, scripts don't have a source string attached
until finalization, but the Script and SharedFunctionInfo objects are
already on the heap and may be picked up by heap walks.

This happens e.g. in CollectSourcePositionsForAllBytecodeArrays, where
we then try to reparse and recompile the SFI. This is invalid, since
the source string is not yet set.

Avoid this by checking for the empty source string (and leaving a TODO
for a nicer future solution).

Bug: v8:12051
Change-Id: Ib4f40cd218151120e5aff8558dd5df5c8834412e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071403
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76104}
2021-08-05 05:50:38 +00:00
v8-ci-autoroll-builder
d589411f72 Update google_benchmark
Rolling v8/third_party/google_benchmark/src: 1067dfc..4124223

Change the default value of `--benchmark_filter` from "." to <empty> (#1207) (Vy Nguyen)
https://chromium.googlesource.com/external/github.com/google/benchmark/+/4124223

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

Change-Id: I3d4874758a667ef41ad05d7faeaacee8ad71e2ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071615
Reviewed-by: 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/master@{#76103}
2021-08-05 05:42:38 +00:00
Omer Katz
1525e951dc cppgc: Fix comment
Change-Id: I64c06cad84e613ecfb3c582c1ac8a97f6d4e6692
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071215
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76102}
2021-08-05 04:43:48 +00:00
v8-ci-autoroll-builder
671c664801 Update V8 DEPS.
Rolling v8/build: cff8a26..e360729

Rolling v8/third_party/aemu-linux-x64: DxCnfY154Xn-UYrZ-GF8FewyGfo29cYHkKdDMgpEHJkC..Nw0OOp4j9l4Sj0WpOmaRhNeJ137UfsLg0P1YrF8uzKwC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/61f0e50..cb61e19

Rolling v8/third_party/depot_tools: a806594..0a4dd41

Rolling v8/third_party/icu: 2a822c5..75e34bc

Rolling v8/tools/luci-go: git_revision:db421da12bad8e57f97ee45b24147e34ec882007..git_revision:467ab48f5ed9f3ef32ae17f5b73a117e0c86566b

Rolling v8/tools/luci-go: git_revision:db421da12bad8e57f97ee45b24147e34ec882007..git_revision:467ab48f5ed9f3ef32ae17f5b73a117e0c86566b

Rolling v8/tools/luci-go: git_revision:db421da12bad8e57f97ee45b24147e34ec882007..git_revision:467ab48f5ed9f3ef32ae17f5b73a117e0c86566b

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

Change-Id: I4006df2bfd8824d5a680d0c24b39f5b4a29f11b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071613
Reviewed-by: 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/master@{#76101}
2021-08-05 03:45:48 +00:00
Shu-yu Guo
68043e340c [typedarray] Throw when constructing a TA with another TA of mixed BigInt-ness
Bug: v8:12052
Change-Id: I2169d06340e49b014c1c24dbc3d5cf3e213b36c2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071903
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76100}
2021-08-04 21:55:38 +00:00
Milad Fa
1c50ffb971 PPC/s390: [masm][ia32][arm] Introduce helper to drop arguments.
Port 6e474ae947

Original Commit Message:

    This CL is a port of https://crrev.com/c/3045349 for ia32 and arm,
    adding helper methods to drop arguments from the stack.

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

Change-Id: I7099bd98285eb22cc1cbf3abd634b3479fe9e9d9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3072539
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76099}
2021-08-04 20:40:18 +00:00
Clemens Backes
61150c17be [liftoff] Refactor options for Liftoff compilation
The number of arguments for the LiftoffCompiler has grown significantly
since its initial implementation, and it becomes hard to keep track of
all options at the call sites.

This CL refactors all optional parameters into a {LiftoffOptions} struct
which has a factory-like interface.
This will allow us to add more options in the future, e.g. for dynamic
tiering.

R=thibaudm@chromium.org

Change-Id: I66697bb2f99b676a84c158304cc3a285e1b077d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3069148
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76098}
2021-08-04 16:48:48 +00:00
Benedikt Meurer
c2f30c2b3f [inspector] Fix positions for inline scripts with #sourceURL.
For inline scripts that have a `// #sourceURL=foo.js` annotation, the
V8 inspector (and by extension `Error.stack`) currently operates in
terms of the `foo.js`, i.e. doesn't give any hint about the actual
source, except for the line/column offsets reported upon scriptParsed.
However in case of stack frames (i.e. as part of `Error.stack` or as
part of the call frames reported via CDP), the line/column offsets are
relative to the actual source instead of relative to the `foo.js` part,
which - besides other things - makes post-processing of recorded stack
traces tricky (sometimes impossible).

This change adjusts the source positions reported for (inline) scripts
with sourceURL annotations to be relative to the (inline) script instead
of the surrounding document.

Bug: chromium:1183990
Fixed: chromium:578269
Change-Id: I74f2b93c22ec43ca796b6b51faa9df5b99cf03f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3069289
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76097}
2021-08-04 15:53:57 +00:00
Thibaud Michaud
1b1b45726d [wasm][eh] Add WebAssembly.Exception.is()
R=jkummerow@chromium.org

Bug: v8:11992
Change-Id: I9fd1eabf70408f6abc4480c999ac26bf5d8ccd8d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3067321
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76096}
2021-08-04 15:40:37 +00:00
Patrick Thier
6e474ae947 [masm][ia32][arm] Introduce helper to drop arguments.
This CL is a port of https://crrev.com/c/3045349 for ia32 and arm,
adding helper methods to drop arguments from the stack.

Drive-by: Add RootAsOperand to ia32.

Bug: v8:11112
Change-Id: I07b753d51b9fc9fc91bf09618b1315d146827123
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3069157
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76095}
2021-08-04 14:36:51 +00:00
Omer Katz
a92f70d86c cppgc: Fuchsia can allocate stack below 4GB
crrev.com/c/3069146 fixed a write barrier issue leading to a null
dereference on Windows that was triggered by having the stack allocated
at address below 4GB.
Turns out the same can happen on Fuchsia.

Bug: chromium:1230763, chromium:1056170
Change-Id: I74ba0b465c3230b4274f2c23d279c4f73183eddb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071402
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76094}
2021-08-04 14:30:11 +00:00
Junliang Yan
f41476bf20 ppc: [liftoff] cleanup unimplemented macros
Change-Id: Ib5e44e60c60afdc3c3527c882056610d72ed5e7b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071518
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#76093}
2021-08-04 14:15:30 +00:00
Victor Gomes
fb4f89aede [baseline] Retry compiling on-heap when growing buffer
Bug: v8:11872
Change-Id: I6d133ee33b48fa1f02442564b6a30d56986758eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071401
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76092}
2021-08-04 14:08:30 +00:00
Clemens Backes
936debb569 [traphandler] Fix ProbeMemory on Mac release builds
For some reason, the "ret" instruction goes missing on Mac release
builds, probably because the compiler decides to split the inline
assembly block and move the "v8_probe_memory_continuation" block
somewhere else. This CL fixes that by adding another explicit "ret" at
the end of "ProbeMemory".

Also, we remove the "v8_probe_memory_address" symbol (which is identical
to just "ProbeMemory"), to prevent the compiler from splitting
"ProbeMemory" and "v8_probe_memory_address".

R=ahaas@chromium.org

Bug: v8:11955
Change-Id: I2e63b2db94206e329be214ab7b553ab502d6ecc2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071202
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76091}
2021-08-04 14:04:00 +00:00
Patrick Thier
d4711df350 [sparkplug] Fix maximum frame size in prologue.
Maximum frame size (in bytes) is used to check for stack overflows
in the prologue.
The maximum number of call arguments is pre-calculated and included
in this check. However the count was added to the frame size wihout
converting the count to bytes, resulting in inaccurate stack overflow
checks.

Bug: chromium:1235182
Change-Id: I21bca4e183fccfd055f2f1d5a40b71651c14b911
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071399
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76090}
2021-08-04 13:58:00 +00:00