Commit Graph

60507 Commits

Author SHA1 Message Date
Peter Marshall
78176faf75 Revert 2 ScriptContext CLs
Reason: Breaks side-effect free debug evaluate for let/const declarations

Revert "[interpreter/runtime] Create ScriptContext before Script invocation"

This reverts commit 9e51f79e27.

Revert "[interpreter/runtime] Hole script let/const requiring initialization in NewScriptContext"

This reverts commit a128e38f8b.

TBR=verwaest@chromium.org,leszeks@chromium.org,szuend@chromium.org,ulan@chromium.org

Bug: chromium:1043151
Change-Id: Ib802789f45f8d7dbb4c2ccc30c6246e32155a92b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2013112
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65915}
2020-01-22 14:21:15 +00:00
Philip Pfaffe
f23945b82b Remove special handling of wasm scripts based on the SourceMapURL
Get rid of two left-over special-cases for wasm scripts that have (or
don't have) a SourceMapURL attached to them.

Bug: chromium:1013527
Change-Id: I51bab8074011299e6f0d1fd32d93e4cb559bd476
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2013113
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65914}
2020-01-22 14:13:29 +00:00
Philip Pfaffe
827107a7dc [wasm-debug] Let wasm scripts report correct column information.
In the debugger, wasm scripts currently do not contain meaningful column
informations. Fix that by keeping track of the offset and size of the
wasm code section inthe module and reporting that to the debugger.

Bug: chromium:1042636
Change-Id: Ie2b5d3a50952a467d256f815c16e459cb0ae600e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011083
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65913}
2020-01-22 14:12:06 +00:00
Andreas Haas
e56a7edbed [turbofan] Don't assume that Word32AtomicPairLoad has a projection-0
The instruction selector assumed for Word32AtomicPairLoad node that if
there exists a Projection(1) user, then there also exists a
Projection(0) user. This, however, is not the case, because TurboFan
eliminates unreachable nodes. The missing projection node lead to a
failed DCHECK in the register allocator.

To fix the problem I use now the Word32AtomicPairLoad node directly to
allocate the register. On ia32 I stop additionally to allocate unneeded
temp registers.

R=gdeepti@chromium.org
CC=zhin@chromium.org

Bug: chromium:1042379
Change-Id: I79bd9f3f4672e147246a71c32b7c9b4dbd79b17f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002547
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65912}
2020-01-22 11:54:36 +00:00
Joey Gouly
13b400cb6a [codegen][arm64] Use ldp instead of 2 ldrs before a TailCall
A port of https://chromium-review.googlesource.com/c/v8/v8/+/2011103
for arm64. Saves 2784 bytes (0.2%) in the arm64.release embedded.S

Change-Id: Ifae6b3f220356ab286b49750c7ae422e4b6d4306
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2013107
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Joey Gouly <joey.gouly@arm.com>
Cr-Commit-Position: refs/heads/master@{#65911}
2020-01-22 11:51:25 +00:00
Georg Neis
3fe6f95c6a [turbofan] Add CHECKs to hunt down a crash
Bug: chromium:1027130
Change-Id: Ifd1f355ce266e672183f337f114432f11a866a52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011835
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65910}
2020-01-22 09:53:13 +00:00
Johannes Henkel
f82c27f7b1 [DevTools] Remove all calls to ::toJSONString from V8. (V8)
Instead, serialize to CBOR, then convert to JSON.
I plan to remove the JSON serialization support from
protocol::Value and from the generated types. We're
close - three files here, four files in Chromium.

Change-Id: I067dc896dad1bb7cd95914b3dcc86597f136251b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2008751
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65909}
2020-01-22 09:09:43 +00:00
Clemens Backes
a184598fb4 [wasm] Deprecate unused {DeserializeOrCompile} API
This API was used for IndexedDB support and for transferring modules by
serializing and deserializing (before we were sharing code between
isolates). Last uses were removed in https://crrev.com/c/1847366, thus
this whole API is unused by now.
This CL deprecates the API and refactors tests to use the internal APIs
instead.

R=adamk@chromium.org

Bug: v8:10146
Change-Id: I838039b4be7ea4eebe6769f31f48e51e7bcd4645
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2006090
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65908}
2020-01-22 08:46:23 +00:00
Michael Achenbach
bb278115ca [test] Ensure restoring of signal handler when tests terminate
Otherwise, the last tests that ran in a worker keep sitting on their
sigterm handlers without any running processes. This creates
exceptions when workers terminate.

Bug: v8:8292
Change-Id: Iefb9a4a353399c1e3168eae2916e3cedca4e09b3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011831
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65907}
2020-01-22 08:04:03 +00:00
Clemens Backes
9e3f60700a [api] Fix link in the API header
The previous link does not use http, and redirects to
http://developers.google.com/v8/?csw=1, which again redirects to
https://v8.dev/.
Thus place the proper link directly.

R=ulan@chromium.org

No-Try: true
Change-Id: Ifb4fa7cbb5727bab1a2e46ce1801fdef7c70a5ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010797
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65906}
2020-01-22 07:46:13 +00:00
Clemens Backes
c4e2e84d13 [wasm] Skip checks when decoding asm offset table
Since we create the asm offset table ourselves, we can skip all decoder
error checks when decoding it. We keep DCHECKs though to catch errors
early and give fuzzers a change to find inconsistencies in our encoding
and decoding.

R=jkummerow@chromium.org

Bug: chromium:667678
Change-Id: I2c77f3857548057ce5c432d1c6f5576d66ca5cd1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011086
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65905}
2020-01-21 18:36:18 +00:00
Ng Zhi An
51067cc22c [wasm-simd][liftoff] Fix spills of S128 values on ARM
Add a case for kWasmS128 in Spill. We encounter this in the
wasm-trace-memory-liftoff test, but that test was skipped on ARM and
ARM64 due to insufficient implementation of Liftoff on those archs. But
with recent changes, they are now capable of running this particular
test, so we enable it.

Drive-by fix for incorrect size used in vld1 for filling S128 values.

Bug: v8:9909
Change-Id: I8addd06ba3c9a40364e432180cd5dbc48debca23
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007901
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65904}
2020-01-21 18:35:14 +00:00
Zhi An Ng
5b981d35b0 Revert "Reland "[wasm] Perform NativeModule tier down in parallel.""
This reverts commit faccc95b77.

Reason for revert: Causing some failures, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20verify%20csa/15741 and https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64/35635 and https://ci.chromium.org/p/v8/builders/ci/V8%20Mac64/32736

Original change's description:
> Reland "[wasm] Perform NativeModule tier down in parallel."
> 
> This is a reland of 3352fcc900
> 
> Disable stress-opt for test and check recompilation before clearing
> callbacks.
> 
> Original change's description:
> > [wasm] Perform NativeModule tier down in parallel.
> >
> > Reuse logic in {CompileNativeModule} function in module-compiler.cc:
> > initialize parallel compile jobs, then wait for them to finish while
> > taking part in this compilation.
> >
> > Bug: v8:9654
> > Change-Id: I9974d9f8b516e9faec716a592c7c0ee9c7077d8e
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1977041
> > Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> > Reviewed-by: Clemens Backes <clemensb@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#65763}
> 
> Bug: v8:9654
> Change-Id: I8e8830f05e189596207365b7332a2cc25e493e47
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002945
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65901}

TBR=clemensb@chromium.org,duongn@microsoft.com

Change-Id: I99f5a5455a022d0cbff3da54610cedfe6380a094
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9654
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2012985
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65903}
2020-01-21 18:10:23 +00:00
Clemens Backes
49ca64b8ec [wasm] Add GraphAssembler to WasmGraphBuilder
This is a pure refactoring to make the {GraphAssembler} available in all
of {WasmGraphBuilder}, including {WasmWrapperGraphBuilder}.
Future CLs will use more features of the {GraphAssembler} for building
wasm graphs.

The {WasmGraphAssembler} class will be extended to contain functionality
only needed (or making sense) in the context of wasm.

Drive-by: Move fields to the end of the {WasmGraphBuilder} class.

R=jkummerow@chromium.org

Bug: v8:10123
Change-Id: Idf44915944882adec75ef002ec577f63b2317a17
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011825
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65902}
2020-01-21 16:57:53 +00:00
Z Nguyen-Huu
faccc95b77 Reland "[wasm] Perform NativeModule tier down in parallel."
This is a reland of 3352fcc900

Disable stress-opt for test and check recompilation before clearing
callbacks.

Original change's description:
> [wasm] Perform NativeModule tier down in parallel.
>
> Reuse logic in {CompileNativeModule} function in module-compiler.cc:
> initialize parallel compile jobs, then wait for them to finish while
> taking part in this compilation.
>
> Bug: v8:9654
> Change-Id: I9974d9f8b516e9faec716a592c7c0ee9c7077d8e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1977041
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65763}

Bug: v8:9654
Change-Id: I8e8830f05e189596207365b7332a2cc25e493e47
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002945
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65901}
2020-01-21 16:56:48 +00:00
Clemens Backes
87f09404b2 Move decoded asm.js offset table off-heap
The asm.js offset table exists in two forms: Delta-encoded in a byte
array, as generated during asm translation, and decoded, for faster
lookup.
This CL moves the encoded version from the {AsmWasmData} and
{WasmModuleObject} to the {WasmModule}, and stores it off-heap in a C++
array instead of a {ByteArray}.
Also, it moves the decoded version off-heap by storing it in a C++ data
structure that makes lookup easy, instead of encoding it again in
another {ByteArray}.

This change is a nice refactoring in itself, but it also prepares adding
more information to the offset table. For reconstructing the source code
of an asm.js function, we will need to store the start and end offsets
of the whole function as well (see linked bug).

R=jkummerow@chromium.org

Bug: chromium:667678
Change-Id: I79b789c3122dd8ba803cedc6bfdcc3d4b1fa0fd4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011108
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65900}
2020-01-21 16:55:44 +00:00
Joshua Litt
182b43d4d5 [promises] Port promiseAll to torque.
Bug: v8:9838
Change-Id: I04383cba6dcb5fc61c82cb8018160aff6fed3b15
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1988794
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65899}
2020-01-21 16:35:33 +00:00
Clemens Backes
365d7c80e2 [wasm] Fix deserializer test
The test was supposed to manipulate the serialized bytes to make them
invalid, but the value at the manipulated position was already 0, hence
the bytes stayed valid. This went unnoticed before
https://crrev.com/c/2010786, since there was a fallback anyway to
re-compile the module if deserialization fails.

This CL fixes this by using the right offset, and checking that the
value there is not already zero.

R=thibaudm@chromium.org

Change-Id: Ie0eaf2c8ee9e8c4c477f717f3d8aed8564b3adbf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007493
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65898}
2020-01-21 16:20:33 +00:00
Milad Farazmand
9cd1f8260b PPC: Fix return register number for unwinding
Change-Id: I6586dc2b681b93cb5401b3e990786ee407baff73
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2012520
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#65897}
2020-01-21 15:57:03 +00:00
Andreas Haas
799d951fcf [wasm][ia32] Implement atomic load and store in Liftoff
R=clemensb@chromium.org

Bug: v8:10108
Change-Id: Icbb00a268c311b133195a2ffbcb66dc8f1c72a0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1997142
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65896}
2020-01-21 15:38:23 +00:00
Thibaud Michaud
2be674e751 [wasm] Move native module cache in its own class
Move caching logic out of the {WasmEngine} and in its own
{NativeModuleCache} class, with its own mutex.

R=clemensb@chromium.org

Bug: v8:6847
Change-Id: I73067fd9f0556e57c28782088dcb772a14265154
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2004613
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65895}
2020-01-21 15:33:54 +00:00
Clemens Backes
9914f26d56 [wasm] Allow --trace-liftoff without --trace-wasm-decoder
There is not really a reason to guard the first by the latter. Just emit
a hint if --trace-liftoff is used without --trace-wasm-decoder, but
still make it work.
Also, used DEFINE_DEBUG_BOOL instead of guarding the output by another
"#ifdef DEBUG".

R=ahaas@chromium.org

Change-Id: Ia7d3f504df92779447877612e98b9c2a847b9f6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011828
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65894}
2020-01-21 15:27:13 +00:00
Tobias Tebbi
c46a41fadd [torque] fix inaccurate UnsafeCast in array-slice.tq
Bug: chromium:1039112
Change-Id: Ia9a6a4f9c3782852bcb83dd334f5dba0c8cd74a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011823
Commit-Queue: Joshua Litt <joshualitt@chromium.org>
Reviewed-by: Joshua Litt <joshualitt@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65893}
2020-01-21 15:01:24 +00:00
Liviu Rau
734169f9b0 [torque] Add support for torque output comparison
Bug: v8:9641
Change-Id: Ia85d14677e8eb7d2d14ff7eb150a1b0b279642f4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1998078
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65892}
2020-01-21 14:39:04 +00:00
Clemens Backes
51d6f2d6a7 [wasm] Remove dead field
The {locals_names} in {WasmDebugInfo} was left unused after
https://crrev.com/c/2002541. All uses and even all accessors are removed
already.

R=thibaudm@chromium.org

Bug: v8:10019
Change-Id: Ib7ce61cf8c6a749b0919a8a6857664e2ab354785
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011101
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65891}
2020-01-21 14:22:25 +00:00
Clemens Backes
6c775639b8 [wasm] Skip new test also in lite mode
Lite mode implies jitless, hence we also need to skip in lite mode.

TBR=thibaudm@chromium.org

Bug: v8:6847
Change-Id: I0147b2604180e3801d5e939619ea00a87220f7ec
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011830
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65890}
2020-01-21 14:18:53 +00:00
Milad Farazmand
c177666cc3 Add support for emitting DW_CFA_restore_extended
This CL enables emitting register codes that are
greater than 6 bits by encoding it as a LEB128.

Change-Id: I35675b5ef6a935f785035aa101ed4ca812af251e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2008305
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#65889}
2020-01-21 14:15:00 +00:00
Clemens Backes
9349fb784f [wasm] Refactor and fix wasm serialization test
This fixes a few issues:
1) It avoids using the {DeserializeOrCompile} API method, which is not
   used in chrome any more and will be deprecated soon.
2) It switches to the {DeserializeNativeModule} internal method, which
   really checks deserialization in isolation and does not fall back to
   compiling the wire bytes if the serialized bytes are incorrect.
3) It disables a test which tried to invalidate the number of functions,
   but the respective bytes were already zero, so nothing was
   invalidated. This still needs to be fixed in a follow-up CL.
4) It serializes the modules in a separate isolate, which then gets
   disposed to free references to the NativeModule and remove it from
   the modules cache. Otherwise we will just never deserialize, but use
   the cached module instead.

R=thibaudm@chromium.org

Bug: v8:6847, v8:10146
Change-Id: I37ef524a9c96c32fec2e7466488d67395fa5ccea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010786
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65888}
2020-01-21 14:13:53 +00:00
Thibaud Michaud
1c9bb77de5 [wasm] Share native modules for async compilation
Use the native module cache for asynchronous, non-streaming compilation.

R=clemensb@chromium.org

Bug: v8:6847
Change-Id: Ie4c9469ee8cfdd6b987b70be6e237734a5de9733
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002542
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65887}
2020-01-21 13:33:04 +00:00
Santiago Aboy Solanes
498be7bdbd [x64] Remove TruncateInt64ToInt32 before ChangeInt32ToInt64
There is no need to truncate if we are going to extend it again.

At first glance it looks like we can eliminate both steps but
unfortunately the Change is still needed since it will write on the
top bits.

Change-Id: I06d9776384a76f7b2a4454a9176926b3bcef2f2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010111
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65886}
2020-01-21 12:34:53 +00:00
Dan Elphick
5a05383acd [debug] Collect source positions Debug::PrintBreakLocation
Force source position collection when using --print-break-location.

Bug: v8:10132
Change-Id: I4706d9f1e09c52ca7bfb2410485bc3ef26c2128a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011821
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65885}
2020-01-21 12:07:03 +00:00
Milad Farazmand
125ab19f62 [test] Add the missing algorithm header
Compilation is failing on certain versions of gcc with:
'sort' is not a member of 'std'
'adjacent_find' is not a member of 'std'
'count' is not a member of 'std' and

Bug: v8:10145
Change-Id: I0672636987c515485318d29d251c3b49a22ff374
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2008307
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: Milad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65884}
2020-01-21 12:05:14 +00:00
Ross McIlroy
2186828f17 [Compiler] Verifying ReferenceMaps in register allocator verifier
Adds support to the register allocator verifier to keep track of which
stack slots contain tagged pointers, but have not been tracked by the
reference map and so could contain stale values (i.e., not traced by a
garbage collection).

BUG=v8:9684

Change-Id: I8dd9925f0cb71cac4ae3e49f467767454694e515
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007488
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65883}
2020-01-21 11:17:32 +00:00
Dan Elphick
5668c90956 [codegen] Use ldm instead of 2 ldrs before a TailCall
Combines 2 ldrs into a single ldm (without writeback since the
instruction uses fp as base and as a target). Shrinks the builtin
instruction size on ARM by 2932 bytes.

Change-Id: Id74e1e158a9d5db49caa2927e88df2a350adafab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011103
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65882}
2020-01-21 10:59:32 +00:00
Georg Neis
ad583fcd4f Revert "[turbofan] Make hints equality cheaper using hashing"
This reverts commit 50a80c9359.

Reason for revert: We want to understand if this change is
necessary to avoid renderer hangs.

Original change's description:
> [turbofan] Make hints equality cheaper using hashing
> 
> Put the nesting limit of the serializer back to 25.
> 
> Bug: chromium:1034768
> Change-Id: I7ea827d27241ea930bae40142069bab1962e4133
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1981156
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65630}

TBR=mvstanton@chromium.org,mslekova@chromium.org

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

Bug: chromium:1034768
Change-Id: I7aaf71e665e35999ea9c1b8d2680678add17bf96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010115
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65881}
2020-01-21 10:26:12 +00:00
Georg Neis
34d51668d1 [turbofan] Eliminate some broker arguments
If we assume that kMaxHintsSize is at least 1, we can reduce the
clutter of broker arguments somewhat.

Bug: v8:7790
Change-Id: I6c6607f694e420ef50a07202d0c98cbff7471af9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011084
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65880}
2020-01-21 09:57:06 +00:00
Andreas Haas
f506c609bd [x64] Implement xadd in the assembler
This CL introduces the xadd instruction to the x64 assembler so it can
be used to implement WebAssembly's AtomicAdd. This is done in a
separate CL though.

R=clemensb@chromium.org

Bug: v8:10108
Change-Id: I36dcb900ed4c39b23c4996328774780afd8b816a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011105
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65879}
2020-01-21 09:54:45 +00:00
Bill Ticehurst
99641cb424 Fix native stacks flag for pointer compression
The interpreted-frames-native-stack flag has been broken since pointer
compression was enabled. This fixes the load of the field.

Bug: v8:10138
Change-Id: I746407a7a5680c5d3e9a3b190371af00818282b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011206
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65878}
2020-01-21 09:40:57 +00:00
Jakob Gruber
7fe5ce4291 [gasm] Trigger IfBuilder0 graph generation in destructor
To improve ergonomics, graph generation is now triggered by the
IfBuilder0 destructor instead of requiring an implicit call to
Build().  This will be more expected for gasm users, since no other
builders require such a Build() call.

Drive-by: Rename 'ForSmiZeroUntil' methods to 'ForZeroUntil' since
'Smi' doesn't make sense in this context (TF only knows the Number
type here).

Bug: v8:9972
Change-Id: I365805e8428b35f19760e6ff155423463194b0f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011107
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65877}
2020-01-21 08:56:18 +00:00
Simon Zünd
230e4ed0e1 Mark intrinsics AsyncFunction{Enter,Reject,Resolve} as side-effect free
This fixes the DevTools console preview when using REPL mode.
AsyncFunction* intriniscs are side-effect free and marking them as such
is correct.

Bug: chromium:1043151
Change-Id: Ie0c36507b98b0c12f3d627c34102c04c27358ff2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010106
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65876}
2020-01-21 08:45:17 +00:00
Tobias Nießen
f2bd9c6cbf [wasm] Fix silent failure with --dump-wasm-module
The previous behavior failed silently if the file could not be opened
in the first place, and only wrote to stderr if writing failed after
opening the file successfully.

Change-Id: I1d1058134efd9298b60b65191ed6334de24d3f52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1972886
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65875}
2020-01-21 08:38:17 +00:00
Jakob Gruber
e3602c111e [gasm] Port the PromiseConstructor reduction to GraphAssembler
The most interesting part of this change is that try-catch patterns
are now supported by graph assembler through TryCatchBuilder0.

Bug: v8:9972
Change-Id: I6ef0d51d4a1973eb8a30a5072c630261860f0a05
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1986000
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65874}
2020-01-21 06:10:17 +00:00
Wez
26f2c1cc61 [test] Configure GTest for thread-safe death tests.
Most V8 unit tests are multi-threaded, so configure GTest to use the
thread-safe GTest implementation by default.

This can be overridden on a per-test basis by setting:
  testing::FLAGS_gtest_death_test_style = "fast";
during the test's SetUp() (see the GTest documentation for details).

Bug: v8:10143
Change-Id: I7414c5d8ae22eb8d9b8c4813f958ca571e1d0310
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2011085
Commit-Queue: Wez <wez@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65873}
2020-01-20 20:03:54 +00:00
Wez
1a9eee0ae9 [test] Correctly restore allocator on SequentialUnmapperTest teardown.
The SequentialUnmapperTest replaces the process-global PageAllocator
with a wrapper which tracks allocations.  The suite was deleting the
tracking allocator without first restoring the original PageAllocator,
causing any subsequent tests which tried to use it to use-after-free.

Bug: chromium:934932
Change-Id: I0f69b6a07542a3f381724afdbfb2e9b67a9f39de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010113
Commit-Queue: Wez <wez@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65872}
2020-01-20 20:02:34 +00:00
Georg Neis
e33d633896 [turbofan] Don't verify context input of Create*Context nodes
The verifier tried to assert that the context input of Create*Context
nodes has type OtherInternal (all Context constants have that type).
This didn't quite work because of OSR values so actually it checked
something much weaker. And what it checked still doesn't work because
of dead code, in which the context input might statically be known to
be the undefined value. I'm removing the assertion entirely now.

I suspect that there are other assertions in the verifier that don't
hold in the OSR code or in dead code. We are discussing a more general
solution such as inserting TypeGuards in the relevant cases.

Bug: chromium:1037771
Change-Id: I6fb59c60e7120d5984ea0fe140269f2df6de8708
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010792
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65871}
2020-01-20 18:25:04 +00:00
Georg Neis
d99eaef7c7 [turbofan] Remove redundant or bogus comments from verifier
Change-Id: Icc86a805d1eef8c3c805f956d805c43923e6422b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007504
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65870}
2020-01-20 18:21:14 +00:00
Z Nguyen-Huu
d1b3682008 Fix perf regression in RegExp/Match
Existing Torque code uses bounds-checked access and it seems to hurt
perf. Change to use UnsafeLoadFixedArrayElement.

Bug: chromium:1028605
Change-Id: Ifcf3b9d181b4ec0ed1b757eeed466b0f76808578
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007894
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65869}
2020-01-20 18:05:04 +00:00
Clemens Backes
dd82d95a24 [utils] Fix construction of constant OwnedVector
I hit this issue in an unrelated CL and it took me a while to figure out
what's happening.
This CL will allow the creation of constant OwnedVectors via
{OwnedVector<const T>::Of(collection)}.

R=tebbi@chromium.org

Change-Id: I337077a6c3960a2a2a8d857bec7450f664b87a3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2010109
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65868}
2020-01-20 17:11:52 +00:00
Santiago Aboy Solanes
7763a926d7 [node] OwnedBy fix for only one owner check
In the case of having:
 * NodeA(...)
 * NodeB(NodeA, NodeA), with this being the only use of NodeA.
this CL gives A's ownership to B.

Before, we used to say that B didn't have ownership of A due to A having
two uses.

This brings it in line with OwnedBy with two owners check:
abd1a0fc04:src/compiler/node.cc;l=291

Change-Id: I15fdf373136a21bf423e6dffd9588054fd720d72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007502
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65867}
2020-01-20 16:36:02 +00:00
Mythri A
92df7d10f6 Only flush feedback vector on bytecode flush
When bytecode is flushed we also want to flush the feedback vectors to
save memory. There was a bug in this code and we flushed
ClosureFeedbackCellArray too. Flushing ClosureFeedbackCellArrays causes
the closures created by this function before and after the bytecode
flush to have different feedback cells and hence different feedback
vectors. This cl fixes it so we only flush feedback vectors on a
bytecode flush.

Also this cl pretenures ClosureFeedbackCellArrays. Only FeedbackCells
and FeedbackVectors can contain ClosureFeedbackCellArrays which are
pretenured, so it is better to pretenure ClosureFeedbackCellArrays as
well.


Bug: chromium:1031479
Change-Id: I7831441a95420b9e5711f4143461f1eb7fa1616a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1980582
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65866}
2020-01-20 16:12:42 +00:00