Commit Graph

60796 Commits

Author SHA1 Message Date
Dominik Inführ
4fa45c6de2 [heap] Keep array buffer bytes stable during sweeping
Introduce separate counters for young and old array buffer bytes. They
are used to keep the counter stable during sweeping when the array
buffer lists are moved to the concurrent thread for sweeping.

Bug: v8:10064
Change-Id: I0f11a634341873b4d21759c284c55beb26fe30a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2045511
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66204}
2020-02-10 14:38:43 +00:00
Ulan Degenbaev
c50dcf68c7 [d8] Make myself an owner of d8
Change-Id: If22a3121f3fdaf0e67ecee267ea275b1bc79d617
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039052
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66203}
2020-02-10 14:21:13 +00:00
Michael Achenbach
cf05e4ca79 Make using natives for fuzzing more permissive
This makes creating whitelisted runtime functions more permissive on
fuzzers (when --allow-natives-for-fuzzing is passed).

- Runtime functions with too few arguments are replaced with undefined.
- Superfluous arguments are ignored.

This reduces syntax-error rate on fuzzers. Also prevents
dcheck errors when fuzzing debug builds and fuzzers use too many
arguments for runtime functions.

Bug: chromium:1044942
Change-Id: I23b45398421c50bc82d1e8bfdf019f565253db96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039352
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66202}
2020-02-10 14:18:08 +00:00
Ulan Degenbaev
f925176e19 [base] Clean up atomicops.h
This groups atomicops by type, removes an unused atomicop, and fixes
comments.

Change-Id: I9621ac4512d019ae9d0ce4f7e38c81011d46aa37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2047044
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66201}
2020-02-10 14:06:53 +00:00
Leszek Swirski
ec554ec053 [offthread] Make NextScriptId thread-safe
Make the NextScriptId value incrementing method thread-safe, using
CompareAndSwap primitives. This will allow it to be used in the
future for off-thread compilation.

Bug: chromium:1011762
Change-Id: I5b449e75c7dc63d24fa045ae880b0680b54c2f3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2046883
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66200}
2020-02-10 14:05:23 +00:00
Leszek Swirski
f6d988f910 [offthread] Clean-up HandleOrOffThreadHandle uses
Take advantage of the HandleOrOffThreadHandle implicit conversions where
applicable.

Bug: chromium:1011762
Change-Id: Iaf49d9098368b402e1cd3d991629d3f5e718f28e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2046885
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66199}
2020-02-10 13:46:23 +00:00
Pierre Langlois
86d4b9f6ca [codegen][cleanup] Unify assembler's support for DebugBreak().
Each assembler has it's own way to place breakpoints:

  - stop() for arm, mips*, ppc* and s390.
  - debug() for arm64.
  - int3() for ia32 and x64.

We can mandate a macro-assembler `DebugBreak()` method that all should
implement so one can place a breakpoint in a portable way using a
macro-assembler. This way also assemblers are in line with TurboFan, CSA, Torque
and Liftoff which all have a DebugBreak() facility.

Change-Id: Ic4332bd19ca4db53e01441d54af6632c2c1189f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020954
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#66198}
2020-02-10 13:39:33 +00:00
Leszek Swirski
5f6384622f [offthread] Add off-thread scope allocation
Make Scope allocation and ScopeInfo creation Isolate-templated. This
includes making SourceTextModuleInfo allocation templated -- modules
aren't currently streamed off-thread, but will hopefully be in the
future, so this future-proofs them against that.

Bug: chromium:1011762
Change-Id: I8954e08e8e81489eb821b5f62ec35a5be31fce09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043790
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66197}
2020-02-10 12:58:03 +00:00
Michael Lippautz
7a410e739b heap: Be more conservative when delaying finalization
When delaying finalization we considered the maximum of the current time
to task and the recorded average. In case there's no recorded average
the GC would consider the current time to task as estimate which is too
aggresive as V8 may never get a task executed.

Be fully conservative about recorded task times and bail out in such
cases.

Bug: chromium:1049957
Change-Id: Ibaac242f72459341a170af80e63fb2266f91b0eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043809
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66196}
2020-02-10 12:17:13 +00:00
Dominik Inführ
83dfd0583b [heap] Improve accounting with ArrayBufferExtensions
Update external memory counters when using ArrayBufferExtensions. In
case the array buffers are swept concurrently, the counters are updated
at the beginning of the next minor/full GC. A subsequent GC is going
to update counters faster.

ArrayBufferExtension now stores the accounting_length such that
the sweeper always knows how much memory to deduct from the external
memory on destruction.

ArrayBufferList now also tracks the size of all ArrayBuffers in it.

Bug: v8:10064
Change-Id: I50a8b1180aa837b6932f834df1610255bd2bd9fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2041441
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66195}
2020-02-10 11:16:03 +00:00
Leszek Swirski
98129efc92 [offthread] Add InOffThreadSpace checks for Isolate access
Make sure we can't get the Isolate for writable off-thread space
objects, to avoid leaking the Isolate into off-thread compilation.

Bug: chromium:1011762
Change-Id: I5c4316e751736b8c8235fdcc8949d52b78313f38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043791
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66194}
2020-02-10 10:14:52 +00:00
Joakim Bengtsson
4b1447e4bb Improve V8 GC logic for external memory
The logic for V8 GC normally only takes the external memory growth
since last mark-compact into account. Unfortunately, the amount of
external memory recorded at the end of MC is often too high. The
reason is that it might take a while for the external memory
associated with the GCed objects to be released (e.g. V8 itself post a
task to release external memory for ArrayBuffer backing stores). In a
worst case scenario GC is driven only by external memory and none of
the external memory is released by the end of the MC. Then each MC
will record the external memory at its highest point and the GC logic
will allow the external memory to grow a bit higher each time which
can lead to excessive memory use.

This patch improves the situation a bit by calculating the growth from
the lowest external memory seen since the last MC. That way the growth
calculation will be offset from a level presumably closer to the
intended one (to what it would have been if the external memory
associated with the GCed objects was released during the MC). Now,
this fix is not perfect because it can be thrown off by external
memory growth occurring before the lingering memory is
released. However, it seems to work rather well in practice (e.g. when
playing MSE video on YT).

Bug: v8:10185
Change-Id: Ifcdd87eb45f3ae4a99d2aeec667c3ae4ca9a52b6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042711
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66193}
2020-02-10 09:33:33 +00:00
Peter Marshall
e16bd85b8e [tooling] Reland "Keep track of idle state even when we aren't profiling"
> It isn't expensive to set this enum on the isolate and we only call
> this in chrome when the ThreadDebugger is enabled anyway.
>
> This means we have a correct idle state to use with the upcoming
> CDP event which emits the thread state.

This time, move the dcheck below the stack pointer check. It turns out
we call into this with current state == JS, but only when js is on the
stack, so we can just move the check lower.

Bug: chromium:1025490
Change-Id: Ic9b2eff1ae1880535d0c6da5487ebea4f7e5e62b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039050
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66192}
2020-02-10 09:15:22 +00:00
v8-ci-autoroll-builder
9e548ec77a Update V8 DEPS.
Rolling v8/tools/clang: 4f24c2a..7d1284a

Rolling v8/tools/luci-go: git_revision:bbda6f0d563b25ce0a25b147dec46e5815da5601..git_revision:02ba678a47594da180904851f3e6f809da7e0fc5

Rolling v8/tools/luci-go: git_revision:bbda6f0d563b25ce0a25b147dec46e5815da5601..git_revision:02ba678a47594da180904851f3e6f809da7e0fc5

Rolling v8/tools/luci-go: git_revision:bbda6f0d563b25ce0a25b147dec46e5815da5601..git_revision:02ba678a47594da180904851f3e6f809da7e0fc5

TBR=machenbach@chromium.org,tmrts@chromium.org

Change-Id: Iff417ef02e3e79fa094fad500fec3975c915c399
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2044840
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@{#66191}
2020-02-10 03:55:52 +00:00
Michael Achenbach
72fc962b4d Revert "[weakrefs] Schedule FinalizationGroup cleanup tasks from within V8"
This reverts commit 31d8ff7ac5.

Reason for revert: https://crbug.com/v8/10190

Original change's description:
> [weakrefs] Schedule FinalizationGroup cleanup tasks from within V8
> 
> Deprecate the following explicit FinalizationGroup APIs in favor of
> automatic handling of FinalizationGroup cleanup callbacks:
>   - v8::Isolate::SetHostCleanupFinalizationGroupCallback
>   - v8::FinaliationGroup::Cleanup
> 
> If no HostCleanupFinalizationGroupCallback is set, then
> FinalizationGroup cleanup callbacks are automatically scheduled by V8
> itself as non-nestable foreground tasks.
> 
> When a Context being disposed, all FinalizationGroups that are
> associated with it are removed from the dirty list, cancelling
> scheduled cleanup.
> 
> Bug: v8:8179
> Change-Id: Ic09313a11dd00af36d1f698250b3d735155f45e8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1986392
> Commit-Queue: Shu-yu Guo <syg@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66184}

TBR=ulan@chromium.org,rmcilroy@chromium.org,syg@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: v8:8179
Change-Id: If7869e9a5841803c10e748691f019a7d28f3b62e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043807
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66190}
2020-02-09 16:24:52 +00:00
Johannes Henkel
40e2bd1a9c [DevTools] Roll inspector_protocol (V8)
Upstream PR:
"Drop && from Serializable::TakeSerialized() &&."
https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/2029933

New Rev: 75c465e8d425f2e0b5297245c7eb058411af493a

Change-Id: I11dafc589c8f0c5a7e158b9cc5ad5202ba8237e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2029335
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66189}
2020-02-09 12:24:31 +00:00
Z Nguyen-Huu
ddc7e69125 [wasm] Skip test in multiple isolates
If both isolates run this test, they are kind of racing on the
{tier_down_} flag, hence you get unexpected results.

Bug: v8:10189, v8:10099
Change-Id: I8657c32c024898442d5c916cf15077c846276b1f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2044544
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66188}
2020-02-09 07:50:01 +00:00
v8-ci-autoroll-builder
a781302612 Update V8 DEPS.
Rolling v8/build: d34dbf0..8ada491

TBR=machenbach@chromium.org,tmrts@chromium.org

Change-Id: I1a5aaa521f42bf2779605345568ab851d7126e4a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2044836
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@{#66187}
2020-02-09 04:01:41 +00:00
v8-ci-autoroll-builder
574b099985 Update V8 DEPS.
Rolling v8/build: 68bdecf..d34dbf0

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/8052d29..ea794b8

Rolling v8/third_party/depot_tools: 73c7670..3b8094a

TBR=machenbach@chromium.org,tmrts@chromium.org

Change-Id: I55eddf107dd1001dbcadef4c2222a5bd2b630117
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2044833
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@{#66186}
2020-02-08 03:49:30 +00:00
Milad Farazmand
f2579c7331 s390: [wasm-simd] Add to simd conversion operations
Change-Id: Id3d6566dc7b8a4cc10574abe79246ebf1398f016
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043024
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#66185}
2020-02-08 02:19:10 +00:00
Shu-yu Guo
31d8ff7ac5 [weakrefs] Schedule FinalizationGroup cleanup tasks from within V8
Deprecate the following explicit FinalizationGroup APIs in favor of
automatic handling of FinalizationGroup cleanup callbacks:
  - v8::Isolate::SetHostCleanupFinalizationGroupCallback
  - v8::FinaliationGroup::Cleanup

If no HostCleanupFinalizationGroupCallback is set, then
FinalizationGroup cleanup callbacks are automatically scheduled by V8
itself as non-nestable foreground tasks.

When a Context being disposed, all FinalizationGroups that are
associated with it are removed from the dirty list, cancelling
scheduled cleanup.

Bug: v8:8179
Change-Id: Ic09313a11dd00af36d1f698250b3d735155f45e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1986392
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66184}
2020-02-08 00:20:10 +00:00
Ng Zhi An
51a7668976 [wasm-simd] Scalar lowering for load splat (s8x16, s16x8, s32x4)
We lower each op into num_lanes loads, and connecting up the effects in
a chain.

s64x2 is not implemented since we lowering for 64x2 generally doesn't
work anyway.

Load extends are a bit more complicated, so we'll do that in a separate
change.

Bug: v8:9886
Change-Id: I80096827bf8e8e0db1ef0ad1b76759ed1797ca5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2031893
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66183}
2020-02-07 19:59:09 +00:00
Seth Brenith
e5e4ea962e [torque] Support bitfield structs stored within Smis
This change moves the definition of the bits stored in DebugInfo::flags
to Torque, and updates the only Torque usage of that field to use more
natural syntax. This is intended as an example of common patterns found
in various other classes. Several supporting changes are required:

1. Add a new type representing a bitfield struct stored within a Smi. It
   is currently called SmiTagged, but I'm open to suggestions.
2. Add an enum-style output for Torque bitfield structs whose bitfields
   occupy only one bit each.
3. Add a new case to MachineOperatorReducer that makes the generated
   code for IncBlockCounter match with what was generated before this
   change.
4. Add support for reporting these bitfields in the postmortem debugging
   API. The format matches existing bitfields but with an offset value
   that includes the SMI shift size.

Bug: v8:7793
Change-Id: Icaecbe4a162da55d2d9a3a35a8ea85b285b2f1b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2028832
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66182}
2020-02-07 18:43:06 +00:00
Ng Zhi An
9991e4066c [cleanup] Add undefs for macros
Bug: v8:10115
Change-Id: If2ef0cd4bef9805dce3c9486d91385d0d40189fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2044650
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66181}
2020-02-07 18:27:40 +00:00
Ng Zhi An
62e3127111 Cast RelocInfo.Mode to int before printing
Mode has an underlying type of int8_t. When printing it we can end up
with unprintable ascii values. This shows up with --trace-turbo, and the
json file ends up with invalid bytes, and Turbolizer cannot preview.

Change-Id: I6bc905416b6e6da35a259734233b366b858452e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2031895
Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66180}
2020-02-07 17:54:20 +00:00
Bill Ticehurst
1e36e21acc Remove unnecessary export, which happens to break MSVC DLL builds.
Change-Id: I47c9211274cefd26bde6bd93aa7503e022df4357
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042874
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Bill Ticehurst <billti@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#66179}
2020-02-07 17:36:10 +00:00
Ng Zhi An
7e1d052580 [wasm-simd] Add i8x16 shift tests using non-immediates
These were not added in https://crrev.com/c/2026067 when we added
similar tests for other lane sizes, since x64 had a completely different
path for i8x16. But this tests are useful anyway for other archs, so add
them in.

Bug: v8:10115
Change-Id: I77ecca0cd9f4021c94f1538aa5635b5d54983207
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2041708
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66178}
2020-02-07 17:28:15 +00:00
Ng Zhi An
36ce4cdc8d [wasm-simd] Implement scalar lowering for rounding average
Bug: v8:10039
Change-Id: Ibb0fea59b180d8e015aeee6d6e211ef1f85b0c61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2041698
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66177}
2020-02-07 17:27:10 +00:00
Ulan Degenbaev
23c09ad44a [ptr-compr, heap] Fix --huge_max_old_generation_size
This restores ~4GB limit for 64-bit devices with 16GB physical memory
running with pointer compression.

Bug: chromium:1049816,chromium:1045034
Change-Id: I7946a4510f8aac2c71fb427776574adba5127cbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043797
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66176}
2020-02-07 16:30:20 +00:00
Etienne Pierre-doray
4300eec7ca [v8 heap]: Track GlobalSize in worklist.
GlobalSize will be used as a hint to schedule scavenger work in
https://chromium-review.googlesource.com/c/v8/v8/+/2036661

This is implemented as an atomic variable that's updated when adding/removing
segments.

Bug: chromium:1012816
Change-Id: I8f6c3f10612f8febda9bfe640d91e235aa3c2f12
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043273
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66175}
2020-02-07 16:12:30 +00:00
Ulan Degenbaev
1d54a600ac [heap] Enable --huge_max_old_generation_size by default and add tests
Now ResourceConstraints::ConfigureDefaults sets the heap limit to 4GB
if the physical memory size is greater or equal to 16GB on 64-bit
platforms.

This CL also adds tests for configuring heap limits from the physical
memory size.

Bug: chromium:1045034
Change-Id: If0d5a237b2db31309a9a2a6456d950ef70dc71af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043833
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66174}
2020-02-07 15:51:00 +00:00
Igor Sheludko
63228e2698 [ptr-compr][csa] Support TaggedIndex in CSA
Bug: v8:10047
Change-Id: I140fcf453ce7dd6189e0f643f95570163b625456
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043831
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66173}
2020-02-07 13:25:40 +00:00
Mythri A
e85ffb4686 Disable one shot optimizations
We used to optimize functions that are expected to executed only
once by not allocating feedback slots for some of the bytecodes. This
would help in reducing the memory and avoiding initializing feedback
that would be never used. With lazy feedback allocation, we don't
allocate feedback vectors for most of such functions anyway.

The generated bytecode for oneshot optimized functions is different and
if we don't properly track this information we might end up generating
different bytecode for the same function. This could causes problems
when there is a mismatch between the feedback slots used by the new
bytecode and the old bytecode. Since we potentially get most of the
benefits of this optimization with lazy feedback vector allocation
we can simplify the code by disabling this optimization.

Bug: chromium:1045824
Change-Id: Ib94605c8c766adc99f54c8333f780d2448caff5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030918
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66172}
2020-02-07 12:50:40 +00:00
Emanuel Ziegler
d25872d51d [wasm] Use lookup-tables for ValueTypes static methods
Improve performance of switch statements by using constexpr lookup
tables wherever possible.

Bug: chromium:1042868

R=clemensb@chromium.org

Change-Id: I8a44bd8022d1c4e3a74243e3657498a2bc49ff64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2041448
Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66171}
2020-02-07 12:21:10 +00:00
Igor Sheludko
808a3f23bc [ptr-compr] Introduce TaggedIndex class
... a Smi-looking type containing properly sign-extended int31 integer.

The idea is to use this kind of tagged integers for the cases where
the value is guaranteed to fit into int31. For example, feedback vector
slots is one of the candidates for using TaggedIndex representation.

Bug: v8:10047
Change-Id: Ifaa2978a5d42467578ff243dc44d327536efbe93
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1960292
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66170}
2020-02-07 11:21:29 +00:00
Yu Yin
2877a2ad12 [mips][wasm] Fix saved parameter register
Change-Id: Ic18995af870c41852d5b10dbe5adead7bb36d37e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2043611
Auto-Submit: Yu Yin <xwafish@gmail.com>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66169}
2020-02-07 11:17:20 +00:00
Leszek Swirski
7fa19160d0 [ast] Cache allocated AstConsString
Allow caching the result of allocating AstConsStrings, to allow
sharing of inferred names between functions.

This is a partial revert of https://crrev.com/c/2020953, with
the observation that *some* AstConsStrings are always flattened,
while others are only ever used as ConsStrings, so we want to
allow the allocation to be lazy while still caching the result.

As a drive-by, cleanup the old AstConsString linked list fields.

Bug: chromium:1011762
Bug: chromium:1048082
Change-Id: Icc14342eb3f6f97359596b42b2c296cbc49fd791
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042093
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66168}
2020-02-07 11:10:37 +00:00
Clemens Backes
f0057afc2f [api] Remove deprecated and non-functional method
The functionality was not used since a long time, and was hence removed
for the 8.1 branch, and the method was deprecated.
This CL removed the deprecated method completely.

R=adamk@chromium.org

Bug: v8:10155
Change-Id: Iae299d64decb7230d38c2fda8d269a7b0387bb0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2033169
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66167}
2020-02-07 09:40:47 +00:00
v8-ci-autoroll-builder
f8d45ea806 Update V8 DEPS.
Rolling v8/build: c80cd76..68bdecf

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/1ffa053..8052d29

Rolling v8/third_party/depot_tools: e868546..73c7670

TBR=machenbach@chromium.org,tmrts@chromium.org

Change-Id: Ic4628b14b96343bf2a9cacf07ecdde49b728dca7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042164
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@{#66166}
2020-02-07 03:53:06 +00:00
Johannes Henkel
2b078975e1 [DevTools] Roll inspector_protocol (V8)
Upstream PR:
"Implement crdtp::ErrorSupport, replacing the jinja2 template."
https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/2036608

In addition; this PR includes removal of now unused routines
in string-util.h (StringBuilder and number conversions).

New Rev: e4ffb7288a17b2bbe2f7b7cd62abcb1d1e55681a

Change-Id: Iae14c001c1f468466a42cb1b842c0ded766fccc9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037959
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66165}
2020-02-07 01:44:26 +00:00
Z Nguyen-Huu
1f7861c8a9 Reland "[wasm] Tierdown wasm module upon "Debugger.enable""
This is a reland of 410ca4c50e

Skip new test for unsupported liftoff architecture.
Previously, if there is some unsupported liftoff functions, it fall
through Turbofan but recompilation didn't catch and count it. This CL
fixes it by using requested_tier on finished units.

Avoid to tier down asm.js.
Introduce reached recompilation tier to monitor recompilation progress.

Original change's description:
> [wasm] Tierdown wasm module upon "Debugger.enable"
>
> Put a logic in Wasm Engine to tier down all existing modules per isolate
> when debugger is enabled. This CL does not handle new module added after
> debugger is enabled yet.
>
> Bug: v8:9654
> Change-Id: I87060f5c416506543fcaf231bff9999d06ba4c0d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2013692
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66017}

TBR=szuend@chromium.org,bmeurer@chromium.org

Bug: v8:9654
Change-Id: I6014ae52d1e04726e64ee9267c5ce559090414d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2031744
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66164}
2020-02-06 23:47:06 +00:00
Michael Achenbach
1ae4669bcd [release] Remove obsolete flag from auto-roller
Roller broke after this flag was removed here:
https://crrev.com/52969c9d1049ffc5daecdb9210ad29f13438449b

TBR=mslekova@chromium.org

No-Try: true
Change-Id: Ic81b093ba28df8806938f4b1022330ce0eddc082
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042710
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66163}
2020-02-06 21:29:56 +00:00
Ng Zhi An
97f0c9f447 [wasm-simd] Optimize codegen when shift is constant
Define a macro in code-generator-ia32 to help identify cases when the
shift value is an immediate/constant. In those cases we can directly
emit the shifts without any masking, since the instruction selector
would have modulo-ed the shift value. We also don't need any temporaries
in this case.

Bug: v8:10115
Change-Id: I3cdef493fd7c365c733a85ad31b86e2d258b6429
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037649
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66162}
2020-02-06 21:26:26 +00:00
Johannes Henkel
ff4e5da5a8 [DevTools] Roll inspector_protocol (V8)
Upstream: "Remove Parser_{h,cpp}.template as promised."
https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/2040571

New rev: 9fd0f91cc4331f931b7ac4040ceaa36de43937d0

Change-Id: Ie8df73e1fa898d4d46090fa6597548b2e1ca9a4e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039349
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66161}
2020-02-06 19:51:36 +00:00
Milad Farazmand
343eeb15aa [inspector] Remove extra byte swapping on BE machines
With "Value::parseBinary" now being revamped by https://crrev.com/c/2020518
and making use of "cbor::ParseCBOR", the extra endianness check
is not needed anymore as "ParseCBOR" already switches
the byte order in this line:

crdtp/cbor.cc
void ParseUTF16String(CBORTokenizer* tokenizer, ParserHandler* out) {
  ....
  for (size_t ii = 0; ii < rep.size(); ii += 2)
  value.push_back((rep[ii + 1] << 8) | rep[ii]);
  ...

"String16EndianTest" does not go through the newly added pipeline
and "ParseUTF16String" is never used which makes the test redundant.

Change-Id: I6ad59fef7036c70d475b492407fd394977ca98f4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2038716
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66160}
2020-02-06 18:00:54 +00:00
Ulan Degenbaev
8732596c70 [ptr-compr, heap] Use system pointer size for heap limit computation
A pointer-compressed heap has the same heap limit heuristics as a 32-bit
heap. Specifically, the heap limit is restricted to 1GB due to scarce
virtual addresses space on 32-bit platforms. That limitation does not
apply for pointer-compressed heaps which can use 4GB.

This CL changes the heap limit computation to use system the pointer
size instead of the tagged pointer size. Note that the young generation
limit continues to use the tagged pointer size.

Bug: chromium:1045034
Change-Id: I9d5bb818c32a82322476e9c97feee331400ebe0f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042102
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66159}
2020-02-06 17:32:44 +00:00
Omer Katz
6cfba48b65 [heap] Align v8 and oilpan worklists
This CL makes the following changes:
1) Size of allocated buffer is set by a template parameter
   (with a default value instead of hardcoded size)
2) Remove dynamic parameter for initializing number of
   tasks (see comment in scavenger.cc)

This CL aligns the v8 and oilpan heaps so that they provide
the same interface and functionality.

Change-Id: I77d63793f0a54ea29198ddd6bd298eae2c15cf42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030920
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66158}
2020-02-06 17:31:25 +00:00
Leszek Swirski
e9d8b99063 [handles] Allow implicit HandleOrOffThreadHandle conversion
Allow HandleOrOffThreadHandle to implicitly convert to any of
Handle, MaybeHandle, and OffThreadHandle, so that it can be used
in Isolate-templated code with fewer 'get' calls.

As a drive-by, allow OffThreadHandle to have an OffThreadIsolate
parameter (so that HandleFor<Isolate, Foo>(x, isolate) works), and
use a static_cast rather than a T::cast in the implicit upcast
constructor of OffThreadHandle to prevent implicit down-casts.

Bug: chromium:1011762
Change-Id: I226f3a48b0f3b5e0347e6325be1cbd482c9048ed
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2042100
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66157}
2020-02-06 17:11:44 +00:00
Leszek Swirski
4aa43e7d4a [offthread] OffThreadFactory support for literals
Add off-thread support for literals, including object/array boilerplates.
Notably, this includes adding FixedArray and HeapNumber support to
OffThreadFactory.

As a drive-by, OffThreadHandle is redefined to store an Address rather
than an Object, similar to Handle, so that it still works with forward
definitions of types.

Bug: chromium:1011762
Change-Id: I7c8452f450d8c57fe683a9e44532ce5647c84a11
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036084
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66156}
2020-02-06 16:49:04 +00:00
Thibaud Michaud
9c44330d86 [wasm] Add some DCHECKs to the native module cache
And fix a few issues that were already found.

R=clemensb@chromium.org

Change-Id: Ib93626751220dcdd2b9647a6e352bd86bd0ef1ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2039053
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66155}
2020-02-06 15:28:14 +00:00