Commit Graph

63793 Commits

Author SHA1 Message Date
Gus Caplan
331a293865 [Torque] Add flags to NewExpression
This allows `new (Pretenured) X{}` to force a pretenured allocation.

Bug: v8:7793
Change-Id: Ib09f186b3b503b9b23291c39c1390f120d25eebe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288409
Commit-Queue: Gus Caplan <me@gus.host>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68801}
2020-07-10 15:34:36 +00:00
Clemens Backes
bc52bf69c5 [liftoff][cleanup] Replace loop by straight-line code
This removes a loop that runs exactly one or two times by straight-line
code for the two cases. This should make it more readable and easier to
maintain.

R=thibaudm@chromium.org

Bug: v8:10576
Change-Id: I242bc4a7f7333b04ec39e79dc530625fb5e2305f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287505
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68800}
2020-07-10 15:31:45 +00:00
Clemens Backes
05298900ff [liftoff] Simplify ParallelRegisterMove
We often want to pass a list of moves of fixed length. Instead of
constructing an array on the caller's stack and passing it via
{ArrayVector}, we should just pass it via {std::initializer_list}. This
also avoids to spell out the internal name
{LiftoffAssembler::ParallelRegisterMoveTuple}.

R=thibaudm@chromium.org

Bug: v8:10576
Change-Id: Ibe7ac5a5a02686533333cb45652cbb2b99ad9c60
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287498
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68799}
2020-07-10 15:21:21 +00:00
Victor Gomes
6327b26105 [compiler] Use default call order in GetJSCallDescriptor
This change has no impact. It only changes the order of the arguments when using v8_enable_reverse_jsargs.

Change-Id: I6063da3703f0fa4a2b790e4291727dd7ff460dfa
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2292232
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68798}
2020-07-10 15:20:16 +00:00
Santiago Aboy Solanes
d4c91e7dc9 [csa][cleanup] Remove the use of non-typed Variables
Since we are not using CodeAssemblerVariables anymore, we can properly
scope the class so that the only way to instance one is through the
typed version (i.e TypedCodeAssemblerVariable).

Bug: v8:6949
Change-Id: I3ee99bcbb9421aadd0944af57f6452e832719758
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290858
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68797}
2020-07-10 14:32:55 +00:00
Omer Katz
b98a183171 cppgc: Add AccessMode template to DynamicallyMarkAddress
This will be needed later for concurrent marking

Bug: chromium:1056170
Change-Id: Iab7812d7ac8a30e3a54bd7c4b739077b293db775
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287869
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68796}
2020-07-10 14:17:25 +00:00
Zeynep Cankara
907270528c [tools] Landing page style fix
This CL attempts to change change content and change
format to increase accessibility.

Bug: v8:10664

Change-Id: Ic80e00310884ac64dc99fe053354250671cabfdd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290859
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Cr-Commit-Position: refs/heads/master@{#68795}
2020-07-10 14:15:03 +00:00
Zeynep Cankara
e6f11a460e [tools][system-analyzer] Add Stats panel
This CL attempts to encapsulate Statistics gathered
to a separate custom web component.

Screenshots: https://imgur.com/a/xlffxDE
Bug: v8:10667

Change-Id: I37816a4fe3d37f2b042d05a7110eda04af303fbb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287506
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Zeynep Cankara <zcankara@google.com>
Cr-Commit-Position: refs/heads/master@{#68794}
2020-07-10 14:13:56 +00:00
Milad Farazmand
2c20f4f38f PPC/s390: [wasm-simd][liftoff] Implement subset of v128.const
Port 34871eddc0

Original Commit Message:

    Partial implementation of v128.const, only the optimized case for all 0s
    and all 1s. The other cases bailout to TurboFan for now, and will be
    added in subsequent patches.

R=zhin@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I948380f0859b49bcc5a55d239b24a93b1cd5fd04
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2292113
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#68793}
2020-07-10 14:00:56 +00:00
Igor Sheludko
f3e9edd1cc [zone] Cleanup zone allocations in src/ast and tests
... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: I79fc4f9793a0c7a3bd38230ca4e23d33344fc1b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288863
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68792}
2020-07-10 13:48:20 +00:00
Igor Sheludko
e4f5f23b35 [zone] Cleanup zone allocations in src/asmjs
... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: I8293cc1854e39726eb9e4e5f9d2a34d38fa54859
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288861
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68791}
2020-07-10 13:47:15 +00:00
Santiago Aboy Solanes
4dd5e1da16 [csa][cleanup] Change the last Variable*[]s to VariableList
Bug: v8:6949
Change-Id: I8bd989ffce16b05e7cc37a35da9c2912090f60ec
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290857
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68790}
2020-07-10 12:22:45 +00:00
Igor Sheludko
295ee7ef84 [zone] Cleanup zone allocations in src/wasm and tests
... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: I2fc4a44ea05e4d087565811f343893f0e97dc660
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288857
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68789}
2020-07-10 12:11:55 +00:00
Igor Sheludko
734ea68230 [zone] Cleanup zone allocations in src/compiler and tests, pt.1
... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: Iea6c1225ee672035763d8141292a40874658d270
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288864
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68788}
2020-07-10 12:09:05 +00:00
Omer Katz
ab2b18e1be cppgc: Use object start bitmap to trace mixins
This CL removes the GetTraceDescriptor virtual call from garbage
collected mixins and replaces it with querying the object start
bitmap.

The CL also removes the mixin macros which are now no longer needed.

Bug: chromium:1056170
Change-Id: I27ed299f93025d09a3bb3f0d17b14bed3c200565
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287508
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68787}
2020-07-10 12:00:45 +00:00
Igor Sheludko
9db60f2b19 [zone] Cleanup zone allocations in src/interpreter and tests
... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: Ic7d893b8d6772bd923c37c3d1e7cff5cc6667192
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288868
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68786}
2020-07-10 11:58:15 +00:00
Ulan Degenbaev
e4e57d16b9 Reland "[heap] Allow LocalHeap on the main thread"
This is a reland of bebb2bdc06

Original change's description:
> [heap] Allow LocalHeap on the main thread
>
> This changes the safepoint scope to skip LocalHeap that is active
> for the current thread to avoid deadlocking.
>
> Bug: v8:10315
> Change-Id: I45e80ae66d0dbbe768107aa9cf0603204c644d9f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289983
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68769}

Bug: v8:10315
Tbr: dinfuehr@chromium.org
Change-Id: I1974d8b6ffffbf3244e7ede2d20d9b2d623df150
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290851
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68785}
2020-07-10 11:22:19 +00:00
Igor Sheludko
921c247694 [zone] Cleanup zone allocations in src/regexp and tests
... by migrating old-style code
  MyObject* obj = new (zone) MyObject(...)

to the new style
  MyObject* obj = zone->New<MyObject>(...)

Bug: v8:10689
Change-Id: Icc60fdbf247ec05f9b5688b3d2d73d4fed06ea89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289770
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68784}
2020-07-10 10:30:05 +00:00
Ulan Degenbaev
3647f758c2 [heap] Move marking bitmap into the memory chunk header
Instead allocating the bitmap with malloc, we now reserve a block
at the start of the memory chunk. This CL is a partial revert of
https://chromium-review.googlesource.com/c/v8/v8/+/1254125
Additionally it refactors field offset computation and moves them
to MemoryChunkLayout.

Having the bitmap in the memory chunk simplifies sharing of RO pages
and also solves the malloc fragmentation issues.

Bug: chromium:1073140
Change-Id: Ibc04f48921fc9496370858ce4c25c56b31c93c89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289979
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68783}
2020-07-10 10:23:05 +00:00
Clemens Backes
db36a80b17 [liftoff] Remove bailout for saturating conversions
Saturating conversions are implemented on all platforms now, so remove
the (unreachable) bailout.
Also, move the new cases up to the other macros, such that the
indentation (by clang-format) makes more sense.

R=rstz@chromium.org, thibaudm@chromium.org

Bug: v8:10520
Change-Id: Ia44a4852a087b0a2c19b3d62aebd73c834fa9af9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289982
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68782}
2020-07-10 10:12:45 +00:00
Igor Sheludko
911a13ebdd [zone] Add TypeTag type parameter to zone allocation functions
This will allow implementing per-type allocation stats.

Also migrate old-style zone allocations
  ... = new (zone) MyObject(...)

to the new style:
  ... = zone->New<MyObject>(...)

in several source files.

Bug: v8:10689
Change-Id: I1b044c9eccb4ac7e1b627276691f3c1fbad52137
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288232
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68781}
2020-07-10 09:47:25 +00:00
Peter Marshall
f33df41a76 Remove myself from snapshot owners
Change-Id: Iceaba4dcb9f3bc457e03735a94b615764757a635
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290854
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68780}
2020-07-10 09:46:15 +00:00
Ulan Degenbaev
45d7278c7d [heap] Make PersistentHandles::NewHandle typed
PersistentHandles::NewHandle/LocalHeap::NewPersistentHandle currently
erase the type of the object. This patch templatizes them to preserve
the type and introduces versions that take Handle<T>

Bug: v8:10315
Change-Id: I899179a5b842b7b16144b340f6cd2b91e1db228f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287501
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68779}
2020-07-10 09:45:05 +00:00
Omer Katz
b6c7e1f10f cppgc: Atomic object start bitmap
This CL ports the atomic object start bitmap from blink.
Using the bitmap for mixin tracing is left as a followup.

Bug: chromium:1056170
Change-Id: I4998a0d9d76708a7bab0634e04354809dfc8c78f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287504
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68778}
2020-07-10 09:00:45 +00:00
Ulan Degenbaev
9ff7156f87 [test] Fix UAF in cctest/test-memory-measurement/RandomizedTimeout
The test creates a mock platform. The bug was that the lifetime of the
mock platform was shoter than the lifetime of the isolate. Even though
the mock platform restores the old platfrom, a background thread may
still have a pointer to the mock platform leading to UAF.

Bug: v8:10690
Tbr: dinfuehr@chromium.rg
Change-Id: Ic14bf408e5e3e9e7d07e01af545bb88c21462300
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290850
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68777}
2020-07-10 08:52:00 +00:00
Igor Sheludko
d4078c642c [zone-stats] Cleanup ZoneList interface
... and introduce a bottleneck for collecting reusable zone memory
statistics.

Tbr: jgruber@chromium.org
Bug: v8:10572
Change-Id: I418f8b495c0d89c0eb73f4e19bc4315acfadb480
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287500
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68776}
2020-07-10 08:50:55 +00:00
Jakob Kummerow
b8b08347aa Revert "[wasm] Make an "incumbent context" available for module instantiation"
This reverts commit 8ba517e194.

Reason for revert: causing Chromium test failures on external/wpt/wasm/jsapi/functions/entry-different-function-realm.html, e.g. here: https://ci.chromium.org/p/v8/builders/ci/V8%20Blink%20Mac/3045

Original change's description:
> [wasm] Make an "incumbent context" available for module instantiation
> 
> A Wasm module's start function might be imported from JavaScript, and
> as such might contain calls to Blink. For such a case, we must make
> sure that an "incumbent context" is available.
> See microtask queue handling for a similar example.
> 
> Bug: chromium:1096558
> Change-Id: I2e3c0fc20d4e3581e490822c3ac63ce2c5e1e990
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284982
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68760}

TBR=jkummerow@chromium.org,verwaest@chromium.org

Change-Id: Ib36d2198cf686f561a2a64034faf0479686f3500
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1096558
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290853
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68775}
2020-07-10 08:36:27 +00:00
v8-ci-autoroll-builder
b17c8b17c5 Update V8 DEPS.
Rolling v8/build: 2f694ac..3fd005e

Rolling v8/third_party/aemu-linux-x64: Y1_xyAnxWY49mUT2otmospCKTrX01gsjJxt9x-qV0RsC..s9pb0zCLuc3Aj9A3n8IG3qBVpc2wOmQ1A32bDtG1idwC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/5d5af4e..e4221b4

Rolling v8/third_party/depot_tools: 6402141..9af33fa

Rolling v8/tools/clang: 77b632f..21dcb28

TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Change-Id: I3836af60d3bd8673de45d391815fc02aaa6980e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290712
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@{#68774}
2020-07-10 03:48:05 +00:00
Frank Tang
d3fe0e29c3 Return undefined if fractionalSecondDigits is 0
Bug: v8:10686
Change-Id: I5a7b47dd4ed10142a795de56c4739ab072e63421
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2286814
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68773}
2020-07-09 23:01:15 +00:00
Ng Zhi An
34871eddc0 [wasm-simd][liftoff] Implement subset of v128.const
Partial implementation of v128.const, only the optimized case for all 0s
and all 1s. The other cases bailout to TurboFan for now, and will be
added in subsequent patches.

Bug: v8:9909
Change-Id: I3240c1c5f4259c45d51edca00fec37047bc1b3a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284212
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68772}
2020-07-09 22:37:55 +00:00
Deepti Gandluri
3fec0d9132 Add zhin@ to OWNERS files needed for SIMD reviews
Change-Id: I256c351bea62fede28f6cfaa0be149729abffbd9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2271132
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68771}
2020-07-09 22:35:45 +00:00
Bill Budge
1e546a49fe Revert "[heap] Allow LocalHeap on the main thread"
This reverts commit bebb2bdc06.

Reason for revert: Breaks GarbageCollectionWithLocalHeap test.
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20debug/31107

Original change's description:
> [heap] Allow LocalHeap on the main thread
> 
> This changes the safepoint scope to skip LocalHeap that is active
> for the current thread to avoid deadlocking.
> 
> Bug: v8:10315
> Change-Id: I45e80ae66d0dbbe768107aa9cf0603204c644d9f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289983
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68769}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: Ifba8218f9104afed3f2d92258296067f8f424062
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290573
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68770}
2020-07-09 21:21:25 +00:00
Ulan Degenbaev
bebb2bdc06 [heap] Allow LocalHeap on the main thread
This changes the safepoint scope to skip LocalHeap that is active
for the current thread to avoid deadlocking.

Bug: v8:10315
Change-Id: I45e80ae66d0dbbe768107aa9cf0603204c644d9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289983
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68769}
2020-07-09 20:15:54 +00:00
Dominik Inführ
72bd81c071 [handles] Do not allow handle deref when local heap is parked
When local heap is parked it is not allowed to dereference any handles.
A GC might be relocating objects at that point.

Change-Id: I557682d47f8f0acfe041506833f6b397feb4438b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289981
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68768}
2020-07-09 19:38:38 +00:00
Manos Koukoutos
8b9c2ac3c6 [wasm-gc] Preparation for rtt global initializers
Motivation: With rtt.sub now allowed in constant expressions, we have
to generalize WasmInitExpr to be able to handle expressions with
operands. This is the second CL that prepares the ground for this
change.

Changes:
- Remove the error from read-value-type when reading a generic rtt.
- Add validation for HeapTypeImmediate in ModuleDecoder. Use it to
  validate null constants immediates, which was missing. Add tests.
- Change ValueType::name to print rtt depths as integers.
- Move global initializer building in wasm-module-builder to its own
  function.

Bug: v8:7748
Change-Id: Ic041e1c7d032f2a1063a21fec1bfe96cb0d8120e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284983
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68767}
2020-07-09 18:33:38 +00:00
Will Harris
f85021ca3d Disable CFI icall for v8::internal::MemMove.
MemMove makes an indirect call to memmove_function which is
overwritten in init_memcopy_functions to an address not
permitted by CFI to be called indirectly.

This CL disables CFI_ICALL for this function.

BUG=chromium:584575

Change-Id: I372f0c13a1900bf3c48484db9ba7ff4a3b3fc7e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289010
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68766}
2020-07-09 17:43:38 +00:00
Z Nguyen-Huu
5cad40b6ee Trace turbo stack access counters per function
With this change, if we pass --trace-turbo-stack-accesses, output will
be something like:

=== Stack access counters ===
Number of functions: xx
Name: wasm-function#1, Loads: xx, Stores: xx
...
Total Loads: xx, Total Stores: xx

This only applies to optimized/wasm functions.

Bug: v8:10663
Change-Id: I0b08e3fa321b76dc53942c8fbffd14759978c7b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2283913
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68765}
2020-07-09 17:34:48 +00:00
Camillo Bruni
3353502322 [api] Fix TryCatch comment
TryCatch creates normal handles for Exception and Message objects.

Bug: v8:10537
Change-Id: I6ccd531242bfdc7a97ff5d8314d2f31086a28b07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284490
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68764}
2020-07-09 17:31:08 +00:00
Milad Farazmand
e13967c3c3 s390: [wasm-simd] Simplify S8x16Shuffle on s390
Change-Id: I52fc8025a4a878e4494ef9134a8c2bd1cec25fe1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289903
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#68763}
2020-07-09 17:25:48 +00:00
Dominik Inführ
6daf691154 Revert "[heap] Move start of incremental marking in allocation"
This reverts commit d6a14abe05.

Reason for revert: Caused TSAN failures.

Original change's description:
> [heap] Move start of incremental marking in allocation
> 
> Move start of incremental marking out of
> RefillLinearAllocationAreaFromFreeList. This avoids a potential
> safepoint while holding allocation_mutex_.
> 
> Bug: v8:10315
> Change-Id: Ieb60ac68f26199eea7b6b7ad6d874851382f3d69
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287496
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68751}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: Ic928413884115ac01917a8db591af83cbbc9cc5a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289977
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68762}
2020-07-09 16:55:20 +00:00
Dominik Inführ
29d861ec13 Revert "[heap] Avoid ParkedMutexGuard during allocation"
This reverts commit 273f4e42e3.

Reason for revert: Based on another need that needs to be reverted because of TSAN failures.

Original change's description:
> [heap] Avoid ParkedMutexGuard during allocation
> 
> Since main thread allocation does not start incremental marking anymore
> while holding allocation_mutex_, background allocation does not need
> ParkedMutexGuard anymore to avoid deadlocks.
> 
> This also means background thread allocation isn't paused anymore to
> perform a GC, which already resulted in subtle bugs (e.g. in
> ExpandBackground with incremental marking). We also do not
> stop-the-world anymore while holding allocation_mutex_.
> 
> Bug: v8:10315
> Change-Id: Iadf00bc26434c765722b82a10497ab06151f15cc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289771
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68754}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: I3a16c13626c891e8063564fc05fd2d3fc427d159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289975
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68761}
2020-07-09 16:47:30 +00:00
Jakob Kummerow
8ba517e194 [wasm] Make an "incumbent context" available for module instantiation
A Wasm module's start function might be imported from JavaScript, and
as such might contain calls to Blink. For such a case, we must make
sure that an "incumbent context" is available.
See microtask queue handling for a similar example.

Bug: chromium:1096558
Change-Id: I2e3c0fc20d4e3581e490822c3ac63ce2c5e1e990
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284982
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68760}
2020-07-09 16:09:28 +00:00
Manos Koukoutos
01e59c4bd9 [wasm-gc] Refactoring in preparation of generalizing WasmInitExpr
Motivation: With rtt.sub now allowed in constant expressions, we have
to generalize WasmInitExpr to be able to handle expressions with
operands. This CL prepares the ground for this change and adds no
functionality.

Changes:
- ValueType::heap_representation and HeapType::representation now
  return HeapType::Representation.
- Add ValueType::is_rtt().
- WasmInitExpr:
  - Make kind private. Rename val -> operator, make it private. Add
    accessors.
  - Rename kGlobalIndex -> kGlobalGet.
  - Squash global_index and function_index into index.
  - Add heap_type Immediate. Use it for RefNullConst. TypeOf in
    module-decoder.cc can now fully determine the type of a
    WasmInitExpr.
  - Add class constructors/static method constructors for each Operator
    kind.
  - Delete copy constructor. WasmInitExpr will use std::unique_ptr for
    its operands.
- consume_init_expr now uses a stack.
- A few minor improvements.

Bug: v8:7748
Change-Id: I3ba3ee7ac2d6bc58e887790c37110ceb80658985
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284483
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68759}
2020-07-09 15:03:18 +00:00
Seth Brenith
607452dc22 [regalloc] Fix another case where FindOptimalSpillingPos missed ranges
In previous change https://crrev.com/c/2274308 , I attempted to fix an
issue where FindOptimalSpillingPos could sometimes fail to find the
LiveRange that covers the top of the loop. However, I misunderstood how
TopLevelLiveRange::GetChildCovers behaves, so I introduced a different
case where FindOptimalSpillingPos would fail to find the right
LiveRange. This change updates GetChildCovers to do what I had thought
it would do, so it can find the right LiveRange in all cases.

     chromium:1102243

Bug: chromium:1101958, chromium:1101954, chromium:1102257,
Change-Id: If91c642c3f7f5e3a8b4cfaa3b3577865c84afcb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288660
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#68758}
2020-07-09 13:42:08 +00:00
Jakob Gruber
f468e8e75f [nci] Verify native context independent code
After native-context-independent codegen, verify that the resulting
Code object does not embed any nc-dependent objects, and that no code
dependencies have been created.

Bug: v8:8888
Change-Id: I894e74b27e86e7727ff17aa0dbfdd908373a5e55
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284498
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68757}
2020-07-09 13:38:09 +00:00
Georg Neis
f44900d2f1 [turbofan] Prettify a condition
Change-Id: I3800486f18a3693c9e2d3ace0a6f8ee626efc84e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289780
Commit-Queue: Georg Neis <neis@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68756}
2020-07-09 13:35:18 +00:00
Jakob Kummerow
38b1bff18c [wasm-gc] Support RTTs of generic types ("eqref" etc)
By introducing a globally known map for each generic type.
These maps are never used to allocate objects, they only
serve as sentinels for generic heap types.

Bug: v8:7748
Change-Id: I950a8c712dc1510759a833fe9122b9e9a6222dc2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288860
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68755}
2020-07-09 13:29:48 +00:00
Dominik Inführ
273f4e42e3 [heap] Avoid ParkedMutexGuard during allocation
Since main thread allocation does not start incremental marking anymore
while holding allocation_mutex_, background allocation does not need
ParkedMutexGuard anymore to avoid deadlocks.

This also means background thread allocation isn't paused anymore to
perform a GC, which already resulted in subtle bugs (e.g. in
ExpandBackground with incremental marking). We also do not
stop-the-world anymore while holding allocation_mutex_.

Bug: v8:10315
Change-Id: Iadf00bc26434c765722b82a10497ab06151f15cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289771
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68754}
2020-07-09 12:45:18 +00:00
Camillo Bruni
f4b3a59c08 [tools] Remove sodium
The tool is no longer supported since we migrated to Turbofan.

Change-Id: I55b911f47867b2a6985ce14f973cd837f71ec4b4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2288859
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68753}
2020-07-09 11:38:48 +00:00
Clemens Backes
b429b8f924 [liftoff] Handle unordered register pairs
For 64-bit binary operations, Liftoff on arm made the assumption that
register pairs are always ordered, i.e. the register code for the low
word is lower than the register code for the high word.
Ensuring this was only implemented in {GetUnusedRegister} in
https://crrev.com/c/2168875. Other cases were missing though, e.g.
return values, but also different places were we
construct register pairs internally.

Thus, this CL removes this constraint again and instead handles
unordered register pairs in 64-bit binary operations on arm.

R=thibaudm@chromium.org

Bug: chromium:1101304
Change-Id: I4cd9fb1577f82ab06d34c9dde6533cf04a2cade7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287870
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68752}
2020-07-09 11:05:08 +00:00