Commit Graph

47772 Commits

Author SHA1 Message Date
Michael Achenbach
d169622f83 Revert "[release] Switch auto-roller to gclient setdep"
This reverts commit a9f5dd30e4.

Reason for revert:
Temporarily use legacy method until https://crbug.com/843917 is fixed.

Original change's description:
> [release] Switch auto-roller to gclient setdep
> 
> NOTRY=true
> 
> Bug: chromium:828745
> Change-Id: I051f57893937796e01f0b823f1050dd36e0fbfd9
> Reviewed-on: https://chromium-review.googlesource.com/997556
> Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52385}

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

NOTRY=true

Bug: chromium:843917
Change-Id: I69978ba55ffa5996101e1d31bdf10364b7ef273f
Reviewed-on: https://chromium-review.googlesource.com/1064130
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53230}
2018-05-17 12:09:59 +00:00
Michael Achenbach
5783c63942 [tools] Make sure pinned depot_tools don't auto-update
TBR=sergiyb@chromium.org

Bug: chromium:843917
Change-Id: I7f1c6d7979a76a9573f0673a09444eba26297f05
Reviewed-on: https://chromium-review.googlesource.com/1063971
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53229}
2018-05-17 11:11:08 +00:00
Tobias Tebbi
9295c42ca1 [torque] fix memory leak
Change-Id: I9ca9d0d81ed37bdddd3286b3ebc46f2ecdacb248
Reviewed-on: https://chromium-review.googlesource.com/1063612
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53228}
2018-05-17 09:48:16 +00:00
Michael Achenbach
24c1d35a32 [build] Revert pinned depot_tools to unbreak auto-roller
TBR=sergiyb@chromium.org

Bug: chromium:843917
Change-Id: I1b7efb5dd4fa7a87c84cc1bbfa7780a8600aad03
Reviewed-on: https://chromium-review.googlesource.com/1063750
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53227}
2018-05-17 09:41:55 +00:00
Anna Henningsen
ff0a979333 [api] Expose PreviewEntries as public API
Turn `debug::EntriesPreview` into a public API.
This is a straightforward approach to addressing
https://github.com/nodejs/node/issues/20409
(not relying on functionality behind `--allow-natives-syntax`)
in Node.js.

Refs: https://github.com/nodejs/node/issues/20409
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7021e5846012a55a82c488408ded6591f6b139e7
Reviewed-on: https://chromium-review.googlesource.com/1057467
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53226}
2018-05-17 08:04:33 +00:00
Anna Henningsen
1e8d963fb3 [api] Slightly improve ValueSerializer documentation
Without specifying what the default allocator does, using
the buffer returned from `Release()` means that one basically
had to make an educated guess on how to free it
(and that ownership actually was transferred to the caller).

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie2ac0c91d9bdafbe91f6bce9b2263e304b2336ea
Reviewed-on: https://chromium-review.googlesource.com/1056369
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53225}
2018-05-17 08:01:32 +00:00
Nebojsa Ciric
9df3c3221e Fix a problem with the map.
Bug: v8:7765
Change-Id: I9366e28db004dcc565d654be2bb2fd62a12ebff1
Reviewed-on: https://chromium-review.googlesource.com/1062952
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53224}
2018-05-17 00:38:24 +00:00
Gabriel Charette
8f6ffbfca7 [V8Platform] Remove deprecated Background threads APIs and make new APIs pure virtual.
Also fixup some implementations that were lagging behind per the lack of
pure virtual not having enforced everything yet.

Also fixed recently introduced
PredictablePlatform::CallDelayedOnWorkerThread() to ignore delayed tasks
after realizing the intent is to intercept worker tasks instead of
sending them to |platform_|.

Node.js migrated off these APIs @
https://github.com/v8/node/pull/69

R=ahaas@chromium.org, yangguo@chromium.org

Bug: chromium:817421
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I92171f213b5fc64ab1f21e8eec72738f5ce228bd
Reviewed-on: https://chromium-review.googlesource.com/1045310
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53223}
2018-05-16 23:27:02 +00:00
Alexei Filippov
c6c28f7a41 [cpu-profiler] Eagerly delete not used CodeEntry'es
Currently ProfilerListener holds all the CodeEntries it ever
created during the profiling session. It is not capable of removing
entries corresponding to the code objects discarded by GC as there's
no such code event.

However it is sometimes possible to tell if a code object was GCed.
Hook up to the CodeMap code entry removal and if the entry has never
been hit by a sample we can safely delete it.

As a bonus the CodeEntryInfo size has been reduced on x64, which also
saves 8 x <number of code entries> bytes.

BUG=v8:7719

Change-Id: I988bc5b59f3fba07157a9f472cbcf68596fcd969
Reviewed-on: https://chromium-review.googlesource.com/1054346
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53222}
2018-05-16 17:19:21 +00:00
Tobias Tebbi
88ffe246d4 [torque] handle souce position information in a global context
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I20e30f0c19c887b1e093b02e39c7bd3d53d15182
Reviewed-on: https://chromium-review.googlesource.com/1054073
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53221}
2018-05-16 16:09:01 +00:00
Clemens Hammacher
0b6ad25168 [wasm] Add histogram for code space per module
In the context of launching Liftoff, this will help us estimate the code
size increase and find a good value for the maximum allowed code space.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ie76172edbf136629636911fe97c7ecdc940be86d
Reviewed-on: https://chromium-review.googlesource.com/1061497
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53220}
2018-05-16 16:03:41 +00:00
Bill Budge
337c1e522e [wasm] Copy misaligned buffer on serialization
- Changes WASM serialization to copy misaligned code into an aligned
  buffer before relocating. This extra copy will eventually go away
  when code is mapped into the process.
- Serialized code buffers no longer need padding to align their
  contents.

Change-Id: Ib016c69b5099a4cf039dcd3d36a48f076033227c
Reviewed-on: https://chromium-review.googlesource.com/1060471
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53219}
2018-05-16 15:56:51 +00:00
Michael Starzinger
7bab086e79 [arm][arm64] Disable write protection of code memory.
R=cbruni@chromium.org
BUG=chromium:842862

Change-Id: I1b7ba33ffdfc3bb7542308ccc68a14696db5f583
Reviewed-on: https://chromium-review.googlesource.com/1061519
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53218}
2018-05-16 15:14:48 +00:00
Tobias Tebbi
07f19a085d [torque] implement function pointers to builtins
This CL adds the new type expression
builtin(Context, ArgType1, ...) => ReturnType
and allows to use Torque-defined builtins as values of this type, as well
as calling values of this type.
The new function pointer types are subtypes of Code.

Change-Id: Ib7ba3ce6ef7a8591a4c79230dd189fd25698d5b9
Reviewed-on: https://chromium-review.googlesource.com/1060056
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53217}
2018-05-16 14:44:48 +00:00
Sigurd Schneider
f651409fee [turbofan] Add missing check in JSCallReducer
Bug: chromium:843543
Change-Id: I709c4be330e7d45e597b3ca4ae9db8a960b07bbc
Reviewed-on: https://chromium-review.googlesource.com/1061463
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53216}
2018-05-16 14:01:30 +00:00
Sergiy Byelozyorov
9fc3551a7b Reland "[tools] Add benchmark owners to the config"
This is a reland of 989285b7a0

Original change's description:
> [tools] Add benchmark owners to the config
>
> R=machenbach@chromium.org
>
> No-Try: true
> Bug: chromium:826280
> Change-Id: Ic34d13170dfecdd9e791974a34c33ba0248c7a38
> Reviewed-on: https://chromium-review.googlesource.com/1053809
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53138}

TBR=machenbach@chromium.org

No-Try: true
Bug: chromium:826280
Change-Id: I169788ff40dd88a7017b46a15b292568b907f38e
Reviewed-on: https://chromium-review.googlesource.com/1061697
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53215}
2018-05-16 13:53:49 +00:00
Sergiy Byelozyorov
b595b89c36 [tools] Add minor_mc test variant to the V8 CQ
R=machenbach@chromium.org

Bug: chromium:651354
Change-Id: I9ce5c6dc6a155ff9a70713cbdbf2d4037ad47f24
Reviewed-on: https://chromium-review.googlesource.com/1053773
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53214}
2018-05-16 13:52:45 +00:00
Sigurd Schneider
a97a362d86 [turbolizer] Add support for inlined functions
This CL adds support for inlined functions in Turbolizer. It is also a
refactoring of the Turbolizer code-base. Most importantly, handling of
source positions changed to exact source positions, and not code ranges.
This improves selection interoperability between different phase views.

A separate CL changes the Turbolizer JSON format to include inlining
information. This Turbolizer update, however, is intended to be backwards
compatible with the JSON format Turbolizer generated before the JSON
format change.


Bug: v8:7327
Change-Id: Ic67506a6f3a36fe98c012b1e76994972779c1fd2
Reviewed-on: https://chromium-review.googlesource.com/1032784
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53213}
2018-05-16 13:43:14 +00:00
Sergiy Byelozyorov
4b6263be32 Reland "[tools] Add benchmark owners to the config"
This is a reland of 989285b7a0

Original change's description:
> [tools] Add benchmark owners to the config
>
> R=machenbach@chromium.org
>
> No-Try: true
> Bug: chromium:826280
> Change-Id: Ic34d13170dfecdd9e791974a34c33ba0248c7a38
> Reviewed-on: https://chromium-review.googlesource.com/1053809
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53138}

R=machenbach@chromium.org

No-Try: true
Bug: chromium:826280
Change-Id: Ie61892c80d5ce004703d3e769abd58c4f2af1eec
Reviewed-on: https://chromium-review.googlesource.com/1057092
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53212}
2018-05-16 13:39:34 +00:00
Sigurd Schneider
c43d79f86d [turbolizer] Add inlining information to --trace-turbo
Bug: v8:7327
Change-Id: Ic00291784e982632b15cd83059397b6e9e4c4f79
Reviewed-on: https://chromium-review.googlesource.com/1057487
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53211}
2018-05-16 13:22:24 +00:00
jgruber
5999f8f1fc [regexp] Do not assume fast regexp results are non-empty
It is possible for user code to modify fast regexp result objects
before they are used e.g. by RegExp.p.match, so we may not make any
assumptions about their contents. The only exception is when the
RegExp itself is fast.

Bug: chromium:843022
Change-Id: I14eafbdfb2b2ced609da1391b57c73cbe167f7fb
Reviewed-on: https://chromium-review.googlesource.com/1061455
Reviewed-by: Peter Wong <peter.wm.wong@gmail.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53210}
2018-05-16 13:06:14 +00:00
Camillo Bruni
05bcb12e55 Flush ICache on startup deserialization after marking memory executable
Tentative fix for Android invoke crashers with write protection code
enabled.

Bug: chromium:842862
Change-Id: If238b25b239b50c597f3745aa683f564a717434f
Reviewed-on: https://chromium-review.googlesource.com/1061513
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53209}
2018-05-16 13:01:55 +00:00
Clemens Hammacher
c865c9f56e [wasm] Fix naming to distinguish memory from code space
The term memory usually refers to the wasm memory. In the
{NativeModule}, we store pools for allocated and available code space.
This CL changes naming to make clear that this is code space and not
memory.

R=titzer@chromium.org

Bug: v8:7754
Change-Id: I195bf5c9227ad246af302ae1e98f9c839a02adbf
Reviewed-on: https://chromium-review.googlesource.com/1061495
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53208}
2018-05-16 12:53:34 +00:00
Andreas Haas
63bd3a88c5 [turbofan] Increase the number of inputs for Binop instructions further
In WebAssembly benchmarks I saw Binop instructions with 6 inputs. We
don't know how many inputs there can actually be, so we conservatively
increase the number to 8 now.

R=jarin@chromium.org
Bug=chromium:842501

Change-Id: Id087481e7e524006c2f03fc545f9e35d1cad1fe8
Reviewed-on: https://chromium-review.googlesource.com/1061114
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53207}
2018-05-16 12:04:34 +00:00
Benedikt Meurer
0f3b19f436 [ic] Remove obsolete IC::FrameDepth.
The CallIC class is obsolete and unused for a long time, and the
IC::FrameDepth was only there to support the additional frame
that was imposed by the CallFunctionStub. All of that is long gone, so
we don't need that here.

Bug: v8:7754
Change-Id: Ic82f68b325e3e10e285e30111053ffffd547f965
Reviewed-on: https://chromium-review.googlesource.com/1061354
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53206}
2018-05-16 11:44:14 +00:00
Marja Hölttä
1950cf7f18 [iwyu] objects.h iwyu
BUG=v8:7490

Change-Id: I53888e391a0ad25407e59431b2fffbd7cacf5273
Reviewed-on: https://chromium-review.googlesource.com/1060060
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53205}
2018-05-16 11:38:44 +00:00
Sergiy Byelozyorov
a2c8169851 Update V8 DEPS.
Rolling v8/build: b61b6b6..03f39fd

Rolling v8/buildtools: 0b71401..e754647

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/e853531..d8600cc

Rolling v8/third_party/depot_tools: d1de725..8de3800

Rolling v8/tools/clang: 51de78a..a67a084

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

Change-Id: I09efa7ed11e7f575c4f02746b39e151ebf8c2698
Reviewed-on: https://chromium-review.googlesource.com/1061093
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53204}
2018-05-16 10:47:58 +00:00
Daniel Clifford
3d2cb0b4ae [torque]: Implement Generics for Builtins and Macros
Including specialization, e.g.:

  // Declare parameterized generic
  macro GenericMacroTest<T: type>(param: T): Object {
    return Undefined;
  }

  // Declare specialization of generic
  GenericMacroTest<Object>(param: Object): Object {
    return param;
  }

  ...
  assert(GenericMacroTest<Smi>(0) == Undefined);
  assert(GenericMacroTest<Smi>(1) == Undefined);
  assert(GenericMacroTest<Object>(Null) == Null);
  assert(GenericMacroTest<Object>(False) == False);
  ...

Known issue: specialization doesn't rigorously checked to verify
that specialization signature precisely matches generic declaration.

Change-Id: I9d9d96da4c5c8c9a76550844680e9e133a5edaed
Reviewed-on: https://chromium-review.googlesource.com/1043986
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53203}
2018-05-16 10:29:48 +00:00
Camillo Bruni
c1928181d1 [factory] Flush instructions as late as possible
As my mum used to say: When it comes to flushing, later is better than early.

Tentative fix for Android invoke crashers with write protection code
enabled.

Bug: chromium:842862
Change-Id: Ib37115883a6fa615c9514aeb543dc3527335803a
Reviewed-on: https://chromium-review.googlesource.com/1059673
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53202}
2018-05-16 09:43:25 +00:00
Sigurd Schneider
e0059db555 [turbofan] Add --trace-turbo-filter
This adds a filter option for --trace-turbo, --trace-turbo-graph
and --trace-turbo-scheduled. The filter is a pattern that matches
function names in this way:
   "*"      all; the default
   "-"      all but the top-level function
   "-name"  all but the function "name"
   ""       only the top-level function
   "name"   only the function "name"
   "name*"  only functions starting with "name"
   "~"      none; the tilde is not an identifier

Bug: v8:7761
Change-Id: I7e8e726023f2c72754b0dd691d790af20b022fd3
Reviewed-on: https://chromium-review.googlesource.com/1059774
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53201}
2018-05-16 09:33:15 +00:00
Miran.Karic
42027031dc MIPS: Fix liftoff bit shift operations.
The problem occurs when getting an unused register causes spilling, but
the generated code is not executed because of a branch, resulting in
loss of data.

BUG=
TEST=cctest/test-run-wasm/RunWasmLiftoff_I64Sh*

Change-Id: Icdb897df42059ed27bec57fcf91cc8338e4598f3
Reviewed-on: https://chromium-review.googlesource.com/1060213
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#53200}
2018-05-16 08:51:30 +00:00
Simon Zünd
154f0cb381 [array] Refactor sort pre-processing into a single runtime function.
This CL consolidates CopyFromPrototype and RemoveArrayHoles into a
single runtime function. It also creates two small helper functions
that are needed in both pre-processing steps.

Additionally it removes the return value from CopyFromPrototype since
it is no longer needed (it was previously used by a sort post-
processing step that no longer exists).

Bug: v8:7382
Change-Id: I7f9b00c1bc639d2118fdecef9c3b45c2cf010310
Reviewed-on: https://chromium-review.googlesource.com/1051887
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53199}
2018-05-16 08:50:26 +00:00
ray glover
d22b125a0c Document --module option for d8
- I think d8's ability to load es6 modules is important enough to
document through the CLI
- I also tried to simplify the d8/shell CLI synopsis

This is my first patch; I can't run the automated test suite.

Change-Id: I6376542f57f11dd8ec53be9b53f3d17d46a86fed
Reviewed-on: https://chromium-review.googlesource.com/1056530
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53198}
2018-05-16 07:35:46 +00:00
Vaclav Brozek
be5cfb2295 Fix array.indexOf for negative fromIndex
Array.indexOf accepts an optional fromIndex argument. When non-negative,
this argument restricts the searched indices to those starting at
fromIndex:
[1, 2, 1].indexOf(1,1) == 2
When negative, it is meant to be added to the array length to provide
such initial index for the search:
[1, 2, 1].indexOf(1, -2) == 2

This transformation has been done by the non-optimised builtin but not
by the reducer. The CL adds this construction to the reducer.

Bug: chromium:842612
Change-Id: I0ff089997f4ebb4dc3c2923e52c382a8a96cd711
Reviewed-on: https://chromium-review.googlesource.com/1059628
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53197}
2018-05-16 07:31:46 +00:00
Dan Elphick
7485b1296b [heap] Start making ReadOnlySpace Pages relocatable
Adds Page::MakeHeaderRelocatable that clears pointers to objects
outside the space. In this case relocatable means the entire page
heading is position independent in memory, meaning it could be saved to
disk and reloaded at a different memory location in a new process
without there being any invalid pointers.

Currently this only affects mutex_, locate_tracker_ and reservation_.

Additionally makes VerifyHeap work when there's no mutex in a Page.

This is just a stepping stone to making the Pages headers relocatable
since heap_ and owner_ still point out of the Page.

Also removes the empty ReadOnlySpace destructor.

Bug: v8:7464
Change-Id: Ife3c06575fa73a5818c4991fb9bec30a5f43901d
Reviewed-on: https://chromium-review.googlesource.com/1054879
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53196}
2018-05-16 07:25:26 +00:00
Georg Neis
b1fb9e9002 [serializer] Fix ExternalReferenceEncoder::NameOfAddress.
This function didn't account for addresses of api-provided external
references, leading to out-of-bound reads on external_reference_table.
(This happened to me when printing a code object in gdb, I'm not sure
how to easily test it.)

Also remove an unused method from the private Value class.

R=jgruber@chromium.org

Change-Id: Id14fed3fb3866df750bcad8f4a02c61748b07ad3
Reviewed-on: https://chromium-review.googlesource.com/1060035
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53195}
2018-05-16 07:17:16 +00:00
jgruber
50b2ecf9af [builtins] Reduce lifetime of builtins constant table builder
Code generation introduces indirections if a builder exists (and the
serializer is active). These indirections are not necessary outside of
embedded builtins (e.g. in bytecode handlers), so let's reduce its
lifetime.

Bug: v8:6666
Change-Id: I57207012997786f599f79f0982da61eea26f3e22
Reviewed-on: https://chromium-review.googlesource.com/1059114
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53194}
2018-05-16 06:46:46 +00:00
Nebojsa Ciric
ab72273692 Implementing Intl.Locale proposal.
https://github.com/tc39/proposal-intl-locale

Rename locale property to baseName to better reflect the intented use case and the change in spec.

TBR: bmeurer@chromium.org
Bug: v8:7684
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I91b630b49ce73abcebd6040ec968c91d75cff879
Reviewed-on: https://chromium-review.googlesource.com/1014411
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53193}
2018-05-15 22:25:02 +00:00
Wez
aca333123d [heap] Replace retained_size() with ExternalBackingStoreBytes().
ArrayBuffer memory allocated off-heap was previously tracked by a test-
only retained_size() field on each LocalArrayBufferTracker.

Changes in off-heap ArrayBuffer memory usage are now reported to the
Space with which the ArrayBuffer is associated, so that the value is
cheaply available to include in e.g. GC limit calculations, via a new
getter, ExternalBackingStoreBytes().

Changes to external ArrayBuffer backing-store allocations are tracked in
an AtomicNumber associated with each Space, to allow for ArrayBuffers
being concurrently moved or freed from multiple Pages in the same Space
during sweeps & compactions.

Bug: chromium:837583
Change-Id: I8b1b6addd5cd05533d8da55ca813e134bc36e181
Reviewed-on: https://chromium-review.googlesource.com/1052347
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53192}
2018-05-15 21:04:42 +00:00
Clemens Hammacher
3b59a3dd4a [wasm] Refactor all call targets to be Addresses
With the introduction of a jump table, call targets will not be
{WasmCode} objects any more. Instead, we just call any {Address}.
This CL does not change anything yet, but changes interfaces to accept
an {Address} instead of {WasmCode*}.

R=titzer@chromium.org

Bug: v8:7758
Change-Id: Id299738bb7cc6a1891e4a03d7f67c24cde6d1699
Reviewed-on: https://chromium-review.googlesource.com/1058793
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53191}
2018-05-15 17:55:50 +00:00
Clemens Hammacher
37e9017f8e [wasm] Use correct instance when calling start function
We were always using the instance we were currently building. If the
start function is an exported wasm function of another instance, use the
exporting instance instead.

R=titzer@chromium.org

Bug: chromium:843120
Change-Id: I141d272b947bef8e903be7208ddf6ce344e754c4
Reviewed-on: https://chromium-review.googlesource.com/1059620
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53190}
2018-05-15 16:17:29 +00:00
jgruber
b9df312346 Refactor RelocIterator constructors
The (currently four, soon five) RelocIterator constructors contain
basically identical logic. Refactor that into a basic version that all
other constructors call.

Bug: v8:6666
Change-Id: Ice7b4891d5e539ff6fe63337fc52d480d85dc270
Reviewed-on: https://chromium-review.googlesource.com/1059109
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53189}
2018-05-15 15:19:19 +00:00
Igor Sheludko
41e7e17338 [heap-stats] Also collect object field stats.
In particular:
* number of pointer fields
* number embedder fields
* number boxed fields
* number of unboxed double field
* number of raw data fields

Bug: v8:7703
Change-Id: I22a310d941317a0f34f67536e55fbfab5f5354cd
Reviewed-on: https://chromium-review.googlesource.com/1056532
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53188}
2018-05-15 14:59:16 +00:00
Clemens Hammacher
d171ed411a [wasm] Add tests for re-importing into different instances
Since the code around that is quite fragile, and I plan to refactor it,
just add some tests to ensure that everything is and keeps working as
intended.

R=mstarzinger@chromium.org

Bug: v8:7758
Change-Id: Ib3814b93b465286d70b5669ed0161eecb9fc925a
Reviewed-on: https://chromium-review.googlesource.com/1059616
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53187}
2018-05-15 14:52:26 +00:00
Tobias Tebbi
b5708d9249 [build] Disable sysroot on gcov coverage builder
The sysroot only contains headers for gcc6, not gcc4.8 which is the version installed on the coverage bots.

Bug: chromium:837238
Change-Id: Ifd9b53dae510b969b4ef5ec8c1c2684eb92a94fa
Reviewed-on: https://chromium-review.googlesource.com/1059150
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53186}
2018-05-15 14:03:06 +00:00
Clemens Hammacher
fa569391bd [wasm] Disambiguate {ImportedFunctionEntry::set} methods
{ImportedFunctionEntry} offers two {set} methods: One takes a
{JSReceiver*}, the other one a {WasmInstanceObject*}. Since
{WasmInstanceObject} inherits from {JSReceiver}, it's quite easy to
confuse the two if the instance is hold as e.g. {JSObject}.
Hence, rename the methods to remove this ambiguity.

R=titzer@chromium.org

Bug: v8:7758
Change-Id: I06617a565faa561d3afc70085e0df3b528c715bb
Reviewed-on: https://chromium-review.googlesource.com/1059147
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53185}
2018-05-15 12:57:14 +00:00
Clemens Hammacher
7696972ec3 [wasm][cleanup] Name interpreter entry consistently
The interpreter entry was sometimes referred to as "interpreter stub"
or "interpreter wrapper". Use the term "interpreter entry" consistently.

R=titzer@chromium.org

Bug: v8:7754
Change-Id: Ia06449c91300fca454c6afd5c82a789749d6b7d0
Reviewed-on: https://chromium-review.googlesource.com/1058794
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53184}
2018-05-15 12:53:44 +00:00
Marja Hölttä
6a0ff91c31 [in-place weak refs] Add MaybeObject::Print.
BUG=v8:7308

Change-Id: I12a38a6099f0ffd8718dc5cb77433baa75bc0411
Reviewed-on: https://chromium-review.googlesource.com/1059110
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53183}
2018-05-15 12:23:54 +00:00
Clemens Hammacher
7631358e34 [wasm] Reuse information from wasm-linkage.h
For generating the WasmCompileLazy builtin, we need to know the list of
parameter registers in wasm. Instead of duplicating this, just use the
existing array from wasm-linkage.h.

R=titzer@chromium.org

Change-Id: Ib552af7b6a3defbc9c8b48390244bf943306a4b7
Reviewed-on: https://chromium-review.googlesource.com/1057310
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53182}
2018-05-15 12:06:34 +00:00
sreten.kovacevic
8ae28f3276 [Refactor][mips] Refactor liftoff MIPS files
Since `at` register is used a lot in macro-assembler-mips, change
usage of this register with `kScratchReg` and `kScratchReg2`.
Also, remove TODO comments for unaligned memory access, since there
is nothing that can be done about it.

Change-Id: Ibf55c04a1f53521f34dfb483294de3010a0120c6
Reviewed-on: https://chromium-review.googlesource.com/1059347
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#53181}
2018-05-15 11:51:54 +00:00