Commit Graph

19172 Commits

Author SHA1 Message Date
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
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
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
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
Théotime Grohens
c79feb8aa3 Add a first performance test for DataView
and comparison with a JS implementation using TypedArray

Change-Id: Ifec9c19f23e182db25ad3e54edc3f60c6e6048f4
Reviewed-on: https://chromium-review.googlesource.com/1057729
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Théotime Grohens <theotime@google.com>
Cr-Commit-Position: refs/heads/master@{#53177}
2018-05-15 08:45:54 +00:00
Simon Zünd
a410e9e441 [torque] Emit labels only if they are used.
This CL changes the generated C++ code for LabeledStatementBlocks to
only emit labels if they are used.

Prior to this CL, when a label was only used on one path of an
if constexpr expression, and not at all anywhere else,
the try/label construct would BIND a label that was not used,
causing a CSA verification error.

R=tebbi@chromium.org

Change-Id: Ia81a0cd081b84528c95bbdbdb98b9ab51928e13f
Reviewed-on: https://chromium-review.googlesource.com/1057247
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Simon Zünd <szuend@google.com>
Cr-Commit-Position: refs/heads/master@{#53173}
2018-05-15 08:29:33 +00:00
Kanghua Yu
3302242667 Reland "[turbofan][x64] Reduce compare-zero followed by flags-setting binop"
On IA architecture, arithmetic and shifting operations set the flags
according to the computation result.

    subl rsi,0x1
    REX.W movq rbx,[rbx+0x17]
    cmpl rsi, 0                       <-- TO BE REDUCED
    jnz 0x3f54d2dcef0
==>
    REX.W movq rbx,[rbx+0x17]
    subl rsi,0x1
    jnz 0x3f54d2dcef0
&
    orl rdx,rbx
    cmpl rdx,0x0                      <-- TO BE REDUCED
    jnz 0x3f54d22b0f5
==>
    orl rdx,rbx
    jnz 0x3f54d22b0f5

Bug: chromium:842497, chromium:842501
Change-Id: I4e2c40861b76ac3f508b01ee27249e85eab3222f
Reviewed-on: https://chromium-review.googlesource.com/1057351
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kanghua Yu <kanghua.yu@intel.com>
Cr-Commit-Position: refs/heads/master@{#53171}
2018-05-15 06:40:13 +00:00
Vasili Skurydzin
82cad34119 PPC/s390: Enable atomic operation tests
Change-Id: I05bd981c8050a6f59446be660d449320979ceaea
Reviewed-on: https://chromium-review.googlesource.com/1053957
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#53168}
2018-05-14 19:26:39 +00:00
Sathya Gunasekaran
e4215e4036 [hash-table] Implement Delete
Bug: v8:6443, v8:7569
Change-Id: I61677e75f23c604ba7ad0ea110aa57578dcadb89
Reviewed-on: https://chromium-review.googlesource.com/1047957
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53166}
2018-05-14 18:54:09 +00:00
Maya Lekova
17875b01ca [builtins] Fix error message in Proxy set trap
Bug: chromium:842101

R=neis@chromium.org

Change-Id: I4a142b28682ba73cbf3398e74c15614fa491ad40
Reviewed-on: https://chromium-review.googlesource.com/1057627
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53164}
2018-05-14 16:37:20 +00:00
Michael Starzinger
541abb1cc7 [wasm] Move {shared} field to {WasmModuleObject}.
This makes the fact that {WasmSharedModuleData} is shared across
instances explicit by hanging this {shared} reference off the module
object instead of the instance-specific {WasmCompiledModule} object.

R=titzer@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I99bf3d855d6283bdc48373f0f8e2df1990905d3f
Reviewed-on: https://chromium-review.googlesource.com/1051909
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53163}
2018-05-14 15:55:45 +00:00
Pierre Langlois
7927d6468e [turbofan][wasm] Fix --trace-turbo with compiling a WASM function.
The --trace-turbo flag would cause a crash when compiling a WASM_FUNCTION. It
was caused by assuming the OptimizedCompilationInfo had a SharedFunctionInfo
attached if the code isn't a stub and wasm functions are not considered as such.

In order to test this, we've added a new flag to specify were to dump JSON
files: --trace-turbo-path. This is used to make sure we do not leave lots of
files behind in the top-level directory. It should be useful as standalone
feature too.


Change-Id: Ia9442638d28100bea45a8683fb233803cc5393f2
Reviewed-on: https://chromium-review.googlesource.com/1030555
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53153}
2018-05-14 13:37:13 +00:00
jgruber
8ec92f5118 [api] Add a dedicated UnboundModuleScript type
Module and script SharedFunctionInfos can't be used interchangeably
(e.g.: it should not be possible to bind a Module's SFI to a Context).

The dedicated type disambiguates the two.

This also adds an overload for CreateCodeCache which takes an unbound
module script instead of an unbound script. Both are just a SFI
underneath, so their behavior is identical.

Bug: v8:7685
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iab519d0d50b6b41c95abdb6397f5622e292da4d8
Reviewed-on: https://chromium-review.googlesource.com/1047107
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53150}
2018-05-14 11:48:51 +00:00
Andreas Haas
1b11d98f4d [turbofan] Binop Instructions can have up to 5 input operands
The clusterfuzz issue crashes because VisitBinops expected only but 4
input operands but in the generated graph 5 input operands get created
The issue is fixed by increasing the size of the input operand buffer.

R=jarin@chromium.org

Bug: chromium:842501
Change-Id: I4bbb09a968e165e6f5a0a02d06eee97333f7aa38
Reviewed-on: https://chromium-review.googlesource.com/1056989
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53147}
2018-05-14 10:38:47 +00:00
Mythri
a55117d7ed [Interpreter] Share feedback slots for load / store named properties
Shares the feedback slot when loading / storing named properties
when the name of the property and the variable corresponding
to the object are the same. This reduces the memory usage on most
real world benchmarks. There is a slight (~1%) increase in the overall
time spent in V8 on a couple of these pages.

There is also no overall performance regression on peak-performance
benchmarks like Octane, ARES. More detailed results are in this doc[1]

[1]: https://docs.google.com/document/d/1rPNjXU-WOlyNQovuQS28Zf2PHCENR97Bi76gV9mHHOc/edit?usp=sharing

BUG: v8:7530
Change-Id: I7dd98c2d26f4e6c94690ca7d9a8a4a8281b3142d
Reviewed-on: https://chromium-review.googlesource.com/966302
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53145}
2018-05-14 10:21:42 +00:00
Georg Neis
fc36cacd17 [compiler] Fix bug in representation changer.
We must not accept something of kBit representation as of
kWord32 representation (unless it's truncated accordingly).
Deopt instead.

Bug: v8:7740
Change-Id: Ib4f73600d66f8762a6e22f7ea1ce79e8ef451b34
Reviewed-on: https://chromium-review.googlesource.com/1054670
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53144}
2018-05-14 10:16:22 +00:00
Sergiy Byelozyorov
0a71347353 Revert "[tools] Add benchmark owners to the config"
This reverts commit 989285b7a0.

Reason for revert: broke internal bots

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,sergiyb@chromium.org

Change-Id: Iec3f8fa8eda77b1bcfb00274b28a12e4d233d6c4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:826280
Reviewed-on: https://chromium-review.googlesource.com/1057091
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53140}
2018-05-14 09:52:33 +00:00
Maya Lekova
91ddb65d3b Revert promises optimizations due to regressions in async hooks
Revert "[async-await] Eliminate throwaway promise in async functions."

This reverts commit a840f1f8f7.

Revert "[async-generators] Also avoid throwaway promise here."

This reverts commit feb545ceba.

Revert "[async-await] Turn await closures into intrinsics."

This reverts commit d97bb31738.

Revert "[async-generators] Add fast-path for primitives in AsyncGeneratorYield."

This reverts commit e57b500eb2.

Revert "[async-generators] Add fast-path to skip "then" lookup in AsyncGeneratorResolve."

This reverts commit c15802e11e.

Revert "[promises] Correctly run before/after hooks for await."

This reverts commit ca7639239f.

Bug: v8:7253, v8:7745
Change-Id: I25ad0d2df3cfbc84dbb431aa25b268bce8a39e89
Reviewed-on: https://chromium-review.googlesource.com/1049975
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53139}
2018-05-14 09:36:22 +00:00
Sergiy Byelozyorov
989285b7a0 [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}
2018-05-14 09:27:32 +00:00
peterwmwong
e6238be3cb [torque]: Fix Labels with multiple parameters
Change-Id: I37ed9115c099f3d17f23a26348a1bbf5f773ee32
Reviewed-on: https://chromium-review.googlesource.com/1056668
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Peter Wong <peter.wm.wong@gmail.com>
Cr-Commit-Position: refs/heads/master@{#53136}
2018-05-13 17:07:25 +00:00
Daniel Clifford
5f920f770d [torque]: Add the ability to test Torque functionality with cctest
In the process, add a few simple tests for "constexpr" expressions, which
identified a few bugs that are also fixed in this CL.

Change-Id: I97486c781572642d2b574b92133b1f9cda3db592
Reviewed-on: https://chromium-review.googlesource.com/1055493
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53135}
2018-05-13 10:58:56 +00:00
Michael Starzinger
f6fbbc0c51 [wasm] Move {export_wrappers} field to {WasmModuleObject}.
This makes the fact that export wrapper code is shared across instances
explicit by hanging the {export_wrappers} array off the module object
instead of the instance-specific {WasmCompiledModule} object.

R=titzer@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ic5c73bcc17f759e520c105317361e5654628b99e
Reviewed-on: https://chromium-review.googlesource.com/1051987
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53131}
2018-05-11 16:00:58 +00:00
Dan Elphick
fad99f5e21 [objects] Disallow externalizing RO_SPACE 2-byte strings
This was already the case for 1-byte strings. This prevents crashes when
attempting to externalize such strings.

Bug: chromium:842078, v8:7464
Change-Id: I3092a6748edaf77b2689f7b6f6b949929998e508
Reviewed-on: https://chromium-review.googlesource.com/1054290
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53124}
2018-05-11 12:37:55 +00:00
Igor Sheludko
93bcce68a8 [csa] Typify dictionary related code.
Bug: v8:7754
Change-Id: I44d20d55f5da0a0f95b89a565dbe21304c6d174c
Reviewed-on: https://chromium-review.googlesource.com/1052111
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53122}
2018-05-11 11:46:16 +00:00
Dan Elphick
0b4b14bc48 [elements] Avoid NOP operation when shrinking HashTables
Avoid writing NumberOfElements to HashTable when it hasn't changed as
the HashTable could be in RO_SPACE and this operation will crash.

Bug: v8:841592
Change-Id: Iffadd567fc10aa9cd13d953da81275464b16c6c0
Reviewed-on: https://chromium-review.googlesource.com/1052693
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53116}
2018-05-10 11:09:59 +00:00
Andreas Haas
0263383d69 [wasm] Move the CompilationManager into the WasmEngine
The CompilationManager was introduced to manage the memory of
AsyncCompileJobs. However, by now this can be done better by the new
WasmEngine.

This CL just moves the code to wasm-engine.[h,cc] and adjusts the
callsites.

R=titzer@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Icd2c1f19feeaa854c74e020b41e314b8ad00cea5
Reviewed-on: https://chromium-review.googlesource.com/1052109
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53112}
2018-05-09 16:41:35 +00:00
Clemens Hammacher
aae0732c72 Reland "Fix SourcePositionInfo for wasm"
This is a reland of e084eea628.
Undefined behavious was fixed in https://crrev.com/c/1051235.

Original change's description:
> Fix SourcePositionInfo for wasm
>
> In wasm we often don't have a SharedFunctionInfo associated with a
> compilation job, so we can't get a Script. Just print "unknown" in
> these cases (instead of crashing).
>
> R=titzer@chromium.org
> CC=​herhut@chromium.org
>
> Bug: chromium:840757, v8:7738
> Change-Id: I850c6adfd9e07c9a0f6dd018f1a9314feb89d887
> Reviewed-on: https://chromium-review.googlesource.com/1049632
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53080}

TBR=titzer@chromium.org

Bug: chromium:840757, v8:7738
Change-Id: If04040a33766955cfed78e7c27226dd04c3f9b9f
Reviewed-on: https://chromium-review.googlesource.com/1051266
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53111}
2018-05-09 16:39:55 +00:00
Clemens Hammacher
ae8405080d [x64] Add disassembler support for 'pause'
The 'pause' instruction is used for implementing retpolines. It is
currently being printed as 'nop', which is incorrect.

R=titzer@chromium.org

Change-Id: I134b6dae332103fd7f9b3c4e5520f0d5db06ba74
Reviewed-on: https://chromium-review.googlesource.com/1051789
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53109}
2018-05-09 16:06:52 +00:00
Clemens Hammacher
c8ae9729ec [lsan] Ignore code comments
Code comments are heap-allocated and never freed. We don't want to
attach them to the code object via a finalizer, since that could change
gc timing and heap layout when you enable code comments. They are used
to testing only anyway, so leaking is acceptable here.

R=bmeurer@chromium.org, jarin@chromium.org

Bug: v8:7738
Change-Id: I27b0f95db1d66b57f4f113c154f23edb84e6700d
Reviewed-on: https://chromium-review.googlesource.com/1051241
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53107}
2018-05-09 15:13:34 +00:00
Dominic Farolino
c9a728aaa0 [inspector] implement console.countReset()
Implement console.countReset() from the WHATWG Console Standard

R=bmeurer@chromium.org, dgozman@chromium.org, kozyatinskiy@chromium.org

Bug: chromium:839947
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I8a900e9cdf3e5b08506f709cf6497476c8c6c00b
Reviewed-on: https://chromium-review.googlesource.com/1044902
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#53106}
2018-05-09 14:59:04 +00:00
Igor Sheludko
09d4ba01ee [builtins] Properly handle non-simple target in Object.assign.
Plus a bit of CSA typification.

Bug: v8:7725
Change-Id: I43fea4a4c0739f9c24d84035816b046e742372ee
Reviewed-on: https://chromium-review.googlesource.com/1051653
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53102}
2018-05-09 13:44:00 +00:00
Clemens Hammacher
199533558e Fix undefined behaviour on CommentOperator
The {CommentOperator}, used for implementing the --code-comments flag,
is not UBSan-safe. This CL fixes this and adds a test which uses code
comments.

R=bmeurer@chromium.org

Bug: v8:7744
Change-Id: Ia6ec509e77d998df085ac7377cb24854354e3aa2
Reviewed-on: https://chromium-review.googlesource.com/1051235
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53100}
2018-05-09 13:31:21 +00:00
Igor Sheludko
11aaf0fb84 [api] Move tagging scheme definition up in include/v8.h
... in order to be able to use it in other constants definitions in the header.

Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Id5d6ae34ab401ecf063bf5897b87b6bb87c24960
Reviewed-on: https://chromium-review.googlesource.com/1032782
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53097}
2018-05-09 13:17:07 +00:00
Dan Elphick
9d5aea8dc4 Reland "[heap] Move even more objects into RO_SPACE"
Moves all Oddballs, empty_feedback_metadata, lots of symbols and
immortal heap numbers and several other empty collection objects.

      RO_SPACE  NEW_SPACE  OLD_SPACE  CODE_SPACE  MAP_SPACE  LO_SPACE
old      31800          0     241976       24032        176         0
new      35080          0     238680       24032        176         0
diff     +3280                 -3296

Reland of https://chromium-review.googlesource.com/c/v8/v8/+/1025996,
without the empty_property_dictionary which is not read-only.

Bug: v8:7464
Change-Id: I84840d86eb3e5906ddb8b4c4e9e70bfec0cf78bc
Reviewed-on: https://chromium-review.googlesource.com/1049611
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53096}
2018-05-09 13:12:01 +00:00
Dan Elphick
6098ddeaff [snapshot] Ensure padding is always cleared in tests
Re-enables and fixes msan test failures due to string padding being
cleared only selectively in tests. This change instead makes sure it
always happens in TestIsolate.

Bug: v8:7746
Change-Id: I259b43ad25cb7af18bf16d29effb15772c981a67
Reviewed-on: https://chromium-review.googlesource.com/1051647
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53095}
2018-05-09 11:31:49 +00:00
Clemens Hammacher
d096508fe8 Skip failing msan tests
These tests started failing after https://crrev.com/c/1046657.

R=ahaas@chromium.org

Bug: v8:7748
No-Try: true
Change-Id: I67b44b144e5e62c5a88cbf6683e0678e6eab1dc6
Reviewed-on: https://chromium-review.googlesource.com/1051243
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53094}
2018-05-09 09:40:49 +00:00
Mike Stanton
5945e1ccd0 [Builtins] Torque version of Array.prototype.forEach()
BUG=v8:7672

Change-Id: I0c157ce88b31312dfbea7a149c1d9fbdfb398278
Reviewed-on: https://chromium-review.googlesource.com/1013524
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53091}
2018-05-09 08:58:39 +00:00
Hannes Payer
4a1ceff1aa Remove --use-allocation-folding relict from tests.
Change-Id: Ia4d4211dbc8f0714dd11983ac7bc899f51ba69c5
Reviewed-on: https://chromium-review.googlesource.com/1051237
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53090}
2018-05-09 08:50:59 +00:00
Dan Elphick
600641338d Reland "[heap] Mark RO_SPACE as read-only after deserialization"
This is a reland of 40f1aaf330

Put back padding clearing into the SerializeObject method but only when
the String is not in RO_SPACE. For RO_SPACE strings, if required
iterate over the space before serialization clearing the strings.

Original change's description:
> [heap] Mark RO_SPACE as read-only after deserialization
>
> Adds MarkAsReadOnly and MarkAsReadWrite to ReadOnlySpace. The latter
> is only usable with ReadOnlySpace::WritableScope to avoid the space
> being left writable). MarkAsReadOnly updates the high water mark and
> makes several previously mutating methods into no-ops.
>
> Moves some writes to immutable objects out of the bootstrapper to
> setup-heap-internal so they don't write to a read-only page.
>
> Also avoid writing hashes to strings that already have the value set as
> that invariably means writing to the "0" and "1" constant strings in
> RO_SPACE.
>
> Before serialization, it makes RO_SPACE writable again so that any
> padding can be cleared before writing it.
>
> Bug: v8:7464
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I22edc20dba7dde8943991a8fcaf87244af4490a3
> Reviewed-on: https://chromium-review.googlesource.com/1014128
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52943}

Bug: v8:7464
Change-Id: Ia8386c4ff5f5df3207f584caf7a9b1ff1e405f25
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1042145
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53087}
2018-05-09 08:31:49 +00:00
Ben L. Titzer
e847124b01 [wasm] Refactor WasmGraphBuilder to use MachineGraph
This CL removes the JSGraph from WasmGraphBuilder and uses MachineGraph,
which is independent of the isolate, instead. In addition to using
the machine graph in the WasmGraphBuilder, this CL splits off a subclass
for compiling wrappers that does have a JSGraph and encapsulates it in
the .cc file. This makes the separation of WASM function graphs and WASM
wrapper graphs more explicit.

R=mstarzinger@chromium.org
CC=ahaas@chromium.org
BUG=v8:7721

Change-Id: I3c190baef2084919d22a9a89a8c9f11d2ddcf3d0
Reviewed-on: https://chromium-review.googlesource.com/1050266
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53086}
2018-05-09 08:05:06 +00:00
Michael Starzinger
8c57a54b86 [wasm] Create module object in async compilation earlier.
This makes sure that the {WasmModuleObject} has been allocated before
any debug events are fired. Since {WasmScript} objects reference the
module object, it needs to be allocated earlier by now.

R=ahaas@chromium.org
TEST=debugger/regress/regress-crbug-840288
BUG=chromium:840288

Change-Id: I02783ce126c463ac953eb2192acb65f3a5d420a1
Reviewed-on: https://chromium-review.googlesource.com/1050246
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53084}
2018-05-09 07:54:56 +00:00
Jaroslav Sevcik
d520ebb9a8 [turbofan] Fix NumberFloor typing.
Bug: chromium:841117
Change-Id: I1e83dfc82f87d0b49d3cca96290ae1d738e37d20
Reviewed-on: https://chromium-review.googlesource.com/1051228
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53083}
2018-05-09 07:32:46 +00:00
Michael Achenbach
2b6fb352a6 Revert "Fix SourcePositionInfo for wasm"
This reverts commit e084eea628.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20UBSanVptr/builds/3163

Original change's description:
> Fix SourcePositionInfo for wasm
> 
> In wasm we often don't have a SharedFunctionInfo associated with a
> compilation job, so we can't get a Script. Just print "unknown" in
> these cases (instead of crashing).
> 
> R=​titzer@chromium.org
> CC=​​herhut@chromium.org
> 
> Bug: chromium:840757, v8:7738
> Change-Id: I850c6adfd9e07c9a0f6dd018f1a9314feb89d887
> Reviewed-on: https://chromium-review.googlesource.com/1049632
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53080}

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

Change-Id: Ib2020ea3f2b778df9fe50ccbe803938f2f4fd709
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:840757, v8:7738
Reviewed-on: https://chromium-review.googlesource.com/1051265
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53082}
2018-05-09 07:11:03 +00:00
Clemens Hammacher
e084eea628 Fix SourcePositionInfo for wasm
In wasm we often don't have a SharedFunctionInfo associated with a
compilation job, so we can't get a Script. Just print "unknown" in
these cases (instead of crashing).

R=titzer@chromium.org
CC=​herhut@chromium.org

Bug: chromium:840757, v8:7738
Change-Id: I850c6adfd9e07c9a0f6dd018f1a9314feb89d887
Reviewed-on: https://chromium-review.googlesource.com/1049632
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53080}
2018-05-08 18:23:04 +00:00
Eric Holk
4d4a3294b9 [test] Reverse sense of wasm_traps variant
D8 enables the Wasm trap handler by default now, but we need to make sure the
older bounds check case still gets test coverage too, as bounds checks will
continue to be a supported configuration.

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I5b0bdded6929a9b3a8480e87d038398b8d2a0fd8
Reviewed-on: https://chromium-review.googlesource.com/1048835
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53078}
2018-05-08 17:49:14 +00:00
Alexey Kozyatinskiy
4c5926d593 [debug] handle termination after break
If termination was requested on pause we should handle it properly as
soon as execution resumed.

R=yangguo@chromium.org

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ica50500094138097f115545db716264126fbe59e
Reviewed-on: https://chromium-review.googlesource.com/1049486
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53074}
2018-05-08 14:25:41 +00:00
Simon Zünd
369b447695 [array] Remove ShadowPrototypeElements post-processing from sort.
To stay compatible with JSC, Array.p.sort did a post-processing step
that shadowed elements from the prototype chain.

Some time ago, JSC changed and no longer exhibits this behavior. To
preserve comptibility and stay consistent with RemoveArrayHoles,
this CL removes this post-processing step altogether and adjusts
tests to expect the new behavior.

R=cbruni@chromium.org, jgruber@chromium.org

Bug: v8:7382
Change-Id: Iecedc37cea25001d3768b99a3a9de3a2db90ba82
Reviewed-on: https://chromium-review.googlesource.com/1047286
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@{#53066}
2018-05-08 12:30:12 +00:00