Commit Graph

2093 Commits

Author SHA1 Message Date
zhiguo
ed9154168f Add Base64 VLQ decoding support
This CL adds the support for Base64 VLQ decoding, which is the base of
parsing source map files (Version 3). With this support, the mappings of
C/C++ source code and WASM bytecode could be built in V8 engine. The
newly-added function is called VLQBase64Decode, which accepts two
character to be decoded. Upon its return, the position is updated with
the next start position. The unittest of this support is also added in
this CL.

argument: the Base64-encoded VLQ string and the position of first
Change-Id: If0f32972ecd7488844478a7b93a0f10cc38b6a5d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657421
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Zhiguo Zhou <zhiguo.zhou@intel.com>
Cr-Commit-Position: refs/heads/master@{#62748}
2019-07-16 16:16:24 +00:00
Georg Schmid
2e82ead865 [turbofan] Add optional runtime checks for range types
This CL adds the --assert-types flag to d8, which is intended to
insert additional runtime checks after typed nodes, verifying the
validity of our typing rules. So far, only range types are checked.

Thanks to Neil Patil for suggesting something similar.

R=neis@chromium.org, tebbi@chromium.org

Change-Id: I5eb2c482235ec8cd07ee802ca7c12c86c2d3dc40
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1678372
Commit-Queue: Georg Schmid <gsps@google.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62664}
2019-07-12 08:32:59 +00:00
Mythri A
b086cb7b9a Check that function was prepared before optimizing using manually
With lazy feedback allocation and bytecode flushing we need to call
%PrepareFunctionForOptimize before we call %OptimizeFunctionOnNextCall/
%OptimizeOsr. This cl:
1. Adds an additional state in pending optimized table to check if the
optimization was triggered manually.
2. Changes the compilation pipeline to delete the entry from pending
optimized table only if the optimization was triggered through
%OptimizeFunctionOnNextCall / %OptimizeOsr.
3. Adds a check to enforce %PrepareFunctionForOptimize was called.
4. Adds a new run-time flag to only check in the d8 test runner. We
don't want this check enabled in other cases like clusterfuzz that doesn't
ensure %PrepareFunctionForOptimize is called.

Bug: v8:8394, v8:8801, v8:9183
Change-Id: I9ae2b2da812e313c746b6df0b2da864c2ed5de51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664810
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62653}
2019-07-11 14:57:49 +00:00
Maciej Goszczycki
01db8ede94 [roheap] Add BasicMemoryChunk
BasicMemoryChunk sits above the MemoryChunk in the chunk hierarchy and
is responsible for storing the bare minimum data to identify a chunk of
memory, without worrying about GC etc.

This change also completes the MemoryChunk offset asserts, which were
previously missing for few key properties.

Bug: v8:7464
Change-Id: Id4c7716c4ed5722ceca3cbc66d668aed016c74b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1688843
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62652}
2019-07-11 14:52:59 +00:00
Yang Guo
a4b41fd339 Fix build when ICU is not available.
Change-Id: Iabb9e75b62f13a3bd08114941880c1d4a7f74d8c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687278
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62613}
2019-07-10 08:10:00 +00:00
Peter Marshall
6b2b60cb02 [cleanup] Rename RegExpMacroAssemblerIrregexp to RegExpBytecodeGenerator
This makes it clearer what this class does, and is more consistent with
the terminology used by ignition (BytecodeGenerator).

Change-Id: I9085f29f437cf15605a5ae971b1fc72d6c79feaa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1692923
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62612}
2019-07-10 08:01:10 +00:00
Irina Yatsenko
ef332f7a69 Make adding crash keys a platform API
The current integration of crash keys into v8 got the dependencies wrong: it introduced into v8 a dependency on components and base. This change will allow moving the implementation into "gin" (via Platform's abstraction), which is ok to depend on components and base, while providing the default noop implementation for the embedders that don't care to collect crash keys. Gin's side: https://chromium-review.googlesource.com/c/chromium/src/+/1690003.

Bug: v8:9323
Change-Id: I7b6e3e2cdc4b5f14f61ad20d2c362344d53896c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1689834
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62579}
2019-07-08 17:23:49 +00:00
Clemens Hammacher
bf92fbf4c8 Revert "[arraybuffer] Rearchitect backing store ownership"
This reverts commit 31cd5d83d3.

Reason for revert: It breaks my heart to revert this, but it fails differently on several bots, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20debug/26671.

Original change's description:
> [arraybuffer] Rearchitect backing store ownership
> 
> This CL completely rearchitects the ownership of array buffer backing stores,
> consolidating ownership into a {BackingStore} C++ object that is tracked
> throughout V8 using unique_ptr and shared_ptr where appropriate.
> 
> Overall, lifetime management is simpler and more explicit. The numerous
> ways that array buffers were initialized have been streamlined to one
> Attach() method on JSArrayBuffer. The array buffer tracker in the
> GC implementation now manages std::shared_ptr<BackingStore> pointers,
> and the construction and destruction of the BackingStore object itself
> handles the underlying page or embedder-allocated memory.
> 
> The embedder API remains unchanged for now. We use the
> v8::ArrayBuffer::Contents struct to hide an additional shared_ptr to
> keep the backing store alive properly, even in the case of aliases
> from live heap objects. Thus the embedder has a lower chance of making
> a mistake. Long-term, we should move the embedder to a model where they
> manage backing stores using shared_ptr to an opaque backing store object.
> 
> R=​mlippautz@chromium.org
> BUG=v8:9380,v8:9221
> 
> Change-Id: I48fae5ac85dcf6172a83f252439e77e7c1a16ccd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584323
> Commit-Queue: Ben Titzer <titzer@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62572}

TBR=ulan@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,titzer@chromium.org,gdeepti@chromium.org,mlippautz@chromium.org

Change-Id: Ib35788ba8c31192d90cbc72df3dbc41030f109de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9380, v8:9221
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1691034
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62578}
2019-07-08 17:20:51 +00:00
Ben L. Titzer
31cd5d83d3 [arraybuffer] Rearchitect backing store ownership
This CL completely rearchitects the ownership of array buffer backing stores,
consolidating ownership into a {BackingStore} C++ object that is tracked
throughout V8 using unique_ptr and shared_ptr where appropriate.

Overall, lifetime management is simpler and more explicit. The numerous
ways that array buffers were initialized have been streamlined to one
Attach() method on JSArrayBuffer. The array buffer tracker in the
GC implementation now manages std::shared_ptr<BackingStore> pointers,
and the construction and destruction of the BackingStore object itself
handles the underlying page or embedder-allocated memory.

The embedder API remains unchanged for now. We use the
v8::ArrayBuffer::Contents struct to hide an additional shared_ptr to
keep the backing store alive properly, even in the case of aliases
from live heap objects. Thus the embedder has a lower chance of making
a mistake. Long-term, we should move the embedder to a model where they
manage backing stores using shared_ptr to an opaque backing store object.

R=mlippautz@chromium.org
BUG=v8:9380,v8:9221

Change-Id: I48fae5ac85dcf6172a83f252439e77e7c1a16ccd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584323
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62572}
2019-07-08 16:06:48 +00:00
Peter Marshall
edd383fbcd [tracing] Use the new perfetto client API
The client API provides a much simpler interface so that we don't have
to deal with producers, consumers etc. directly. This CL removes all the
code that dealt with the more complex API used previously.

The architecture used here requires that the embedder call into
Tracing::Initialize() to set up the tracing backend. The tracing
controller then connects to this backend when calling
DataSource::Register() and Tracing::NewTrace(). This will ultimately
avoid the need for a virtual call (or two) for every trace event that
need to be dispatched over the API - chrome can provide a backend
and V8 will connect to it opaquely with the same code when tracing is
enabled.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I6b74fbb49ffcc89638caeb59ed3d5cc81238f3e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1634916
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62568}
2019-07-08 13:37:16 +00:00
Frank Tang
433403dc9b Reland "Speed up CharacterRange::AddCaseEquivalents"
This is a reland of f23f644fb3

Fix the issue by wrap v8_executable("gen-regexp-special-case")
inside if (current_toolchain == v8_generator_toolchain) {
and change deps of action("run_gen-regexp-special-case")
to  ":gen-regexp-special-case($v8_generator_toolchain)",


Original change's description:
> Speed up CharacterRange::AddCaseEquivalents
>
> By using the lexCss("color:") to measure the performance
> The change make the lexCss("color:")
>   x21 - x40 times faster than trunk.
>   x2.3 - x4.6 times faster than m74.
>
> Design Doc: http://shorturl.at/adfO5
>
> Measured by out/x64.release/d8 reg977003.js
> see reg977003.js attached to chromium:977003
>
> Also see another cl of benchmark in
> https://chromium-review.googlesource.com/c/v8/v8/+/1679651/
>
>
> Bug: chromium:977003
> Change-Id: Ie8518493d2c33df1594be1b4576bda715087b421
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1674851
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62471}

Bug: chromium:977003
Change-Id: Ie690810f596e9551b5765f422665c9617391bcf8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1683706
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62486}
2019-07-02 08:41:21 +00:00
Maya Lekova
569e5d2323 Revert "Speed up CharacterRange::AddCaseEquivalents"
This reverts commit f23f644fb3.

Reason for revert: Breaks arm debug builder - https://ci.chromium.org/p/v8/builders/ci/V8%20Arm%20-%20debug%20builder/22390 - missing file?

Original change's description:
> Speed up CharacterRange::AddCaseEquivalents
> 
> By using the lexCss("color:") to measure the performance
> The change make the lexCss("color:")
>   x21 - x40 times faster than trunk.
>   x2.3 - x4.6 times faster than m74.
> 
> Design Doc: http://shorturl.at/adfO5
> 
> Measured by out/x64.release/d8 reg977003.js
> see reg977003.js attached to chromium:977003
> 
> Also see another cl of benchmark in
> https://chromium-review.googlesource.com/c/v8/v8/+/1679651/
> 
> 
> Bug: chromium:977003
> Change-Id: Ie8518493d2c33df1594be1b4576bda715087b421
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1674851
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62471}

TBR=adamk@chromium.org,jkummerow@chromium.org,yangguo@chromium.org,jshin@chromium.org,gsathya@chromium.org,ftang@chromium.org

Change-Id: I780fac2cf5f4bae6846f8d5c8765cabd76637545
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:977003
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1684073
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62472}
2019-07-01 15:31:49 +00:00
Frank Tang
f23f644fb3 Speed up CharacterRange::AddCaseEquivalents
By using the lexCss("color:") to measure the performance
The change make the lexCss("color:")
  x21 - x40 times faster than trunk.
  x2.3 - x4.6 times faster than m74.

Design Doc: http://shorturl.at/adfO5

Measured by out/x64.release/d8 reg977003.js
see reg977003.js attached to chromium:977003

Also see another cl of benchmark in
https://chromium-review.googlesource.com/c/v8/v8/+/1679651/


Bug: chromium:977003
Change-Id: Ie8518493d2c33df1594be1b4576bda715087b421
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1674851
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62471}
2019-07-01 15:18:18 +00:00
Maciej Goszczycki
50822c2c4b Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled"
This is a reland of 24ac9a9a72

Fixed an msvc warning.

Original change's description:
> [roheap] Enable shared ro-heap by default if ptr compression is disabled
>
> Shared read-only heap is currently incompatible with pointer compression.
> Enable sharing only if pointer compression is disabled.
>
> Bug: v8:7464
> Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Cr-Commit-Position: refs/heads/master@{#61963}

Bug: v8:7464
Change-Id: Ieb5fefe8be1f94e0ac8e769d73de21427559ccab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1681128
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#62445}
2019-06-28 10:49:19 +00:00
Daniel Clark
92147e3aca [modules] Introduce SyntheticModule
This change is a partial implementation of Synthetic Module Record as specified here:
https://heycam.github.io/webidl/#synthetic-module-records

This includes:
- Introduce SyntheticModule class inheriting from Module.
- Extend v8::Module interface in v8.h to include Synthetic Module APIs, with corresponding
  implementations in api.cc.
- Provide SyntheticModule implementations of PrepareInstantiate, FinishInstantiate, and SetExport.
- Provide cctest unit tests for the implementations in the preceding item.

We will follow up with further submissions to implement the remaining members of
SyntheticModule (ResolveExport and Evaluate).

Bug: v8:9292
Change-Id: I25b1b695b5d1c3004677cd685f0dfd95283438fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1626829
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62433}
2019-06-27 22:23:46 +00:00
Georg Neis
1a7b24012b Revert "Reland "Enable lazy source positions by default""
This reverts commit a05bcc3afd.

Reason for revert: Still issues with maybe_assigned, blocking roll.

Original change's description:
> Reland "Enable lazy source positions by default"
> 
> Second attempt to reland 69fafb5fe3
> now that the maybe_assigned bug is fixed.
> 
> > Original change's description:
> > Enable lazy source positions by default
> >
> > Also adds a compile time flag which allows the default to be configured
> > so node can disable it since it hangs the node cpu profiler tests.
> >
> > Bug: v8:8510
> > Change-Id: Idf4785036dc6242769410091518a67ac9179b718
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1491491
> > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> > Commit-Queue: Dan Elphick <delphick@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#62089}
> 
> Bug: v8:8510
> Change-Id: Ia6d5d1d3a3c2b6a14c70ee67b02bec62a6a1a1d4
> Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg, v8_linux64_gc_stress_custom_snapshot_dbg_ng
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1679498
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62411}

TBR=rmcilroy@chromium.org,delphick@chromium.org

Change-Id: I52b2924e05ff87f6469be4723e5e13979d1aeffa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8510
Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg, v8_linux64_gc_stress_custom_snapshot_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1680553
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62428}
2019-06-27 16:52:10 +00:00
Francis McCabe
27ed54f38b Revert "Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled""
This reverts commit 24ac9a9a72.

Reason for revert: compilation failures on windows. See https://ci.chromium.org/p/v8/builders/ci/V8%20Win32%20-%20builder/29313

Original change's description:
> Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled"
> 
> This is a reland of fb4d54802e
> 
> Few test-serialize tests were not clearing the shared heap before using a
> new snapshot, breaking the noembed build. This is fixed now and a check
> has been added
> (https://chromium-review.googlesource.com/c/v8/v8/+/1667415) to make
> sure it doesn't happen again.
> 
> Original change's description:
> > [roheap] Enable shared ro-heap by default if ptr compression is disabled
> >
> > Shared read-only heap is currently incompatible with pointer compression.
> > Enable sharing only if pointer compression is disabled.
> >
> > Bug: v8:7464
> > Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
> > Reviewed-by: Dan Elphick <delphick@chromium.org>
> > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> > Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> > Cr-Commit-Position: refs/heads/master@{#61963}
> 
> Bug: v8:7464
> Change-Id: Ie7d09cebf897a3f0e4a6c103ad0c132c4faf6c6e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1667418
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Cr-Commit-Position: refs/heads/master@{#62425}

TBR=delphick@chromium.org,goszczycki@google.com

Change-Id: Ia96e2f13b502f96315ac2ed3447373c7b5774c6a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7464
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1680659
Reviewed-by: Francis McCabe <fgm@chromium.org>
Commit-Queue: Francis McCabe <fgm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62426}
2019-06-27 15:32:21 +00:00
Maciej Goszczycki
24ac9a9a72 Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled"
This is a reland of fb4d54802e

Few test-serialize tests were not clearing the shared heap before using a
new snapshot, breaking the noembed build. This is fixed now and a check
has been added
(https://chromium-review.googlesource.com/c/v8/v8/+/1667415) to make
sure it doesn't happen again.

Original change's description:
> [roheap] Enable shared ro-heap by default if ptr compression is disabled
>
> Shared read-only heap is currently incompatible with pointer compression.
> Enable sharing only if pointer compression is disabled.
>
> Bug: v8:7464
> Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Cr-Commit-Position: refs/heads/master@{#61963}

Bug: v8:7464
Change-Id: Ie7d09cebf897a3f0e4a6c103ad0c132c4faf6c6e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1667418
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#62425}
2019-06-27 15:13:28 +00:00
Jakob Kummerow
e304d80e09 [wasm-c-api] Faster C-to-Wasm entry
powered by a new function Execution::CallWasm and a corresponding,
Turbofan-generated CWasmEntry stub. This entirely sidesteps the
traditional Execution::Invoke -> JSEntryStub path.

Change-Id: If2b97825cca4ce927eecbddc248c64782d903287
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660618
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62424}
2019-06-27 13:39:48 +00:00
Dan Elphick
a05bcc3afd Reland "Enable lazy source positions by default"
Second attempt to reland 69fafb5fe3
now that the maybe_assigned bug is fixed.

> Original change's description:
> Enable lazy source positions by default
>
> Also adds a compile time flag which allows the default to be configured
> so node can disable it since it hangs the node cpu profiler tests.
>
> Bug: v8:8510
> Change-Id: Idf4785036dc6242769410091518a67ac9179b718
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1491491
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62089}

Bug: v8:8510
Change-Id: Ia6d5d1d3a3c2b6a14c70ee67b02bec62a6a1a1d4
Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg, v8_linux64_gc_stress_custom_snapshot_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1679498
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62411}
2019-06-27 09:41:09 +00:00
Z Nguyen-Huu
fc8c4ef27e Implement fastpath for proxy trap setPrototypeOf
ObjectSetPrototypeOf and ReflectSetPrototypeOf are now Torque builtins (previously CPP) and the Proxy path is implemented completely in Torque while everything else calls into runtime (and is thus a bit slower than previously).

Perf improvement in micro-benchmark JSTests/Proxies
Before:
SetPrototypeOfWithoutTrap-Proxies(Score): 120
SetPrototypeOfWithTrap-Proxies(Score): 112

After:
SetPrototypeOfWithoutTrap-Proxies(Score): 131
SetPrototypeOfWithTrap-Proxies(Score): 127

Bug: v8:6664
Change-Id: I630096e1964c91d1ec39e19f380a2e9e948de4bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1669787
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62402}
2019-06-27 07:03:51 +00:00
Tobias Tebbi
9d4772db3e [torque] add notice to Torque exception usage
Change-Id: Ie5dbbf7cd17571c6ad1b0e83613bce605d0b9257
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1675956
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62355}
2019-06-25 12:01:31 +00:00
Igor Sheludko
0f0b31744f [cleanup] Move GetIsolateFromHeapObject() and friends to src/execution
Bug: v8:9183
Change-Id: Ib17445fe22da683c5be4c3f0249a31502040c2dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1672935
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62331}
2019-06-24 10:53:42 +00:00
Irina Yatsenko
5ad5f0ac38 Reland "Add Crash Keys support"
This is a reland of 02103b276b

Fix for the original build break: build android with noop crashkeys for now

Original change's description:
> Add Crash Keys support
>
> This adds crash keys containing the isolate address and addresses of
> the read_only, map, and code spaces to crash report minidumps.
> When not compiling V8 with Chrome, a noop implementation is used.
>
> Bug: v8:9323
> Change-Id: I8523630e7a4ff792855163c06bf76dab35b1b9e5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1641326
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#62059}

Bug: v8:9323
Change-Id: I6bb115ad14b2ce5865f4d8fb255245c38fb0cd14
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658505
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62320}
2019-06-21 17:19:08 +00:00
Sigurd Schneider
76c1e829e3 [torque] Support 'real' internal classes
Rework the implementation of non-external Torque classes to use
Struct machinery rather than FixedArray machinery. This allows
Torque-only defined 'internal' classes to the automatically generate
class verifiers and printers.

As part of this change, generate C++ boilerplate accessors for
internal Torque classes, since this is a pre-requisite for the
verifiers, printers and other Struct-based functionality.

Moreover, augment the header-generating functionality in Torque
to create separate header files for field offset definitions,
internal class C++ definitions and instance types.

Bug: v8:7793
Change-Id: I47d5f1570040c2b44d378f23b6cf95d3d132dacc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607645
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62317}
2019-06-21 16:09:28 +00:00
Sigurd Schneider
dd65ef6a9a [base] Move v8memory.h to base/memory.h
v8memory.h does not have V8 specific definitions, and having it in base
makes it clear that every component may include the file. It also
ensures that including it does not create spurious dependencies on
v8_base.

Change-Id: I565f63b25f33a9ada19d7b2ac5990863ab17f4a7
Bug: v8:9183, v8:8855
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1657923
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62309}
2019-06-21 11:44:18 +00:00
Daniel Clark
8d8215504b [modules] Introduce SourceTextModule class
Introduce SourceTextModule as a subclass of Module.  Move all the
JavaScript-module-specific code down from Module to
SourceTextModule, with all code applicable to other future
module types remaining in Module.

With this change, Module is roughly equivalent to the spec's
Abstract Module Record and SourceTextModule is roughly equivalent
to Source Text Module Record.

Bug: v8:9292
Change-Id: I6e9cd3ece9d0c1da57e52f8af8ed5848d87dd22d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1633154
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62296}
2019-06-19 17:54:52 +00:00
Dan Elphick
96577220d7 Revert "Reland "Enable lazy source positions by default""
This reverts commit ccf0d80261.

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

Original change's description:
> Reland "Enable lazy source positions by default"
> 
> This is a reland of 69fafb5fe3
> after fixing the in crash with
> https://chromium-review.googlesource.com/c/v8/v8/+/1664334
> 
> Original change's description:
> > Enable lazy source positions by default
> >
> > Also adds a compile time flag which allows the default to be configured
> > so node can disable it since it hangs the node cpu profiler tests.
> >
> > Bug: v8:8510
> > Change-Id: Idf4785036dc6242769410091518a67ac9179b718
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1491491
> > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> > Commit-Queue: Dan Elphick <delphick@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#62089}
> 
> Bug: v8:8510
> Change-Id: I81b36dbba3cc7b9a99dc5cc4ea72040fabfec97e
> Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg,v8_linux64_gc_stress_custom_snapshot_dbg_ng
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660484
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Auto-Submit: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62288}

TBR=rmcilroy@chromium.org,delphick@chromium.org

Change-Id: Icbe93550850f79d1c29bed3e8084676c453cdf06
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8510
Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg, v8_linux64_gc_stress_custom_snapshot_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1667419
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62294}
2019-06-19 15:54:34 +00:00
Dan Elphick
ccf0d80261 Reland "Enable lazy source positions by default"
This is a reland of 69fafb5fe3
after fixing the in crash with
https://chromium-review.googlesource.com/c/v8/v8/+/1664334

Original change's description:
> Enable lazy source positions by default
>
> Also adds a compile time flag which allows the default to be configured
> so node can disable it since it hangs the node cpu profiler tests.
>
> Bug: v8:8510
> Change-Id: Idf4785036dc6242769410091518a67ac9179b718
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1491491
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62089}

Bug: v8:8510
Change-Id: I81b36dbba3cc7b9a99dc5cc4ea72040fabfec97e
Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg,v8_linux64_gc_stress_custom_snapshot_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660484
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62288}
2019-06-19 14:32:41 +00:00
Jakob Gruber
983ab01a68 [utils,diagnostics] Remove SplayTree and its last use
The last use of V8's SplayTree was in diagnostics and is now replaced
by std::map.

Bug: v8:9359
Change-Id: I7b79fe619eb734343579652058be4d2b81fd4a1e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664060
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62276}
2019-06-19 09:48:02 +00:00
Jakob Gruber
3663e83424 [regexp] Remove unused DispatchTable and ZoneSplayTree
Bug: v8:9359
Change-Id: I237f16324ff036f2cbfb7ca97b4ac208442b06cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664056
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62268}
2019-06-19 07:19:38 +00:00
Jakob Gruber
83da1c2d4c [regexp] Simplify UnicodeRangeSplitter
This class used to be based on DispatchTable, which itself uses an
interval tree to both categorize and canonicalize ranges
(i.e. such that no overlap and all immediately adjacent ranges are
merged). The produced ranges were then entered into lists for
{bmp,lead_surrogate,trail_surrogate,non_bmp} splits.

With this CL, we simplify to a plain loop over all character range
kinds instead. The dispatch table (and ZoneSplayList, perhaps
SplayList) can be removed in follow-ups.

Bug: v8:9359
Change-Id: I9c6b72f3bc44d1557af7c74419709ae5662611f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664053
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62260}
2019-06-18 20:18:18 +00:00
Z Nguyen-Huu
4e17a6beb4 Implement fastpath for proxy trap getPrototypeOf
ObjectGetPrototypeOf and ReflectGetPrototypeOf are now Torque builtins (previously CPP) and the Proxy path is implemented completely in Torque while everything else calls into runtime (and is thus a bit slower than previously).

Perf improvement in micro-benchmark JSTests/Proxies
Before:
GetPrototypeOfWithoutTrap-Proxies(Score): 1876
GetPrototypeOfWithTrap-Proxies(Score): 857

After:
GetPrototypeOfWithoutTrap-Proxies(Score): 2810
GetPrototypeOfWithTrap-Proxies(Score): 3197

Bug: v8:6664
Change-Id: If60dda67d6e90c2d6f0ec743f6cb7c0fff54d607
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658717
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62256}
2019-06-18 17:14:59 +00:00
Thibaud Michaud
79e8e3ec65 [wasm] Parallelize JS to WASM wrapper compilation
R=ahaas@chromium.org
CC=titzer@chromium.org

Bug: v8:9231
Change-Id: I209f7c89c99408a53a8db6a6af1ed795f6668a1d
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655653
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62249}
2019-06-18 15:00:05 +00:00
Jakob Gruber
a8c62102e1 [regexp] Further narrow public API and restrict includes to regexp.h
This CL renames jsregexp.{h,cc} to regexp.{h,cc}, hides all non-public
functions of RegExpImpl in the .cc file, and renames the public parts
of RegExpImpl to just RegExp. Include directives from outside the
src/regexp directory are limited to regexp.h, regexp-stack.h, and
regexp-utils.h. We also expose all result codes that can be returned
by irregexp code (including RETRY) on the public header since they
are needed elsewhere, e.g. in builtins.

Bug: v8:9359
Change-Id: Iae1a01ac9f6e1e4dc168f3fbe8fe8679cb6b1259
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1662297
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62240}
2019-06-18 12:23:16 +00:00
Jakob Gruber
c7d57dd309 [regexp] Reduce public API surface
This further reduces the number of things declared in the public
regexp API file, currently still named jsregexp.h.

* Move JSRegExp::Flags convenience functions to regexp-compiler.h.
* Set RegExpImpl methods private if possible (these will later be
  moved to a new hidden impl class).
* Merge RegExpEngine::CompilationResult into RegExpCompileData.
* Move remaining RegExpEngine methods to RegExpImpl and delete
  RegExpEngine.
* Extract RegExpGlobalCache.
* Document a few data structures.

Upcoming CLs will rename RegExpImpl to RegExp and jsregexp.h to
regexp.h. This should then be the only header included from other
directories.

Bug: v8:9359
Change-Id: I78c8f4cca495a2b95735a48b6181583bc3310bdf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1662294
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62218}
2019-06-17 15:10:24 +00:00
Jakob Gruber
def9aa5d0a [regexp] Extract more parts of the regexp compiler
Bug: v8:9359
Change-Id: I06a4ccc53abff25237a1113774a0b17bdf861c86
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658157
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62198}
2019-06-17 08:25:08 +00:00
Igor Sheludko
bc8106dceb [ptr-compr][cleanup] Introduce TaggedField<T, kOffset> template
It will allow us to use knowledge about the type of field during value
decompression upon field read.

Use the new class for HeapObject::MapField.

Bug: v8:9353
Change-Id: I1368426ec2e25fcec3af8d5cccd7a78d80423e72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658150
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62184}
2019-06-14 14:06:58 +00:00
Jakob Gruber
d61a558a23 Reland "[regexp] Move AST-to-Node code to a dedicated file"
This is a reland of 811bfbbc56

Original change's description:
> [regexp] Move AST-to-Node code to a dedicated file
>
> Prior to this CL, jsregexp contains a bunch of things that are slightly
> related but would be cleaner in separate files, including: AST-to-Node
> transformations, the compiler implementation, and a debugging printer.
>
> This CL extracts AST-to-Node transformations.
>
> Bug: v8:9359
> Change-Id: I030cfca5c40cfd72e3a7abe2188e4654cfe2277c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655303
> Auto-Submit: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62148}

Tbr: yangguo@chromium.org
Bug: v8:9359
Change-Id: I68a16086dc56c9a059547033ca8bc1e9de1080db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658568
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62154}
2019-06-13 16:39:56 +00:00
Leszek Swirski
ee279dc223 Revert "[regexp] Move AST-to-Node code to a dedicated file"
This reverts commit 811bfbbc56.

Reason for revert: Breaks noi18n build (https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20noi18n%20-%20debug/27201)

Original change's description:
> [regexp] Move AST-to-Node code to a dedicated file
> 
> Prior to this CL, jsregexp contains a bunch of things that are slightly
> related but would be cleaner in separate files, including: AST-to-Node
> transformations, the compiler implementation, and a debugging printer.
> 
> This CL extracts AST-to-Node transformations.
> 
> Bug: v8:9359
> Change-Id: I030cfca5c40cfd72e3a7abe2188e4654cfe2277c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655303
> Auto-Submit: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62148}

TBR=yangguo@chromium.org,jgruber@chromium.org,petermarshall@chromium.org

Change-Id: I079e15b02d73d81aef806992f324f08d7008e367
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9359
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658160
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62149}
2019-06-13 15:05:01 +00:00
Jakob Gruber
811bfbbc56 [regexp] Move AST-to-Node code to a dedicated file
Prior to this CL, jsregexp contains a bunch of things that are slightly
related but would be cleaner in separate files, including: AST-to-Node
transformations, the compiler implementation, and a debugging printer.

This CL extracts AST-to-Node transformations.

Bug: v8:9359
Change-Id: I030cfca5c40cfd72e3a7abe2188e4654cfe2277c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655303
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62148}
2019-06-13 14:40:08 +00:00
Jakob Gruber
6d990aee80 [execution] Extract interrupt scopes and stack guard
Refactor-only, this moves interrupt scopes and stack guard code into
their own dedicated files.

Change-Id: I5723a04786a04bba31a0da54622f3cd0b926ef07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655288
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62141}
2019-06-13 12:03:52 +00:00
Z Nguyen-Huu
8e0ef9b9a0 Add fast path for proxy with preventExtensions trap
ObjectPreventExtensions and ReflectPreventExtensions are now Torque builtins (previously CPP) and the Proxy path is implemented completely in Torque while everything else calls into runtime (and is thus a bit slower than previously).

Perf improvement in micro-benchmark JSTests/Proxies
Before:
PreventExtensionsWithoutTrap-Proxies(Score): 1978
PreventExtensionsWithTrap-Proxies(Score): 739

After:
PreventExtensionsWithoutTrap-Proxies(Score): 3017
PreventExtensionsWithTrap-Proxies(Score): 2044

Bug: v8:6664
Change-Id: I6505d730cea6b0d197f6f5d0540b39056c8b763d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1652688
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62130}
2019-06-12 20:57:31 +00:00
Jakob Gruber
b0899cf8ab [regexp] Add wrapper header for arch-specific files
This adds regexp-macro-assembler-arch.h which contains the arch-specific
include dispatch.

Change-Id: Ibc2be8059d54b57afeed9b7ce244229ce1bd79bc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655296
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62118}
2019-06-12 14:17:13 +00:00
Jakob Gruber
89ad50be1f [regexp] Rename interpreter files
bytecodes-irregexp.h -> regexp-bytecodes.h
interpreter-irregexp.{cc,h} -> regexp-interpreter.{cc,h}

Change-Id: I98ca9d5c3264ad0adbd280b93082aa3e01b45b67
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655294
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62113}
2019-06-12 11:57:58 +00:00
Georg Schmid
b536240340 Re-enable double const store check under v8_enable_test_features flag
R=machenbach@chromium.org, tebbi@chromium.org

Change-Id: I99a5d5200ef7e0e812a2bf1e22a5f8ff813a1ca6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653117
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Georg Schmid <gsps@google.com>
Cr-Commit-Position: refs/heads/master@{#62098}
2019-06-11 14:56:15 +00:00
Dan Elphick
99f8850294 Revert "Enable lazy source positions by default"
This reverts commit 69fafb5fe3.

Reason for revert: V8 Linux64 GC Stress - custom snapshot
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/26291

Original change's description:
> Enable lazy source positions by default
> 
> Also adds a compile time flag which allows the default to be configured
> so node can disable it since it hangs the node cpu profiler tests.
> 
> Bug: v8:8510
> Change-Id: Idf4785036dc6242769410091518a67ac9179b718
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1491491
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62089}

TBR=rmcilroy@chromium.org,delphick@chromium.org

Change-Id: I92a64ddc63e36ec326e6d8ba1a5b68af38e3134b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8510
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1653112
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62091}
2019-06-11 13:12:57 +00:00
Dan Elphick
69fafb5fe3 Enable lazy source positions by default
Also adds a compile time flag which allows the default to be configured
so node can disable it since it hangs the node cpu profiler tests.

Bug: v8:8510
Change-Id: Idf4785036dc6242769410091518a67ac9179b718
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1491491
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62089}
2019-06-11 12:29:52 +00:00
Simon Zünd
4d70d33c27 [cleanup] Move GlobalContext constructor to new .cc file
This CL creates global-context.cc and moves the GlobalContext
constructor impl to this new file. Preparatory refactoring for import
syntax.

This CL also removes one unused static method from GlobalContext
and changes two use-sites where Get() was used together with a static
accessor.

Drive-by: "Include what you use" for global-context.h

Bug: v8:9183
Change-Id: Iafd877d03af9ad65b1c99ebd9743be64192f45c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1649790
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62081}
2019-06-11 09:38:46 +00:00
Maya Lekova
06930f7420 Revert "Add Crash Keys support"
This reverts commit 02103b276b.

Reason for revert: Speculative revert for breakage on roll:
https://chromium-review.googlesource.com/c/chromium/src/+/1650264

Failing build in breakpad:
https://ci.chromium.org/p/chromium/builders/try/linux_chromium_asan_rel_ng/298512

Original change's description:
> Add Crash Keys support
> 
> This adds crash keys containing the isolate address and addresses of
> the read_only, map, and code spaces to crash report minidumps.
> When not compiling V8 with Chrome, a noop implementation is used.
> 
> Bug: v8:9323
> Change-Id: I8523630e7a4ff792855163c06bf76dab35b1b9e5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1641326
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#62059}

TBR=jkummerow@chromium.org,tmrts@chromium.org,irinayat@microsoft.com

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

Bug: v8:9323
Change-Id: I29138292dd474cf60e2bf3cc9b0629a085abd31c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1649787
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62077}
2019-06-11 08:49:52 +00:00
Z Nguyen-Huu
c9c914f954 Reland: Extend IsExtensible proxy trap fast path for Reflect.isExtensible
This is reland of Ib1c3f78d1f1a44c6628d351fed3bcdc91ca08cb5
Just fix lint error for unused arguments in Torque.

> Original commit message:

> The fast path for IsExtensible proxy trap is already implemented, we just need to use this for ReflectIsExtensible.
Now, ReflectIsExtensible is now a Torque builtin (previously CPP). Other cases will fall back to runtime.

> Bug: v8:6664
> Change-Id: Ib1c3f78d1f1a44c6628d351fed3bcdc91ca08cb5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1645438
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Tamer Tas <tmrts@chromium.org>
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#62031}

Bug: v8:6664
Change-Id: If44ac321ce712a969b3f5076411573eb3968cc14
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1646900
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62070}
2019-06-10 18:24:27 +00:00
Irina Yatsenko
02103b276b Add Crash Keys support
This adds crash keys containing the isolate address and addresses of
the read_only, map, and code spaces to crash report minidumps.
When not compiling V8 with Chrome, a noop implementation is used.

Bug: v8:9323
Change-Id: I8523630e7a4ff792855163c06bf76dab35b1b9e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1641326
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#62059}
2019-06-07 18:31:16 +00:00
Maciej Goszczycki
e3758aee44 Revert "Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled""
This reverts commit fb4d54802e.

Reason for revert: Breaks the noembed build

Original change's description:
> Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled"
> 
> This is a reland of 81abe8f7b6
> 
> It also disables ro-heap sharing in nosnap builds
> 
> Original change's description:
> > [roheap] Enable shared ro-heap by default if ptr compression is disabled
> >
> > Shared read-only heap is currently incompatible with pointer compression.
> > Enable sharing only if pointer compression is disabled.
> >
> > Bug: v8:7464
> > Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
> > Reviewed-by: Dan Elphick <delphick@chromium.org>
> > Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> > Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> > Cr-Commit-Position: refs/heads/master@{#61963}
> 
> Bug: v8:7464
> Change-Id: I6b620152d380864db2a725c25f3c916d695d4f81
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1639298
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#62015}

TBR=rmcilroy@chromium.org,delphick@chromium.org,goszczycki@google.com

Change-Id: If0ceb39a1399e3f731dfca36e6632f327c8226ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7464
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1648154
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62051}
2019-06-07 12:51:05 +00:00
Nico Hartmann
1eee4e1ee5 Port BigInt addition to Torque
Implements the addition of BigInts as a Torque builtin, which performs necessary
checks and then calls into C++. The core logic of MutableBigInt::AbsoluteAdd,
MutableBigInt::AbsoluteSub and MutableBigInt::AbsoluteCompare is now used by both
the runtime and the Torque generated builtin for best performance.

Bug: v8:9213
Change-Id: I5f6af4dd226f11e6287bd04272ccae6ee5c26498
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1640211
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@google.com>
Cr-Commit-Position: refs/heads/master@{#62049}
2019-06-07 10:49:38 +00:00
Dan Elphick
dfce0ae6af Revert "Extend IsExtensible proxy trap fast path for Reflect.isExtensible"
This reverts commit 566233ae52.

Reason for revert: Breaks the build

Original change's description:
> Extend IsExtensible proxy trap fast path for Reflect.isExtensible
> 
> The fast path for IsExtensible proxy trap is already implemented, we just need to use this for ReflectIsExtensible.
> Now, ReflectIsExtensible is now a Torque builtin (previously CPP). Other cases will fall back to runtime.
> 
> Bug: v8:6664
> Change-Id: Ib1c3f78d1f1a44c6628d351fed3bcdc91ca08cb5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1645438
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Tamer Tas <tmrts@chromium.org>
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#62031}

TBR=jgruber@chromium.org,mslekova@chromium.org,tmrts@chromium.org,duongn@microsoft.com

Change-Id: I92f83d8c9cbdca1a33ddd0e875551deb62d7de89
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6664
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1648241
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62033}
2019-06-06 16:20:50 +00:00
Z Nguyen-Huu
566233ae52 Extend IsExtensible proxy trap fast path for Reflect.isExtensible
The fast path for IsExtensible proxy trap is already implemented, we just need to use this for ReflectIsExtensible.
Now, ReflectIsExtensible is now a Torque builtin (previously CPP). Other cases will fall back to runtime.

Bug: v8:6664
Change-Id: Ib1c3f78d1f1a44c6628d351fed3bcdc91ca08cb5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1645438
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#62031}
2019-06-06 15:56:53 +00:00
Igor Sheludko
04beaf63cb [roheap][ptr-compr] Move ReadOnlyHeap::GetReadOnlyRoots() to inl file
The implementation is already quite trivial and in addition in case of
ptr-compr this implementation becomes even simpler and C++ compiler
gets the opportunity to hoist common computation of isolate root.

Tbr: yangguo@chromium.org
Bug: v8:7464, v8:7703
Change-Id: I6e59cd43253c9ade5a0e27025ea7fabecd5b7af7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1647171
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62024}
2019-06-06 14:34:48 +00:00
Georg Schmid
0686e1ef70 Add very basic CsaLoadElimination phase
R=jarin@chromium.org, tebbi@chromium.org

TBR: machenbach@chromium.org

Change-Id: I82dd17b14eb086928f602395d80f0f2cf09770eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635449
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Schmid <gsps@google.com>
Cr-Commit-Position: refs/heads/master@{#62020}
2019-06-06 11:33:05 +00:00
Maciej Goszczycki
fb4d54802e Reland "[roheap] Enable shared ro-heap by default if ptr compression is disabled"
This is a reland of 81abe8f7b6

It also disables ro-heap sharing in nosnap builds

Original change's description:
> [roheap] Enable shared ro-heap by default if ptr compression is disabled
>
> Shared read-only heap is currently incompatible with pointer compression.
> Enable sharing only if pointer compression is disabled.
>
> Bug: v8:7464
> Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Cr-Commit-Position: refs/heads/master@{#61963}

Bug: v8:7464
Change-Id: I6b620152d380864db2a725c25f3c916d695d4f81
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1639298
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62015}
2019-06-06 09:23:50 +00:00
Z Nguyen-Huu
3167b3b600 Add fast path for proxy with isExtensible trap
ObjectIsExtensible is now a Torque builtin (previously CPP) and the Proxy path is implemented completely in Torque while everything else calls into runtime (and is thus a bit slower than previously).

Improvement in micro-benchmark
Before:
IsExtensibleWithoutTrap-Proxies(Score): 2228
IsExtensibleWithTrap-Proxies(Score): 917

After:
IsExtensibleWithoutTrap-Proxies(Score): 3683
IsExtensibleWithTrap-Proxies(Score): 3310

Bug: v8:6664
Change-Id: I1fbe1c51cb724a23d7a59fc8231bb3d1461a6add
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1637444
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62006}
2019-06-05 17:38:27 +00:00
Tobias Tebbi
437f680e19 [torque] generate files per Torque file instead of per namespace
TBR: yangguo@chromium.org

Bug: v8:7793
Change-Id: Ie680d72a1da23038d3136f82532496eabbd9c363
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1632227
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62004}
2019-06-05 16:12:27 +00:00
Maciej Goszczycki
edf616e9f6 [roheap] Make nosnap and read-only heap sharing mutually exclusive
Bug: v8:7464
Change-Id: I09e5d66a2dc369d031691ef04cd8bb34bb40278e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1642808
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61985}
2019-06-04 15:08:53 +00:00
Jakob Gruber
0564a99e76 [snapshot] Remove TEST natives
These were only used by test-log/EquivalenceOfLoggingAndTraversal,
which itself has been marked as failing since 2013. This CL removes
the test itself as well as the TEST natives kind.

Bug: v8:7624,v8:2857
Change-Id: Iedf2b1c94e31ccd1ea885d72bf1fac5d33defa90
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1643467
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61984}
2019-06-04 15:05:52 +00:00
Clemens Hammacher
1cf2b4662d Revert "[roheap] Enable shared ro-heap by default if ptr compression is disabled"
This reverts commit 81abe8f7b6.

Reason for revert: Fails several bots, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/26780

Original change's description:
> [roheap] Enable shared ro-heap by default if ptr compression is disabled
> 
> Shared read-only heap is currently incompatible with pointer compression.
> Enable sharing only if pointer compression is disabled.
> 
> Bug: v8:7464
> Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Cr-Commit-Position: refs/heads/master@{#61963}

TBR=rmcilroy@chromium.org,delphick@chromium.org,goszczycki@google.com

Change-Id: If450c8a7530763e69eaddb53583f890a467f4724
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7464
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1640216
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61964}
2019-06-03 13:00:58 +00:00
Maciej Goszczycki
81abe8f7b6 [roheap] Enable shared ro-heap by default if ptr compression is disabled
Shared read-only heap is currently incompatible with pointer compression.
Enable sharing only if pointer compression is disabled.

Bug: v8:7464
Change-Id: I0866ac288a34eb92fc227e8beba57f4d72a69ef0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635509
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61963}
2019-06-03 12:35:47 +00:00
Maciej Goszczycki
f993a9c9cc [roheap] Inform lsan of leaked objects during read-only space set up
Without this, asan (rightfully) complains about read-only space leaking.

Because pages are manually allocated using mmap, a few objects within
them need to be explicitly ignored in addition to the read-only heap
itself.

This change re-adds lsan.h, with tweaks to make the type checking a bit
more lenient.

Bug: v8:7464
Change-Id: I0e2809930f3674e3f891e755b568ebb5194da461
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1622121
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61942}
2019-05-31 11:14:17 +00:00
Yang Guo
f455f86d89 Move architecture dependent files
Bug: v8:9247
Change-Id: I2f999ed3a8cc0931e5092f2ac6e709b8ff3f9e42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1630678
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61896}
2019-05-28 14:02:15 +00:00
Peter Marshall
9ecf38fb63 [tracing] Fix perfetto build on windows
Add .exe to the produced executable for the protoc compiler.

Use include_dirs instead of -isystem. Remove some more warnings that
that causes.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: Ia6b0df63107470ec78f8038834205a0e4fe34b21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1632069
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61893}
2019-05-28 13:39:00 +00:00
Tobias Tebbi
0ab6cc739f [torque] disable Windows ASAN unittests
Due to bug chromium:893437, Torque has ASAN disabled on Windows, which
makes it impossible to run unittests for Torque with ASAN being enabled
in the unittests. To fix this, this skips Torque unittests in the
unsupported configuration.

Bug: chromium:893437
Change-Id: I6c8eee1448c63223af4d7336954190e649d125e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1632214
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61891}
2019-05-28 13:16:06 +00:00
Jakob Kummerow
f5ab7d38be [wasm-c-api] Add tests and fixes
In a new test suite: "wasm-api-tests", using a new binary "wasm_api_tests",
powered by gtest/gmock (like unittests).
Also fix a bunch of issues that these tests uncovered, mostly to ensure
that the stack is walkable.

Change-Id: I1d5604eea85da078ebecd4ebb7383647595f16ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627539
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61885}
2019-05-28 09:57:04 +00:00
Tobias Tebbi
19d8bfa5a8 [torque] no longer generate assemblers per namespace
Instead of generating one CodeStubAssembler-like class per namespace,
Torque-generated macros are now free-standing functions not included
from CSA code, and explicitly exported macros become part of the new
TorqueGeneratedExportedMacrosAssembler, which CodeStubAssembler
inherits from, thus making them available to all CSA code.

Structs are now defined in a new header csa-types-tq.h as free-standing
types with the prefix "TorqueStruct".

This is a preparation for generating per Torque-file instead of per
namespace.

Change-Id: I60fadc493a63f85d1d340768ec6f11ae47be0cb8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1628787
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61865}
2019-05-27 20:05:18 +00:00
Peter Marshall
d365f62ec1 [tracing] Add a way to test perfetto traces.
Add a new abstract class TraceEventListener which is just an interface
for consuming trace events. This separates the V8-specific stuff that
an actual perfetto consumer needs to do e.g. handling the has_more flag
and signalling back to the controller with a semaphore.

This is a change from the previous plan of making the PerfettoConsumer
class sub-classable to implement custom consumption of trace events.
This will be difficult when the consumer is created outside of the
PerfettoTracingController as we can't hook up the
consumer_finished_semaphore_ that belongs to the controller.

Now the PerfettoTracingController is responsible for the Consumer life-
cycle and hides it entirely from callers. We add the
AddTraceEventListener() method to allow callers to register a listener
either for testing or a JSON listener for real tracing.

This lets us write tests that can store all the trace events in memory
without first converting them to JSON, letting us write test more
easily. There's an example test add to test-tracing - more tests using
this style will follow.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I2d2b0f408b1c7bed954144163e1968f40d772c1b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1628789
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61854}
2019-05-27 14:28:36 +00:00
Jakob Gruber
5e42d8ed79 [mksnapshot] Move more files into src/snapshot/embedded/
Bug: v8:9103
Change-Id: I9a11bd99eb3f2b082749cf6a497ffe759216ad22
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627347
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61843}
2019-05-27 10:13:05 +00:00
Yang Guo
f9a88acbc9 Move remaining files in src/
TBR=mvstanton@chromium.org,neis@chromium.org,ahaas@chromium.org

Bug: v8:9247
Change-Id: I5433c863a54f3412d73df0d38aba3fdbcfac7ebe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627973
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61830}
2019-05-24 18:24:36 +00:00
Igor Sheludko
ae348e30ed [ptr-compr] Introduce StrongTaggedValue and TaggedValue
... which represent potentially compressed Object and MaybeObject
values respectively. They provide methods for checking the smi/weak
tags which don't require decompression and conversion to Smi/HeapObject
combined with tag checks.

The new classes should help to write a bit more efficient runtime (C++)
code for the cases when we don't need the full decompressed value
immediately.

Drive-by-fix: fix ptr-compr build after Object::operator->() removal.

Bug: v8:7703
Change-Id: I7a3d747ab6679120a2cca14e45b0d8bcf33fc496
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624786
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61804}
2019-05-23 17:43:12 +00:00
Peter Marshall
9a2e4693a0 [tracing] Add a perfetto consumer base class
Split the JSONConsumer into a base case and subclass so that we can
implement different consumers without needing to repeat the code that
deals with the finished semaphore and endpoint setters/getters.

This makes it possible to add a test consumer that just holds the trace
events in memory in a later CL.

This CL re-uses the existing perfetto-consumer.h file to some extent,
but it was accidentally leftover from a previous CL where we stopped
using it and switched to the JSON consumer instead.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I56c305833c8937da76a8e6defbe7a52c59b25106
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621938
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61799}
2019-05-23 15:52:46 +00:00
Yang Guo
dec3298d9c Move utility code to src/utils
NOPRESUBMIT=true
TBR=mstarzinger@chromium.org

Bug: v8:9247
Change-Id: I4cd6b79a1c2cba944f6f23caed59d4f1a4ee358b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624217
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61790}
2019-05-23 14:13:34 +00:00
Jakob Gruber
7b38639496 [mksnapshot] Remove target OS defines
These were added to support specific cross-compile scenarios that
should now be covered by the --target-os and --target-arch flags.

Bug: v8:9103
Change-Id: I848f4f39cecc83f9ec8529c4f8855662059e3dc5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624219
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61787}
2019-05-23 13:31:54 +00:00
Jakob Gruber
649d759f82 [mksnapshot] Split out platform embedded file writers
Split out embedded file writers for AIX, Windows, and macOS. These are
no longer selected by compile-time defines (e.g. V8_OS_WIN,
V8_TARGET_ARCH_X64) but by --target-os and --target-arch runtime
flags.

Bug: v8:9103
Change-Id: I5d5cac15e48b5c743d74f8a382606a6194ba7865
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624216
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61785}
2019-05-23 12:47:49 +00:00
Yang Guo
a0c3797461 Move more relevant files to src/objects
TBR=bmeurer@chromium.org,leszeks@chromium.org

Bug: v8:9247
Change-Id: I8d14d0192ea8c705f8274e8e61a162531826edb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624220
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61769}
2019-05-23 08:52:30 +00:00
Yang Guo
b72941e8b0 Move src/callable.h to src/codegen
Bug: v8:9247
Change-Id: Iaed837e146603c37b0ad64605405c442154cf1b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624222
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61766}
2019-05-23 08:18:05 +00:00
Yang Guo
4c986c625f Move handles-related files to src/handles
Bug: v8:9247
Change-Id: I0023200c54fa6499ae4e2cf5e4c89407cc35f187
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624218
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61762}
2019-05-23 06:00:15 +00:00
Jakob Gruber
a35e79ee58 [mksnapshot] Add abstract base class for platform embedded file writers
This is in preparation for better cross-compile support in mksnapshot.
Specifically, this CL series will introduce runtime switches to select
the target platform for generated embedded.S assembly.

Each platform writer will derive from the abstract base class
PlatformEmbeddedFileWriterBase. Currently, the code remains
functionally unmodified and was just moved to
PlatformEmbeddedFileWriterGeneric. This will be split up in future
CLs.

Bug: v8:9103
Change-Id: Ie7e29bb60ba5a8ff6c0c1edec676943b80a1781b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1622854
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61745}
2019-05-22 14:01:00 +00:00
Igor Sheludko
1f0543af7a Revert "Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64""
This reverts commit 2d7102004f.

Reason for revert: It's not ready for shipping in M76.

> Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64"
>
> This is a reland of d61a9347c8
>
> 6th attempt. Relanding after fixing TSan/UBSan issues.
>
> Original change's description:
> > [ptr-compr][x64] Temporarily enable pointer compression on x64
> >
> > ... and make sure that the x64 ptr-compr bots proceed testing V8 without
> > pointer compression in order to keep testing the full pointer mode.
> >
> > Bug: v8:7703
> > Change-Id: Ib1498609603cb03be2464043658131d5a2f1e012
> > Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> > Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559850
> > Commit-Queue: Igor Sheludko <ishell@chromium.org>
> > Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#61416}
>
> Bug: v8:7703
> Change-Id: I1fa0989aef9ea08e54fd6dfd32d6989367332ce3
> Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> Cq-Include-Trybots: luci.v8.try:v8_linux64_cfi_rel_ng
> Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607654
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61559}

Tbr: machenbach@chromium.org
Bug: v8:7703
Change-Id: Ic73b57203bbcb637e33b3577ce8142d43c364796
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
Cq-Include-Trybots: luci.v8.try:v8_linux64_cfi_rel_ng
Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621942
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61740}
2019-05-22 12:51:53 +00:00
Jakob Gruber
8b5c2bdd68 [mksnapshot] Add runtime flag to specify the target architecture
The mksnapshot-specific runtime flag --target-arch, together with
--target-os, specifies the target platform for the generated embedded.S
file.

Bug: v8:9103
Change-Id: Icb03a381101e7ab0db4a5fbbf3be8e23ed0b1a1c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1624165
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61739}
2019-05-22 12:38:12 +00:00
Yang Guo
78ed3456cb Fix file list belonging to libbase
R=mstarzinger@chromium.org

Bug: v8:9247
Change-Id: I6819489dd8ed6d5a6f8e2631a5901c7d4b460960
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621943
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61731}
2019-05-22 10:39:46 +00:00
Yang Guo
0fa243af70 Move relevant files to src/execution
Bug: v8:9247
Change-Id: I79e0553e8a0d6dac2aa16b94a6c0e05b6ccde4a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621934
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61725}
2019-05-22 08:36:33 +00:00
Yang Guo
786ce26341 Move sanitizer-related files
TBR=hpayer@chromium.org
NOPRESUBMIT=true

Bug: v8:9247
Change-Id: I3d49c1c748fe5109523d4cd122ba925f20cfc60b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619755
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61685}
2019-05-21 11:13:41 +00:00
Yang Guo
a6eeea35cb Move code generation related files to src/codegen
Bug: v8:9247

TBR=bmeurer@chromium.org,neis@chromium.org
NOPRESUBMIT=true

Change-Id: Ia1e49d1aac09c4ff9e05d58fab9d08dd71198878
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1621931
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61682}
2019-05-21 10:33:39 +00:00
Yang Guo
be014256ad Move string-related files to src/strings
Bug: v8:9247
Change-Id: I9bcf2694b449f79cdbe03f5fde59cb21b8cad418
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619758
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61676}
2019-05-21 07:17:48 +00:00
Yang Guo
93d3b7173f Move JSON files to src/json
R=verwaest@chromium.org

Bug: v8:9247
Change-Id: I747c13cc8517858872c85fc93d0e95af4968e1b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617934
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61675}
2019-05-21 06:32:29 +00:00
Peter Marshall
76f8519953 [tracing] Use ChromeTracePacket to save binary size with perfetto
Previously, compiling with perfetto would add 2.3 MiB to the d8 release
binary. With this change it's 472 KiB.

This is because trace:lite pulls in many more compiled proto classes
than we need, e.g. a bunch of stuff under ftrace/ which is only used
on Android.

Chrome uses a 'mirror proto' ChromeTrackPacket to only provide
compiled protos for the types of packets it will actually see, which on
non-android devices does not include anything under ftrace/.

We use the same trick here in the JSON consumer.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: Iae1f74eec3bd93b18e9f069701fc016440d3ce5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619759
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61662}
2019-05-20 14:32:07 +00:00
Yang Guo
5bfe84a0da Reland "Move deoptimizer files"
This reverts commit a769552055.

Reason for revert: Was not the culprit.

Original change's description:
> Revert "Move deoptimizer files"
> 
> This reverts commit 61523c45a3.
> 
> Reason for revert: https://ci.chromium.org/p/v8/builders/ci/V8%20Win32%20-%20debug/20396
> 
> Original change's description:
> > Move deoptimizer files
> > 
> > Bug: v8:9247
> > Change-Id: I6287907edb8a36225bfa9fe864305ea59c20dd8b
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617667
> > Commit-Queue: Yang Guo <yangguo@chromium.org>
> > Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> > Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#61648}
> 
> TBR=yangguo@chromium.org,mstarzinger@chromium.org,jarin@chromium.org,bmeurer@chromium.org
> 
> Change-Id: Icf258f7bc409ef0c360cfa82029bfc45a41dc75f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: v8:9247
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619749
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61650}

TBR=yangguo@chromium.org,mstarzinger@chromium.org,jarin@chromium.org,bmeurer@chromium.org

Change-Id: Ic2aa07ccd08b6070222ec7a65b92b7afb9db484c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619753
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61652}
2019-05-20 13:01:13 +00:00
Yang Guo
a769552055 Revert "Move deoptimizer files"
This reverts commit 61523c45a3.

Reason for revert: https://ci.chromium.org/p/v8/builders/ci/V8%20Win32%20-%20debug/20396

Original change's description:
> Move deoptimizer files
> 
> Bug: v8:9247
> Change-Id: I6287907edb8a36225bfa9fe864305ea59c20dd8b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617667
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61648}

TBR=yangguo@chromium.org,mstarzinger@chromium.org,jarin@chromium.org,bmeurer@chromium.org

Change-Id: Icf258f7bc409ef0c360cfa82029bfc45a41dc75f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1619749
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61650}
2019-05-20 12:50:42 +00:00
Yang Guo
61523c45a3 Move deoptimizer files
Bug: v8:9247
Change-Id: I6287907edb8a36225bfa9fe864305ea59c20dd8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617667
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61648}
2019-05-20 11:33:07 +00:00
Yang Guo
bf372a73d8 Reland "Move logging and diagnostics related source files"
TBR=verwaest@chromium.org,rmcilroy@chromium.org
NOTREECHECKS=true
NOPRESUBMIT=true

Bug: v8:9247
Change-Id: I9ddfb6e56ca8e47c4ac186a8df5f442d26420a69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617661
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61642}
2019-05-20 09:54:57 +00:00
Yang Guo
8ad6b33537 Move relevant files to src/objects
Code that is being moved primarily deal with layout of a JSObject,
accessing properties and elements, and map transitions.

NOTREECHECKS=true
NOTRY=true

Bug: v8:9247
Change-Id: Ibce5d5926ac4021c8d40c4dd109948775ce1da58
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613994
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61638}
2019-05-20 08:57:47 +00:00
Yang Guo
06bf8261cf Reland "Move API-related files"
TBR=rmcilroy@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org

Bug: v8:9247
Change-Id: I7ffc2bd4a5fdf7c20cc3283bb5545cbf9ffd4e53
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617254
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61609}
2019-05-17 12:52:27 +00:00
Yang Guo
81a0102fe8 Revert "Move logging and diagnostics related source files"
This reverts commit 5f28539599.

Reason for revert: presubmit failure

Original change's description:
> Move logging and diagnostics related source files
> 
> This also introduces a COMMON_OWNERS file, which is derived from the
> current top-level OWNERS file. It is to be used for parts of the
> codebase that is not sensitive to domain-specific expertise.
> 
> NOPRESUBMIT=true
> TBR=verwaest@chromium.org
> 
> Bug: v8:9247
> Change-Id: I34a5eaa7cb1509a80d15094a2aceedd62665b17c
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613987
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61600}

TBR=rmcilroy@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org

Change-Id: I3827c3af4fd63b18aa48c49617f318a01746e813
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617247
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61601}
2019-05-17 09:00:46 +00:00
Yang Guo
5f28539599 Move logging and diagnostics related source files
This also introduces a COMMON_OWNERS file, which is derived from the
current top-level OWNERS file. It is to be used for parts of the
codebase that is not sensitive to domain-specific expertise.

NOPRESUBMIT=true
TBR=verwaest@chromium.org

Bug: v8:9247
Change-Id: I34a5eaa7cb1509a80d15094a2aceedd62665b17c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613987
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61600}
2019-05-17 08:35:30 +00:00
Yang Guo
ee9ed5cc35 Move src/collector.h to test/cctest
It's not used anywhere else.

R=mslekova@chromium.org

Change-Id: I2859618faba4da7cc93d9fba881470fc2ae8a6cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613995
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61590}
2019-05-16 20:55:17 +00:00
Maya Lekova
3253767622 Revert "Move API-related files"
This reverts commit 9ac8b20086.

Reason for revert: Breaks CFI bot 
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20-%20cfi/20442

Original change's description:
> Move API-related files
> 
> NOPRESUBMIT=true
> TBR=verwaest@chromium.org
> 
> Bug: v8:9247
> Change-Id: I45bfe0782ba92aa7ed27a9e308d0aab9ba1bac7f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613988
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61579}

TBR=rmcilroy@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,verwaest@chromium.org

Change-Id: I28ee9174a1cbc1dae9711977bf9369253ef43058
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9247
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1615463
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61583}
2019-05-16 15:00:18 +00:00
Yang Guo
9ac8b20086 Move API-related files
NOPRESUBMIT=true
TBR=verwaest@chromium.org

Bug: v8:9247
Change-Id: I45bfe0782ba92aa7ed27a9e308d0aab9ba1bac7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613988
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61579}
2019-05-16 14:03:36 +00:00
Yang Guo
3cb560adfe Move initialization code into src/init
R=jkummerow@chromium.org, neis@chromium.org, rmcilroy@chromium.org, ulan@chromium.org

Bug: v8:9247
Change-Id: If55cdec37c031df5ae101fdf93082f32ca5beade
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613992
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61573}
2019-05-16 12:36:15 +00:00
Sigurd Schneider
98628ab91c [torque] Generate class templates from Torque
Bug: v8:7793
Change-Id: I390b4b5e1f486c53c122f7ebf8dd4106c9bbd10e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607650
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61564}
2019-05-16 07:39:23 +00:00
Igor Sheludko
2d7102004f Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64"
This is a reland of d61a9347c8

6th attempt. Relanding after fixing TSan/UBSan issues.

Original change's description:
> [ptr-compr][x64] Temporarily enable pointer compression on x64
>
> ... and make sure that the x64 ptr-compr bots proceed testing V8 without
> pointer compression in order to keep testing the full pointer mode.
>
> Bug: v8:7703
> Change-Id: Ib1498609603cb03be2464043658131d5a2f1e012
> Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559850
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61416}

Bug: v8:7703
Change-Id: I1fa0989aef9ea08e54fd6dfd32d6989367332ce3
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
Cq-Include-Trybots: luci.v8.try:v8_linux64_cfi_rel_ng
Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1607654
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61559}
2019-05-15 22:28:10 +00:00
Z Duong Nguyen-Huu
93e9126786 Port StringPrototypeSlice to Torque
Bug: v8:8996
Change-Id: I712f7eea934581f8d0889889a8737548ef8fa255
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611752
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#61558}
2019-05-15 20:00:25 +00:00
Yang Guo
7bbd0bfe51 Move number related files to src/numbers
R=bmeurer@chromium.org, clemensh@chromium.org, jkummerow@chromium.org, sigurds@chromium.org, ulan@chromium.org, verwaest@chromium.org

Bug: v8:9247
Change-Id: I153a6bbfc55989fe7a86c052f95c5cb8ee61e841
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613244
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61557}
2019-05-15 19:34:44 +00:00
Seth Brenith
3161a43ca0 Add option to speed up Torque compilation
This change adds a flag v8_enable_fast_torque, which follows the pattern
of v8_enable_fast_mksnapshot and can improve build times by running an
optimized Torque compiler during debug builds. On my machine, this
change improves rebuild time after changing a .tq file by about 7
seconds.

Change-Id: I7c91d1059c614fe34eefe7ee8c3cba7c931d5a50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1612160
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61556}
2019-05-15 19:21:55 +00:00
Z Duong Nguyen-Huu
94b2c12119 Reland of Port ProxyHasProperty to Torque
Refactor CheckHasTrapResult as well.

Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p
Bug: v8:6664
Change-Id: Iaa9c1cb46ab4f7c8139dfe1380b3ec807a4719ee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1610215
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61546}
2019-05-15 16:03:22 +00:00
Clemens Hammacher
85efe15737 [cleanup] Remove unused format macros plus header
All macros defined in "format-macros.h" are dead now (after
https://crrev.com/c/1613243). This CL removes this header, and includes
<cinttypes> instead wherever we use format macros for the types defined
in <cstdint>.

Plus some drive-by cleanup of includes.

R=mlippautz@chromium.org

Bug: v8:9183
Change-Id: Ic379759b79edb50e38833defb1577cc3af7c8150
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1611800
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61540}
2019-05-15 14:26:25 +00:00
Nico Hartmann
b8c97dd2a8 [torque] Port Boolean constructor to Torque
Add torque implementation of GetDerivedMap

Bug: v8:9240
Change-Id: I9f2203f5c79fad84f67894c9cbaf28e6f7685f58
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609804
Commit-Queue: Nico Hartmann <nicohartmann@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61535}
2019-05-15 13:44:56 +00:00
Yang Guo
c39cabbcbe Move date-related files
R=bmeurer@chromium.org, ishell@chromium.org, jshin@chromium.org, ulan@chromium.org

Bug: v8:9247
Change-Id: I67b591b613dd066f441e63fd61952728f4036636
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613247
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61532}
2019-05-15 13:39:34 +00:00
Yang Guo
a3187716d3 Move d8 into a dedicated subdirectory
Bug: v8:9247
Change-Id: I404e34a013b95c6a7cf03dd9ec0732d9ad796bdc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1613238
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61531}
2019-05-15 13:38:32 +00:00
Yang Guo
3a16befad9 Move snapshot_toolchain.gni to gni/
R=jgruber@chromium.org
BUG: v8:9253

Change-Id: Ifde76a8f2beb581ac4040deeaae3504e599ab4f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1612903
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61516}
2019-05-15 11:07:24 +00:00
Maciej Goszczycki
58fea9c1e2 [heap] Enable read-only heap sharing for lite-mode
Bug: v8:7464
Change-Id: I50de5f19f3303625a492faad5da378e2f0d3ed3f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1602699
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61514}
2019-05-15 10:05:58 +00:00
Z Duong Nguyen-Huu
2dd0db19ba Reland of Port Proxy SetProperty trap builtin to Torque
Reverted CL is in https://chromium-review.googlesource.com/c/v8/v8/+/1585269
This includes fix for ThrowTypeErrorIfStrict and add regression test.

Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
Bug: v8:6664, v8:9234
Change-Id: I785df3f12f619e2e0fe7b011b72043758e4083e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1604071
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61497}
2019-05-14 18:06:46 +00:00
Sigurd Schneider
f6f31d154e [torque] Rename ...from-dsl... to ...tq...
This CL introduces the new suffix '-tq' for Torque generated files,
and replaces the infix 'FromDSL' in type names with a prefix
'TorqueGenerated'.

Change-Id: I1e90460cc0c666da6cf5017e8b3cb7c39c6ac668
Bug: v8:7793
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1609798
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61490}
2019-05-14 14:49:23 +00:00
Santiago Aboy Solanes
23834cbdfd [ptr-compr][Turbofan] Adding the DecompressionElimination AdvancedReducer
After introducing explicit compress and decompress nodes for each load
and store we are left with many nodes that are redundant.

This CL aims to eliminate redundant decompressions and compressions in the
"direct decompression & compression" category.

Also added tests to test the new reducer.

Cq-Include-Trybots: luci.v8.try:v8_linux64_pointer_compression_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_arm64_pointer_compression_rel_ng
Bug: v8:8977, v8:7703
Change-Id: I93e024d13af34d484086b7983f379265d16ac154
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1602702
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61473}
2019-05-14 11:32:22 +00:00
Igor Sheludko
37d89edf06 Revert "Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64""
This reverts commit d61a9347c8.

Reason for revert: May cause UBSan failures

Original change's description:
> Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64"
>
> This is a reland of 42beed975e
>
> Relanding after fixing Chromium issues.
>
> Original change's description:
> > [ptr-compr][x64] Temporarily enable pointer compression on x64
> >
> > ... and make sure that the x64 ptr-compr bots proceed testing V8 without
> > pointer compression in order to keep testing the full pointer mode.
> >
> > Bug: v8:7703
> > Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> > Change-Id: Iee725deda813425a6f0722948b54976154f50909
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1497139
> > Reviewed-by: Michael Hablich <hablich@chromium.org>
> > Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> > Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60230}
>
> Bug: v8:7703
> Change-Id: Ib1498609603cb03be2464043658131d5a2f1e012
> Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559850
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61416}

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

Change-Id: I77d8fe848e53cbea4be89429de967a5966ae7e48
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7703
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng, v8_linux64_tsan_rel
Cq-Include-Trybots: luci.chromium.try:fuchsia_x64, linux-rel, mac-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1606500
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61427}
2019-05-10 20:28:16 +00:00
Seth Brenith
e483fb2731 [torque] Automatically generate verifier functions
This change generates functions that verify the things that Torque knows
about objects and their fields. We still must implement each verifier
function in objects-debug.cc, but we can call into the generated code to
verify that field types match their Torque definitions. If no additional
verification is required, we can use the macro USE_TORQUE_VERIFIER as a
shorthand for a verifier that calls the corresponding generated
function.

A new annotation @noVerifier can be applied to both class and field
definitions, to prevent generating verification code. This allows fully
customized verification for complicated cases like
JSFunction::prototype_or_initial_map, which might not exist at all, and
JSObject::elements, which might be a one pointer filler map.

Because Factory::InitializeJSObjectFromMap fills new objects with
undefined values, and many verifiers need to deal with partially-
initialized objects, the generated verifiers allow undefined values on
every class deriving from JSObject. In cases where stricter checks were
previously performed, they are kept in objects-debug.cc.

Bug: v8:7793
Change-Id: I84034efadca89ba0aceddf92e886ffbfaa4c23fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1594042
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61422}
2019-05-10 17:17:04 +00:00
Igor Sheludko
d61a9347c8 Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64"
This is a reland of 42beed975e

Relanding after fixing Chromium issues.

Original change's description:
> [ptr-compr][x64] Temporarily enable pointer compression on x64
>
> ... and make sure that the x64 ptr-compr bots proceed testing V8 without
> pointer compression in order to keep testing the full pointer mode.
>
> Bug: v8:7703
> Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> Change-Id: Iee725deda813425a6f0722948b54976154f50909
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1497139
> Reviewed-by: Michael Hablich <hablich@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60230}

Bug: v8:7703
Change-Id: Ib1498609603cb03be2464043658131d5a2f1e012
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel,mac-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559850
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61416}
2019-05-10 15:18:37 +00:00
Dan Elphick
82b7db3362 Revert "Port Proxy SetProperty trap builtin to Torque"
This reverts commit 7275c9c8e2.

Reason for revert: Introduces a crash

Original change's description:
> Port Proxy SetProperty trap builtin to Torque
> 
> Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
> Bug: v8:6664
> Change-Id: Ieddb645669a72d78ff9c0a45267165de3c5276f1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585269
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61351}

TBR=jgruber@chromium.org,mslekova@chromium.org,duongn@microsoft.com

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

Bug: v8:6664, v8:9234
Change-Id: I4e26f5321a51498ab44efac75a963afea7b2ca16
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605944
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61415}
2019-05-10 15:01:07 +00:00
Dan Elphick
26ba75c8b0 Revert "Port ProxyHasProperty to Torque"
This reverts commit f117f9a2ee.

Reason for revert: Need to revert https://chromium-review.googlesource.com/c/v8/v8/+/1585269 which this is built on top of

Original change's description:
> Port ProxyHasProperty to Torque
> 
> Refactor CheckHasTrapResult as well.
> 
> Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p
> Bug: v8:6664
> Change-Id: Ic9bacbd21bb329e354ebd08b61d9e60a94534d0d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601895
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61389}

TBR=jgruber@chromium.org,mslekova@chromium.org,duongn@microsoft.com

Change-Id: Iec42848a41d10699e9be717a17aab987269f394a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6664, v8:9234
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1605943
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61412}
2019-05-10 14:11:29 +00:00
Z Duong Nguyen-Huu
f117f9a2ee Port ProxyHasProperty to Torque
Refactor CheckHasTrapResult as well.

Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p
Bug: v8:6664
Change-Id: Ic9bacbd21bb329e354ebd08b61d9e60a94534d0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1601895
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61389}
2019-05-09 18:28:10 +00:00
Igor Sheludko
4170e328e0 [ptr-compr][cleanup] Introduce TaggedImpl<> as a base for MaybeObject
This is a first step towards unification of Object and MaybeObject
definitions.

Having an TaggedImpl template will simplify adding compressed variants
of Object and MaybeObject which is required for avoiding unnecessary
value decompression in tight value copying loops and write barrier
implementations.

Bug: v8:7703, v8:9183
Change-Id: I4c1931c22359533d50cf4a2c7f1339dd55c0c707
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588460
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61385}
2019-05-09 15:06:53 +00:00
Maciej Goszczycki
b69c363ad2 [heap] Ensure ptr-compression and ro-heap sharing are mutually exclusive
Bug: v8:7464
Change-Id: Id191c185ebe811a7e8830cbdfd7751ee4f7b6060
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1602693
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61383}
2019-05-09 14:18:23 +00:00
Sergiy Belozorov
80451b07bc [tools] Implement confidence-based number of runs
R=machenbach@chromium.org, tmrts@chromium.org

Bug: chromium:880724
Change-Id: I2b8ede244fa09868eef384b967223a3788ddd2a1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581180
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61370}
2019-05-09 09:42:28 +00:00
Paolo Severini
0b300d4b3d Reland "Generate unwind info on Win/x64 by default"
The original CL title was updated to reflect CL contents. The
--win64-unwinding-info flag still exists but it is set by default.

This is a reland of efd8c2d975

Original change's description:
> Remove --win64-unwinding-info flag and always generate unwind info on Win/x64
>
> The generation of unwind info to enable stack walking on Windows/x64
> (https://chromium-review.googlesource.com/c/v8/v8/+/1469329) was implemented
> behind a temporary flag, in order to coordinate these changes with the
> corresponding changes in Chromium.
>
> The required changes to Chromium
> (https://chromium-review.googlesource.com/c/chromium/src/+/1474703) have also
> been merged, so we can now remove the flag and enable the generation of stack
> unwinding info by default on Windows/x64.
>
> Bug: v8:3598
> Change-Id: I88814aaeabecc007f5262227aa0681a1d16156d5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573138
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Paolo Severini <paolosev@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#61020}

Bug: v8:3598, chromium:958035
Change-Id: Ie53b39f3bb31567797a61e5110685284c266c1f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599596
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61368}
2019-05-09 09:09:18 +00:00
Peter Marshall
5beb3ebbe9 [tracing] Add a JSON consumer for Perfetto tracing data
We pretty much always want tracing data as a JSON file. Implement a
Consumer which converts protos to the JSON trace events format.

This duplicates a lot of the internals of TraceWriter in
trace-writer.cc but we will remove that eventually.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I85f86562f1b3c4d24ecd755413d1c3f88b292adb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1541042
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61366}
2019-05-09 09:03:18 +00:00
Z Duong Nguyen-Huu
47d32fef2b Port StringPrototypeSubString to Torque
Bug: v8:8996
Change-Id: I63ae821086c42c14a317e866fb4f0f799f4c4f7c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1597555
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61360}
2019-05-09 05:56:28 +00:00
Z Duong Nguyen-Huu
7275c9c8e2 Port Proxy SetProperty trap builtin to Torque
Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
Bug: v8:6664
Change-Id: Ieddb645669a72d78ff9c0a45267165de3c5276f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585269
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61351}
2019-05-08 18:38:27 +00:00
Jakob Kummerow
a58a937189 [wasm-c-api] Introducing WasmCapiFunction
For faster calls from Wasm to C-API functions, passing parameter
values directly instead of through JavaScript wrapper objects.

Change-Id: I31e7d1622dedaf3154483306ab159427ac167663
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591601
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61338}
2019-05-08 14:28:06 +00:00
Peter Marshall
275239382e [tracing] Only build protobuf generators for C++.
The default protobuf compiler main builds generators for the CLI tool
for all the supported languages.

This CL adds a custom main() which only requires the CPP generator.
The protobuf compiler is a build-time dependency so this won't shrink
binary size but will speed up compile a little bit and means we don't
have to list all of the files for the other supported languages in the
build.gn file. That should hopefully make protobuf rolls a bit easier
given that we are maintaining GN build files for protobuf.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: Iac432dfe53b7ac9cfa819be1b2945d5948ffff38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599448
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61317}
2019-05-08 09:21:05 +00:00
Michael Starzinger
0b830b328a [gcmole] Fix BUILD.gn to include compiler directory.
R=clemensh@chromium.org

Change-Id: I8f51731a789b242cdd489f6321bc1ba909aa5d66
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599548
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61311}
2019-05-08 07:35:48 +00:00
Igor Sheludko
47a302f398 [cleanup] Move WriteBarrierKind to v8::internal::compiler namespace
... to minimize pollution of v8::internal namespace.
This CL also removes usages of WriteBarrierKind from CodeAssembler interface.

Bug: v8:9183
Change-Id: I7e87c0a98cfd08b3740a022cf12d3aab415da67a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599176
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61301}
2019-05-07 16:54:56 +00:00
Sigurd Schneider
70678d53a1 [torque] Make torque declarations order independent
Torque semantic analysis is now a four-stage process:

 1. The TypeDeclarationVisitor introduces a TypeAlias for every
    TypeDeclaration* (or derived) in the Torque source, but does
    not process the TypeDeclaration* itself.
 2. All aliases are resolved in a dependency respecting manner.
    This CL also changes struct member resolution to happen at
    this point already. Types for classes are created, but their
    members are not resolved to allow classes to mutually reference
    each other in their field types.
 3. 'value' declarations (macros, etc.) are processed.
 4. Members of classes are processed.

Bug: v8:7793
Change-Id: I46108555a5cdf30df03c5d4399ec786ee6cc6df4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584319
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61264}
2019-05-07 09:19:16 +00:00
Michael Achenbach
c1e08aa52d [test] Increase timeout for full debug and predictable
Bug: v8:9145
Change-Id: Idb1a838666ea21cb260a141929fd80b400913836
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1596731
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61262}
2019-05-07 08:36:41 +00:00
Jakob Gruber
7bc1af3d98 Revert "Remove --win64-unwinding-info flag and always generate unwind info on Win/x64"
This reverts commit efd8c2d975.

Reason for revert: Performance regressions (chromium:958035)

Original change's description:
> Remove --win64-unwinding-info flag and always generate unwind info on Win/x64
>
> The generation of unwind info to enable stack walking on Windows/x64
> (https://chromium-review.googlesource.com/c/v8/v8/+/1469329) was implemented
> behind a temporary flag, in order to coordinate these changes with the
> corresponding changes in Chromium.
>
> The required changes to Chromium
> (https://chromium-review.googlesource.com/c/chromium/src/+/1474703) have also
> been merged, so we can now remove the flag and enable the generation of stack
> unwinding info by default on Windows/x64.
>
> Bug: v8:3598
> Change-Id: I88814aaeabecc007f5262227aa0681a1d16156d5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573138
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Paolo Severini <paolosev@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#61020}

TBR=ulan@chromium.org,mstarzinger@chromium.org,jgruber@chromium.org,paolosev@microsoft.com

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

Tbr: ulan@chromium.org,mstarzinger@chromium.org,paolosev@microsoft.com
Bug: v8:3598, chromium:958035
Change-Id: Ia86a230ee83080ed8ace43e4641c8c1013043df4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1598748
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61259}
2019-05-07 07:52:17 +00:00
Toon Verwaest
8381ea7b29 Reland "[json] Speed up json parsing"
This is a reland of b0c4a8764b

Original change's description:
> [json] Speed up json parsing
>
> - scan using raw data pointers + GC callback
> - scan using scanner tables
> - cap internalizing large string values
> - inline fast transitioning logic
>
> Fixes previous CL by moving AllowHeapAllocation to callers of
> ReportUnexpectedCharacter where needed to make it clear we need to exit.
>
> Tbr: ulan@chromium.org
> Change-Id: Icfbb7cd536e0fbe153f34acca5d0fab6b5453d71
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591778
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61159}

Change-Id: I0d713e02d243723df2d2a7c252eae44a6648b6b7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1596444
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61247}
2019-05-06 15:27:57 +00:00
Z Duong Nguyen-Huu
b061589ba3 Port StringPrototypeToString, StringPrototypeValueOf to Torque
Bug: v8:8996
Change-Id: I86104991d9732157c1fbdff273046bf4f7e0186f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593853
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Peter Wong <peter.wm.wong@gmail.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61221}
2019-05-03 20:01:16 +00:00
Z Duong Nguyen-Huu
c862f5914d Port StringPrototypeIterator to Torque
Bug: v8:8996
Change-Id: I7930d98a9ff3b341611b2833b6847615b0ac467d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593856
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61220}
2019-05-03 19:02:35 +00:00
Peter Marshall
8f4063c6ea [tracing] Implement the default TracingController with Perfetto
Based on Primiano's prototype:
https://chromium-review.googlesource.com/c/v8/v8/+/1290549

This is still behind a build flag. I'll add functionality incrementally
rather than land everything in one giant CL.

This CL sets up the basic classes that will be used for the Perfetto
implementation, e.g. the producer, consumer, controller and task runner.

This implementation produces a binary proto file in the current
directory named v8_trace.proto. It doesn't yet produce JSON output,
that is coming in a following CL.

Currently the old tracing and perfetto tracing are both run alongside
each other if the build flag is enabled.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I0eb9ecefa191ceead60aadd5b591d75c99395a6e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1408995
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61209}
2019-05-03 14:33:58 +00:00
Georg Neis
3460e02064 [turbofan] Move MapInference into its own files
Bug: v8:9197
Change-Id: If72dbf1507f68fa344db389c08ad8614bca6667e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593337
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61199}
2019-05-03 12:42:20 +00:00
Sigurd Schneider
47fccbfd2d Revert "Reland "[json] Speed up json parsing""
This reverts commit bbd740f038.

Reason for revert: blocks lkgr due to layout test failure:
https://ci.chromium.org/p/v8/builders/ci/V8-Blink%20Linux%2064/31607

Original change's description:
> Reland "[json] Speed up json parsing"
> 
> This is a reland of b0c4a8764b
> 
> Original change's description:
> > [json] Speed up json parsing
> >
> > - scan using raw data pointers + GC callback
> > - scan using scanner tables
> > - cap internalizing large string values
> > - inline fast transitioning logic
> >
> > Fixes previous CL by moving AllowHeapAllocation to callers of
> > ReportUnexpectedCharacter where needed to make it clear we need to exit.
> >
> > Tbr: ulan@chromium.org
> > Change-Id: Icfbb7cd536e0fbe153f34acca5d0fab6b5453d71
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591778
> > Reviewed-by: Igor Sheludko <ishell@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#61159}
> 
> Tbr: verwaest@chromium.org
> Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel
> Change-Id: Ic7d0057178c649fc45b8c8f4587ee9128e351515
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593292
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61179}

TBR=ulan@chromium.org,ishell@google.com,verwaest@google.com,ishell@chromium.org,verwaest@chromium.org

Change-Id: I3ae8f9ce8214bebe7fab9d87c5daf8cdfdb94199
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1594438
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61194}
2019-05-03 09:49:38 +00:00
Maciej Goszczycki
9c06209306 Reland "[heap] Skip ro-space from heap iterators, add CombinedHeapIterator."
Code relocation info is now always allocated in old-space. Before relocation
info allocated for placeholders and builtins (which get replaced with
trampolines in nosnap builds) would become unreachable. Since read-only space
is not GCed and ReadOnlyHeapIterator doesn't check for reachability,
ValidateSnapshot would fail finding unreachable objects returned by
ReadOnlyHeapIterator.

Because trampoline relocation info gets replaced with canonical one, this only
affects no-embdded-builtins nosnap builds, which don't get much benefit from
read-only relocation info anyway.

A new check has been added to the read-only deserializer to verify that every
read-only object is reachable at mksnapshot-time.

The CombinedHeapIterator iteration order was changed to iterate over
read-only space first, because that's how HeapIterator worked.

This is a reland of 3d1d8eae77

Original change's description:
> [heap] Skip ro-space from heap iterators, add CombinedHeapIterator.
>
> Read-only space sharing requires an iterator independent of heap. This
> also enables future removal of read-only space from heap.
>
> Bug: v8:7464
> Change-Id: Ia07a9369494ea2c547d12c01ffa1d7b8b6bbeabc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1552795
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60819}

Bug: v8:7464
Change-Id: I49ae070955b77956962334a84f762ab29052d5ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566513
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61185}
2019-05-02 17:35:18 +00:00
Toon Verwaest
bbd740f038 Reland "[json] Speed up json parsing"
This is a reland of b0c4a8764b

Original change's description:
> [json] Speed up json parsing
>
> - scan using raw data pointers + GC callback
> - scan using scanner tables
> - cap internalizing large string values
> - inline fast transitioning logic
>
> Fixes previous CL by moving AllowHeapAllocation to callers of
> ReportUnexpectedCharacter where needed to make it clear we need to exit.
>
> Tbr: ulan@chromium.org
> Change-Id: Icfbb7cd536e0fbe153f34acca5d0fab6b5453d71
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591778
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61159}

Tbr: verwaest@chromium.org
Cq-Include-Trybots: luci.v8.try:v8_linux64_msan_rel
Change-Id: Ic7d0057178c649fc45b8c8f4587ee9128e351515
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593292
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61179}
2019-05-02 15:54:57 +00:00
Alexander Neville
e8986a4e06 [builtins] Port various Math builtins to torque.
This patch ports the following builtins to torque:
- Math.acos()
- Math.acosh()
- Math.asin()
- Math.asinh()
- Math.atan()
- Math.atan2()
- Math.atanh()
- Math.cbrt()
- Math.cos()
- Math.cosh()
- Math.exp()
- Math.expm1()
- Math.fround()
- Math.log()
- Math.log1p()
- Math.log10()
- Math.log2()
- Math.sin()
- Math.sinh()
- Math.sqrt()
- Math.tan()
- Math.tanh()

Change-Id: Ia7b0246744e4b0cace696dc309622e287397be1f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584169
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61168}
2019-05-02 13:16:42 +00:00
Michael Achenbach
2036e2590b Revert "[json] Speed up json parsing"
This reverts commit b0c4a8764b.

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

Original change's description:
> [json] Speed up json parsing
> 
> - scan using raw data pointers + GC callback
> - scan using scanner tables
> - cap internalizing large string values
> - inline fast transitioning logic
> 
> Fixes previous CL by moving AllowHeapAllocation to callers of
> ReportUnexpectedCharacter where needed to make it clear we need to exit.
> 
> Tbr: ulan@chromium.org
> Change-Id: Icfbb7cd536e0fbe153f34acca5d0fab6b5453d71
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591778
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61159}

TBR=ulan@chromium.org,ishell@google.com,ishell@chromium.org,verwaest@chromium.org

Change-Id: Ibe823e187d9ab999be7278140b0ed31868440e9e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593090
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61163}
2019-05-02 12:56:01 +00:00
Toon Verwaest
b0c4a8764b [json] Speed up json parsing
- scan using raw data pointers + GC callback
- scan using scanner tables
- cap internalizing large string values
- inline fast transitioning logic

Fixes previous CL by moving AllowHeapAllocation to callers of
ReportUnexpectedCharacter where needed to make it clear we need to exit.

Tbr: ulan@chromium.org
Change-Id: Icfbb7cd536e0fbe153f34acca5d0fab6b5453d71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1591778
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61159}
2019-05-02 12:26:09 +00:00
Sathya Gunasekaran
ff14c88679 Revert "Reland "[json] Speed up json parsing""
This reverts commit 36dd2bca5b.

Reason for revert: msan still failing https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/26453


Original change's description:
> Reland "[json] Speed up json parsing"
> 
> This is a reland of de8aaef5a3
> 
> Original change's description:
> > [json] Speed up json parsing
> >
> > - scan using raw data pointers + GC callback
> > - scan using scanner tables
> > - cap internalizing large string values
> > - inline fast transitioning logic
> >
> > Change-Id: I545620017b38b80e4193dfaf19381411adf5ff89
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584320
> > Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> > Reviewed-by: Igor Sheludko <ishell@chromium.org>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#61132}
> 
> Tbr: ulan@chromium.org
> Change-Id: Iafd5e7c750a9f3eae706baf51dc4c9237c916132
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588887
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61136}

TBR=ulan@chromium.org,gsathya@chromium.org,ishell@chromium.org,verwaest@chromium.org

Change-Id: If0a34e017fed7688873c21f4b65f62b246820732
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1590626
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61137}
2019-04-30 22:09:30 +00:00
Toon Verwaest
36dd2bca5b Reland "[json] Speed up json parsing"
This is a reland of de8aaef5a3

Original change's description:
> [json] Speed up json parsing
>
> - scan using raw data pointers + GC callback
> - scan using scanner tables
> - cap internalizing large string values
> - inline fast transitioning logic
>
> Change-Id: I545620017b38b80e4193dfaf19381411adf5ff89
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584320
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61132}

Tbr: ulan@chromium.org
Change-Id: Iafd5e7c750a9f3eae706baf51dc4c9237c916132
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588887
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61136}
2019-04-30 21:04:38 +00:00
Sathya Gunasekaran
813d149e17 Revert "[json] Speed up json parsing"
This reverts commit de8aaef5a3.

Reason for revert: breaks MSAN https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8914730548828313776/+/steps/Check/0/logs/json/0

Original change's description:
> [json] Speed up json parsing
> 
> - scan using raw data pointers + GC callback
> - scan using scanner tables
> - cap internalizing large string values
> - inline fast transitioning logic
> 
> Change-Id: I545620017b38b80e4193dfaf19381411adf5ff89
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584320
> Commit-Queue: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61132}

TBR=ulan@chromium.org,ishell@chromium.org,verwaest@chromium.org

Change-Id: I870c82f6f2a5bc3d2dfea57d5d6306cdccbbe935
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1590384
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61134}
2019-04-30 18:24:49 +00:00
Toon Verwaest
de8aaef5a3 [json] Speed up json parsing
- scan using raw data pointers + GC callback
- scan using scanner tables
- cap internalizing large string values
- inline fast transitioning logic

Change-Id: I545620017b38b80e4193dfaf19381411adf5ff89
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584320
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61132}
2019-04-30 18:04:14 +00:00
Suraj Sharma
57b30632d8 [torque] Convert few class layout definitions to torque.
Converted JSGlobalObject, JSIteratorResult, JSLocale, JSDateTimeFormat,
JSListFormat, JSNumberFormat, JSPluralRules, JSRelativeTimeFormat,
JSSegmenter, JSAsyncFromSyncIterator to torque.

Bug: v8:8952
Change-Id: Id912197054727815b481b2c683b93473bfcbd0c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1574491
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Suraj Sharma <surshar@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61099}
2019-04-29 18:10:59 +00:00
Igor Sheludko
28294e877c [cleanup] Move object lists macros and forward declarations from objects.h
... to a separate file.

Bug: v8:9183
Change-Id: I87f98ed0fec84eb32403c3447bec7be50a79261d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588095
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61094}
2019-04-29 15:59:36 +00:00
Toon Verwaest
b7ed86ecde [runtime] Simplify/unify utf8 handling
- Removes Utf8Iterator
- Replaces Utf8Decoder with something based on ValueOfIncremental +
  NonAsciiStart and moves it into v8/internal.
- Internalizes utf8 strings by first converting them to one or two byte
- Removes IsUtf8EqualsTo and replaces current uses with IsOneByteEqualsTo

Tbr: jgruber@chromium.org
Change-Id: I16e08d910a745e78d6fd465718fc69ad731fd217
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585840
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61049}
2019-04-26 15:44:31 +00:00
Paolo Severini
efd8c2d975 Remove --win64-unwinding-info flag and always generate unwind info on Win/x64
The generation of unwind info to enable stack walking on Windows/x64
(https://chromium-review.googlesource.com/c/v8/v8/+/1469329) was implemented
behind a temporary flag, in order to coordinate these changes with the
corresponding changes in Chromium.

The required changes to Chromium
(https://chromium-review.googlesource.com/c/chromium/src/+/1474703) have also
been merged, so we can now remove the flag and enable the generation of stack
unwinding info by default on Windows/x64.

Bug: v8:3598
Change-Id: I88814aaeabecc007f5262227aa0681a1d16156d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573138
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61020}
2019-04-25 15:56:55 +00:00
Z Duong Nguyen-Huu
596bea7249 Port proxy trap GetProperty to Torque
Also, fix CSA generator for call runtime with return type of object.

Spec: https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver
Bug: v8:6664
Change-Id: I61ce1fa72a498520dd811f034e182f060f115330
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573042
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60995}
2019-04-24 22:48:24 +00:00
Jakob Gruber
ae6a47bad7 [coverage] Reduce IncBlockCounter overhead
When collecting JS block coverage, we track block execution counts on
so-called CoverageInfo objects. Generated bytecode and native code
contains inlined snippets of code to increment the appropriate
counters.

These used to be implemented as calls to the IncBlockCounter runtime
function. Each call incurred the entire CEntry overhead.

This CL reduces that overhead by moving logic over into a new
IncBlockCounter TFS builtin. The builtin is called directly from
bytecode, and lowered to the same builtin call for optimized code.

Drive-by: Tweak CoverageInfo layout to generate faster code.

Tbr: jarin@chromium.org
Bug: v8:9149, v8:6000
Change-Id: I2d7cb0db649edf7c56b5ef5a4683d27b1c34605c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571420
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60981}
2019-04-24 13:09:16 +00:00
George Burgess IV
f90456ba3f mksnapshot: introduce a V8_TARGET_OS_CHROMEOS define
We had one use of OS_CHROMEOS in mksnapshot. OS_CHROMEOS is defined if
gn's `is_chromeos` is true, which checks `current_os`. `current_os !=
target_os` can happen if we're building with a non-default toolchain,
which happens often on CrOS, since `mksnapshot` is a host binary.

Tested by manually verifying that .text.hot.embedded now shows up on
arm32/aarch64 builds of embedded.S.

Bug: v8:9103
Change-Id: I038b56f4c18c7dd9a651ce676a977697dad14ae6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573041
Commit-Queue: George Burgess <gbiv@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60925}
2019-04-18 19:47:00 +00:00
Jakob Kummerow
f80bfeaf07 [wasm] Draft version of C/C++ Wasm API
Imported from https://github.com/WebAssembly/wasm-c-api/ and
updated to work inside V8.
Tests will be added in an upcoming CL.

This is experimental; it is not yet recommended to rely on it.

Change-Id: I05914f4b63298bf7c848c4d4c8811f0f6eb882e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1516478
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60910}
2019-04-17 16:00:26 +00:00
Jakob Gruber
104a030f15 [build] Include trap handler files in iOS simulator builds
iOS simulator builds have x64 as the target architecture. This extends
BUILD.gn to properly include trap handler files in this case.

Bug: v8:9140
Change-Id: If6e90a720effdebe8b1f4e4e37eb8b3a3dbae20e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570022
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60901}
2019-04-17 11:02:56 +00:00
Peter Marshall
d1c7007984 [tracing] Add no_chromium_code config and suppress warning in protobuf
Add no_chromium_code config - this is required when removing the
chromium_code config.

Fix a warning that occurs when compiling protobuf_full by suppressing
warnings for not marking overriding functions with override.

Change-Id: I7f71a24b95dc3ef7d327481581aaa217407ee2cf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569441
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60894}
2019-04-17 08:09:09 +00:00
Z Duong Nguyen-Huu
0fbf170821 Porting ProxyConstructor to Torque
Spec: https://tc39.github.io/ecma262/#sec-proxy-constructor
Bug: v8:6664
Change-Id: Ia8b5ed75841d813babd1db4743c3bb9d25658b51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1553007
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60892}
2019-04-17 07:57:29 +00:00
Jakob Gruber
81b6c6dfb1 [build] Add support for is_ios in BUILD.gn
Builds for an iOS target were left unhandled in the v8_libbase
component inside BUILD.gn. This adds the appropriate source files to
the build for iOS targets.

Tbr: machenbach@chromium.org
Bug: v8:9140
Change-Id: I853e9a39727d80f0f281c8ac2da4eeb465e188e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569430
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60871}
2019-04-16 13:03:00 +00:00
Simon Zünd
2d8f2e86ee Reland^3 "[torque] Throw exception instead of aborting if something goes wrong"
This is a reland of ffe6940fbc

The UBSan issue is fixed with https://crrev.com/c/1566511

TBR=tebbi@chromium.org

Original change's description:
> Reland^2 "[torque] Throw exception instead of aborting if something goes wrong"
>
> This is a reland of 251d1623f3
>
> The reland fixes ASAN component builds by adding RTTI build config to both
> torque executables. Big thanks to sigurds for finding the fix.
>
> Original change's description:
> > Reland "[torque] Throw exception instead of aborting if something goes wrong"
> >
> > This is a reland of 3bd49f9b90
> >
> > The issue on the windows bot is apparently a compiler bug in MSVC related to
> > move construction. The fix seems to be to change the order of the fields in
> > "JsonParseResult" (go figure).
> >
> > Drive-by-change: Fix LS on windows by emitting correct line endings and
> > enabling exceptions for the LS executable as well.
> >
> > Original change's description:
> > > [torque] Throw exception instead of aborting if something goes wrong
> > >
> > > This CL enables exceptions for the Torque compiler and Torque language
> > > server. Instead of aborting when something goes wrong during
> > > compilation, a TorqueError is thrown, containing the error message
> > > and a source position. The compiler executable still prints the error
> > > and aborts, while the language server will pass this information
> > > along to the client (not included in this CL).
> > >
> > > R=danno@chromium.org
> > >
> > > Bug: v8:8880
> > > Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> > > Reviewed-by: Daniel Clifford <danno@chromium.org>
> > > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#60512}
> >
> > Bug: v8:8880
> > Change-Id: I00e6591bbb4c516dd7540a7e27196853bc637f11
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545995
> > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60736}
>
> Bug: v8:8880
> Change-Id: Iba198d771169283e83e74324f27aa9e90b8d8975
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1563770
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60804}

Bug: v8:8880
Change-Id: I5b7e40ad27bff8f7bfa22240954c2cb75083ad82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564065
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60860}
2019-04-16 10:41:20 +00:00
Clemens Hammacher
6832f29250 Revert "[heap] Skip ro-space from heap iterators, add CombinedHeapIterator."
This reverts commit 3d1d8eae77.

Reason for revert: Speculative revert; seems to break all nosnap bots, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20nosnap/25240

Original change's description:
> [heap] Skip ro-space from heap iterators, add CombinedHeapIterator.
> 
> Read-only space sharing requires an iterator independent of heap. This
> also enables future removal of read-only space from heap.
> 
> Bug: v8:7464
> Change-Id: Ia07a9369494ea2c547d12c01ffa1d7b8b6bbeabc
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1552795
> Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60819}

TBR=ulan@chromium.org,hpayer@chromium.org,delphick@chromium.org,goszczycki@google.com

Change-Id: I64b58b1b0c5eb073a6d2cfae81bb4de65f0511bf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7464
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1565895
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60825}
2019-04-12 16:38:00 +00:00
Maciej Goszczycki
3d1d8eae77 [heap] Skip ro-space from heap iterators, add CombinedHeapIterator.
Read-only space sharing requires an iterator independent of heap. This
also enables future removal of read-only space from heap.

Bug: v8:7464
Change-Id: Ia07a9369494ea2c547d12c01ffa1d7b8b6bbeabc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1552795
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60819}
2019-04-12 13:26:34 +00:00
Nico Weber
0c08a7565e Remove explicit -Wextra-semi, -Winconsistent-missing-override flags.
They're  enabled via the chromium_code config already these days.
No intended behavior change.

Bug: chromium:926235,chromium:428099
Change-Id: I4f7024ab78cb9672ec3db686e0155b2d835a4790
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564694
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60812}
2019-04-12 11:56:04 +00:00
Simon Zünd
d78014455b Revert "Reland^2 "[torque] Throw exception instead of aborting if something goes wrong""
This reverts commit ffe6940fbc.

Reason for revert: Breaks UBSan bot

Original change's description:
> Reland^2 "[torque] Throw exception instead of aborting if something goes wrong"
> 
> This is a reland of 251d1623f3
> 
> The reland fixes ASAN component builds by adding RTTI build config to both
> torque executables. Big thanks to sigurds for finding the fix.
> 
> Original change's description:
> > Reland "[torque] Throw exception instead of aborting if something goes wrong"
> >
> > This is a reland of 3bd49f9b90
> >
> > The issue on the windows bot is apparently a compiler bug in MSVC related to
> > move construction. The fix seems to be to change the order of the fields in
> > "JsonParseResult" (go figure).
> >
> > Drive-by-change: Fix LS on windows by emitting correct line endings and
> > enabling exceptions for the LS executable as well.
> >
> > Original change's description:
> > > [torque] Throw exception instead of aborting if something goes wrong
> > >
> > > This CL enables exceptions for the Torque compiler and Torque language
> > > server. Instead of aborting when something goes wrong during
> > > compilation, a TorqueError is thrown, containing the error message
> > > and a source position. The compiler executable still prints the error
> > > and aborts, while the language server will pass this information
> > > along to the client (not included in this CL).
> > >
> > > R=danno@chromium.org
> > >
> > > Bug: v8:8880
> > > Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> > > Reviewed-by: Daniel Clifford <danno@chromium.org>
> > > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#60512}
> >
> > Bug: v8:8880
> > Change-Id: I00e6591bbb4c516dd7540a7e27196853bc637f11
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545995
> > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60736}
> 
> Bug: v8:8880
> Change-Id: Iba198d771169283e83e74324f27aa9e90b8d8975
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1563770
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60804}

TBR=sigurds@chromium.org,tebbi@chromium.org,szuend@chromium.org

Change-Id: I30ccec8ac28158c102a4e9a01074432172685f96
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8880
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1564207
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60805}
2019-04-12 09:59:36 +00:00
Simon Zünd
ffe6940fbc Reland^2 "[torque] Throw exception instead of aborting if something goes wrong"
This is a reland of 251d1623f3

The reland fixes ASAN component builds by adding RTTI build config to both
torque executables. Big thanks to sigurds for finding the fix.

Original change's description:
> Reland "[torque] Throw exception instead of aborting if something goes wrong"
>
> This is a reland of 3bd49f9b90
>
> The issue on the windows bot is apparently a compiler bug in MSVC related to
> move construction. The fix seems to be to change the order of the fields in
> "JsonParseResult" (go figure).
>
> Drive-by-change: Fix LS on windows by emitting correct line endings and
> enabling exceptions for the LS executable as well.
>
> Original change's description:
> > [torque] Throw exception instead of aborting if something goes wrong
> >
> > This CL enables exceptions for the Torque compiler and Torque language
> > server. Instead of aborting when something goes wrong during
> > compilation, a TorqueError is thrown, containing the error message
> > and a source position. The compiler executable still prints the error
> > and aborts, while the language server will pass this information
> > along to the client (not included in this CL).
> >
> > R=danno@chromium.org
> >
> > Bug: v8:8880
> > Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> > Reviewed-by: Daniel Clifford <danno@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60512}
>
> Bug: v8:8880
> Change-Id: I00e6591bbb4c516dd7540a7e27196853bc637f11
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545995
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60736}

Bug: v8:8880
Change-Id: Iba198d771169283e83e74324f27aa9e90b8d8975
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1563770
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60804}
2019-04-12 09:27:07 +00:00
Maya Lekova
69e90801c2 Revert "Reland "[torque] Throw exception instead of aborting if something goes wrong""
This reverts commit 251d1623f3.

Reason for revert: Breaks ASAN debug builders for ClusterFuzz, see https://ci.chromium.org/p/v8/builders/ci/V8%20Clusterfuzz%20Linux64%20ASAN%20-%20debug%20builder/8115

Original change's description:
> Reland "[torque] Throw exception instead of aborting if something goes wrong"
> 
> This is a reland of 3bd49f9b90
> 
> The issue on the windows bot is apparently a compiler bug in MSVC related to
> move construction. The fix seems to be to change the order of the fields in
> "JsonParseResult" (go figure).
> 
> Drive-by-change: Fix LS on windows by emitting correct line endings and
> enabling exceptions for the LS executable as well.
> 
> Original change's description:
> > [torque] Throw exception instead of aborting if something goes wrong
> >
> > This CL enables exceptions for the Torque compiler and Torque language
> > server. Instead of aborting when something goes wrong during
> > compilation, a TorqueError is thrown, containing the error message
> > and a source position. The compiler executable still prints the error
> > and aborts, while the language server will pass this information
> > along to the client (not included in this CL).
> >
> > R=danno@chromium.org
> >
> > Bug: v8:8880
> > Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> > Reviewed-by: Daniel Clifford <danno@chromium.org>
> > Commit-Queue: Simon Zünd <szuend@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60512}
> 
> Bug: v8:8880
> Change-Id: I00e6591bbb4c516dd7540a7e27196853bc637f11
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545995
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60736}

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

Change-Id: I0b22db1652bd46fbb7167f75b710ed5e408ea8ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8880
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1561311
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60747}
2019-04-10 13:34:39 +00:00
Jakob Gruber
7ef5670a24 [build] Refactor icu deps inclusion
Instead of adding conditionally everywhere, write the condition once
in v8_maybe_icu and include that. Essentially,

  if (v8_enable_i18n_support) {
    public_deps = [
      "//third_party/icu",
    ]
  }

becomes

  public_deps = [
    ":v8_maybe_icu",
  ]

Bug: v8:8834
Change-Id: I091b14c85f1495a967eaa2b272904fdf41e6e7eb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532337
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60739}
2019-04-10 10:46:26 +00:00
Simon Zünd
251d1623f3 Reland "[torque] Throw exception instead of aborting if something goes wrong"
This is a reland of 3bd49f9b90

The issue on the windows bot is apparently a compiler bug in MSVC related to
move construction. The fix seems to be to change the order of the fields in
"JsonParseResult" (go figure).

Drive-by-change: Fix LS on windows by emitting correct line endings and
enabling exceptions for the LS executable as well.

Original change's description:
> [torque] Throw exception instead of aborting if something goes wrong
>
> This CL enables exceptions for the Torque compiler and Torque language
> server. Instead of aborting when something goes wrong during
> compilation, a TorqueError is thrown, containing the error message
> and a source position. The compiler executable still prints the error
> and aborts, while the language server will pass this information
> along to the client (not included in this CL).
>
> R=danno@chromium.org
>
> Bug: v8:8880
> Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> Reviewed-by: Daniel Clifford <danno@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60512}

Bug: v8:8880
Change-Id: I00e6591bbb4c516dd7540a7e27196853bc637f11
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545995
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60736}
2019-04-10 09:22:05 +00:00
John Budorick
32cb918af7 Fix torque build race.
Example failure caused by this race:
https://ci.chromium.org/p/chromium/builders/ci/linux-dbg/7157

Introduced in crrev.com/c/1557152

Tbr: sigurds@chromium.org,tebbi@chromium.org
Bug: v8:7793
Change-Id: I06f4c95e97577b7ba51e55faa50b844d773e976b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559215
Auto-Submit: John Budorick <jbudorick@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60729}
2019-04-10 04:24:54 +00:00
Jakob Gruber
7e896fe596 [build] Compile compiler with optimizations in fast mksnapshot mode
This changes debug builds [1] to compile src/compiler sources twice:

1. with optimizations, used in mksnapshot to improve performance.
2. without optimizations, linked into d8 and v8 libraries.

While this adds ~200 compilation targets, these can be built in parallel
and should not add much time overall.

This brings mksnapshot runtime back down to 11 seconds on my machine.

[1] The full condition is:
    is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot

Cq-Include-Trybots: luci.chromium.try:android_arm64_dbg_recipe
Cq-Include-Trybots: luci.chromium.try:fuchsia_x64
Bug: v8:8767
Change-Id: Iac57bf8331395d9eda9be5d192e8eeeded182ae6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532335
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60713}
2019-04-09 13:34:32 +00:00
Jakob Gruber
ac8ff59f32 [mksnapshot] Rename --ebt-os to --target-os
Rename the (mksnapshot-specific) --ebt-os flag to --target-os. This
flag specifies the target os for mksnapshot-generated files,
specifically for embedded.S.

In the future we should base all of embedded-file-writer.cc on this
(and an upcoming --target-arch) flag and remove other current
cross-compilation workarounds (e.g.: V8_TARGET_OS_WIN,
V8_TARGET_OS_FUCHSIA).

Bug: chromium:945659,v8:9103
Change-Id: I814fa8c5d4ee9ca0542f63dcae790086d887bbe2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559748
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60711}
2019-04-09 13:18:52 +00:00
Anton Bikineev
2c1ba68c55 [turbofan] Refactor interface of calling C functions
This change aims to simplify RawMachineAssembler::CallCFunction
interface by use of variadic templates.

Change-Id: Ie7081f692f62674f891f09abfd7149e8d95eeb81
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526015
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60710}
2019-04-09 13:16:24 +00:00
Sigurd Schneider
a667b6b319 [torque] Add @generatePrint annotation
The new @generatePrint annotation automatically generates ...Print
methods for objects from their Torque class definition. While this
is mostly geared towards objects derived from Struct, it works on
any Torque class.

Bug: v8:7793
Change-Id: Iaa772879d397b95c7853dafdd9f09a85dbde8e35
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1557152
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60708}
2019-04-09 13:07:22 +00:00
Tom Anderson
30b86eed74 Fix Win/cross/x64 builds
See the changes in BUILD.gn for an explanation of why a new flag is necessary.
It's likely that current usages of V8_TARGET_OS_* and V8_TARGET_ARCH_* also need
to change, but this is good enough for now to ensure both Win/cross/x86 and
Win/cross/x64 build.

BUG=chromium:945659
R=machenbach,thakis
TBR=jgruber

Change-Id: Ie2765db91a1c0d8c72ccf42c9d7fece792d9b252
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1542500
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60687}
2019-04-08 20:11:37 +00:00
Peter Marshall
8a23a3a290 [cpu-profiler] Clean up some includes
Remove unused includes and add includes that were indirect.

Remove UnboundQueue which was not used anywhere.

Change-Id: If47faac45fc9c16a27453ecabed927ea00df3045
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1557136
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60672}
2019-04-08 09:48:16 +00:00
Clemens Hammacher
8a35265ac4 [base] Remove safe_math headers
We only use the safe math helpers (CheckedNumeric<T>) in very few
places. The headers are huge though, and complex. They are pulled in to
839 of our object files, increasing compilation time.

I also find the implicit checks more easy to understand than the complex
logic in CheckedNumeric.

Thus, this CL removes the safe_math headers and implements bounds
checks for the five uses explicitly.

R=jkummerow@chromium.org, mlippautz@chromium.org

Bug: v8:8834
Change-Id: I2d60f95799ee61cfa161354428605f67829cd736
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547651
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60630}
2019-04-04 10:51:51 +00:00
Adithya Srinivasan
e26ec8bd2d Revert "Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64""
This reverts commit 42beed975e.

Reason for revert: This commit seems to cause consistent failures in
some ProcessMemoryMetricsEmitterTest tests on Mac and ChromeOS. I'm
not sure what the exact reasoning behind this is. See https://crbug.com/949157.

Original change's description:
> Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64"
>
> This is a reland of 4f051fd5da
>
> Relanding after fixing Chromium issues.
>
> Original change's description:
> > [ptr-compr][x64] Temporarily enable pointer compression on x64
> >
> > ... and make sure that the x64 ptr-compr bots proceed testing V8 without
> > pointer compression in order to keep testing the full pointer mode.
> >
> > Bug: v8:7703
> > Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> > Change-Id: Iee725deda813425a6f0722948b54976154f50909
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1497139
> > Reviewed-by: Michael Hablich <hablich@chromium.org>
> > Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> > Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#60230}
>
> Bug: v8:7703
> Change-Id: Ic2d1c2ae41ec645f34963f5f561c33199c72ef4b
> Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535819
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60582}

TBR=machenbach@chromium.org,hablich@chromium.org,leszeks@chromium.org,ishell@chromium.org,verwaest@chromium.org

Change-Id: Ib9737081e90dddcfe44af9da1275a610da209323
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7703
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1550709
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60618}
2019-04-03 20:13:12 +00:00
Z Duong Nguyen-Huu
253ce6e188 Port Proxy.revocable to Torque
This is a part of porting Proxy-related builtins to Torque.

Spec: https://tc39.github.io/ecma262/#sec-proxy.revocable
Bug: v8:6664
Change-Id: I5f53eb4dff8ff9d3156b601652f3f86ede25fc1d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529261
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60613}
2019-04-03 17:10:21 +00:00
Clemens Hammacher
433de3ffad [wasm][gc] Make import wrapper cache keep WasmCode alive
The cache also needs to keep the code alive. The code objects are
import wrappers and not wasm functions (which we will focus on first),
but eventually we would also like to collect unused import wrappers.
This CL explicitly increments the ref count when {WasmCode} is added
to the cache, and derements all ref counts in the destructor.

R=titzer@chromium.org

Bug: v8:8217
Change-Id: I1bfb276b25b359d83900147e75ec47788e1fa8de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535825
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60588}
2019-04-03 09:55:53 +00:00
Igor Sheludko
42beed975e Reland "[ptr-compr][x64] Temporarily enable pointer compression on x64"
This is a reland of 4f051fd5da

Relanding after fixing Chromium issues.

Original change's description:
> [ptr-compr][x64] Temporarily enable pointer compression on x64
>
> ... and make sure that the x64 ptr-compr bots proceed testing V8 without
> pointer compression in order to keep testing the full pointer mode.
>
> Bug: v8:7703
> Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
> Change-Id: Iee725deda813425a6f0722948b54976154f50909
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1497139
> Reviewed-by: Michael Hablich <hablich@chromium.org>
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60230}

Bug: v8:7703
Change-Id: Ic2d1c2ae41ec645f34963f5f561c33199c72ef4b
Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng,v8_linux64_tsan_rel
Cq-Include-Trybots: luci.chromium.try:fuchsia_x64,linux-rel
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535819
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60582}
2019-04-03 07:27:03 +00:00
Paolo Severini
969cb0c7a5 Reland "V8 x64 backend doesn't emit ABI compliant stack frames"
This is a reland of 3cda21de77

Original change's description:
> V8 x64 backend doesn't emit ABI compliant stack frames
> 
> On 64 bit Windows, the OS stack walking does not work because the V8 x64
> backend doesn't emit unwinding info and also because it doesn't emit ABI
> compliant stack frames. See
> https://docs.google.com/document/d/1-wf50jFlii0c_Pr52lm2ZU-49m220nhYMrHDi3vXnh0/edit
> for more details.
> 
> This problem can be fixed by observing that V8 frames usually all have the same
> prolog and epilog:
> 
> push rbp,
> mov rbp, rsp
> ...
> pop rbp
> ret N
> 
> and that it is possible to define XDATA (UNWIND_CODEs) that specify how Windows
> should walk through V8 frames. Furthermore, since V8 Code objects are all
> allocated in the same code-range for an Isolate, it is possible to register a
> single PDATA/XDATA entry to cover stack walking for all the code generated
> inside that code-range.
> 
> This PR contains changes required to enable stack walking on Win64:
> 
> EmbeddedFileWriter now adds assembler directives to the builtins
> snapshot source file (embedded.cc) to emit additional entries in the .pdata and
> in the .xdata section of the V8 executable. This takes care of stack walking
> for embedded builtins. (The case of non-embedded builtins is not supported).
> The x64 Assembler has been modified to collect the information required to emit
> this unwind info for builtins.
> 
> Stack walking for jitted code is handled is Isolate.cpp, by registering
> dynamically PDATA/XDATA for the whole code-range address space every time a new
> Isolate is initialized, and by unregistering them when the Isolate is
> destroyed.
> 
> Stack walking for WASM jitted code is handled is the same way in
> wasm::NativeModule (wasm/wasm-code-manager.cpp).
> 
> It is important to note that Crashpad and Breakpad are already registering
> PDATA/XDATA to manage and report unhandled exceptions (but not for embedded
> builtins). Since it is not possible to register multiple PDATA entries for the
> same address range, a new function is added to the V8 API:
> SetUnhandledExceptionCallback() can be used by an embedder to register its own
> unhandled exception handler for exceptions that arise in v8-generated code.
> V8 embedders should be modified accordingly (code for this is in a separate PR
> in the Chromium repository:
> https://chromium-review.googlesource.com/c/chromium/src/+/1474703).
> 
> All these changes are experimental, behind:
> 
> the 'v8_win64_unwinding_info' build flag, and
> the '--win64-unwinding-info' runtime flag.
> 
> Bug: v8:3598
> Change-Id: Iea455ab6d0e2bf1c556aa1cf870841d44ab6e4b1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1469329
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Paolo Severini <paolosev@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#60330}

Bug: v8:3598
Change-Id: If988baf7d3e4af165b919d6e54c1ad985f8e25e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1534618
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60581}
2019-04-03 02:00:43 +00:00
Tobias Tebbi
5f58a82bcf Revert "Reland^2 "[build] disable C++ optimization for mksnapshot code.""
This reverts commit 6beea97e09.

Reason for revert: https://crbug.com/942497

Original change's description:
> Reland^2 "[build] disable C++ optimization for mksnapshot code."
>
> This is a reland of a6b95a6acf
>
> In addition to UBSan, also ASAN needs optimizations.
> So this CL doesn't disable optimizations for all sanitizer builds.
>
> Original change's description:
> > Reland "[build] disable C++ optimization for mksnapshot code."
> >
> > This is a reland of cee2f772c7
> >
> > Original change's description:
> > > [build] disable C++ optimization for mksnapshot code.
> > >
> > > By disabling C++ optimizations for code that's only run in mksnapshot,
> > > that is, CSA and Torque-generated code, we can save compile time.
> > > I observed up to 2x improvements of compile time for some files,
> > > while the mksnapshot time did not increase significantly.
> > >
> > > Bug: v8:7629
> > > Change-Id: I96be2966611b2471b68023e0dd9e351d94f0013c
> > > Reviewed-on: https://chromium-review.googlesource.com/c/1460941
> > > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> > > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#59585}
> >
> > Bug: v8:7629
> > Change-Id: I8330f93173ab3d7b400e15ea4935bbe8256b250f
> > Reviewed-on: https://chromium-review.googlesource.com/c/1473292
> > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> > Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> > Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#59606}
>
> Bug: v8:7629
> Change-Id: I42175c472d8e41345573df81645dfe3accc9d8c4
> Reviewed-on: https://chromium-review.googlesource.com/c/1475396
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#59632}

TBR=yangguo@chromium.org,sigurds@chromium.org,tebbi@chromium.org

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

Bug: v8:7629 chromium:942497
Change-Id: Ie51d7b53440230b41fb763541908cb1162d8850d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1549158
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60577}
2019-04-02 18:56:42 +00:00
Peter Marshall
a18dd6e111 [tracing] Fix build for use_perfetto config
Autoroller updated protobuf which has some different files now.

Change-Id: If3b2f6452d30e754504e8798de5adb8706371cb5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547866
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60571}
2019-04-02 14:05:42 +00:00
Simon Zünd
c3b51ac093 Revert "[torque] Throw exception instead of aborting if something goes wrong"
This reverts commit 3bd49f9b90.

Reason for revert: Build failure on Win Bot

Original change's description:
> [torque] Throw exception instead of aborting if something goes wrong
> 
> This CL enables exceptions for the Torque compiler and Torque language
> server. Instead of aborting when something goes wrong during
> compilation, a TorqueError is thrown, containing the error message
> and a source position. The compiler executable still prints the error
> and aborts, while the language server will pass this information
> along to the client (not included in this CL).
> 
> R=​danno@chromium.org
> 
> Bug: v8:8880
> Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
> Reviewed-by: Daniel Clifford <danno@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60512}

TBR=danno@chromium.org,mvstanton@chromium.org,szuend@chromium.org

Change-Id: Iac253da404eaf6e534267f59a42ca93667c205e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8880
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1543849
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60513}
2019-03-28 16:26:24 +00:00
Simon Zünd
3bd49f9b90 [torque] Throw exception instead of aborting if something goes wrong
This CL enables exceptions for the Torque compiler and Torque language
server. Instead of aborting when something goes wrong during
compilation, a TorqueError is thrown, containing the error message
and a source position. The compiler executable still prints the error
and aborts, while the language server will pass this information
along to the client (not included in this CL).

R=danno@chromium.org

Bug: v8:8880
Change-Id: Iad83c46fb6a91c1babbc0ae7dbd94fbe4e7f1663
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1526003
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60512}
2019-03-28 15:49:52 +00:00
Pierre Langlois
a7fa1ae2e1 Reland "[snapshot] Add support for native counters."
This is a reland of 93716b9e71

Original change's description:
> [snapshot] Add support for native counters.
> 
> Counters in generated code, as enabled with --native-code-counters, do not work
> in the snapshot. This adds a `v8_enable_snapshot_code_counters` build option
> enabled by defaut in debug mode that allows code from the snapshot to increment
> the current isolate's set of counters.
> 
> For this to work, we need to add native code counters in the external reference
> table.
> 
> To keep the no snapshot configuration similar, we've also enabled the
> --native-code-counters flag by default for debug builds.
> 
> Change-Id: I4478b79858c9b04f57e06e7ec67449e9e3a76f53
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1528998
> Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60495}

Change-Id: Ib6427caf068ca196a032e3f3b97d9f9219e0fe60
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1543349
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#60507}
2019-03-28 14:15:22 +00:00
Peter Marshall
800616151e [tracing] Add build config for Perfetto behind a flag
This adds dependencies on Perfetto and Protobuf and the required
configs to build them.

The build configs are behind a gn flag (v8_use_perfetto) and
are disabled by default. Actual implementation of Perfetto will follow.

Based on Primiano's prototype:
https://chromium-review.googlesource.com/c/v8/v8/+/1290549

Bug: v8:8339
TBR: yangguo@chromium.org
Change-Id: I2b7462d567bfb0a5a3ffbbb8b6fcbf41c824e285
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1517876
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60502}
2019-03-28 09:26:52 +00:00
Michael Achenbach
519bf695b2 Revert "[snapshot] Add support for native counters."
This reverts commit 93716b9e71.

Reason for revert: Breaks asan debug:
https://ci.chromium.org/p/v8/builders/ci/V8%20Clusterfuzz%20Mac64%20ASAN%20-%20debug%20builder/7872
https://ci.chromium.org/p/v8/builders/ci/V8%20Clusterfuzz%20Linux64%20ASAN%20-%20debug%20builder/7874

Original change's description:
> [snapshot] Add support for native counters.
> 
> Counters in generated code, as enabled with --native-code-counters, do not work
> in the snapshot. This adds a `v8_enable_snapshot_code_counters` build option
> enabled by defaut in debug mode that allows code from the snapshot to increment
> the current isolate's set of counters.
> 
> For this to work, we need to add native code counters in the external reference
> table.
> 
> To keep the no snapshot configuration similar, we've also enabled the
> --native-code-counters flag by default for debug builds.
> 
> Change-Id: I4478b79858c9b04f57e06e7ec67449e9e3a76f53
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1528998
> Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60495}

TBR=sigurds@chromium.org,jgruber@chromium.org,petermarshall@chromium.org,pierre.langlois@arm.com

Change-Id: I93f1ed714e3dcd309f3100685e4bd282db471d46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1543209
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60500}
2019-03-28 07:58:04 +00:00
Pierre Langlois
93716b9e71 [snapshot] Add support for native counters.
Counters in generated code, as enabled with --native-code-counters, do not work
in the snapshot. This adds a `v8_enable_snapshot_code_counters` build option
enabled by defaut in debug mode that allows code from the snapshot to increment
the current isolate's set of counters.

For this to work, we need to add native code counters in the external reference
table.

To keep the no snapshot configuration similar, we've also enabled the
--native-code-counters flag by default for debug builds.

Change-Id: I4478b79858c9b04f57e06e7ec67449e9e3a76f53
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1528998
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60495}
2019-03-27 17:45:50 +00:00
Sigurd Schneider
432751ae75 [cleanup] Reduce dependents of ordered-hash-table.h to 71.
Together with the previous CL, this is a 10x improvement.


Bug: v8:8834
Change-Id: I89b86ee88c82479997c08b725571369b1bf9d190
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1539592
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60470}
2019-03-26 16:13:58 +00:00
Cliff Smolinsky
31d7e1d366 Replace shlwapi call with STL.
The only use of shlwapi is for a single method which can be easily
replaced by simple wstring calls. This change makes that swap and
removes the reference to shlwapi completely.

Bug: v8:9031
Change-Id: Ia8f2c44e8166d93e309016896b26a84bdb90d720
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1534960
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Cliff Smolinsky <cliffsmo@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60451}
2019-03-25 16:59:58 +00:00
Clemens Hammacher
83f76ba3b5 [wasm] Rename inl headers that can be plain headers
Both js-to-wasm-wrapper-cache-inl.h and wasm-import-wrapper-cache-inl.h
do not include any inl headers, thus they can be plain headers. If they
ever need to include inl headers again, we should split out the
respective functions into a separete inl header to follow the usual
pattern to have *both* a plain header *and* an inl header.

R=mstarzinger@chromium.org

Bug: v8:8834
Change-Id: I1b1b917a8e2c47f1354522479f8c57475bee6244
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1535826
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60431}
2019-03-25 10:48:34 +00:00
Jakob Gruber
5914c29e5b [regexp] Port RegExp.prototype[@@replace] to Torque
Just the outermost wrapper function (which does almost nothing).

Bug: v8:8976
Change-Id: I8137f86bde5e10ba7edd5051e7c86bfc631bfe94
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1528531
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#60402}
2019-03-22 03:18:06 +00:00