Commit Graph

68580 Commits

Author SHA1 Message Date
Camillo Bruni
7c554080d9 [factory] Make FactoryBase::NewStructInternal inlineable
Move NewStructInternal to header and templatize it to unroll
initialisation loop.

Bug: v8:11263
Change-Id: Iaaf2929c9a17b9195177b6afa7087b9b4ed6f0b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2821706
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74088}
2021-04-21 11:38:01 +00:00
Sathya Gunasekaran
ba6ba5cd84 Revert "[compiler] Perform MapRef's SupportsFastArray methods concurrently"
This reverts commit ebd9dcdaac.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20gcc/11378/overview

Original change's description:
> [compiler] Perform MapRef's SupportsFastArray methods concurrently
>
> We are safe to go through the native_contexts_list_ since we do it
> through IsAnyInitialArrayPrototype which disallows the GC. Furthermore,
> we read that list with an acquire load which guarantees that the fields
> have been initialized.
>
> Bug: v8:7790
> Change-Id: I778d51f4ead44e472f842693a7e9ff577d6acfe3
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2826541
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74086}

Bug: v8:7790
Change-Id: I4ef0056fb5ab9bd037375f67ec704f842e003283
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843360
Auto-Submit: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74087}
2021-04-21 10:20:41 +00:00
Santiago Aboy Solanes
ebd9dcdaac [compiler] Perform MapRef's SupportsFastArray methods concurrently
We are safe to go through the native_contexts_list_ since we do it
through IsAnyInitialArrayPrototype which disallows the GC. Furthermore,
we read that list with an acquire load which guarantees that the fields
have been initialized.

Bug: v8:7790
Change-Id: I778d51f4ead44e472f842693a7e9ff577d6acfe3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2826541
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74086}
2021-04-21 09:50:04 +00:00
Camillo Bruni
8003bbbee6 [sparkplug] Preallocate instruction buffer
We have roughly a 7x (5x on ia32) ratio between bytecode and sparkplug
code. Using this number to preallocate the buffer for the emitted code
we can avoid a few copies for larger functions.

Drive-by-fix: Make sure EnsureSpace is marked V8_INLINE

Bug: v8:11420
Change-Id: I6ec48717d2e030c6118c59f5cdc286c952ec2843
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2835732
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74085}
2021-04-21 09:48:20 +00:00
Manos Koukoutos
cc0d6a85d5 [turbofan] LoadImmutable should be eligible as memory operand
Bug: v8:11510

Change-Id: I6cb4bdb45a735bd85adfa02b92f01cd144517560
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2840324
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74084}
2021-04-21 09:44:00 +00:00
Georg Neis
d5feb5c08f [runtime] Weaken a DCHECK
It can happen that the {value} handle initially (when we stored its
contents into the property cell) contained a ThinString but was
subsequently patched by the scavenger to hold the InternalizedString
directly.

Bug: v8:11675
Change-Id: Ia3e5fed5bd28313b6fd2031eee0658ac4136a7ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843350
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74083}
2021-04-21 09:12:00 +00:00
Jakob Gruber
a8a8e6b797 Remove FlagScope use in test-js-to-wasm.cc
Flag reads from background threads are unfortunately scattered and
hard to completely avoid in the current state of V8. An example TSAN
failure:

ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN/36369/overview

The root cause is that FlagScope destruction modifies flag values on
the main thread, racing with flag reads from the background thread. In
cctests, there's no need to reset flags back to initial values at the
end of tests. Let's simply remove the problematic flag scopes.

Bug: v8:11658
Change-Id: I59ed3794ddc9ed570772726a423dc22afc4dc207
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843346
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74082}
2021-04-21 09:07:20 +00:00
Leszek Swirski
92b6c12d04 [base] Optimize VLQ
Templatize the VLQ methods to avoid std::function overheads, and add a
few optimisations (small value fast path, split writing and tagging).

Change-Id: I840d60c972916d1a6023c8ea2a67bbd540f2d159
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839554
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74081}
2021-04-21 08:53:35 +00:00
Sara Tang
a154ce984a [diagnostics] Fix node-v8 build
Turning on V8_ENABLE_SYSTEM_INSTRUMENTATION by default has broken
node-v8 builds on Windows, tracked here:
https://github.com/nodejs/node-v8/issues/192. It looks like it is due
to the fact that Node uses pre-compiled headers, which undefines
some macros needed for the event trace APIs to work. (see
src/base/win32-headers.h)

Bug: v8:11043
Change-Id: I3a6caeaaabab59d42e14b79defb2e37efd9ad04d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2830550
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Sara Tang <sartang@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#74080}
2021-04-21 08:52:30 +00:00
Maya Lekova
c8e8f482f3 [test] Fix a crash in fast API interface types test
This CL hardens the test facility in d8 for interface types for
the fast C API.

Bug: chromium:1201011
Change-Id: Ibfe1bb242f86b4a5edd0d195e049852430f8a2fe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843344
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74079}
2021-04-21 08:20:00 +00:00
Wenyu Zhao
2cd77745d9 [heap] Fix failed tests when enabling single generation
* Filtered some tests that rely on incremental_marking and shape tracking

Bug: v8:11644
Change-Id: Ic9833bf1e49e6413422484858cd1054dd2500092
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2822284
Commit-Queue: Wenyu Zhao <wenyu.zhao@anu.edu.au>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74078}
2021-04-21 07:33:51 +00:00
Maya Lekova
1786ab50dc [test] Disable fast API test on incompatible variants
The compiler/fast-api-interface-types test is incompatible with
jitless and stress_snapshot, so this CL disables it on these two
variants. This fixes a failure on FYI bots:
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20fyi/21641/overview

The test was first introduced in
https://chromium-review.googlesource.com/c/v8/v8/+/2835711.

Change-Id: I0f9e2cc5d444673a1ad2ca9f16cd789fc2c2a814
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843343
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74077}
2021-04-21 06:50:30 +00:00
Ng Zhi An
d8ce100f0e [wasm-simd][x64][ia32] Factor f32x4.extract_lane into shared code
Bug: v8:11589
Change-Id: I90a0c9f8325eb56c607addf1adde60673dfbc9c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2840688
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74076}
2021-04-20 23:02:40 +00:00
Frank Tang
5067f0497b [Intl] Update ICU to 69-1
Diary https://docs.google.com/document/d/1T60FUG62FuvZ447FNoK81uE1fgJ7bayPf_w-rPqFrFM
81d6568..7e7574bd

chrome DEPS rolling https://chromium-review.googlesource.com/c/chromium/src/+/2824939

Bug: chromium:1193795
Change-Id: Ibccb97fe9b6b0601676800dea6c066e0d66a0a6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2793151
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74075}
2021-04-20 22:37:09 +00:00
Ulan Degenbaev
c21f6c1f0d [test] Skip flaky inspector/runtime-call-stats/enable-disable
Enabling and disable RCS at runtime races with concurrent threads
that use RCS.

Bug: v8:11338
Change-Id: I8fa9edcbaefc339f88b2a0d079d094a7e4290fbf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2840446
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74074}
2021-04-20 18:05:49 +00:00
Ng Zhi An
b699d1dc57 [wasm-simd][x64][ia32] Factor f32x4.splat into shared code
Bug: v8:11589
Change-Id: I13c57e1dcc77345bcc9d95a14cf878db6dd60e02
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2837589
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74073}
2021-04-20 17:30:09 +00:00
Dan Elphick
82beb6fc81 [build] Move deps for platform inline interface-descriptors headers
Moves the platform-specific interface-descriptors-<platform>-inl.h into
the v8_internal_headers target so interface-descriptors-inl.h can
include them. (Fixes 1 gn check error).

Bug: v8:7330
Change-Id: Id07635e93a4574b733d258ddba558b106d95c05f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2840448
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74072}
2021-04-20 15:50:06 +00:00
Stephen Belanger
c0fceaa066 Reland "[api] JSFunction PromiseHook for v8::Context"
This is a reland of d5457f5fb7
after a speculative revert.

Additionally it fixes an issue with throwing promise hooks.

Original change's description:
> [api] JSFunction PromiseHook for v8::Context
>
> This will enable Node.js to get much better performance from async_hooks
> as currently PromiseHook delegates to C++ for the hook function and then
> Node.js delegates it right back to JavaScript, introducing several
> unnecessary barrier hops in code that gets called very, very frequently
> in modern, promise-heavy applications.
>
> This API mirrors the form of the original C++ function based PromiseHook
> API, however it is intentionally separate to allow it to use JSFunctions
> triggered within generated code to, as much as possible, avoid entering
> runtime functions entirely.
>
> Because PromiseHook has internal use also, beyond just the Node.js use,
> I have opted to leave the existing API intact and keep this separate to
> avoid conflicting with any possible behaviour expectations of other API
> users.
>
> The design ideas for this new API stemmed from discussion with some V8
> team members at a previous Node.js Diagnostics Summit hosted by Google
> in Munich, and the relevant documentation of the discussion can be found
> here: https://docs.google.com/document/d/1g8OrG5lMIUhRn1zbkutgY83MiTSMx-0NHDs8Bf-nXxM/edit#heading=h.w1bavzz80l1e
>
> A summary of the reasons for why this new design is important can be
> found here: https://docs.google.com/document/d/1vtgoT4_kjgOr-Bl605HR2T6_SC-C8uWzYaOPDK5pmRo/edit?usp=sharing
>
> Bug: v8:11025
> Change-Id: I0b403b00c37d3020b5af07b654b860659d3a7697
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2759188
> Reviewed-by: Marja Hölttä <marja@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Anton Bikineev <bikineev@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73858}

Bug: v8:11025
Bug: chromium:1197475
Change-Id: I73a71e97d9c3dff89a2b092c3fe4adff81ede8ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2823917
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74071}
2021-04-20 14:49:46 +00:00
Junliang Yan
6e4769bf9f s390x: move ceil/floor/trunc/nearestint op to TurboAssm
Change-Id: I2925b0d1378736d3b357e5be7070b6b37510cbff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2840325
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74070}
2021-04-20 14:47:26 +00:00
QiuJi
aad52cc5fa [riscv64] Change one of the owners for RISCV.
Change-Id: I34d31032b8f1704ddea6334398a4ff2198cc192d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2822631
Reviewed-by: Brice Dobry <brice.dobry@futurewei.com>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
Cr-Commit-Position: refs/heads/master@{#74069}
2021-04-20 14:39:26 +00:00
Liu Yu
90c7297faa [mips][codegen] Add static interface descriptors
Port: 2871e05cc3

Bug: v8:11420
Change-Id: Id4e060ba95d7eb19c0a0a3f5eb224be5eb46fa8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839017
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#74068}
2021-04-20 13:48:46 +00:00
Camillo Bruni
d84fc42900 [gn] Fix v8_code_comment assertion
Change-Id: Ia553e38ca65587c16c36c736c2b9ca9b686ed3e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839561
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74067}
2021-04-20 13:37:26 +00:00
Santiago Aboy Solanes
1f187e1282 [compiler] Mark Map's is_migration_target as atomic
Mistakenly had its set as non-atomic when it was modifying maps the
concurrent compiler could see. Since this accessor is set after map
initialization, but it is not necessary for synchronization we can set
it as relaxed write.

Bug: v8:7790, v8:11668
Change-Id: I605935e96b3da47ed6abfb6676bf14456feeeddd
Fixed: v8:11668
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839548
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74066}
2021-04-20 13:27:11 +00:00
Ulan Degenbaev
1cac58d58e [test] Fix flaky unittests/RuntimeCallStatsTest.GarbageCollection
The test fails because of the race condition between concurrent GC
threads and the destructor of the test.

Bug: v8:11413
Change-Id: I5a138a61c16ddf2398e7c54defe6cc4008ca3330
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839552
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74065}
2021-04-20 13:15:36 +00:00
Maya Lekova
5540fbfce5 Reland "[fastcall] Add support for leaf interface type checks"
This is a reland of 6124a534b2

It fixes a UAF issue in the d8 test by moving the test API object
constructor to PerIsolateData. It also fixes a crash in Chromium
caused by current usage of v8::ApiObject, which should be migrated
to v8::Value*.

Original change's description:
> [fastcall] Add support for leaf interface type checks
>
> This CL adds an IsTemplateForApiObject method to FunctionTemplate
> allowing the embedder to check whether a given API object was
> instantiated by this template without including parent templates
> in the search. It also replaces the v8::ApiObject in the fast API
> with a raw v8::Value pointer to allow use of standard C++ casts.
>
> Bug: chromium:1052746
> Change-Id: I0812ec8b4daaa5f5005aabf10b63e1e84e0b8f03
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595310
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73999}

Bug: chromium:1052746, chromium:1199900
Change-Id: I4b7f0c9e9152919dde4a1d0c48fbf5ac8c5b13d8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2835711
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74064}
2021-04-20 12:44:38 +00:00
Jochen Eisinger
c6f2332af7 Add gn flag for enabling javascript promise hooks
Change-Id: Iae17977cec9520cf0194b5686ec31f0501f866f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839556
Auto-Submit: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74063}
2021-04-20 12:38:46 +00:00
Patrick Thier
bb070c662d Reland "[test] Rework Allocation Site Pretenuring Tests"
This is a reland of df52b65dba

Skip test with variant stress-concurrent-allocation.
The test manually triggers pretenuring for allocation sites, but with
--stress-concurrent-allocation these pretenuring decisions are reset
due to low survival rate in old generation.

Original change's description:
> [test] Rework Allocation Site Pretenruing Tests
>
> - Add %PretenureAllocationSite to manually force pretenuring for an
> allocation site during the next GC.
> - Replace cctest test-compiler/DecideToPretenureDuringCompilation, which
> was not triggering the tested behaviour anymore with mjsunit test
> - Add tests for deoptimizations due to pretenuring decision changes
> during OSR.
>
> Bug: chromium:1193094
> Change-Id: I5d6c35e2914b705bf96f27051a4a286413b6fe26
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2825593
> Commit-Queue: Patrick Thier <pthier@chromium.org>
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74032}

Bug: chromium:1193094
Change-Id: I366a4a074435ebffcf2b3af84152067731cd2a5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839550
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74062}
2021-04-20 12:03:16 +00:00
Dominik Inführ
bc2f9f23c0 [heap] Support incremental marking with --track-retaining-path
This allows using --track-retaining-path with incremental marking
enabled. This CL will also track when an object was kept alive through
the write barrier or the RetainMaps feature.

Bug: v8:11645
Change-Id: I08ab5e500ae3580aead0c188c2caeb8f2a5f9f07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2829440
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74061}
2021-04-20 11:56:26 +00:00
Jakob Gruber
baf0e50884 [compiler] Fix missing include
Introduced in crrev.com/c/2833919.

Tbr: mslekova@chromium.org
Bug: v8:7790
Change-Id: I885aa1034f0edb99a6cb698f08361f5c1bf26389
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839549
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74060}
2021-04-20 11:17:46 +00:00
Sathya Gunasekaran
4499f9d2cf Revert "Resolving or rejecting promises doesn't execute script"
This reverts commit f2741b13ba.

Reason for revert: breaks blink linux bot https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Blink%20Linux%20Debug/9089/blamelist

Original change's description:
> Resolving or rejecting promises doesn't execute script
>
> It just enqueues a microtask.
>
> Bug: chromium:728583
> Change-Id: Iecbc6f33db8a94acd10d9ae1f2173700d872ac50
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2827906
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Commit-Queue: Jochen Eisinger <jochen@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74036}

Bug: chromium:728583
Change-Id: I09a750b9c5cf43adedb395949e246421eeaf0a09
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839547
Auto-Submit: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@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/master@{#74059}
2021-04-20 09:45:07 +00:00
Nico Hartmann
b9325542aa Reland "[TurboFan] Fix SpeculativeNumberEqual[Number] with undefined"
This is a reland of 7c7cdec537

Original change's description:
> [TurboFan] Fix SpeculativeNumberEqual[Number] with undefined
>
> Bug: chromium:1198309, v8:5660
> Change-Id: I9cb5f66643c0c0ab9b18ca953cf85d2f6aa84b42
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2827899
> Reviewed-by: Georg Neis <neis@chromium.org>
> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74038}

Bug: chromium:1198309
Bug: v8:5660
Change-Id: Ibf9b3abfb62778a970b791432458076cff46d033
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839544
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74058}
2021-04-20 07:44:38 +00:00
Jakob Gruber
fc2beecbda [compiler] Move heap-refs code to heap-refs.cc
This splits up js-heap-broker.cc into

- js-heap-broker.cc: the JSHeapBroker impl, and
- heap-refs.cc: ObjectRef and ObjectData impls, as well as two
  JSHeapBroker functions that closely deal with refs/data objects.

Bug: v8:7790
Change-Id: I7e097b60cdec4fd61b39d7de9752d536ac313cbe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2833919
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74057}
2021-04-20 07:37:46 +00:00
Sathya Gunasekaran
fbd114bd27 Reland "[ic] Add a new MegaDOM IC"
This is a reland of c83c9590ba

Changes since revert: nothing, issue was crbug.com/v8/11666

Original change's description:
> [ic] Add a new MegaDOM IC
>
> This patch implements the MegaDOM IC setup and access. A new MegaDOM
> IC state indicates that we've seen only DOM accessors at this access
> site.
>
> This CL only adds support for DOM getters in LoadIC, other kinds of
> access will be added in follow on CLs.
>
> Still remaining TODO before shipping:
> 1. Have a mechanism to invalidate the protector
> 2. Have a mechanism to find the accessors that aren't overloaded
> 3. Use a new builtin to miss to runtime on access check failure
>
> Change-Id: Ie12efe5e9fa284f023043b996d61e7d74e710ee2
> Bug: v8:11321
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2618239
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Mythri Alle <mythria@chromium.org>
> Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#73733}

Bug: v8:11321
Change-Id: I2bec54465542b5b40c42adb6eb12b6ce72cce5bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2794439
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74056}
2021-04-20 07:36:26 +00:00
Camillo Bruni
b477f36629 [assembler] Add build flag for --code-comments
- Add v8_code_comments to allow runtime-enabled code comments with
  --code-comments
- v8_code_comments is enable by default in debug mode
- Make MacroAssembler::RecordComment helper inlineable to remove
  call and check overheads when v8_code_comments = false
- Make FLAG_code_comments readonly if v8_code_comments = false and
  benefit from dead-code elimination

This saves roughly 5% CompileBaselineVisit time in sparkplug
on a 5MiB JS file.

Bug: v8:11420
Change-Id: I1174ab37b4bbe1ff8880416c1f6a6e28377a962c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2824428
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74055}
2021-04-20 07:25:23 +00:00
Jakob Gruber
b070ebdb77 [compiler] More skips for --stress-concurrent-inlining
Tbr: gsathya@chromium.org
Bug: v8:11668,v8:11649,v8:11576
Change-Id: I8bd0cb97d7682a8d752c5b78af6dfccd426be1d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2839543
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74054}
2021-04-20 06:39:24 +00:00
Ng Zhi An
65dd021b15 [wasm-simd] Add regression test for shuffle canonicalization
Bug: v8:11542
Change-Id: Ib2f369cbbd91f3da07bd8f60476321ec99265872
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2836825
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74053}
2021-04-19 23:29:44 +00:00
Ng Zhi An
b213a6fd88 [wasm-simd][x64][ia32] Factor i64x2.neg into shared code
Bug: v8:11589
Change-Id: I871ec1aecbac065e80c05309e478d814675c0d44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2828700
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74052}
2021-04-19 22:50:33 +00:00
Deepti Gandluri
39e32ac94a [wasm-simd] Remove the scalar lowering pass
Bug: v8:11613
Change-Id: Ica7fe5ca63fa3729614eb09ace26e679a88577ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2826728
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74051}
2021-04-19 20:52:03 +00:00
Zhi An Ng
3356078ae1 Revert "[wasm-simd][x64][ia32] Factor f64x2.replace_lane into shared code"
This reverts commit b824d85364.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20debug/36784/overview

Original change's description:
> [wasm-simd][x64][ia32] Factor f64x2.replace_lane into shared code
>
> This pblendw/movlhps combination has lower latency and requires less
> unop than pinsrq (1 v.s. 2).
>
> Bug: v8:11589
> Change-Id: I770b0c20a286774afefbac5ef0adffe463318f21
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2828871
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74049}

Bug: v8:11589
Change-Id: I1be96e59fdb844db1e228be3a09d4a06798a16c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2837805
Auto-Submit: Zhi An Ng <zhin@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/master@{#74050}
2021-04-19 20:23:05 +00:00
Ng Zhi An
b824d85364 [wasm-simd][x64][ia32] Factor f64x2.replace_lane into shared code
This pblendw/movlhps combination has lower latency and requires less
unop than pinsrq (1 v.s. 2).

Bug: v8:11589
Change-Id: I770b0c20a286774afefbac5ef0adffe463318f21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2828871
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74049}
2021-04-19 19:33:43 +00:00
Shu-yu Guo
090431b031 [ptr-cage] Factor out a VirtualMemoryCage and remove PtrComprCage
The plan is to use VirtualMemoryCage both for the pointer compression
cage as well as the code range in a future CL. The PtrComprCage class is
removed in favor of using VirtualMemoryCage directly.

Bug: v8:11460
Change-Id: I4e34a3db1359319e3539ede587f6a73e0af03eec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2824098
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74048}
2021-04-19 17:32:04 +00:00
Milad Fa
bab79d3c2e PPC/S390 [codegen]: Add placeholders instead of no_reg
After https://crrev.com/c/2831872 Baseline and Compare_Baseline
functions need to return proper registers as placeholders.

More details can be found on comment section of this port:
https://crrev.com/c/2830897

Change-Id: I7f91a85f9c85ce1813540b4d525f2dce5faaf279
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2836705
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74047}
2021-04-19 17:15:43 +00:00
Junliang Yan
1effec7b15 s390x: Clean up Double/FloatMin/Max
Change-Id: I358d4e811f47cb0975c488fc6c9c0c57648fe42e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2836325
Reviewed-by: Milad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74046}
2021-04-19 15:50:43 +00:00
Jakob Kummerow
bf74af74da [bigint] Move multiplication to src/bigint/
Also replace the schoolbook algorithm with an optimized version
that runs about twice as fast.
This also adds infrastructure to support interrupt checks from
BigInt library code.

Bug: v8:11515
Change-Id: I5f812913697384afca98937e1fb7361b4ec22d62
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2773043
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74045}
2021-04-19 15:40:43 +00:00
Santiago Aboy Solanes
ca42a5b86d [compiler] Skip DescriptorArray search in IsReadOnlyLengthDescriptor
We can hardcode the result and to make sure we are using the correct
offset, we now have a static_assert.

Change-Id: Ic04ce9f8e46847504d3d0a5921f55cb750f7f3ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831473
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74044}
2021-04-19 15:38:03 +00:00
Clemens Backes
cc2a446143 [codegen] Trim safepoints by removing trailing zeros
This saves quite some code space on wasm functions, which often do not
spill any tagged values (hence the safepoints will just be empty). It
also often saves a few bytes on code that actually spills tagged values,
but not to the highest frame slots.

R=jkummerow@chromium.org

Bug: v8:11630
Change-Id: I3bd77b3afcd2cf86a92ce5b302b5aa06ec0ed223
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2831873
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74043}
2021-04-19 15:14:01 +00:00
Milad Fa
b681c3093d s390: Revert "[wasm-simd] Canonicalize shuffles when creating TurboFan graph"
Port ede5e81439

Original Commit Message:

    This reverts commit d16eefe0f2.

    It is not correct to check for node equality during the graph
    construction phase, because we can have optimizations that will combine
    same nodes. So it can happen that in wasm-compiler, the inputs to
    shuffle are not the same, so we canonicalize using that knowledge that
    it will not be the same, and allow indices > 15. But later we can have
    optimizations that combine the 2 inputs (e.g. splat of the same
    constants), and the instruction selector will see that the input nodes
    are the same.

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

Change-Id: I0d388c814dc1c45f978d749218b8120bfd53bb03
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2835397
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74042}
2021-04-19 15:12:56 +00:00
Daniel Lehmann
8fffd56f86 [wasm] Allow execution while modifying code space
The --wasm-write-protect-code-memory flag previously enforced W^X, that
is the WebAssembly code space was either writable or executable, but
never both at the same time. With compilation in background threads
concurrent to execution in the main thread, this simple scheme is no
longer viable because the same memory page can indeed be written to and
executed at the same time. Hence, this flag is currently broken and
disabled and the code space is always writable AND executable.

As a first step towards more security, we at least want to
write-protect the code space (when not required writable by compilation
threads) but at the same time keep it always executable (because of
concurrent execution in the main thread). That is, we no longer switch
between RX and RW (W^X), but rather between RX and RWX
(write-protection only).

This CL starts to change from W^X (which was broken) to
write-protection only when enabling --wasm-write-protect-code-memory.
This is the first of two CLs, where the followup CL will fix the
feature, and this CL merely prepares and cleans up the code. In
particular, this CL changes the permissions from RW to RWX (due to
concurrent execution) and renames `WasmCodeAllocator::SetExecutable()`
to `WasmCodeAllocator::SetWritable()` (and similarly named callers) to
be consistent with that change. Since the code space is now always
executable, this CL also removes now unneeded calls to
`SetExecutable(true)` in tests.

R=clemensb@chromium.org
CC=​​jkummerow@chromium.org

Bug: v8:11663
Change-Id: I2065eed6770215892b81daefbddf74a349e783cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2835237
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Daniel Lehmann <dlehmann@google.com>
Cr-Commit-Position: refs/heads/master@{#74041}
2021-04-19 15:09:46 +00:00
Sathya Gunasekaran
09813c0b2f Revert "[TurboFan] Fix SpeculativeNumberEqual[Number] with undefined"
This reverts commit 7c7cdec537.

Reason for revert: speculative revert for https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8849515345192311664/+/u/Check_-_stress_concurrent_allocation/deopt-pretenure

Original change's description:
> [TurboFan] Fix SpeculativeNumberEqual[Number] with undefined
>
> Bug: chromium:1198309, v8:5660
> Change-Id: I9cb5f66643c0c0ab9b18ca953cf85d2f6aa84b42
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2827899
> Reviewed-by: Georg Neis <neis@chromium.org>
> Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74038}

Bug: chromium:1198309
Bug: v8:5660
Change-Id: I91eef4a6bb85245b82086c91798ca3d650854f52
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2836097
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74040}
2021-04-19 14:57:38 +00:00
Clemens Backes
cc53371605 Revert "[test] Rework Allocation Site Pretenruing Tests"
This reverts commit df52b65dba.

Reason for revert: fails on TSan: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20TSAN/36351/overview

Original change's description:
> [test] Rework Allocation Site Pretenruing Tests
>
> - Add %PretenureAllocationSite to manually force pretenuring for an
> allocation site during the next GC.
> - Replace cctest test-compiler/DecideToPretenureDuringCompilation, which
> was not triggering the tested behaviour anymore with mjsunit test
> - Add tests for deoptimizations due to pretenuring decision changes
> during OSR.
>
> Bug: chromium:1193094
> Change-Id: I5d6c35e2914b705bf96f27051a4a286413b6fe26
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2825593
> Commit-Queue: Patrick Thier <pthier@chromium.org>
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74032}

Bug: chromium:1193094
Change-Id: I0cd526984d467c4e1e3637ac642f630e3cffea41
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2835715
Auto-Submit: Clemens Backes <clemensb@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/master@{#74039}
2021-04-19 14:15:07 +00:00