Commit Graph

10213 Commits

Author SHA1 Message Date
Yang Guo
0a7e08ef26 [compiler] finalize compile jobs asap when compiling on main thread
Previously, we finalize all compile jobs at once. This keeps the zone memory
in every compile job alive until the end. This contributes to a high peak
memory when many functions are compiled eagerly, for example when producing
cache data for the ServiceWorker cache.

Memory tracked by the AccountingAllocator in bytes, prior to this change in
the test case:
peak memory after init:              8192
peak memory after lazy compile:     41200
peak memory after lazy compile:     41200
peak memory after eager compile:   164256

With this change, if we are compiling on the main thread, we finalize every
compile job as soon as it is done and dispose the compile job and its zone
memory.

After this change:
peak memory after init:              8192
peak memory after lazy compile:     41200
peak memory after lazy compile:     41200
peak memory after eager compile:    41376

R=leszeks@chromium.org, rmcilroy@chromium.org

Bug: chromium:901329
Change-Id: Iae0c89396c89692c4ecdeec3970d3c62031d2bce
Reviewed-on: https://chromium-review.googlesource.com/c/1322949
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57340}
2018-11-08 07:29:15 +00:00
Deepti Gandluri
4f6ba3852b Reland "[wasm-simd] Implement remaining I8x16 SIMD ops on x64"
This is a reland of de88bfb270

Original change's description:
> [wasm-simd] Implement remaining I8x16 SIMD ops on x64
> 
>  - Implementation for I8x16 Shifts, and Mul
>  - Fix convert bug
>  - Enable all tests except for shuffle tests
> 
> Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
> Reviewed-on: https://chromium-review.googlesource.com/c/1318609
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57254}

Change-Id: Id2f6eef3a07e40df37af29456116754e7cf5b901
Reviewed-on: https://chromium-review.googlesource.com/c/1320031
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57326}
2018-11-07 18:42:23 +00:00
Toon Verwaest
9d27ec3aac [parser] Introduce FailureExpression to return instead of nullptr
That allows us to keep on running further without explicit RETURN_IF

Bug: v8:8363, v8:7926
Change-Id: If1424a1dae656ac725a8443b09ea1b8cc25dfcb1
Reviewed-on: https://chromium-review.googlesource.com/c/1322953
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57319}
2018-11-07 16:45:10 +00:00
Clemens Hammacher
014d9e4f32 [wasm] Decouple wire bytes from compilation units
Compilation units currently contain pointers into allocated space that
contains the code of the respective function. This requires us to keep
the StreamingDecoder alive as long as compilation is still running
(including tiering).
This CL refactors this by having an additional redirection
(WireBytesStorage) which can point to either the StreamingDecoder or
the NativeModule. We only keep the code section buffer alive as long as
the StreamingWireBytesStorage is still in use.

I will further refactor memory ownership in a follow-up CL to not make
the AsyncCompileJob keep the StreamingDecoder alive.

R=ahaas@chromium.org

Bug: v8:8343,v8:7921,v8:8050
Change-Id: I780582c3217abf64000454f2c9c108b9ac9fbff1
Reviewed-on: https://chromium-review.googlesource.com/c/1319588
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57317}
2018-11-07 13:56:53 +00:00
Igor Sheludko
4001f86afa [ptr-compr] Make cleared weak reference value pointer compression friendly
because otherwise cleared weak references require special treatment during
decompression.

Bug: v8:7703
Change-Id: I38761d656c606e7ba7fc3075dffbd855a9f72302
Reviewed-on: https://chromium-review.googlesource.com/c/1322909
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57315}
2018-11-07 13:28:43 +00:00
Igor Sheludko
6b7bd99574 Reland "[ptr-compr] Fix incorrectly used machine types"
This is a reland of b8e8b0de4f

Original change's description:
> [ptr-compr] Fix incorrectly used machine types
> 
> in TurboFan, CSA, Wasm and compiler tests. Tagged values decompression
> logic will depend on the machine type of the value being loaded so it must
> be correct.
> 
> Bug: v8:7703
> Change-Id: Ia9e7cc1e273e5a458d9de8aaa4adb0c970413b8b
> Reviewed-on: https://chromium-review.googlesource.com/c/1319573
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57280}

Bug: v8:7703
Change-Id: I2c740bab9a800520ebfb83334345bd5641b7e408
Reviewed-on: https://chromium-review.googlesource.com/c/1320850
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57314}
2018-11-07 11:29:32 +00:00
Michael Achenbach
045756f32b Revert "[ptr-compr] Fix incorrectly used machine types"
This reverts commit b8e8b0de4f.

Reason for revert:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Arm%20-%20debug/8276

Original change's description:
> [ptr-compr] Fix incorrectly used machine types
> 
> in TurboFan, CSA, Wasm and compiler tests. Tagged values decompression
> logic will depend on the machine type of the value being loaded so it must
> be correct.
> 
> Bug: v8:7703
> Change-Id: Ia9e7cc1e273e5a458d9de8aaa4adb0c970413b8b
> Reviewed-on: https://chromium-review.googlesource.com/c/1319573
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57280}

TBR=mstarzinger@chromium.org,ishell@chromium.org

Change-Id: Ia97d5bfebf8d8fe1b2b7607f63024b60cf2c584f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7703
Reviewed-on: https://chromium-review.googlesource.com/c/1320349
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57294}
2018-11-06 18:10:54 +00:00
Jakob Kummerow
e0f875fdec [ubsan] Port FieldType to the new design
Bug: v8:3770
Change-Id: I6e2782a7f8589c466b54987c850d41d4ff5f6489
Reviewed-on: https://chromium-review.googlesource.com/c/1316618
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57292}
2018-11-06 17:22:17 +00:00
Joyee Cheung
6c3d784c16 Rename fields to names or members
Rename variables and flag names so that the classes can be reused
by private methods implementation.

In particular:

Rename "fields" to "members" in the initializer so that we can
initialize both fields and private methods/accessors there,
for example:

instance_fields_initializer -> instance_members_initializer
InitializeClassFieldsStatement -> InitializeClassMembersStatement

Rename "private field" to "private name" for the private symbols
used to implement private fields so that we can use them to
store private methods/accessors later as well, for example:

private_field_name_var -> private_name_var
NewPrivateFieldSymbol -> NewPrivateNameSymbol

The follow-on is in
https://chromium-review.googlesource.com/c/v8/v8/+/1301018

The design doc is in
https://docs.google.com/document/d/1T-Ql6HOIH2U_8YjWkwK2rTfywwb7b3Qe8d3jkz72KwA/edit?usp=sharing

Bug: v8:8330
Change-Id: I1cdca8def711da879b6e4d67c5ff0a5a4a36abbe
Reviewed-on: https://chromium-review.googlesource.com/c/1312597
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#57289}
2018-11-06 16:04:08 +00:00
Sigurd Schneider
201a0c67b8 [turbofan] Don't loose checked Uint32 -> Int32 conversion
Bug: chromium:901798
Change-Id: I4b479d6431cc7cdfa53f9cdf6283d2ff86e32821
Reviewed-on: https://chromium-review.googlesource.com/c/1319760
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57285}
2018-11-06 15:16:48 +00:00
Clemens Hammacher
ec8836fb4d [wasm] Fix test platform to process foreground tasks in order
Any sane platform would process foreground tasks in a FIFO order. Hence
our mock platform in the tests should do the same.

R=ahaas@chromium.org

Bug: v8:7921
Change-Id: Iafe1d9f2eb2a0c168f7e994f05b054756ef9e4af
Reviewed-on: https://chromium-review.googlesource.com/c/1319754
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57283}
2018-11-06 14:56:10 +00:00
Igor Sheludko
b8e8b0de4f [ptr-compr] Fix incorrectly used machine types
in TurboFan, CSA, Wasm and compiler tests. Tagged values decompression
logic will depend on the machine type of the value being loaded so it must
be correct.

Bug: v8:7703
Change-Id: Ia9e7cc1e273e5a458d9de8aaa4adb0c970413b8b
Reviewed-on: https://chromium-review.googlesource.com/c/1319573
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57280}
2018-11-06 14:21:44 +00:00
Yang Guo
4495cba3d6 [snapshot] clear internal fields that are serialized by callback
This is to ensure the snapshot is deterministic.

Internal fields can contain:
- reference to heap object
- embedder-defined aligned pointer
- a smi

The latter two are not distinguishable by V8, so if the serializer
callback returns non-zero value, we consider it to be an aligned pointer
and clear it to ensure that the snapshot does not contain memory
addresses that may not be deterministic. If the callback returns
{ nullptr, 0 } as result, we consider it to be a smi or some in-place
data that we then serialize verbatim.


R=jgruber@chromium.org

Bug: chromium:870584
Change-Id: I3cf9abf135ffd28d8138fa32636b12596b076e13
Reviewed-on: https://chromium-review.googlesource.com/c/1304441
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57272}
2018-11-06 11:48:19 +00:00
Peter Marshall
e18fec6b63 [cpu-profiler] Skip a failing test for multiple isolates
Causing ASAN failures

Bug: v8:5193
Change-Id: I7a899a6390bd1258a1afc8738e85f73239f44a59
Reviewed-on: https://chromium-review.googlesource.com/c/1319583
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57271}
2018-11-06 11:03:40 +00:00
Joyee Cheung
0483e9a9ab [api] Allow embedder to construct an Array from Local<Value>*
Currently to obtain a v8::Array out of a C array or a std::vector,
one needs to loop through the elements and call array->Set() multiple
times, and these calls go into v8::Object::Set() which can be slow.
This patch adds a new Array::New overload that converts a
Local<Value>* with known size into a Local<Array>.

Change-Id: I0a768f0e18eec51e78d58be455482ec6425ca188
Reviewed-on: https://chromium-review.googlesource.com/c/1317049
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#57261}
2018-11-06 08:17:08 +00:00
Michael Achenbach
3c8e0220f5 Skip slow tests on arm64
TBR=sigurds@chromium.org
NOTRY=true

Bug: v8:7783
Change-Id: I17f1c17be365db7398e7e13dd62a6dd86a6cb008
Reviewed-on: https://chromium-review.googlesource.com/c/1319569
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57260}
2018-11-06 07:54:26 +00:00
tzik
14654f8422 Ensure Isolate::GetEnteredOrMicrotaskContext returns a NativeContext
Unlike other v8::Context getter on v8::Isolate, the v8::Context returned
by GetEnteredOrMicrotaskContext may be non-NativeContext. However,
Blink implicitly assumes all v8::Context is backed by NativeContexts.

This CL updates GetEnteredOrMicrotaskContext() to check the resulting
Context is NativeContext, and updates callers of EnterMicrotaskContext
to use NativeContext.

Change-Id: Ifae528f4ce8feb067f4ad1a43330dc55f4a8ed79
Reviewed-on: https://chromium-review.googlesource.com/c/1301653
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57259}
2018-11-06 04:00:24 +00:00
Deepti Gandluri
bdb9e7a517 Revert "[wasm-simd] Implement remaining I8x16 SIMD ops on x64"
This reverts commit de88bfb270.

Reason for revert: Breaks msvc build https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Win64%20-%20msvc/5765

Original change's description:
> [wasm-simd] Implement remaining I8x16 SIMD ops on x64
> 
>  - Implementation for I8x16 Shifts, and Mul
>  - Fix convert bug
>  - Enable all tests except for shuffle tests
> 
> Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
> Reviewed-on: https://chromium-review.googlesource.com/c/1318609
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57254}

TBR=bbudge@chromium.org,gdeepti@chromium.org

Change-Id: I09efd8002e27f457e89250336e6c3a12d8d9682c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1318097
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57257}
2018-11-06 00:02:03 +00:00
Deepti Gandluri
de88bfb270 [wasm-simd] Implement remaining I8x16 SIMD ops on x64
- Implementation for I8x16 Shifts, and Mul
 - Fix convert bug
 - Enable all tests except for shuffle tests

Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
Reviewed-on: https://chromium-review.googlesource.com/c/1318609
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57254}
2018-11-05 23:30:16 +00:00
Jakob Kummerow
6d706ae3a0 [ubsan] Port Smi to the new design
and split Smi out of objects.h into smi.h.

Bug: v8:3770, v8:5402
Change-Id: I5ff7461495d29c785a76c79aca2616816a29ab1e
Reviewed-on: https://chromium-review.googlesource.com/c/1313035
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57252}
2018-11-05 20:52:51 +00:00
Toon Verwaest
20ce2c6f87 [parser] Use ScopedPtrList for more statement lists
In particular FunctionLiteral body. Now clients cannot use
function_literal->body() == nullptr anymore to figure out whether it was
preparsed; but have to check the eager compile hint.

Change-Id: Ia0d3a6b51c6fb7e803157e98a9d224224e03c8a7
Reviewed-on: https://chromium-review.googlesource.com/c/1317811
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57246}
2018-11-05 16:21:28 +00:00
Marja Hölttä
a51f3fc652 [js weak refs] Add WeakRef
- Add the WeakRef class and its deref() function.

- Add WeakFactory.prototype.makeRef

- Implement the "keep during job" behavior for WeakRef constructor and deref().

- Here we keep the targets alive longer than until the end of the job
  (microtask), contradicting the spec. However, this is probably the indended
  behavior, see https://github.com/tc39/proposal-weakrefs/issues/39 .

BUG=v8:8179

Change-Id: I41990d41ac1799e34f675d8431b9a7aa7ed3d48d
Reviewed-on: https://chromium-review.googlesource.com/c/1306435
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57242}
2018-11-05 15:10:46 +00:00
Michael Starzinger
fbeaeb26ef [wasm] Remove test-only {RelocInfo::JS_TO_WASM_CALL}.
The relocation mode in question was by now only used in tests to model a
wrapper call from wrapper code (on the GC'ed heap) to a non-movable wasm
code object. Instead of using a special relocation mode, we switch to
using the existing {EXTERNAL_REFERENCE} mode similar to other static C++
functions called from generated code.

R=sigurds@chromium.org
BUG=v8:8238

Change-Id: I30af98b92aed207c52ccccaf018a455ecac39c2b
Reviewed-on: https://chromium-review.googlesource.com/c/1309821
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57239}
2018-11-05 13:49:18 +00:00
Tobias Tebbi
ece9156c4c [torque] allow qualified access to different modules/namespaces
This introduces a new syntax for identifiers and calls: modulename::foo.
Such a name is resolved by trying to find a module modulename in one of
the parent scopes and looking for foo there. So this roughly corresponds
to C++ qualified namespace lookup.

Bug: v8:7793
Change-Id: Iedc43e6ebe125cd74575cbbcbf990bbcc0155a1f
Reviewed-on: https://chromium-review.googlesource.com/c/1309818
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57238}
2018-11-05 13:34:03 +00:00
Peter Marshall
2fb919f4b7 [cpu-profiler] Add a basic test for multiple isolates profiling
We don't have any tests which run multiple isolates concurrently and
starts a profiler in each of them. This test is a basic starting point
so that we can check for flakiness caused by races or interrupts.

The profiling mechanisms should be totally separate for two isolates,
so this should (theoretically) not cause any problems.

A use case for multiple isolates is for workers or in Node via cloud
functions, so we should get some more coverage here.

Change-Id: I0ca6d1296bc7bae7238c51b4487259d09e38d690
Reviewed-on: https://chromium-review.googlesource.com/c/1309823
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57207}
2018-11-02 10:35:24 +00:00
Frank Tang
dffaff7769 [Intl] Move cachedOrNewService to C++ w/o caching
Stage 1 of https://goo.gl/ooFdqJ

Bug: v8:7958,v8:7960,v8:7961
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Iabc69e547760122699a526a1255cb42bf9ddacb4
Reviewed-on: https://chromium-review.googlesource.com/c/1212466
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57203}
2018-11-02 07:08:26 +00:00
Jakob Kummerow
18ac14688d Reland "[ubsan] Replace Object** in GlobalHandles"
and reland "[ubsan] More Object** replacements"

This reverts commit 162d4e6de8.

Reason for revert: Not the culprit, test failed before.

Original change's description:
> Revert "[ubsan] Replace Object** in GlobalHandles"
> 
> This reverts commit 9392727982.
> 
> Reason for revert: Speculative revert, seems the most probable cause of
> https://bugs.chromium.org/p/v8/issues/detail?id=8396
> 
> Revert "[ubsan] More Object** replacements"
> 
> This reverts commit 5cce694d60.
> 
> Speculative revert.
> 
> NOTRY=true
> 
> Bug: v8:8396
> Change-Id: I9c2866a9db707cd03e4cf90822acde20813cebf0
> Reviewed-on: https://chromium-review.googlesource.com/c/1309761
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57174}

TBR=yangguo@chromium.org,mstarzinger@chromium.org,mslekova@chromium.org

Bug: v8:8396
Change-Id: I64fc80804b4ec324cef80ac528d08b724963f7f7
Reviewed-on: https://chromium-review.googlesource.com/c/1311813
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57194}
2018-10-31 23:56:23 +00:00
Daniel Clifford
27dc9fa5ca Reland "[torque]: Implement catch handlers for try blocks"
This is a reland of 0f15ed05b9

Original change's description:
> [torque]: Implement catch handlers for try blocks
> 
> In addition (and in combination), try statements now support "catch"
> clauses at the end that catch JavaScript exceptions throw by any builtin
> or runtime function contained in the try block:
> 
>   try {
>     ThrowTypeError(context, ...);
>   }
>   catch (e) {
>     // e has type Object
>   }
> 
> Bug: v8:7793
> Change-Id: Ie285ff888c49c112276240f7360f70c8b540ed19
> Reviewed-on: https://chromium-review.googlesource.com/c/1302055
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57169}

Bug: v8:7793
Change-Id: I3c4182303acfdfa625654976bec372cf531d954f
Reviewed-on: https://chromium-review.googlesource.com/c/1310295
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57184}
2018-10-31 17:59:17 +00:00
Alexei Filippov
6dcbd4ff8e [tracing] Escape UTF8 strings in JSON compliant form.
JSON format does not support \xNN encoding. Use \uNNNN instead.

+ Add myself to the src/tracing/OWNERS

BUG=chromium:895974

Change-Id: I410a09d44af08b61837579fa09d263d897b9385e
Reviewed-on: https://chromium-review.googlesource.com/c/1303535
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57180}
2018-10-31 17:46:52 +00:00
Maya Lekova
4ac7866d32 Revert "[torque]: Implement catch handlers for try blocks"
This reverts commit 0f15ed05b9.

Reason for revert: Braking Node.js integration, see
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20-%20node.js%20integration/3917

Original change's description:
> [torque]: Implement catch handlers for try blocks
> 
> In addition (and in combination), try statements now support "catch"
> clauses at the end that catch JavaScript exceptions throw by any builtin
> or runtime function contained in the try block:
> 
>   try {
>     ThrowTypeError(context, ...);
>   }
>   catch (e) {
>     // e has type Object
>   }
> 
> Bug: v8:7793
> Change-Id: Ie285ff888c49c112276240f7360f70c8b540ed19
> Reviewed-on: https://chromium-review.googlesource.com/c/1302055
> Commit-Queue: Daniel Clifford <danno@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57169}

TBR=danno@chromium.org,mstarzinger@chromium.org,tebbi@chromium.org

Change-Id: Ib9e3155ef46cc46851c4ca8a2624fd7634238e13
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7793
Reviewed-on: https://chromium-review.googlesource.com/c/1310197
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57177}
2018-10-31 16:36:25 +00:00
Maya Lekova
162d4e6de8 Revert "[ubsan] Replace Object** in GlobalHandles"
This reverts commit 9392727982.

Reason for revert: Speculative revert, seems the most probable cause of
https://bugs.chromium.org/p/v8/issues/detail?id=8396

Revert "[ubsan] More Object** replacements"

This reverts commit 5cce694d60.

Speculative revert.

NOTRY=true

Bug: v8:8396
Change-Id: I9c2866a9db707cd03e4cf90822acde20813cebf0
Reviewed-on: https://chromium-review.googlesource.com/c/1309761
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57174}
2018-10-31 14:48:57 +00:00
Daniel Clifford
0f15ed05b9 [torque]: Implement catch handlers for try blocks
In addition (and in combination), try statements now support "catch"
clauses at the end that catch JavaScript exceptions throw by any builtin
or runtime function contained in the try block:

  try {
    ThrowTypeError(context, ...);
  }
  catch (e) {
    // e has type Object
  }

Bug: v8:7793
Change-Id: Ie285ff888c49c112276240f7360f70c8b540ed19
Reviewed-on: https://chromium-review.googlesource.com/c/1302055
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57169}
2018-10-31 13:41:34 +00:00
Jakob Gruber
4ef0e79cba [snapshot] Remove the builtins snapshot
Now that lazy deserialization has been removed, we can roll back all
the mechanisms we introduced to support lazy single-builtin
deserialization.

This CL moves serialized builtin code objects (i.e.
off-heap-trampolines in most cases) back into the startup snapshot.
Support classes for builtin serialization and deserialization, as well
as the builtins snapshot itself are removed. Templatization on the
allocator class is removed as well.

Tbr: delphick@chromium.org
Bug: v8:6666, v8:7990
Change-Id: I2a910f8d3278b7e27b5f18ad408361ebd18871cc
Reviewed-on: https://chromium-review.googlesource.com/c/1304539
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57160}
2018-10-31 10:18:28 +00:00
Jakob Kummerow
5cce694d60 [ubsan] More Object** replacements
mostly in HandleScopeImplementer and related classes.

Bug: v8:3770
Change-Id: I9da757c60be99434b711fe74a5f5d296a0f08b22
Reviewed-on: https://chromium-review.googlesource.com/c/1300854
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57154}
2018-10-31 05:17:16 +00:00
Jakob Kummerow
9392727982 [ubsan] Replace Object** in GlobalHandles
as part of the continuing quest to get rid of Object*/Object** entirely.
Since it fits nicely, this CL as a bonus includes the planned change to
make Handle::location() return an Address*, in the process dropping the
temporarily needed duplicate Handle::location_as_address_ptr().

Bug: v8:3770
Change-Id: I87480289ce2a62ea1ae503e73d179256b7108c5c
Reviewed-on: https://chromium-review.googlesource.com/c/1298389
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57153}
2018-10-31 00:28:40 +00:00
Sathya Gunasekaran
c65dbd5153 [class] Rewrite destructuring assignment in class field initializers
Bug: v8:5751, chromium:899537
Change-Id: I4c072727dffc9381a81eb8711c4114220345914d
Reviewed-on: https://chromium-review.googlesource.com/c/1304538
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57141}
2018-10-30 16:34:04 +00:00
Clemens Hammacher
1ff8045530 Reland "[wasm] Store compile errors in CompilationState"
This is a reland of bf3d7b9ae3

Original change's description:
> [wasm] Store compile errors in CompilationState
> 
> We are currently storing compilation errors in the individual
> compilation units and pass it to the ErrorThrower during finishing.
> This CL changes that to store errors on the CompilationState directly.
> From there, it is propagated to the ErrorThrower in the compilation
> state callback.
> This removes more work from the finisher task and slims down the
> WasmCompilationUnits.
> 
> R=mstarzinger@chromium.org
> 
> Bug: v8:8343, v8:7921
> Change-Id: Id332add43d4219d2a30fee653ed4e53a9b2698d9
> Reviewed-on: https://chromium-review.googlesource.com/c/1303720
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57091}

Bug: v8:8343, v8:7921
Change-Id: Iaa5c89d224cb2bcfca2d12eba305413a9ad95618
Reviewed-on: https://chromium-review.googlesource.com/c/1304547
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57126}
2018-10-30 13:35:00 +00:00
Peter Marshall
b87d408f65 [heap-profiler] Fix a use-after-free when snapshots are deleted
If a caller starts the sampling heap profiler and takes a snapshot, and
then deletes the snapshot before the sampling has completed, a
use-after-free will occur on the StringsStorage pointer.

The same issue applies for StartTrackingHeapObjects which shares the
same StringsStorage object.

Bug: v8:8373
Change-Id: I5d69d60d3f9465f9dd3b3bef107c204e0fda0643
Reviewed-on: https://chromium-review.googlesource.com/c/1301477
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57114}
2018-10-30 09:37:12 +00:00
Benedikt Meurer
15c31fe461 [turbofan] Add support for huge DataViews.
This introduces Word64 support for the CheckBounds operator, which now
lowers to either CheckedUint32Bounds or CheckedUint64Bounds after the
representation selection. The right hand side of CheckBounds can now
be any positive safe integer on 64-bit architectures, whereas it remains
Unsigned31 for 32-bit architectures. We only use the extended Word64
support when the right hand side is outside the Unsigned31 range, so
for everything except DataViews this means that the performance should
remain the same. The typing rule for the CheckBounds operator was
updated to reflect this new behavior.

The CheckBounds with a right hand side outside the Unsigned31 range will
pass a new Signed64 feedback kind, which is handled with newly introduced
CheckedFloat64ToInt64 and CheckedTaggedToInt64 operators in representation
selection.

The JSCallReducer lowering for DataView getType()/setType() methods was
updated to not smi-check the [[ByteLength]] and [[ByteOffset]] anymore,
but instead just use the raw uintptr_t values and operate on any value
(for 64-bit architectures these fields can hold any positive safe
integer, for 32-bit architectures it's limited to Unsigned31 range as
before). This means that V8 can now handle huge DataViews fully, without
falling off a performance cliff.

This refactoring even gave us some performance improvements, on a simple
micro-benchmark just exercising different DataView accesses we go from

  testDataViewGetUint8: 796 ms.
  testDataViewGetUint16: 997 ms.
  testDataViewGetInt32: 994 ms.
  testDataViewGetFloat64: 997 ms.

to

  testDataViewGetUint8: 895 ms.
  testDataViewGetUint16: 889 ms.
  testDataViewGetInt32: 888 ms.
  testDataViewGetFloat64: 890 ms.

meaning we lost around 10% on the single byte case, but gained 10% across
the board for all the other element sizes.

Design-Document: http://bit.ly/turbofan-word64
Bug: chromium:225811, v8:4153, v8:7881, v8:8171, v8:8383
Change-Id: Ic9d1bf152e47802c04dcfd679372e5c85e4abc83
Reviewed-on: https://chromium-review.googlesource.com/c/1303732
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57095}
2018-10-29 15:17:57 +00:00
Maya Lekova
dd5c36316d Revert "[wasm] Store compile errors in CompilationState"
This reverts commit bf3d7b9ae3.

Reason for revert: Breaks TSAN build, see
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux64%20TSAN/23248

Original change's description:
> [wasm] Store compile errors in CompilationState
> 
> We are currently storing compilation errors in the individual
> compilation units and pass it to the ErrorThrower during finishing.
> This CL changes that to store errors on the CompilationState directly.
> From there, it is propagated to the ErrorThrower in the compilation
> state callback.
> This removes more work from the finisher task and slims down the
> WasmCompilationUnits.
> 
> R=​mstarzinger@chromium.org
> 
> Bug: v8:8343, v8:7921
> Change-Id: Id332add43d4219d2a30fee653ed4e53a9b2698d9
> Reviewed-on: https://chromium-review.googlesource.com/c/1303720
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57091}

TBR=mstarzinger@chromium.org,clemensh@chromium.org

Change-Id: Id32c7337494a4749485adbcfcaae7b2331afea66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8343, v8:7921
Reviewed-on: https://chromium-review.googlesource.com/c/1304544
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57094}
2018-10-29 15:16:52 +00:00
Clemens Hammacher
bf3d7b9ae3 [wasm] Store compile errors in CompilationState
We are currently storing compilation errors in the individual
compilation units and pass it to the ErrorThrower during finishing.
This CL changes that to store errors on the CompilationState directly.
From there, it is propagated to the ErrorThrower in the compilation
state callback.
This removes more work from the finisher task and slims down the
WasmCompilationUnits.

R=mstarzinger@chromium.org

Bug: v8:8343, v8:7921
Change-Id: Id332add43d4219d2a30fee653ed4e53a9b2698d9
Reviewed-on: https://chromium-review.googlesource.com/c/1303720
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57091}
2018-10-29 14:19:45 +00:00
Clemens Hammacher
cc70a6b050 [wasm] Rename GrowMemory to MemoryGrow
The "grow_memory" opcode was renamed to "memory.grow", and the spec
repo was updated to use kExprMemoryGrow internally instead of
kExprGrowMemory (https://github.com/WebAssembly/spec/pull/720).
This CL does the same change for v8.

Drive-by: Rename "current_size" to "memory.size", and a minor cleanup
in wasm-graph-builder.js to bring it in line with the version in the
js-api tests in the spec repo.

R=titzer@chromium.org

Change-Id: If525dba898b2c248890a616d3392c22b45f698ef
Reviewed-on: https://chromium-review.googlesource.com/c/1302057
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57089}
2018-10-29 14:06:24 +00:00
Clemens Hammacher
6e0706bcc0 [wasm] Do not store Counters in compilation units
The Counters are not specific to compilation units, they just happen to
be used in WasmCompilationUnit::ExecuteCompilation.
Remove it from the compilation unit and pass it explicitly where needed.
This saves another field on the compilation units.

R=titzer@chromium.org

Bug: v8:8343
Change-Id: Iad4fd8ae23b022c237535503e0e805db7e67071a
Reviewed-on: https://chromium-review.googlesource.com/c/1304297
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57083}
2018-10-29 12:55:42 +00:00
Marja Hölttä
b16fdb77a5 [js weak refs] Fix contexts + task scheduling
- Store dirty JSWeakFactories in a heap root (not native context) -
during GC there's no native context necessarily.

- Schedule one microtask per JSWeakFactory.

- Enter the context of the cleanup function before calling it.

BUG=v8:8179

Change-Id: Icaa245a08a60dd7325af828858ebe55d842c5bf6
Reviewed-on: https://chromium-review.googlesource.com/c/1298899
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57081}
2018-10-29 12:39:37 +00:00
Jakob Gruber
f5ef9f363a [builtins] Remove lazy deserialization
Now that embedded builtins are enabled everywhere*, lazy
deserialization can be turned off and removed.

* Except nosnap builds, on aix and in msvc builds.

Bug: v8:6666, v8:6624, v8:7990
Change-Id: Ib5fefe10e7ff35b13a1eb803fbc3736b8851b22b
Reviewed-on: https://chromium-review.googlesource.com/c/1288638
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57064}
2018-10-29 10:16:33 +00:00
Ross McIlroy
073d0d5ee6 Reland "[Compile] Ensure we don't access the native context during bytecode finalization."
This is a reland of 9cde880856 now the the underlying
problem in Chromium is fixed by:
   https://chromium-review.googlesource.com/c/chromium/src/+/1301459

Original change's description:
> [Compile] Ensure we don't access the native context during bytecode finalization.
>
> Resets the isolate's context to nullptr in debug builds during bytecode finalization
> to ensure that we don't rely on the native context during context independent
> unoptimized compilation.
>
> BUG=chromium:898076, v8:8041
>
> Change-Id: Ifaa5006a7a3d31d7fbd535ebb63f8889c75526c4
> Reviewed-on: https://chromium-review.googlesource.com/c/1297961
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56979}

TBR=leszeks@chromium.org

Bug: chromium:898076, v8:8041
Change-Id: I11904e19e843b0eadab698196ac1ef9c7aeec766
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel; luci.chromium.try:linux_chromium_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/1301480
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57048}
2018-10-26 22:33:56 +00:00
Ross McIlroy
21784e3d94 [Lite] Disable ICs in lite mode
BUG=v8:8293

Change-Id: I1d0e75f8671d3ec1c899c65bb9a865f2358173de
Reviewed-on: https://chromium-review.googlesource.com/c/1280527
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57042}
2018-10-26 16:07:20 +00:00
Igor Sheludko
8741040eef [ptr-compr] Prepare Isolate for pointer-compression friendly creation/deletion
In order to ensure that Isolate::New()/Isolate::Delete() are the bottlenecks
this CL also makes the Isolate class final.

Bug: v8:8182
Change-Id: I6bb170363a1210f66d63f4bcc46ea06fb5000d50
Reviewed-on: https://chromium-review.googlesource.com/c/1301481
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57041}
2018-10-26 15:28:31 +00:00
Peter Marshall
6396a361a3 [cpu-profiler] Enable Issue1398 test which has been fixed
This test was incidentally fixed by
https://chromium-review.googlesource.com/c/v8/v8/+/1280436.

Calls to StartTickSample() and FinishTickSample() are not permitted by
multiple producers. If the signal handler interrupts the main thread,
both might receive the same pointer into the circular buffer and one
will overwrite the data of the other.

This means we cannot call it in tests, and have to use AddSample()
instead.

Bug: v8:8209

Change-Id: I6904204e88077f704f819b52cde0fdaab0f13462
Reviewed-on: https://chromium-review.googlesource.com/c/1299022
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57019}
2018-10-26 08:34:53 +00:00
Jakob Gruber
1dec99f538 [ia32,root] Remove ebx from ALLOCATABLE_GENERAL_REGISTERS
This CL restores consistency with other platforms. ebx is now the
kRootRegister on ia32, and thus not an allocatable register any more.

The PreserveRootIA32 register configuration can be removed since it is
now identical to the Default configuration.

Bug: v8:6666
Change-Id: If4e2b4c52aa8b5db40bcd3b4469004b29c0e3d99
Reviewed-on: https://chromium-review.googlesource.com/c/1299078
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57018}
2018-10-26 08:33:48 +00:00