Commit Graph

46718 Commits

Author SHA1 Message Date
Clemens Hammacher
61e4679906 [code] Fix constant pool offset
If FLAG_enable_embedded_constant_pool is false, the field for the
builtin index would alias the field for the constant pool offset in the
code object. This makes constant_pool() return the builtin index, but it
also makes set_constant_pool() override the builtin index (and vice
versa).
This CL fixes this by making all constant_pool accessors honor that
flag.

R=mstarzinger@chromium.org

Change-Id: I88803a4f28bd5a2fe85a310708c7a365cc457339
Reviewed-on: https://chromium-review.googlesource.com/970586
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52076}
2018-03-20 17:35:38 +00:00
Igor Sheludko
f52d005395 [iterpreter] Share feedback slots for global stores to the same variable.
Bug: v8:7206, chromium:576312
Change-Id: I1628e7966a40fa7d6f628bd972b0ad0142a5d349
Reviewed-on: https://chromium-review.googlesource.com/970825
Reviewed-by: Mythri Alle <mythria@google.com>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52075}
2018-03-20 17:05:38 +00:00
jgruber
b105df6d1e Fix kArchRootsPointer typo on s390
TBR=jarin@chromium.org

Bug: v8:6666
Change-Id: I9f4654955f297c54e67b98afb42125b659e35fd3
Reviewed-on: https://chromium-review.googlesource.com/971042
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52074}
2018-03-20 16:55:24 +00:00
jgruber
9afde91b94 [builtins] Load external references from the external-reference-table
Off-heap code cannot embed external references. With this CL, we load
from the external reference table (reached through the root pointer)
instead.

In a follow-up, the table could be stored within the isolate itself,
removing one more level of indirection.

Bug: v8:6666
Change-Id: I4c612ad3d4112ec03c3b389f5bfb9cdc3dc8a671
Reviewed-on: https://chromium-review.googlesource.com/970468
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52073}
2018-03-20 16:42:01 +00:00
Peter Marshall
1d597f03a6 [runtime] Use JSBuiltinsConstructStub for InternalArray
Part of ongoing work to remove the construct_stub field of the SFI.

Generate_InternalArrayConstructor was actually incorrect for packed
internal arrays, where it would instead create a regular internal array
because it loaded the constructor function from the context every time.

Ultimately InternalArray should be removed, or the constructor ported
to CSA in the meantime. But for now, it is off the critical path for
the construct_stub removal.

Also fix a bug: Runtime_NewArray expects a type_info parameter, which
should be in rbx (on x64). Because we now go through
JSBuiltinsConstructStubHelper first, rbx is loaded with a value that
doesn't look like a heap object, which causes a crash in NewArray.
Fix that by first loading undefined explicitly (which is what the
ArrayConstructor builtin does already).

Bug: v8:7503
Change-Id: Ic92fa8864b0af2d32200eb0176ba55ccff03b114
Reviewed-on: https://chromium-review.googlesource.com/970823
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52072}
2018-03-20 16:40:46 +00:00
Vasili Skurydzin
6bc4bfea65 Fixes to V8 GN build process on aix platform
src/base/debug/stack_trace_posix.cc: suppressed unused function warnings
for functions DemangleSymbols, OutputPointer(in order to compile with
-Werror flag)

test/cctest/test-isolate-independent-builtins.cc: corrections to make
ByteInText test case compatible with aix. (affects aix only)

Change-Id: I49e45e63545404c77aaed3f51b26557f6f03455e
Reviewed-on: https://chromium-review.googlesource.com/927484
Reviewed-by: 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@{#52071}
2018-03-20 16:16:54 +00:00
Camillo Bruni
1f53e38100 [runtime] Shrink StringTable if it is very empty
We currently never shrink the StringTable which causes excessive memory usage
on certain websites. This CL tries to mitigate this by shrinking the
StringTable if it is very empty (nof_elements * 16 < capacity) hopefully
avoiding costly reallocations.

Bug: chromium:818642, v8:5443
Change-Id: I4e6a95b3a6992b499fa6dd59ae159c51f089965a
Reviewed-on: https://chromium-review.googlesource.com/970465
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52070}
2018-03-20 15:18:04 +00:00
jgruber
377803f804 Introduce CodeAssembler::LoadRootsPointer
Loading external references from off-heap builtins will be
root-pointer-relative. At least initially, these loads will happen in
CSA and thus need access to the root pointer value.

Bug: v8:6666
Change-Id: Iae4c89061df442f5afd03f93e5ba35c4e125b850
Reviewed-on: https://chromium-review.googlesource.com/970264
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52069}
2018-03-20 14:10:54 +00:00
Yang Guo
5b7854f008 [debug] Unskip tests for debug break in builtins.
Win64 MSVC build seems to be fixed.

Bug: v8:178
Change-Id: I6d3ec22511a7a3c25467c486d3d05df0939c7c87
Reviewed-on: https://chromium-review.googlesource.com/970469
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52068}
2018-03-20 14:00:13 +00:00
Ulan Degenbaev
23a593b9d8 [api] Deprecate HeapProfiler::SetWrapperClassInfoProvider.
The embedders should use the EmbedderGraph API. The similar structure
can be created with the following steps:
1) Create a root node for each retainer info group.
2) Iterate all handles using Isolate::VisitHandlesWithClassIds.
3) Add an edge from the retainer info node to the v8 wrapper node.
4) Add an edge from the v8 wrapper node to the retainer info node.

See how HeapSnapshotRetainedObjectInfo is converted to the new API.

Bug: chromium:749490
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I124ae3853354863b4f888e6aa2ea13777dcaa37d
Reviewed-on: https://chromium-review.googlesource.com/948842
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52067}
2018-03-20 13:53:43 +00:00
Leszek Swirski
9b4d8fe41f Revert "Remove SFI code field"
This reverts commit 520b025f72.

Reason for revert: Breaks internal-snapshot build: https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20internal%20snapshot/builds/14603

Original change's description:
> Remove SFI code field
> 
> Remove the SharedFunctionInfo code field, inferring the code object
> from the function_data field instead. In some cases, the function_data
> field can now hold a Code object (e.g. some WASM cases).
> 
> Bug: chromium:783853
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I1219a4d6aa5abaa9fee54dda883da7a3186e347a
> Reviewed-on: https://chromium-review.googlesource.com/952452
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52064}

TBR=yangguo@chromium.org,mstarzinger@chromium.org,jgruber@chromium.org,leszeks@chromium.org,bmeurer@chromium.org,verwaest@chromium.org

Change-Id: Iaf464ed29ba4317bbbb255c1aec76fb65cddba84
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:783853
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/970647
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52066}
2018-03-20 13:47:34 +00:00
sreten.kovacevic
0fe64b7e62 [Liftoff][mips] Implement remaining Call and Trace memory methods
Port CallIndirect and CallRuntime methods. Also, implement methods
for allocation and deallocation of stack slots, which are used in
trace memory operations.

Bug: v8:6600
Change-Id: I99e0115dcf6d971229892b27b4b4f01d0c5441e8
Reviewed-on: https://chromium-review.googlesource.com/970262
Commit-Queue: Sreten Kovacevic <sreten.kovacevic@mips.com>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#52065}
2018-03-20 13:29:03 +00:00
Leszek Swirski
520b025f72 Remove SFI code field
Remove the SharedFunctionInfo code field, inferring the code object
from the function_data field instead. In some cases, the function_data
field can now hold a Code object (e.g. some WASM cases).

Bug: chromium:783853
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I1219a4d6aa5abaa9fee54dda883da7a3186e347a
Reviewed-on: https://chromium-review.googlesource.com/952452
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52064}
2018-03-20 13:14:53 +00:00
Clemens Hammacher
994d2390e0 [Liftoff] Implement i64 comparisons
This adds support for i64.eqz, and all binary comparisons (i64.eq,
i64.ne, i64.lt_s, i64.le_s, i64.lt_u, i64.le_u, i64.gt_s, i64.ge_s,
i64.gt_u, i64.and i64.ge_u).

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ic6c59529b007220698e09d5959394bcfb6590173
Reviewed-on: https://chromium-review.googlesource.com/969125
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52063}
2018-03-20 12:49:03 +00:00
Predrag Rudic
9f08fd926f [builtins] MIPS[64] Disable embedded builtins on MIPS
Embedded builtins cause many failures therefore we'll disable them.

Bug: v8:7571
Change-Id: I20fae241b2fab4ed41339de3a469d514e16c3894
Reviewed-on: https://chromium-review.googlesource.com/970542
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52062}
2018-03-20 12:45:43 +00:00
Ulan Degenbaev
8ed81ddeb2 [heap] Restore TSAN exception for page flags.
This was removed in one of the branches during weak-refs work.

Bug: v8:7574
Change-Id: Id2a1af22b1150d8c888c117c023e8c78f532b9f2
Reviewed-on: https://chromium-review.googlesource.com/970702
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52061}
2018-03-20 12:41:33 +00:00
Michael Achenbach
c00323773f [build] Add configs for new msvc trybot
NOTRY=true

Change-Id: I30bb7c1935db33e49729ea66a8535809531c7130
Reviewed-on: https://chromium-review.googlesource.com/970642
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52060}
2018-03-20 12:29:03 +00:00
Ulan Degenbaev
747d198cad [api] Deprecate HeapProfiler::SetGetRetainerInfosCallback.
The embedders should use the new EmbedderGraph API to provide retainer
info.

Bug: chromium:749490
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iac8dc1e749ef14277b027f43e799357c5bd413ea
Reviewed-on: https://chromium-review.googlesource.com/948489
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52059}
2018-03-20 12:26:43 +00:00
Yang Guo
ea2007d870 Fix register allocation in tail-call to TFJ builtin.
R=jgruber@chromium.org

Bug: v8:178
Change-Id: Id00ae14cb5a50e560f93249eed4e4b20aa0a6ce7
Reviewed-on: https://chromium-review.googlesource.com/970467
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52058}
2018-03-20 12:09:23 +00:00
Clemens Hammacher
78f88ef013 [platform] Use condition variable instead of semaphore
The MessageLoopBehavior might change over time: Sometimes we want to
wait because wasm background compilation is going on, sometimes we
don't. This makes the semaphore go out of sync with the task queue (we
always notify it when a new task is scheduled, but we only sometimes
wait on it).
Using a condition variable instead of a semaphore avoids this problem.

R=ahaas@chromium.org

Change-Id: Ib9850efc634f5988d3f824895b6566bd76475985
Reviewed-on: https://chromium-review.googlesource.com/969122
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52057}
2018-03-20 11:48:23 +00:00
Daniel Clifford
a5f1d5d4b3 Ensure CSA-generated code can handle one-input phis
In general, TurboFan doesn't encounter phi nodes with only a single
data input in the backend. However, CSA-based builtins (especially
auto-generated ones, e.g. from Torque), may contain single-input phi nodes,
although outside the auto-generated case this doesn't happen much in practice.

Single input phi nodes (i.e. phis in blocks with one predecessor) don't have
any side effects and are essentially useless and harmless, but to avoid problems
in the backend of TurboFan (whose SSA deconstruction disallows control flow
splits that continue to blocks with phis), this CL tweaks the existing
CSA-only control flow and graph sanitization in the CSA path to ensure
no no-op phis.

Change-Id: I109f4dc6cde5ad1794585a09609a230b1848e0d5
Reviewed-on: https://chromium-review.googlesource.com/963711
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52056}
2018-03-20 11:28:23 +00:00
Michael Achenbach
f0940a6390 Reland "[build] Make separate snapshot for trusted variant"
This is a reland of 40d66d8bf8

The fix disambiguates duplicate symbols in the generated embedded
builtins file.

Original change's description:
> [build] Make separate snapshot for trusted variant
>
> This enables side-by-side snapshots with and without untrusted-code
> mitigations. It'll be the default in all V8 stand-alone builds
> with external startup data. Internal snapshots are not supported.
>
> The files snapshot_blob.bin and snapshot_blob_trusted.bin will be
> bundled with V8 on swarming and the correct file is loaded dependent
> on the --untrusted-code-mitigations runtime flag.
>
> Likewise we embed two snapshots for builtins.
>
> Side-by-side snapshots won't be supported in Chromium.
>
> Bug: v8:7441
> Change-Id: I2949ddfd5773649946b1c8e74751d48ad1d9c524
> Reviewed-on: https://chromium-review.googlesource.com/960004
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52028}

Bug: v8:7441
Change-Id: I626171d4e07389f0453b4d0a698e2772fd37e8c5
Reviewed-on: https://chromium-review.googlesource.com/968623
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52055}
2018-03-20 10:59:24 +00:00
Clemens Hammacher
48f1fc71cf [Liftoff] Support globals of all standard types
This adds support to get or set globals of all the standard types (i32,
i64, f32, f64).

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ie8d14d3d964e2abe3f19945a0e80b0e8462e9485
Reviewed-on: https://chromium-review.googlesource.com/969262
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52054}
2018-03-20 10:27:14 +00:00
Dan Elphick
f15ea68d98 Create a new read-only space
Adds a new space RO_SPACE and modifies the serializer and other machinery
to support it.

Currently RO_SPACE has nothing in it, but will eventually contain all the
immovable immutable objects, so the GC can ignore it.

Bug: v8:7464
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib2ff474699196c138df8c24f7a2248471e30fbac
Reviewed-on: https://chromium-review.googlesource.com/925703
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52053}
2018-03-20 10:11:54 +00:00
Clemens Hammacher
fed003c624 [wasm] Store AsyncCompileJob in unique_ptr
It was stored in a shared_ptr so far, which makes it more difficult to
reason about life times. Since there is always exactly one owner of the
AsyncCompileJob, a unique_ptr actually suffices.

R=ahaas@chromium.org

Change-Id: If94c9091889ad05325c559a97e9a9ffeee8d450c
Reviewed-on: https://chromium-review.googlesource.com/968604
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52052}
2018-03-20 09:56:24 +00:00
Clemens Hammacher
014f459047 [Liftoff] Implement f32.abs and f64.abs
This adds support for the f32.abs and f64.abs opcodes.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I05a16bb4301d492ba8d22a6326c7b2ce0f9f2faa
Reviewed-on: https://chromium-review.googlesource.com/968502
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52051}
2018-03-20 09:52:14 +00:00
Yang Guo
25259d3ffc Make Snapshot::EnsureBuiltinIsDeserialized more robust.
Also unskip test that has already been fixed in f1b1ec7.

R=jgruber@chromium.org

Bug: v8:178
Change-Id: I9cd2156ef41146b0dd58a974088726f5cbda8058
Reviewed-on: https://chromium-review.googlesource.com/970243
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52050}
2018-03-20 09:27:43 +00:00
Jaroslav Sevcik
b6b9c9fd53 [turbofan] Equip (Field|Element)Access with constructors.
This prevent forgotten field initializations.

Bug: v8:5267
Change-Id: Iaef5f79af360e2400b29afe878f80870c8a64e71
Reviewed-on: https://chromium-review.googlesource.com/970241
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52049}
2018-03-20 08:27:43 +00:00
Michael Achenbach
783968261e [build] Remove configs for mac32 builders
TBR=sergiyb@chromium.org
NOTRY=true
NOTREECHECKS=true

Bug: chromium:822593
Change-Id: I86291a5039fc368c0fddea4d46e0d6c72c56a226
Reviewed-on: https://chromium-review.googlesource.com/968921
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52048}
2018-03-20 07:55:33 +00:00
v8-autoroll
cc47cc63dd Update V8 DEPS.
Rolling v8/build: 76da9f5..a7e9a83

Rolling v8/buildtools: 2888931..3748a2a

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/6c4a8ca..734f737

Rolling v8/tools/clang: 0a9737b..7d56ff9

TBR=machenbach@chromium.org,hablich@chromium.org,sergiyb@chromium.org

Change-Id: I60e4196d8ed8d39e88bbf3688569bbd0aadef919
Reviewed-on: https://chromium-review.googlesource.com/969956
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52047}
2018-03-20 03:48:49 +00:00
Peter Marshall
4af7efc1bc [runtime] Use JSBuiltinsConstructStub for all builtins where possible
In order to remove the construct_stub field of the SFI we need all
construct stubs to be the same, and do any branching at runtime
instead. For builtins we don't need to set the construct stub because
the builtins construct stub will call into it for us.

There should only be two builtins left without the builtins construct
stub: Array and InternalArray, which are special cases that need to
be dealt with in another CL.

Bug: v8:7503
Change-Id: If0d419399a9ee22c09cf2a5a3d3dbea7a04dee77
Reviewed-on: https://chromium-review.googlesource.com/968862
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52046}
2018-03-19 16:52:54 +00:00
Michael Stanton
11831378a5 Revert "[turbofan] Masking/poisoning in codegen (optimized code, mips & mips64)"
This reverts commit 46a3c77201.

Reason for revert: This is actually not quite ready. What we need is a speculation free poisoning, and if we do another branch, then I think that won't happen.

Original change's description:
> [turbofan] Masking/poisoning in codegen (optimized code, mips & mips64)
> 
> This introduces masking of loads with speculation bit during code generation.
> At the moment, this is done only under the
> --branch-load-poisoning flag, and this CL enlarges the set of supported
> platforms from {x64, arm, arm64} to {x64, arm, arm64, mips, mips64}.
> 
> Overview of changes:
> - new register configuration configuration with one register reserved for
>   the speculation poison/mask (kSpeculationPoisonRegister).
> - in codegen, we introduce an update to the poison register at the starts
>   of all successors of branches (and deopts) that are marked as safety
>   branches (deopts).
> - in memory optimizer, we lower all field and element loads to PoisonedLoads.
> - poisoned loads are then masked in codegen with the poison register.
>   * only integer loads are masked at the moment.
> 
> Bug: chromium:798964
> Change-Id: I211395b8305ed0ad9288d6da48fa159fa970c827
> Reviewed-on: https://chromium-review.googlesource.com/951382
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
> Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
> Cr-Commit-Position: refs/heads/master@{#52042}

TBR=mvstanton@chromium.org,mstarzinger@chromium.org,ivica.bogosavljevic@mips.com

Change-Id: Ief4d9ef56d918172f0b545d321a64b1ab5b46915
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:798964
Reviewed-on: https://chromium-review.googlesource.com/969041
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52045}
2018-03-19 16:10:16 +00:00
Kim-Anh Tran
714b528a9c [wasm] Stop compilation when error was thrown in CompileInParallel()
Synchronous compilation currently continues creating new tasks even
though compilation has already failed. This stops the creation of
new background tasks and makes sure that the background task manager
in the CompilationState is not canceled twice.

Change-Id: Ic4c55275ff70e7eca901ad357253f81aa8e2e8e1
Reviewed-on: https://chromium-review.googlesource.com/968781
Commit-Queue: Kim-Anh Tran <kimanh@google.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52044}
2018-03-19 16:08:25 +00:00
Clemens Hammacher
60efd46f8c [Liftoff] Merge two nearly identical functions
EmitMonomorphicBinOp and EmitBinOpWithDifferentResultType were nearly
identical, they just differ in one argument to GetUnusedRegister.
This CL merges them.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ief75beb410c8ba248b43cd382693f25bd9153d74
Reviewed-on: https://chromium-review.googlesource.com/968501
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52043}
2018-03-19 15:51:34 +00:00
Mike Stanton
46a3c77201 [turbofan] Masking/poisoning in codegen (optimized code, mips & mips64)
This introduces masking of loads with speculation bit during code generation.
At the moment, this is done only under the
--branch-load-poisoning flag, and this CL enlarges the set of supported
platforms from {x64, arm, arm64} to {x64, arm, arm64, mips, mips64}.

Overview of changes:
- new register configuration configuration with one register reserved for
  the speculation poison/mask (kSpeculationPoisonRegister).
- in codegen, we introduce an update to the poison register at the starts
  of all successors of branches (and deopts) that are marked as safety
  branches (deopts).
- in memory optimizer, we lower all field and element loads to PoisonedLoads.
- poisoned loads are then masked in codegen with the poison register.
  * only integer loads are masked at the moment.

Bug: chromium:798964
Change-Id: I211395b8305ed0ad9288d6da48fa159fa970c827
Reviewed-on: https://chromium-review.googlesource.com/951382
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#52042}
2018-03-19 15:43:04 +00:00
Marja Hölttä
58b0dea85c [in-place weak refs prework] No dependent code handling when maps die.
For problems with the current approach, see crbug.com/v8/7564.

We can instead gather all weak references in code in VisitEmbeddedPointer.

BUG=v8:7564, v8:7308

Change-Id: Ib369e7ab9efd62c90bdac69835318929c58217f2
Reviewed-on: https://chromium-review.googlesource.com/968250
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52041}
2018-03-19 15:28:44 +00:00
Georg Neis
32a1ebd245 [compiler] No longer expose the OtherString type.
This type is dangerous because it can become smaller over time (as
strings get internalized).

Bug: v8:6521
Change-Id: Iea650789ab52c13a0519f46999edc8a7959ccc71
Reviewed-on: https://chromium-review.googlesource.com/968525
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52040}
2018-03-19 15:24:24 +00:00
jgruber
94833cbfec Introduce a static layout for external reference table
This is another step towards efficient external reference access from
off-heap builtins.

Bug: v8:6666
Change-Id: I6f128a8a64724acaa092f28b1fceae01e3c05487
Reviewed-on: https://chromium-review.googlesource.com/968481
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52039}
2018-03-19 15:22:54 +00:00
Igor Sheludko
0fa0b28a84 [runtime] Remove unused Runtime::kDeclareGlobals.
... and rename Runtime::kDeclareGlobalsForInterpreter -> Runtime::kDeclareGlobals.

Bug: v8:7310
Change-Id: I58f9615b6948b66727f2de7e9ba1b0be4f87d9aa
Reviewed-on: https://chromium-review.googlesource.com/966291
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52038}
2018-03-19 15:14:24 +00:00
Yang Guo
a21d055209 Fix termination within microtasks.
Bug: v8:7552
Change-Id: I6bee9de640bae67e005fc174ea53875d79afc1ba
Reviewed-on: https://chromium-review.googlesource.com/964281
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52037}
2018-03-19 15:13:19 +00:00
Georg Neis
7d5e6b1516 [compiler] Don't infer receiver map for keyed stores.
This avoids a deopt loop.

Bug: v8:7254
Change-Id: I3a676186bc52fd47b03f03c26cb07d9257993693
Reviewed-on: https://chromium-review.googlesource.com/968503
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52036}
2018-03-19 15:11:09 +00:00
Michael Starzinger
b6ecf53b05 [wasm] Drop some obsolete code modification scopes.
R=clemensh@chromium.org
BUG=v8:6792,v8:7549

Change-Id: I1d153dcff729ed4c0863ae339ac7915efff3c33c
Reviewed-on: https://chromium-review.googlesource.com/968484
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52035}
2018-03-19 15:10:05 +00:00
Michael Achenbach
2ba5b33300 [build] Switch mac gc stress bot to 64 bits
TBR=sergiyb@chromium.org
NOTRY=true
NOTREECHECKS=true

Bug: chromium:822593
Change-Id: Iaa76cbcb95f2262d927a9a031b85cddeebdd2a87
Reviewed-on: https://chromium-review.googlesource.com/968490
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52034}
2018-03-19 15:03:57 +00:00
Michael Achenbach
b16e7aae86 [CQ] Deprecate mac in favor of mac64 trybots
NOTRY=true
TBR=sergiyb@chromium.org

Bug: chromium:822593
Change-Id: I0c16b879b8dbfc8fba061a2fd42ee339aa6a853e
Reviewed-on: https://chromium-review.googlesource.com/968485
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52033}
2018-03-19 14:20:15 +00:00
v8-autoroll
1891a9d13a Update V8 DEPS.
Rolling v8/build: 95a628b..76da9f5

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/7b53f08..6c4a8ca

Rolling v8/third_party/jinja2: d343832..45571de

TBR=machenbach@chromium.org,hablich@chromium.org,sergiyb@chromium.org

Change-Id: I576dc15bcc3c4c69572a0ff244d055e804e9e4d8
Reviewed-on: https://chromium-review.googlesource.com/963764
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52032}
2018-03-19 14:15:04 +00:00
Michael Achenbach
188cca4dac [test] Skip death-tests for mac64 asan
NOTRY=true

Bug: chromium:820416
Change-Id: If995357345c2916ed5a3c8d1ad94f783cf6d633a
Reviewed-on: https://chromium-review.googlesource.com/968249
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52031}
2018-03-19 14:13:59 +00:00
Sathya Gunasekaran
f17ad9e316 [numeric separator] Add tests for parseInt
Bug: v8:7317
Change-Id: I6c88de63c4bdb31f873c18c450d26f60659171f2
Reviewed-on: https://chromium-review.googlesource.com/968621
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52030}
2018-03-19 14:12:44 +00:00
Michael Achenbach
7e7c04b677 Revert "[build] Make separate snapshot for trusted variant"
This reverts commit 40d66d8bf8.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Mac64/builds/20910

Original change's description:
> [build] Make separate snapshot for trusted variant
> 
> This enables side-by-side snapshots with and without untrusted-code
> mitigations. It'll be the default in all V8 stand-alone builds
> with external startup data. Internal snapshots are not supported.
> 
> The files snapshot_blob.bin and snapshot_blob_trusted.bin will be
> bundled with V8 on swarming and the correct file is loaded dependent
> on the --untrusted-code-mitigations runtime flag.
> 
> Likewise we embed two snapshots for builtins.
> 
> Side-by-side snapshots won't be supported in Chromium.
> 
> Bug: v8:7441
> Change-Id: I2949ddfd5773649946b1c8e74751d48ad1d9c524
> Reviewed-on: https://chromium-review.googlesource.com/960004
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52028}

TBR=rmcilroy@chromium.org,machenbach@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,jgruber@chromium.org

Change-Id: I5b18f7aff7c05a17842fc68d785bb617eeca4a41
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7441
Reviewed-on: https://chromium-review.googlesource.com/968622
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52029}
2018-03-19 13:56:35 +00:00
Michael Achenbach
40d66d8bf8 [build] Make separate snapshot for trusted variant
This enables side-by-side snapshots with and without untrusted-code
mitigations. It'll be the default in all V8 stand-alone builds
with external startup data. Internal snapshots are not supported.

The files snapshot_blob.bin and snapshot_blob_trusted.bin will be
bundled with V8 on swarming and the correct file is loaded dependent
on the --untrusted-code-mitigations runtime flag.

Likewise we embed two snapshots for builtins.

Side-by-side snapshots won't be supported in Chromium.

Bug: v8:7441
Change-Id: I2949ddfd5773649946b1c8e74751d48ad1d9c524
Reviewed-on: https://chromium-review.googlesource.com/960004
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52028}
2018-03-19 13:34:54 +00:00
Marja Hölttä
38525dd209 [reland] [in-place weak refs] Use WeakArray in Script::shared_function_infos.
For serializer changes, see goo.gl/Kh2eop

Previous version: https://chromium-review.googlesource.com/955593

BUG=v8:7308

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I14c92874d04545eb6d04590bedb21dc402326401
Reviewed-on: https://chromium-review.googlesource.com/968245
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52027}
2018-03-19 13:33:24 +00:00