Commit Graph

60731 Commits

Author SHA1 Message Date
Georg Neis
e920b2e351 [arm32] Fix breakpoints in simulator/debugger
- Debugger stepping assumes that the pc points to the instruction
  that should get executed next, so we need to increment it when
  we hit a stop or a bkpt instruction or else we'll end up in an
  infinite loop.
- The "break" and the "stop unstop" command write into code space, so
  they need to temporarily make code space writable or else they
  just crash. (Note that this doesn't work for embedded builtins.)

Bug: v8:10164
Change-Id: Id77f5e97892076a9fdf8de0230632e0ce979da43
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2026732
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66039}
2020-01-30 09:44:16 +00:00
Jan Krems
f9257802c1 Fix scanner-level error reporting for hashbang
When the file begins with a hashbang, the scanner is in a failed state
when SkipHashbang() is called. This is usually not an issue but when
the parser encounters an ILLEGAL token, it will reset the SyntaxError
location because of it.

Bug: v8:10110
Change-Id: I1c7344bf5ad20079cff80130c991f3bff4d7e9a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1995312
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66038}
2020-01-30 09:28:16 +00:00
v8-ci-autoroll-builder
d651b8e75b Update V8 DEPS.
Rolling v8/build: 2f17606..25075ce

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/2e0a0cb..707a874

Rolling v8/third_party/depot_tools: ea8b58b..1a0daf7

Rolling v8/tools/clang: 535dbf1..953ea7a

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

Change-Id: Ic908ce11f46097bf4b21189879220c21a90b7578
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2028530
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@{#66037}
2020-01-30 04:02:56 +00:00
Ng Zhi An
c10153b4e9 [wasm-simd][liftoff] Implement i32x4.splat
Bug: v8:9909
Change-Id: I53d3b95e1f22e0194ac1a2ed7b556189acb8f9ad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023399
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66036}
2020-01-29 23:15:55 +00:00
Ng Zhi An
3dbbb37223 Fix typo in disasm for psrlq
Change-Id: I78a33d10b2c73d2fa0cb364a7a4b23de0c01d94c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2028516
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66035}
2020-01-29 21:37:20 +00:00
Deepti Gandluri
1b5a3178f8 Revert "[wasm-simd] Fix scalar lowering of kParameter"
This reverts commit e8832647b6.

Reason for revert: Causes flaky fails on the tree, reverting as this test should be deterministic pass/fail.

https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8889903130443940000/+/steps/Check_-_nosse3__flakes_/0/logs/simd-call/0

Original change's description:
> [wasm-simd] Fix scalar lowering of kParameter
> 
> Lowers the call descriptor of a wasm function if it contains simd.
> 
> Also fixes a couple of issues with the lowering of kParameter:
> - the old_index == new_index check is incorrect, it would only work if
> the s128 parameter is the first parameter
> - the old_index was also not adjusted to account for Parameter[0] being
> the wasm instance object
> - new_index needs to be adjusted to account for the instance object too
> 
> These fixes make it more similar to the lowering of kParameter in
> int64-lowering.c.
> 
> Also add a new mjsunit test to exercise this logic.
> 
> Bug: v8:10154
> Change-Id: Ia767a464c26a6a78fd931eab9e6897890a0904e8
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020521
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66032}

TBR=gdeepti@chromium.org,ahaas@chromium.org,zhin@chromium.org

Change-Id: I69589e2331c857c0f197ac53b8fb8a241376c632
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10154
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2028830
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66034}
2020-01-29 20:38:00 +00:00
Andrew Comminos
8580537587 [cpu-profiler] Remove instruction_start field from CodeEntry
This data is duplicated across the code map, and not actually required
for some esoteric types of CodeEntry objects (e.g. inline stacks). Unify
sourcing of this data from the code map instead.

Change-Id: I75fddc03221d1d6b7dab77d16fa05ad6eb3dd2a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2026416
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Cr-Commit-Position: refs/heads/master@{#66033}
2020-01-29 19:31:00 +00:00
Ng Zhi An
e8832647b6 [wasm-simd] Fix scalar lowering of kParameter
Lowers the call descriptor of a wasm function if it contains simd.

Also fixes a couple of issues with the lowering of kParameter:
- the old_index == new_index check is incorrect, it would only work if
the s128 parameter is the first parameter
- the old_index was also not adjusted to account for Parameter[0] being
the wasm instance object
- new_index needs to be adjusted to account for the instance object too

These fixes make it more similar to the lowering of kParameter in
int64-lowering.c.

Also add a new mjsunit test to exercise this logic.

Bug: v8:10154
Change-Id: Ia767a464c26a6a78fd931eab9e6897890a0904e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020521
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66032}
2020-01-29 19:00:30 +00:00
Joshua Litt
f22c213304 [promises] Port remaining promise code to Torque.
Bug: v8:9838
Change-Id: Idc6bda122354a54dd24e39b0356f35b0f54ef089
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2012596
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66031}
2020-01-29 18:02:40 +00:00
Michael Achenbach
01646bc89c Suppress some console functions for fuzzing
Bug: chromium:1044942
Change-Id: I6bc5f9a83e56a67996bb23ff46e1c58c719a2dfb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2027988
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66030}
2020-01-29 18:00:10 +00:00
Dominik Inführ
acb4f3b549 [heap] Disable concurrent_array_buffer_sweeping in single-threaded mode
Bug: chromium:1045937
Change-Id: Ic30db61ec77cb684f927bae0ed45446abcb2e426
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2027989
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66029}
2020-01-29 16:59:30 +00:00
Milad Farazmand
c7e8d66e71 PPC/s390: [wasm] skip liftoff debugger tests
Tests need to be disable until liftoff is fully implemented.

Change-Id: Ib906b7d4ef2abae1359fbfb1a61031eeb5d5e70c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2028289
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66028}
2020-01-29 16:55:24 +00:00
Jakob Kummerow
efaa34b5e5 Fix one more LookupIterator
Copying one object's named properties is always fine, even if one of
the names could be a large index on a TypedArray. Mark the LookupIterator
as OWN_SKIP_INTERCEPTOR to avoid the DCHECK.

Bug: chromium:1044909
Change-Id: I6918186a4b50df7865de3572cb674fd7d6eadb78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023558
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66027}
2020-01-29 16:49:50 +00:00
Jakob Kummerow
a35214a0c5 [turbofan] Repair 'index in typedarray' regression
Bumping the max TypedArray length caused the typer to make different
representation decisions, which caused inefficient back-and-forth
conversions. This patch repairs the microbenchmark where this was
most significant.
There might be additional future work to ensure that TypedArray
accesses that actually use huge indices remain on the fast path as well.

Bug: chromium:1045934
Change-Id: Ic6dccaae35fcdf74a26d47388477a1969bf0aa9f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2026728
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66026}
2020-01-29 16:42:20 +00:00
Leszek Swirski
60f108f984 [ast] Allocate cons strings in young space on main thread
In the case of function names, we allocate ConsStrings only to flatten
them during finalization. Allocating these ConsStrings in old space
appears to have regressed some benchmarks (especially memory benchmarks),
but is necessary for off-thread allocation which doesn't have a young
space.

Ideally, we would avoid allocating these ConsStrings in the first place,
and would flatten the data directly from the AstConsString. For now, we
make them allocate in old space for off-thread allocation only, to
revert the regressions. In the future we can investigate smarter
flattening.

Bug: chromium:1011762
Bug: chromium:1044477, chromium:1044147, chromium:1043573, chromium:1043168
Change-Id: If24b738d6f2eeb8c0fea042a711deb2a19015fbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020948
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66025}
2020-01-29 12:56:23 +00:00
Igor Sheludko
861da54fcb [cleanup] Reformat BUILD.gn file
... using up-to-date git cl format.

Bug: v8:10155
Change-Id: Ie29b492a7831fe2d7c0de247d16f9b7be9e42a5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2026730
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66024}
2020-01-29 12:26:43 +00:00
Igor Sheludko
68cc5c6796 [builtins] Fix FastCreateDataProperty
... which didn't check writability of array length on appending
a new element to an array.

Bug: chromium:1041251
Change-Id: I6935e505a4844e5b22abe9d4a42786619499daa6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023551
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66023}
2020-01-29 12:25:03 +00:00
Jakob Gruber
390c7fed66 Revert "[regexp] Correctly escape a backslash-newline sequence"
This reverts commit 7d1f95d6e4.

Reason for revert: Speculative revert for https://crbug.com/1046678

Original change's description:
> [regexp] Correctly escape a backslash-newline sequence
> 
> When printing the source string, a backslash-newline sequence ('\\\n',
> '\\\r', '\\\u2028', '\\\u2029') should be formatted as '\n', '\r',
> '\u2028', '\u2029', respectively. Prior to this CL it was formatted as
> a backslash followed by the literal newline character.
> 
> Bug: v8:8615
> Change-Id: Iac90195c56ea1707ea8469066b0cc967ea87fc73
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2016583
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Auto-Submit: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65986}

TBR=neis@chromium.org,jgruber@chromium.org

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

Bug: v8:8615,chromium:1046678
Change-Id: If28626a1c6868ed848310c0d30cf61a73326f2c1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2027452
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66022}
2020-01-29 12:08:03 +00:00
Georg Neis
e395871fdb [runtime] Don't invalidate property cell when it becomes read-only
The compiler assumes (for loads) that the property cell of a
non-configurable global property never gets invalidated.

Bug: chromium:1044919
Change-Id: I27f6ce30fb9a21e2c1e5310f25e9bb973ebbc266
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023562
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66021}
2020-01-29 11:06:42 +00:00
Jakob Kummerow
2d10033fba Fix ArrayLengthSetter for suddenly frozen elements
Converting an object to an array length can freeze the array whose
length is being set, but SetLength for the frozen elements accessor
is supposedly unreachable. This fix extends the existing special
handling for suddenly-readonly lengths to cover this case as well.
Prior art: https://codereview.chromium.org/2543553002

Bug: chromium:1044911
Change-Id: I85d2e79446a8d9c1d22cd86ddf828328bf51a1a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023555
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66020}
2020-01-29 10:52:52 +00:00
Ulan Degenbaev
f3e2ad9991 [heap] Separate shared objects from objects of untracked contexts
Currently objects that belong to the untracked contexts (i.e. contexts
for which measurement was not requested) are accounted in the shared
context. This CL introduces a dummy kOtherContext and attributes such
objects to that context.

Bug: chromium:973627
Change-Id: I9801ab317d95b944336b79a5e17721511d4897c3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2025370
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66019}
2020-01-29 09:58:32 +00:00
Ulan Degenbaev
19f23ae9fb [heap] Add per-context accounting of external bytes
The existing legacy performance.memory API accounts external string
and array buffer backing store bytes. This CL adds per-context tracking
of external bytes

Bug: chromium:973627
Change-Id: I2b308dc540454e7b0b66406b83a18bf8f8d55d8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2025369
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66018}
2020-01-29 09:46:42 +00:00
Z Nguyen-Huu
410ca4c50e [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}
2020-01-29 07:03:24 +00:00
v8-ci-autoroll-builder
7fa6c693e2 Update V8 DEPS.
Rolling v8/base/trace_event/common: e327c63..bd79231

Rolling v8/build: fd02540..2f17606

Rolling v8/buildtools: 73414d5..afc5b79

Rolling v8/buildtools/linux64: git_revision:0c5557d173ce217cea095086a9c9610068123503..git_revision:97cc440d84f050f99ff0161f9414bfa2ffa38f65

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/251c765..2e0a0cb

Rolling v8/third_party/depot_tools: 05b001c..ea8b58b

Rolling v8/third_party/zlib: 94485d9..b9b9a5a

Rolling v8/tools/clang: 42fbdfe..535dbf1

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

Change-Id: Ie4dd3f3acb98c7fd3bbba0d5425a2791bf94567e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2027147
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@{#66016}
2020-01-29 04:01:44 +00:00
Ng Zhi An
554a347892 [wasm-simd] Remove f64x2.convert_i64x2_s and _u
These conversion instructions were removed from the proposal in
https://github.com/WebAssembly/simd/pull/178.

Change-Id: I212ca2f923362bf08e178f6d28cc2338cf6f5927
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2016006
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66015}
2020-01-28 18:36:43 +00:00
Andreas Haas
60d5f8cefd [wasm][liftoff] Implement AtomicSub on x64
R=clemensb@chromium.org

Bug: v8:10108
Change-Id: I1a0546b4a5b754dcf35c66594ac7c5c37d940001
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2019484
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66014}
2020-01-28 15:34:33 +00:00
Liviu Rau
ca02cfc698 [deps] Add android_platform to deps
Added the new dependency pointing to head of this repo:
https://chromium.googlesource.com/chromium/src/third_party/android_platform/

A more relevant dry run can be found below where I also included the changes that the auto-roller was unable to land.
https://chromium-review.googlesource.com/c/v8/v8/+/2023553

Bug: chromium:1043646
Change-Id: Ife6547ca9cbb7f303beb48c330d1b4457495dd83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023556
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66013}
2020-01-28 15:19:54 +00:00
Dan Elphick
a811f58432 [cleanup] limit headers in instruction.cc
Remove include for state-values-utils.h and add node.h and
utils/ostream.h.

Bug: v8:10155
Change-Id: I3662018b546a0a9b82bc2cc72f3a8ced27156fe0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023557
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66012}
2020-01-28 15:06:03 +00:00
Milad Farazmand
02253a90ea s390: [wasm-simd] Implement simd unary and boolean operations
Change-Id: I0c85de569b75e47dddb54c2dc4101da252547751
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023370
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#66011}
2020-01-28 14:51:13 +00:00
Andreas Haas
62cde0061f [wasm][liftoff] Implement Atomic[And|Or|Xor] on x64
R=clemensb@chromium.org

Bug: v8:10108
Change-Id: I0a561a007ffd5327f47f68cc605b9eae57829d8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2016596
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66010}
2020-01-28 14:32:06 +00:00
Dan Elphick
3387b7706e [objects] Fix type of ByteCodeArray::source_position_table
Declare that ByteCodeArray's source_position_table entry can also
contain Exception. (Also adds the Exception type to base.tq).

This is just a clean up for now but could be required if torque starts
generating checks for Union types (including differentiating between
different Oddballs).

Change-Id: Ie34ade100040df2f3a2e8120613b6b29d604984a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2019483
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66009}
2020-01-28 13:20:33 +00:00
Simon Zünd
e99d4e77be REPL mode must only re-write AST on successful parses
This CL fixes a parser crash in REPL mode. Some SyntaxErrors can cause
the AST to contain NULL nodes, resulting in a crash when we want to
rewrite the AST after parsing.

Instead of re-writing a broken AST we bail early.

R=leszeks@chromium.org

Bug: chromium:1040034, chromium:1045758
Change-Id: I9c559f6de5969c8db17833ccbdb1608627b46311
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023547
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66008}
2020-01-28 13:09:13 +00:00
Philip Pfaffe
c51c9f7ca9 Improve iterator_range to take non-&& arguments
The current implementation takes forwarding reference arguments, which
is fine when you call it with rvalues, like
make_iterator_range(V.begin(), V.end()). If you call it with lvalues
though, it doesn't do what you'd expect. ForwardIterator becomes a
reference:

Foo I = V.begin();
make_iterator_range(I, I); //ForwardIterator is deduced as Foo&

Since iterator are supposed to be small, no harm in passing them by
value.

Change-Id: I151c87304949d810c72c42f60e9d1a7151f61f83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020780
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66007}
2020-01-28 13:03:43 +00:00
Ulan Degenbaev
8c8732f415 [heap] Add missing per-context size accounting
This adds accounting for
- StringTable that is marked black directly without going through
  ProcessMarkingWorklist.
- DescriptorArray that is marked black directly inside VisitMap.
- FeedbackMetadata that erroneously was assigned kVisitDataObject
  visitor id, which works only for a fixed size data object.

Bug: chromium:973627
Change-Id: If7c8bca06316f60e975bf86beea09481df8aca8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023545
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66006}
2020-01-28 10:59:34 +00:00
Michael Achenbach
bc6ebfec81 [foozzie] Add mock for maximum SharedArrayBuffer
No-Try: true
Bug: chromium:1045795
Change-Id: I8313194bd1b0706291bd6a041d370a0b43215e10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020956
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66005}
2020-01-27 19:27:46 +00:00
Dominik Inführ
3ec36776a0 [heap] Do not start array buffer sweeping task without any work
RequestSweep started an array buffer sweeping task even when there was
no work.

Bug: chromium:1045937
Change-Id: Ieb0835284f898dbc9b899d2b4118d9f7f6108a6f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020961
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66004}
2020-01-27 18:07:56 +00:00
Andreas Haas
8060c26755 [wasm] Remove negation in --wasm-no-[bounds-checks|stack-checks]
The flag naming was confusing, and inconsistent with other flags. To
disable bounds checks, you now have to say --no-wasm-bounds-checks
instead of the original --wasm-no-bounds-checks. Similarly, it is now
--no-wasm-stack-checks instead of --wasm-no-stack-checks.

R=clemensb@chromium.org

Bug: v8:10021
Change-Id: Ib57963866af794d4e47d68e520a42b4054ed2a8f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2017475
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66003}
2020-01-27 17:04:05 +00:00
Leszek Swirski
272f9182b3 [ast] Add leszeks@ to src/ast owners
Change-Id: I64b2ae64dc668a937be0bf2950199b4f3d543f50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020778
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66002}
2020-01-27 17:02:59 +00:00
Clemens Backes
1e6732f1cc Revert "[wasm] Cache streaming compilation result"
This reverts commit 015f379aa1.

Reason for revert: Msan is unhappy: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/30702

Original change's description:
> [wasm] Cache streaming compilation result
> 
> Before compiling the code section, check whether the
> bytes received so far match a cached module. If they do, delay
> compilation until we receive the full bytes, since we are likely to find
> a cache entry for them.
> 
> R=​clemensb@chromium.org
> 
> Bug: v8:6847
> Change-Id: Ie5170d1274da3da6d52ff1b408abc7cb441bbe3c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002823
> Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66000}

TBR=clemensb@chromium.org,thibaudm@chromium.org

Change-Id: Idfa5b3f354816eb600ae7aab7857063d5d0d27ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6847
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2022949
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66001}
2020-01-27 17:01:55 +00:00
Thibaud Michaud
015f379aa1 [wasm] Cache streaming compilation result
Before compiling the code section, check whether the
bytes received so far match a cached module. If they do, delay
compilation until we receive the full bytes, since we are likely to find
a cache entry for them.

R=clemensb@chromium.org

Bug: v8:6847
Change-Id: Ie5170d1274da3da6d52ff1b408abc7cb441bbe3c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002823
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66000}
2020-01-27 16:42:15 +00:00
Clemens Backes
c29868ba72 [wasm] Fix flaky failure in tier-down-to-liftoff test
Since the {kFinishedRecompilation} event can happen either before or
after the {kFinishedTopTierCompilation} event, we should not check it's
order relative to the other events.

R=ahaas@chromium.org

Bug: v8:10086
Change-Id: I880700b514c7c2238a0eb7791875bf0b81c64e97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020779
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65999}
2020-01-27 15:39:05 +00:00
Andreas Haas
82b78191ef [wasm][liftoff] Zero-extend result of atomic.add
R=clemensb@chromium.org

Fix: chromium:1045737
Change-Id: I0e27b8ff6ab09078a2f63f955e6123e1003ed889
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020768
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65998}
2020-01-27 14:02:35 +00:00
Steve Blackburn
6de6fdd034 TODO makes future intentions clear.
This TODO clarifies intentions of 49f60a3.

Bug: v8:9533
Change-Id: Ide448ae863a8716dafdcdd7fb27801a51655650e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2022145
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Cr-Commit-Position: refs/heads/master@{#65997}
2020-01-27 11:39:55 +00:00
Steve Blackburn
0b596c0077 Clean up of (de)serialization's dependence on read only heap.
Bug: v8:9533
Change-Id: Id51430bb2ad7a782cf30542d0d7117d271079423
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2019164
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Cr-Commit-Position: refs/heads/master@{#65996}
2020-01-27 11:22:55 +00:00
Ben Noordhuis
872bc2d17f [api] Fix DCHECK on API failure
Utils::ReportApiFailure() contains logic to handle the case where no
isolate has been entered but it called Isolate::Current(), which DCHECks
when there is no active isolate. Switch to Isolate::TryGetCurrent().

See https://github.com/denoland/rusty_v8/issues/253 for background.

Change-Id: I73c28c31102c0c4ab216a925d22ad54174c7911d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020943
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65995}
2020-01-27 11:12:45 +00:00
Clemens Backes
4299cb69fb [wasm] Introduce declared_function_index helper
We often only need to store information about declared (i.e.
non-imported) functions in a wasm module. Thus we remove the number of
imported function from a function index. We do this in several places,
with different amount of checking.

This CL extracts this logic to a new {declared_function_index} helper
and uses it wherever we do this translation. This more or less
establishes the concept of "declared function index" and hopefully
prevents errors in the future.

R=jkummerow@chromium.org

Bug: chromium:1045767
Change-Id: I7e957401495a2a8cb5d2c51031f9c69fe46195d8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020763
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65994}
2020-01-27 10:53:35 +00:00
Clemens Backes
dd11f9799e [wasm] Fix asm.js toString for modules with imports
Fix the string representation of functions exported from asm.js modules
in the presence of imported functions.

R=jkummerow@chromium.org

Bug: chromium:1045767, chromium:667678
Change-Id: I55714252036511598eeec7fe7b81985213f7e4f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2022142
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65993}
2020-01-27 10:34:35 +00:00
Steve Blackburn
49f60a3b1d Refactor deserialization allocation.
Deserialization bypasses the heap allocators, bumping pointers into the
spaces directly, instead.  So the deserializer is tightly coupled to the
implementation of the existing collector.

Here I've added an interface to heap.h for this purpose.  This CL
leaves things as-is unless the TPH is enabled, in which case the new
interface is used.

Future work: use the heap.h interface in all cases.

Bug: v8:9533

Change-Id: I3b1cc81870b347fbfb509ddb4031bd3781710240
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2019482
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65992}
2020-01-27 10:30:15 +00:00
Peter Marshall
73f4ac62ed [inspector] Add a test for const declaration and side effects
Add a test that does the same thing the devtools-frontend does when
evaluating console inputs.

1) Declare a const variable with throwOnSideEffect=true. This should
throw.
2) Declare the same const variable with throwOnSideEffect=false.
This should successfully declare the variable.

Previously it could be the case that even though we threw in 1), the
variable would fail to be initialized in 2) with a re-declaration
error.

Bug: chromium:1043151
Change-Id: I1a6126b518f7bb3788c39b9f8e3adb8850aa962a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2016587
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65991}
2020-01-27 10:10:56 +00:00
Liviu Rau
d7a2973fb2 [fuchsia] Finalize rename & add test configuration for test runner
Bug: chromium:1033865
Change-Id: I63999575d4962124a4d9a64c4e661900aec5fa6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2019167
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65990}
2020-01-27 09:54:25 +00:00