Commit Graph

34861 Commits

Author SHA1 Message Date
Ulan Degenbaev
41daf8a579 Revert "Start migration of try/throw/catch to match proposal."
This reverts commit 470a10015d.

Reason for revert: GC stress bot failures.
https://uberchromegw.corp.google.com/i/client.v8/builders/V8%20Mac%20GC%20Stress/builds/14522


Original change's description:
> Start migration of try/throw/catch to match proposal.
> 
> This CL does the first baby steps on moving the current (experimental)
> exception handling to match that of the WebAssembly proposal.
> 
> It does the following:
> 
> 1) Use exception tags instead of integers.
> 
> 2) Only handle empty exception signatures (i.e. no values associated
>    with the exception tag.
> 
> 3) Only handle one catch clause.
> 
> 4) Be sure to rethrow the exception if the exception tag does not match.
> 
> Note: There are many things that need to be fixed, and are too
> numerous to list here. However, the code should have TODO's on each
> missing parts of the implementation.
> 
> Also note that the code currently doesn't handle nested catch blocks,
> nor does it change the throw value being an integer. Rather, the
> integer value is still being thrown, and currently is the exception
> tag. Therefore, we don't build an exception object. This is the reason
> why this CL doesn't handle exceptions that pass values.
> 
> Also, the current implementation still can't handle multiple modules
> because tag resolution (between) modules has not be implemented yet.
> 
> Bug: v8:6577
> Change-Id: Id6d08b641b3c42d1eec7d4db582f2dab35406114
> Reviewed-on: https://chromium-review.googlesource.com/591910
> Reviewed-by: Brad Nelson <bradnelson@chromium.org>
> Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47087}

TBR=bradnelson@chromium.org,eholk@chromium.org,kschimpf@chromium.org

Change-Id: I01dc8c40cc1057333a988c1d275ce5f457b0cb64
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6577
Reviewed-on: https://chromium-review.googlesource.com/598847
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47090}
2017-08-02 19:19:20 +00:00
Michael Lippautz
652654291c [heap] MC marking: Refactor roots visitation
Use separate visitors for roots visitation:
- A general RootVisitor for all regular roots
- An ObjectVisitor that is able to process contents of the string table
  and code hanging of the top optimized frame

Bug: chromium:750084
Change-Id: I21aaa18760dede8a9419de2890a47c6dcf7efa3b
Reviewed-on: https://chromium-review.googlesource.com/598239
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47089}
2017-08-02 18:10:22 +00:00
Deepti Gandluri
201bcba2c2 [wasm] Memory.grow(0) should return a new ArrayBuffer when the buffer is empty
R=ahaas@chromium.org

BUG=v8:6546

Change-Id: I2808b78cd047d875d4530c86cc079488a78e5ea1
Reviewed-on: https://chromium-review.googlesource.com/557355
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47088}
2017-08-02 18:02:22 +00:00
Karl Schimpf
470a10015d Start migration of try/throw/catch to match proposal.
This CL does the first baby steps on moving the current (experimental)
exception handling to match that of the WebAssembly proposal.

It does the following:

1) Use exception tags instead of integers.

2) Only handle empty exception signatures (i.e. no values associated
   with the exception tag.

3) Only handle one catch clause.

4) Be sure to rethrow the exception if the exception tag does not match.

Note: There are many things that need to be fixed, and are too
numerous to list here. However, the code should have TODO's on each
missing parts of the implementation.

Also note that the code currently doesn't handle nested catch blocks,
nor does it change the throw value being an integer. Rather, the
integer value is still being thrown, and currently is the exception
tag. Therefore, we don't build an exception object. This is the reason
why this CL doesn't handle exceptions that pass values.

Also, the current implementation still can't handle multiple modules
because tag resolution (between) modules has not be implemented yet.

Bug: v8:6577
Change-Id: Id6d08b641b3c42d1eec7d4db582f2dab35406114
Reviewed-on: https://chromium-review.googlesource.com/591910
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47087}
2017-08-02 17:38:42 +00:00
Ulan Degenbaev
35c923cc10 [heap] Add support for atomic access to page flags.
This patch renames AsAtomicWord to AsAtomicPointer and
adds new AsAtomicWord that works with intptr_t.

Slot recording uses atomic page flag accessors.

BUG=chromium:694255

Change-Id: I1c692813244b41320182e9eea50462d1802fcd98
Reviewed-on: https://chromium-review.googlesource.com/597688
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47086}
2017-08-02 17:13:01 +00:00
Michael Lippautz
bca8409a39 Make CancelableTask ids unique
They were only limited to 32 bit when using the internal Hashmap. Since
this has changed alreay some time ago, we can switch to 64 bit ids and
check that we never overflow.

Bug: 
Change-Id: Ia6c6d02d6b5e555c6941185a79427dc4aa2a1d62
Reviewed-on: https://chromium-review.googlesource.com/598229
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47085}
2017-08-02 16:10:42 +00:00
Ulan Degenbaev
b9acf4eded Revert "Reland^2 "[heap] Add mechanism for tracking invalidated slots per memory chunk.""
This reverts commit 0a9d515095.

Reason for revert: another gc-stress failure

Original change's description:
> Reland^2 "[heap] Add mechanism for tracking invalidated slots per memory chunk."
> 
> This reverts commit 6fde541d4c.
> 
> Bug: chromium:694255
> Change-Id: I4670d0de3d2749afbb3bdb8dc5418822a885330c
> Reviewed-on: https://chromium-review.googlesource.com/597850
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47083}

TBR=ulan@chromium.org,mlippautz@chromium.org

Change-Id: Iaabf4586e0297dccb1ab4ef180b6f1eea173273b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:694255
Reviewed-on: https://chromium-review.googlesource.com/598094
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47084}
2017-08-02 15:12:24 +00:00
Ulan Degenbaev
0a9d515095 Reland^2 "[heap] Add mechanism for tracking invalidated slots per memory chunk."
This reverts commit 6fde541d4c.

Bug: chromium:694255
Change-Id: I4670d0de3d2749afbb3bdb8dc5418822a885330c
Reviewed-on: https://chromium-review.googlesource.com/597850
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47083}
2017-08-02 14:29:31 +00:00
Yang Guo
c924a942e9 [snapshot] initialize padding space.
This is to ensure the snapshot is deterministic.


R=mstarzinger@chromium.org

Bug: v8:4886, v8:3645
Change-Id: I79c8e54ba6b4810f005bc1ece61890790c815cea
Reviewed-on: https://chromium-review.googlesource.com/595740
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47082}
2017-08-02 13:36:11 +00:00
jgruber
062bb7d487 [regexp] Limit ATOM regexps to single-character patterns
There's an inherent trade-off when deciding between ATOM and IRREGEXP
regexps: IRREGEXP is faster at runtime for all but trivial single-character
patterns, while ATOM regexps have a lower memory overhead.

This CL is intended to help investigate impact on benchmarks and real-world
code - if something tanks, it's easy to revert, otherwise it can be a first
step towards a possible removal of ATOM regexps.

Bug: v8:6633
Change-Id: Ia41d8eb28d33952735562d3d4127202746a6ac4e
Reviewed-on: https://chromium-review.googlesource.com/589435
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47081}
2017-08-02 12:25:23 +00:00
Leszek Swirski
069c2ac2a1 [sfi] Move bailout reason into compiler hints
By representing "optimization disabled" with a kNoReason bailout reason,
we have enough spare bits to merge the bailout reason field into
compiler hints. This decreases SFI size by one word.

Change-Id: I0169c91dfbfa443128b060a83e483717ed31a166
Reviewed-on: https://chromium-review.googlesource.com/595980
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47080}
2017-08-02 12:21:30 +00:00
jgruber
7ac416caf7 [coverage] Ensure that closing braces of functions are never uncovered
Consider:

function f() {
  return;
}

This CL ensures that the closing brace is considered as covered by
introducing a special case for open-ended range rewrites when the
parent range is the function range itself.

Bug: v8:6000, v8:6661
Change-Id: I0be307759967e9f4df245a4f367326a37dda86fd
Reviewed-on: https://chromium-review.googlesource.com/597651
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47079}
2017-08-02 12:03:39 +00:00
Ulan Degenbaev
6fde541d4c Revert "Reland "[heap] Add mechanism for tracking invalidated slots per memory chunk.""
This reverts commit d4a742fdf1.

Reason for revert: gc-stress failures

Original change's description:
> Reland "[heap] Add mechanism for tracking invalidated slots per memory chunk."
> 
> This reverts commit c59b81d7b8.
> 
> Original change's description:
> > [heap] Add mechanism for tracking invalidated slots per memory chunk.
> 
> > For correct slots recording in concurrent marker, we need to resolve
> > the race that happens when
> > 1) the mutator is invalidating slots for double unboxing or string
> > conversions
> > 2) and the concurrent marker is recording these slots.
> 
> > This patch adds a data-structure for tracking the invalidated objects.
> > Thus we can allow the concurrent marker to record slots without
> > worrying about clearing them. During old-to-old pointer updating phase
> > we re-check all slots that belong to the invalidated objects.
> 
> BUG=chromium:694255
> 
> Change-Id: Idf8927d162377a7bbdff34f81a87e52db27d6a9f
> Reviewed-on: https://chromium-review.googlesource.com/596868
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47068}

TBR=ulan@chromium.org,mlippautz@chromium.org

Change-Id: I81c6059a092cc5834acd799c51fd30dc0ecf5b27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:694255
Reviewed-on: https://chromium-review.googlesource.com/597787
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47078}
2017-08-02 11:38:20 +00:00
Leszek Swirski
33cac84c73 [objects] Remove unused bailout reasons
Some bailout reasons are never referenced. Removing these allows us to
decrease the size of bailout reason bit-fields to 7 bits.

Change-Id: Ib5e884d224c12313e06493ed05a18a22b3951665
Reviewed-on: https://chromium-review.googlesource.com/596128
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47077}
2017-08-02 11:28:18 +00:00
Benedikt Meurer
71012480b7 [runtime] Properly forward the "interesting symbol" bit.
This fixes a corner case of rewriting the transition trees, where the
"interesting symbols" bit was not properly forwarded.

Drive-by-fix: Introduce additional checking in Map::ConnectTransition to
make it easier for clusterfuzz to detect cases we might have missed.

R=mstarzinger@chromium.org

Bug: chromium:751109
Change-Id: I3f1a1e6232db9b3694064b3d4e9f37255b018acc
Reviewed-on: https://chromium-review.googlesource.com/597669
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47075}
2017-08-02 11:08:38 +00:00
Alexandre Talon
47a15c6293 [Turbofan] New DCHECK to ensure no use is mutated when iterating through them
This CL adds a DCHECK to make the uses() function safer: we store what
the next pointer should be to comparing with the next use (from the 
current element in the linked list). This helps detect code which 
invalidates the use-list iterator, which would otherwise cause 
hard-to-debug errors.

Bug: 
Change-Id: I3875361809ffd55fb8be2cbb15af3250e3fd4c12
Reviewed-on: https://chromium-review.googlesource.com/596030
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Alexandre Talon <alexandret@google.com>
Cr-Commit-Position: refs/heads/master@{#47074}
2017-08-02 10:38:07 +00:00
Ilija Pavlovic
d721a9d406 MIPS[64]: Delete unused code from macro assembler
Port for https://chromium-review.googlesource.com/c/571011/

In macro-assembler-mips64.*, function StubPrologue is left
intentionally. (See: https://codereview.chromium.org/2467513002)

TEST=
BUG=

Change-Id: I95de571c636cce88fc2c40e5d8c60162004634a6
Reviewed-on: https://chromium-review.googlesource.com/591127
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Cr-Commit-Position: refs/heads/master@{#47073}
2017-08-02 09:58:18 +00:00
Julien Brianceau
b41f857b9e Fix common misspellings
Bug: chromium:750830
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Icab7b5a1c469d5e77d04df8bfca8319784e92af4
Reviewed-on: https://chromium-review.googlesource.com/595655
Commit-Queue: Julien Brianceau <jbriance@cisco.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47072}
2017-08-02 09:35:28 +00:00
Georg Neis
31173f92e5 [modules] Make Evaluate deal with errored dependencies.
Apparently it can happen that Blink calls Evaluate on a module that has
errored dependencies.

R=adamk@chromium.org

Bug: v8:1569, chromium:750024
Change-Id: I44b6dde2d5fe5ca25ca2b8c44ede2683d1be944d
Reviewed-on: https://chromium-review.googlesource.com/596055
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47071}
2017-08-02 09:26:08 +00:00
Ulan Degenbaev
d4a742fdf1 Reland "[heap] Add mechanism for tracking invalidated slots per memory chunk."
This reverts commit c59b81d7b8.

Original change's description:
> [heap] Add mechanism for tracking invalidated slots per memory chunk.

> For correct slots recording in concurrent marker, we need to resolve
> the race that happens when
> 1) the mutator is invalidating slots for double unboxing or string
> conversions
> 2) and the concurrent marker is recording these slots.

> This patch adds a data-structure for tracking the invalidated objects.
> Thus we can allow the concurrent marker to record slots without
> worrying about clearing them. During old-to-old pointer updating phase
> we re-check all slots that belong to the invalidated objects.

BUG=chromium:694255

Change-Id: Idf8927d162377a7bbdff34f81a87e52db27d6a9f
Reviewed-on: https://chromium-review.googlesource.com/596868
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47068}
2017-08-02 08:46:56 +00:00
Michael Starzinger
54bee830dd [deoptimizer] Support materialization in frame summary.
This adds support to materialize objects when generating a frame summary
for an optimized frame via {OptimizedFrame::Summarize}. Note that this
means each summary might re-materialize objects and hence produce new
object identities every time. All use sites need to be able to cope with
such semantics.

R=jarin@chromium.org
BUG=v8:6586

Change-Id: I85c66ad3e7d247cd40f37a0a6e4391c0ee279706
Reviewed-on: https://chromium-review.googlesource.com/595745
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47067}
2017-08-02 08:44:25 +00:00
Juliana Franco
895c321948 Replacing pc with trampoline on stack (gc-stress fix)
Replacing pc with trampoline on stack
 
This CL is the follow up of https://chromium-review.googlesource.com/c/586707/
which used to crash when running the gc-stress bots. 
It seems to be working now. We now keep the trampoline PC in the Safepoint 
table and use that information to find SafepointEntries.

There's some refactoring that can be done, such as changing the code for 
exceptions in a similar way and removing the trampoline from the 
DeoptimizationInputData. Will take care of this in the next CL.
 

Bug: v8:6563
Change-Id: I8c0a2489de19e6d5fb4ebf1de7da1933726265b4
Reviewed-on: https://chromium-review.googlesource.com/596027
Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47066}
2017-08-02 08:28:15 +00:00
Ulan Degenbaev
a5230d81d1 [heap] Set initial semi-space size to 512K.
This is a partial reland of "Allow a minimum semi-space size of 512K."
with a heuristic to keep 1MB initial semi-space size for high
memory devices.

Original commit message:
> [heap] Allow a minimum semi-space size of 512K.
> This CL also reduces the minimum semi-space size to 512K.
> BUG=chromium:716032

BUG=chromium:735649,chromium:716032

Change-Id: I5ec851f2380c40dbc34b4576a668f63ae38ac898
Reviewed-on: https://chromium-review.googlesource.com/594387
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47065}
2017-08-02 07:56:10 +00:00
Yang Guo
266be35b3b Support circular references between generated builtins.
Until now, when generating a builtin, it can only embed builtins
(as call targets) that have already been generated. This is either
achieved by reordering the builtins list, or by loading the call
target at runtime from the builtins list (see
MacroAssembler::TailCallBuiltin).

This patch works around this issue by filling the builtins list
with dummy code objects, which are later replaced with the completed
actual builtins. In release mode, this adds around 3ms to 140ms we
previously needed to populate the builtins list. 

Change-Id: I7d451b3c09a1db4b9e755548102a80c7f0dfada2
Reviewed-on: https://chromium-review.googlesource.com/586531
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47062}
2017-08-02 05:47:40 +00:00
Jaroslav Sevcik
b4b32df0b4 Remove the unused hydrogen_track_positions flag.
Change-Id: Ife88feb55f12c592b1c3b4435cd584333953ef6b
Reviewed-on: https://chromium-review.googlesource.com/593619
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47061}
2017-08-02 03:41:30 +00:00
Alexey Kozyatinskiy
f19b889be8 [inspector] support for cases when embedder doesn't call contextDestroyed
Node.js doesn't have good place to call contextDestroyed.
We need to cleanup everything on our side to allow clients to not call
contextDestroyed method.

R=dgozman@chromium.org,eostroukhov@chromium.com

Bug: none
Change-Id: Ibe3f01fd18afbfa579e5db66ab6f174d5fad7c82
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/575519
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#46849}
Reviewed-on: https://chromium-review.googlesource.com/596549
Cr-Commit-Position: refs/heads/master@{#47060}
2017-08-01 23:06:20 +00:00
Annie Sullivan
25f03308a7 Revert "[wasm] redirect wasm calls to js functions through a GCed table"
This reverts commit eb65f35e96.

Reason for revert: Broke jetstream benchmark on android.

BUG=chromium:750828

Original change's description:
> [wasm] redirect wasm calls to js functions through a GCed table
> 
> With this patch, rather than embedding the JSReceiver address directly
> in the WasmToJS wrappers, we put that in a fixed array with global handle
> scope and instead embed the location of the handle and the index in the
> wrapper. This ensures that the wrapper doesn't need to be patched if the
> GC kicks in. This is needed to get the WASM code off the GCed heap.
> 
> R=​mtrofin@chromium.org
> 
> Bug: 
> Change-Id: Ie5a77a78cdecec51b04f702c63b8e4285e6a2d8d
> Reviewed-on: https://chromium-review.googlesource.com/581682
> Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
> Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46884}

TBR=mtrofin@chromium.org,aseemgarg@google.com,aseemgarg@chromium.org,clemensh@chromium.org

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

Change-Id: I26f49ee0a1fe73cc5d8852ded87b56638be39ebf
Reviewed-on: https://chromium-review.googlesource.com/596268
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47059}
2017-08-01 21:34:25 +00:00
Caitlin Potter
ac6ed35a31 Reland "[async-iteration] implement spec-change to yield in async generators"
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:

AsyncGeneratorResolve no longer unwraps a value component. Instead, the value is
unwrapped before the builtin call via Await, allowing Promise rejections to
affect the generator control flow.

Thus, all `yield <expr>` implicitly become `yield await <expr>`.

Additionally, `return <expr>` becomes `return await <expr>`. Finally, when the
generator is resumed with `.return()`, the parameter passed to .return() is
awaited before generator execution properly continues).

BUG=v8:6187, v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org
TBR=rmcilroy@chromium.org, neis@chromium.org

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Id7718028fd555481f9f4ca0dbecfa788e3057c48
Reviewed-on: https://chromium-review.googlesource.com/594500
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#47058}
2017-08-01 18:39:26 +00:00
Ulan Degenbaev
638343afd2 [heap] Revert remaining parts of 5337b9
BUG=chromium:694255
TBR=ulan@chromium.org,mlippautz@chromium.org

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I832014d423335514cf1564984832b7a4e2c104ad
Reviewed-on: https://chromium-review.googlesource.com/595984
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47057}
2017-08-01 18:38:20 +00:00
Junliang Yan
04ac652862 s390: Fix lay overflow when too many arguments on stack
R=bjaideep@ca.ibm.com, joransiu@ca.ibm.com

Bug: 
Change-Id: Ia9fa7785b0f508775f38547e56f07bc7ef9ee03d
Reviewed-on: https://chromium-review.googlesource.com/557928
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#47055}
2017-08-01 18:23:48 +00:00
Jaideep Bajwa
788d828948 PPC/s390: MIPS[64] Fix SizeOfInitialHeap test failing
Port 316254a710

Original Commit Message:

    Commit 0d833cb94f deleted function call
    that created CEntryStub code in snapshot. So when CEntryStub::GetCode is
    called while initializing V8, the code for it, is not found in shapshot.
    Hence this code has to be generated in new allocation on heap, that is
    why initial heap is above the limit.
    This patch assures that CEntryStub code is in the snapshot.

R=predrag.rudic@imgtec.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I976dacf885e0d4ce8c5446a2c560a00cc0792150
Reviewed-on: https://chromium-review.googlesource.com/596071
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#47054}
2017-08-01 18:15:55 +00:00
Ulan Degenbaev
2614b26b44 [heap] Disable compaction for concurrent marking.
7a5a777 is going to be reverted and compaction depends on it.

BUG=chromium:694255
TBR=ulan@chromium.org,mlippautz@chromium.org

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I975ea597860dd63e543b69bdc787c6667b015567
Reviewed-on: https://chromium-review.googlesource.com/595993
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47053}
2017-08-01 18:14:50 +00:00
Ulan Degenbaev
c59b81d7b8 Revert "[heap] Add mechanism for tracking invalidated slots per memory chunk."
This reverts commit 7a5a777c97.

Reason for revert: crashing in test-api

Original change's description:
> [heap] Add mechanism for tracking invalidated slots per memory chunk.
> 
> For correct slots recording in concurrent marker, we need to resolve
> the race that happens when
> 1) the mutator is invalidating slots for double unboxing or string
> conversions
> 2) and the concurrent marker is recording these slots.
> 
> This patch adds a data-structure for tracking the invalidated objects.
> Thus we can allow the concurrent marker to record slots without
> worrying about clearing them. During old-to-old pointer updating phase
> we re-check all slots that belong to the invalidated objects.
> 
> BUG=chromium:694255
> 
> Change-Id: Ifc3d82918cd3b96e5a5fb7125691626a56f4ab83
> Reviewed-on: https://chromium-review.googlesource.com/591810
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47049}

TBR=ulan@chromium.org,mlippautz@chromium.org

Change-Id: I7f4f8e8cb027b921a82e9c0a0623536af02581fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:694255
Reviewed-on: https://chromium-review.googlesource.com/595994
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47052}
2017-08-01 18:13:41 +00:00
Ulan Degenbaev
5337b905ce [heap] Record slots in concurrent marker and enable compaction.
BUG=chromium:694255

Change-Id: I25ac134ea2e6f9af13f18e2da819b6d368497646
Reviewed-on: https://chromium-review.googlesource.com/593009
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47051}
2017-08-01 17:30:04 +00:00
Ulan Degenbaev
7a5a777c97 [heap] Add mechanism for tracking invalidated slots per memory chunk.
For correct slots recording in concurrent marker, we need to resolve
the race that happens when
1) the mutator is invalidating slots for double unboxing or string
conversions
2) and the concurrent marker is recording these slots.

This patch adds a data-structure for tracking the invalidated objects.
Thus we can allow the concurrent marker to record slots without
worrying about clearing them. During old-to-old pointer updating phase
we re-check all slots that belong to the invalidated objects.

BUG=chromium:694255

Change-Id: Ifc3d82918cd3b96e5a5fb7125691626a56f4ab83
Reviewed-on: https://chromium-review.googlesource.com/591810
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47049}
2017-08-01 16:12:53 +00:00
Georg Neis
f7d41ebe2c [modules] Produce more debug output for --trace-module-status.
R=adamk@chromium.org

Bug: v8:1569
Change-Id: I3931418ef17a309789cbc5281a4542a20a1db94e
Reviewed-on: https://chromium-review.googlesource.com/596029
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47047}
2017-08-01 15:20:33 +00:00
Adam Klein
5ff10f2060 [ignition] Add a DCHECK that scopes are visited in nesting order
Also fix one apparently-harmless bug in the Parser where we failed
to Finalize an empty scope. Without this fix, the DCHECK fails
on any C-style for-loop with a lexical binding that hits the
fast path (this is well-covered by many existing tests in mjsunit).

Thanks to Georg Neis for the suggestion of this DCHECK.

Change-Id: Ie1a8f8809f4d152c87f2da08209c610514645827
Reviewed-on: https://chromium-review.googlesource.com/587750
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47046}
2017-08-01 14:43:26 +00:00
Bill Budge
e11332f34b [ARM simulator] Fix vrev for Neon64-Neon16.
Bug: v8:750454
Change-Id: Ia270d2ede546bdc0b8a61b944dada59905a5c862
Reviewed-on: https://chromium-review.googlesource.com/594490
Reviewed-by: Martyn Capewell <martyn.capewell@arm.com>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47045}
2017-08-01 14:36:32 +00:00
Ben L. Titzer
b488e73a02 Move RegList and related out of frame.h and arch-specific files.
Register configuration data is not the same as frame configuration data.
This CL moves the last remnants of register configuration into
the assembler files, to be with the other register configuration
macros.

Next step: extract this register configuration data into
platform-specific files that can be included independent of the
assembler.

R=mstarzinger@chromium.org

Bug: 
Change-Id: I10933b5090be94e90e2a1442197528dfe30bb566
Reviewed-on: https://chromium-review.googlesource.com/595590
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47044}
2017-08-01 14:32:57 +00:00
Michael Lippautz
481c170505 [RCS] Reuse GCTracer scopes in RCS
This makes all the information that is present for GCTracer also
available to RCS.

Bug: chromium:748569
Change-Id: Ie7e8c3770b81ab1321cad08f6954492b72ef0514
Reviewed-on: https://chromium-review.googlesource.com/585427
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47043}
2017-08-01 14:23:22 +00:00
Ulan Degenbaev
d624daacc6 [heap] Remove special handling of map space in old-to-old pointer update.
Now that the layout descriptor is pretenured, we don't need atomic
accessor for the map space.

BUG=chromium:694255

Change-Id: I0ced8c04eaa61eec0f6a7b518ecba6413a691501
Reviewed-on: https://chromium-review.googlesource.com/595742
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47042}
2017-08-01 13:43:36 +00:00
Leszek Swirski
77cd84169b [heap] Remove IC age
Remove the concept of IC age from the heap and SFI, since it no
longer does anything useful.

Change-Id: I4ce466efc77c007c09c0889bae09ec6a0c907e33
Reviewed-on: https://chromium-review.googlesource.com/593623
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47041}
2017-08-01 13:25:30 +00:00
Michael Starzinger
2bdf6ac554 [deoptimizer] Removed unused argument from {TranslatedState}.
R=jarin@chromium.org
BUG=v8:6586

Change-Id: I1eedfe8d3d420fe88df5321cc855cfd6266d7c6e
Reviewed-on: https://chromium-review.googlesource.com/595653
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47040}
2017-08-01 13:05:53 +00:00
Yang Guo
809c3d455b Remove cell visiting in object visitor.
Change-Id: Ida5c537fa94a376a134e60edce889b96b676a8f9
Reviewed-on: https://chromium-review.googlesource.com/584874
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47039}
2017-08-01 12:39:12 +00:00
Michael Achenbach
3138850ed6 Revert "Replacing pc with trampoline on stack"
This reverts commit a01ac7cbd9.

Reason for revert: Causes flakes on gc stress:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/14218

Original change's description:
> Replacing pc with trampoline on stack
> 
> This CL is the follow up of https://chromium-review.googlesource.com/c/586707/
> which used to crash when running the gc-stress bots. 
> It seems to be working now. We now keep the trampoline PC in the Safepoint 
> table and use that information to find SafepointEntries.
> 
> There's some refactoring that can be done, such as changing the code for 
> exceptions in a similar way and removing the trampoline from the 
> DeoptimizationInputData. Will take care of this in the next CL.
> 
> Bug: v8:6563
> Change-Id: I02565297093620023a1155b55d76a4dafcb54794
> Reviewed-on: https://chromium-review.googlesource.com/593622
> Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47030}

TBR=jarin@chromium.org,bmeurer@chromium.org,jupvfranco@google.com

Change-Id: Ie9929c9acae321a91014b76b9008f8835313e67d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6563
Reviewed-on: https://chromium-review.googlesource.com/595927
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47038}
2017-08-01 12:15:45 +00:00
jgruber
fcaa2c2e57 Reland "[builtins] Remove Builtins::Name() accessors"
This is a reland of 2f79e03560
Original change's description:
> [builtins] Remove Builtins::Name() accessors
> 
> Instead of auto-generating the Name() convenience accessor, use a macro to
> avoid wasting code space.
> 
>   BUILTIN_CODE(isolate, Name)
> 
> expands to
> 
>   isolate->builtins()->builtin_handle(Builtins::kName);
> 
> This reduces the size of libv8.so by 134,752 bytes on a x64 release build.
> 
> Bug: v8:6624
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
> Reviewed-on: https://chromium-review.googlesource.com/593607
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47010}

TBR=bmeurer@chromium.org,ahaas@chromium.org

Bug: v8:6624
Change-Id: I4733731e56dc8873ee06c2b36cac1918c0a658b2
Reviewed-on: https://chromium-review.googlesource.com/594087
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47037}
2017-08-01 10:39:10 +00:00
Michael Lippautz
6e9e2e58cf [heap] Move SweeperTask to CancelableTask
This mitigates the problem of blocking on the main thread when the
platform is unable to execute background tasks in a timely manner.

Bug: v8:6655
Change-Id: Icdaae744ee73146b86b9a28c8035138746721971
Reviewed-on: https://chromium-review.googlesource.com/595467
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47036}
2017-08-01 10:38:01 +00:00
Michael Achenbach
828e0e3595 Revert "[turbofan] enable new implementation of escape analysis"
This reverts commit a6c3f14374.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/14478
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20gc%20stress/builds/11907

Original change's description:
> [turbofan] enable new implementation of escape analysis
> 
> Bug: 
> Change-Id: I0218ab67bf391deb8f1b1b78811643eb84745b7c
> Reviewed-on: https://chromium-review.googlesource.com/595508
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47032}

TBR=jarin@chromium.org,tebbi@chromium.org

Change-Id: Ib534a1c5e3b67e0585c63185065370a23ba954c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/595647
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47035}
2017-08-01 10:05:26 +00:00
Benedikt Meurer
31800120cc [builtins] Speed-up Object.prototype.toString.
The @@toStringTag lookup in Object.prototype.toString causes quite a
lot of overhead and oftentimes dominates the builtin performance. These
lookups are almost always negative, especially for primitive values,
and Object.prototype.toString is often used to implement predicates
(like in Node core or in AngularJS), so having a way to skip the
negative lookup yields big performance gains.

This CL introduces a "MayHaveInterestingSymbols" bit on every map,
which says whether instances with this map may have an interesting
symbol. Currently only @@toStringTag is considered an interesting
symbol, but we can extend that in the future.

In the Object.prototype.toString we can use the interesting symbols
bit to do a quick check on the prototype chain to see if there are
any maps that might have the @@toStringTag, and if not, we can just
immediately return the result, which is very fast because it's derived
from the instance type. This also avoids the ToObject conversions for
primitive values, which is important, since this causes unnecessary
GC traffic and in for example AngularJS, strings are also often probed
via the Object.prototype.toString based predicates.

This boosts Speedometer/AngularJS by over 3% and Speedometer overall
by up to 1%. On the microbenchmark from the similar SpiderMonkey bug
(https://bugzilla.mozilla.org/show_bug.cgi?id=1369042), we go from
roughly 450ms to 70ms, which corresponds to a 6.5x improvement.

```
function f() {
    var res = "";
    var a = [1, 2, 3];
    var toString = Object.prototype.toString;
    var t = new Date;
    for (var i = 0; i < 5000000; i++)
	res = toString.call(a);
    print(new Date - t);
    return res;
}
f();
```

The design document at https://goo.gl/e8CruQ has some additional
data points.

TBR=ulan@chromium.org

Bug: v8:6654
Change-Id: I31932cf41ecddad079d294e2c322a852af0ed244
Reviewed-on: https://chromium-review.googlesource.com/593620
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47034}
2017-08-01 09:30:44 +00:00
Andreas Haas
a4d914c904 [x64] Do not encode RelocatableInt32Constant(0) with xor
R=titzer@chromium.org

Bug: v8:6640
Change-Id: I08bed124f7c6f6607b28844ea91bee90c1c1ab22
Reviewed-on: https://chromium-review.googlesource.com/586603
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47033}
2017-08-01 09:27:24 +00:00
Tobias Tebbi
a6c3f14374 [turbofan] enable new implementation of escape analysis
Bug: 
Change-Id: I0218ab67bf391deb8f1b1b78811643eb84745b7c
Reviewed-on: https://chromium-review.googlesource.com/595508
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47032}
2017-08-01 08:54:23 +00:00
Clemens Hammacher
6a8432da4f Add DCHECKs for no pending exceptions
We were just debugging a trap triggered in the c entry stub, because
there was a pending exception even though the return value of the
runtime function was not {heap()->exception()}.
The DCHECKs added here help to catch this common error earlier.

R=mstarzinger@chromium.org
CC=ahaas@chromium.org

Also-by: ahaas@chromium.org
Change-Id: I3718dcb64a7924137c9f4bddff62776772d10386
Reviewed-on: https://chromium-review.googlesource.com/594447
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47031}
2017-08-01 08:28:32 +00:00
Juliana Franco
a01ac7cbd9 Replacing pc with trampoline on stack
This CL is the follow up of https://chromium-review.googlesource.com/c/586707/
which used to crash when running the gc-stress bots. 
It seems to be working now. We now keep the trampoline PC in the Safepoint 
table and use that information to find SafepointEntries.

There's some refactoring that can be done, such as changing the code for 
exceptions in a similar way and removing the trampoline from the 
DeoptimizationInputData. Will take care of this in the next CL.

Bug: v8:6563
Change-Id: I02565297093620023a1155b55d76a4dafcb54794
Reviewed-on: https://chromium-review.googlesource.com/593622
Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47030}
2017-08-01 08:08:33 +00:00
Predrag Rudic
316254a710 MIPS[64] Fix SizeOfInitialHeap test failing
Commit 0d833cb94f deleted function call
that created CEntryStub code in snapshot. So when CEntryStub::GetCode is
called while initializing V8, the code for it, is not found in shapshot.
Hence this code has to be generated in new allocation on heap, that is
why initial heap is above the limit.
This patch assures that CEntryStub code is in the snapshot.

Bug: 
Change-Id: Ifc885998e9253ab3e19e4e2409e4c124a5f1b0d1
Reviewed-on: https://chromium-review.googlesource.com/593950
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Cr-Commit-Position: refs/heads/master@{#47028}
2017-08-01 07:46:42 +00:00
Bill Budge
f8db3e8f38 Reland "[Memory] Add an OnCriticalMemoryPressure method to V8::Platform."
This is a reland of 3f90d9f994
Original change's description:
> [Memory] Add an OnCriticalMemoryPressure method to V8::Platform.
> 
> Adds virtual V8::Platform::OnCriticalMemoryPressure method, default
> implementation does nothing.
> 
> Calls this method on first allocation failures in NewArray, Malloced,
> and zone AccountingAllocator and adds retry logic.
> 
> Adds utility functions for allocating base::VirtualMemory to functions
> in allocation.h, which call this method and add retry logic.
> 
> Calls these utility functions in heap CodeRange, Spaces, StoreBuffer
> and SequentialMarkingDeque.
> 
> Bug: v8:6635
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: I38afd394f3be556aca037d16675e9884658158cb
> Reviewed-on: https://chromium-review.googlesource.com/583543
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46988}

Bug: v8:6635
Change-Id: I0d70c5796f407f0ed42cfddf581d26f533f9bea8
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/593090
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47027}
2017-08-01 01:42:19 +00:00
Deepti Gandluri
03da4fecb7 [wasm] Remove shared parameter to Memory.Grow()
R=mtrofin@chromium.org

Change-Id: Ia1e215d59e9ea863b85c64c2eab41f6cd6fe3404
Reviewed-on: https://chromium-review.googlesource.com/570842
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47026}
2017-08-01 01:26:21 +00:00
Sathya Gunasekaran
c805d5e317 [parser] Provide better error when destructuring callable
The patch changes CallPrinter's AST traversal to continue even after
the first positive match for an AST node. This helps us check for the
subsequent GetIterator AST node in case of destructuring.

We can not differentiate between the function call failing and the
GetIterator failing based on source position info. This would involve
runtime checks costing performance.

Instead of providing an incorrect error, we provide both the
possiblities to user and allow them to disambiguate.

Previously,
  d8> function f() { return 5; }
  undefined
  d8> var [a] = f();
  (d8):1: TypeError: f is not a function
  var [a] = f();
            ^
  TypeError: f is not a function
      at (d8):1:11


Now,
  d8> function f() { return 5; }
  undefined
  d8> var [a] = f();
  (d8):1: TypeError: f is not a function or its return value is not iterable
  var [a] = f();
            ^
  TypeError: f is not a function or its return value is not iterable
      at (d8):1:11

Bug: v8:6616, v8:6513
Change-Id: I3d6427f10cae54951b0ad0e5ddcbe802bb7191c1
Reviewed-on: https://chromium-review.googlesource.com/594894
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47025}
2017-08-01 01:19:08 +00:00
Mathias Bynens
473a6f5b03 Ship RegExp lookbehind assertions
Intent to ship:
https://groups.google.com/d/msg/v8-users/r-SN2yuKTL8/pfwrSuqSBQAJ

BUG=v8:4545

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I15a8a5af211a3af1d2f952b48923288adc09d93c
Reviewed-on: https://chromium-review.googlesource.com/592705
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47024}
2017-08-01 00:01:33 +00:00
Alexey Kozyatinskiy
f2fe13f663 [inspector] don't call clearAllBreakpoints
This call from inspector side is redundant, V8 will clear all breakpoints on removing debug delegate in v8::internal::Debug::Unload method.

In any case for correct support of multiclient we need to clear breakpoints in V8DebuggerAgentImpl::disable method.

R=dgozman@chromium.org

Bug: v8:5510,chromium:652939
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I66f9b97797860bad28884a099928d54ac3560428
Reviewed-on: https://chromium-review.googlesource.com/592281
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47022}
2017-07-31 21:23:27 +00:00
Alexey Kozyatinskiy
f455986fc1 [inspector] speedup Debugger.getPossibleBreakpoints
In current implementation we call PrepareForBreakPoints during getting possible breakpoints, this call produce GC and iteration through heap, but it's not needed before we set real breakpoint.

On my machine, get-possible-breakpoints-master.js without CL takes ~200ms, with CL it takes ~60 ms. Running test without getPossibleBreakpoints protocol call takes ~50 ms. It means that we have (200-50)/(60-50) = 15 times faster getPossibleBreakpoints.

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

Bug: none
Change-Id: If12e41cd87dbba11a89aa5895e3b4d88123d7d3d
Reviewed-on: https://chromium-review.googlesource.com/591027
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47021}
2017-07-31 21:00:57 +00:00
Ulan Degenbaev
6fbbe93c5e Revert "[heap, runtime] Fix data race in prototype map transition during"
This reverts commit d8846ffd5f.

Reason: the fix doesn't work, the proper fix is to not mutate the map.

BUG=chromium:694255
TBR=ishell@chromium.org

Change-Id: Iebef7cd01081145c172902727e0035a8745703b7
Reviewed-on: https://chromium-review.googlesource.com/594727
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47020}
2017-07-31 19:16:24 +00:00
Adam Klein
30a7d497c5 Rename parameter-initializer-rewriter.cc to match its current use
Change-Id: Idb6dfed1d0314c38c25b230faa7e28728cff2637
Reviewed-on: https://chromium-review.googlesource.com/587250
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47019}
2017-07-31 18:54:23 +00:00
Ross McIlroy
9dc664bbdd [Compile] Remove CompilationInfo::ExpectsJSReceiverAsReceiver.
Removes CompilationInfo::ExpectsJSReceiverAsReceiver and the associated
debug code in full-codegen which uses it. This avoids the need to check
language_mode from CompilationInfo and will enable decoupling of
ParseInfo and CompilationInfo in a followup CL.

BUG=v8:5203

Change-Id: Ib88252408e59ef321d16d5a1dd4b2b6cea609729
Reviewed-on: https://chromium-review.googlesource.com/593954
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47018}
2017-07-31 18:08:34 +00:00
Ulan Degenbaev
14e6a65afe [runtime] Use nullptr instead of NULL when calling WRITE_FIELD.
BUG=chromium:694255
TBR=cbruni@chromium.org

Change-Id: I8a7907aa18d2855ca571ae564c7eeda41bf13fbb
Reviewed-on: https://chromium-review.googlesource.com/593655
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47017}
2017-07-31 16:54:17 +00:00
Ulan Degenbaev
7486dc3331 [heap] Partially reland "Allow a minimum semi-space size of 512K."
This sets the minimum semi-space size to 512K, but does not
change the initial semi-space size.

This reverts commit 774a4c5e24.

Original commit message:
> [heap] Allow a minimum semi-space size of 512K.
> This CL also reduces the minimum semi-space size to 512K.
> BUG=chromium:716032
BUG=chromium:735649
TBR=mlippautz@chromium.org

Change-Id: I1f5dd05b0851ba2b438bedcc023a5cf5f9242a81
Reviewed-on: https://chromium-review.googlesource.com/594107
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47016}
2017-07-31 15:45:06 +00:00
Ross McIlroy
9a118af647 [Compile] Remove unused language mode from DeclareGlobalsFlag.
BUG=v8:5203

Change-Id: Id7f1b3a50f5f407e9fdada8a5b62a7ada8d966df
Reviewed-on: https://chromium-review.googlesource.com/593951
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47015}
2017-07-31 15:43:32 +00:00
Leszek Swirski
b34d2ec6a8 [objects] Move deopt_count to FeedbackVector
Since any deopt-count-based heuristics should be native context
dependent, it belongs in the feedback vector rather than the SFI.

Bug: v8:6402
Change-Id: I30804d58bc1dec9150558e6ee21ee5b4dbd36c8d
Reviewed-on: https://chromium-review.googlesource.com/593661
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47014}
2017-07-31 15:28:44 +00:00
Michael Achenbach
2d79d2c3a7 Revert "[async-iteration] implement spec-change to yield in async generators"
This reverts commit 409f84c93b.

Reason for revert: Breaks nosnap debug:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug/builds/14288

Original change's description:
> [async-iteration] implement spec-change to `yield` in async generators
> 
> Per https://github.com/tc39/proposal-async-iteration/pull/102/files:
> 
> AsyncGeneratorResolve no longer unwraps a value component. Instead, the
> value is unwrapped before the builtin call via Await, allowing Promise
> rejections to affect the generator control flow.
> 
> Thus, all `yield <expr>` implicitly become `yield await <expr>`.
> 
> Additionally, `return <expr>` becomes `return await <expr>`. Finally, when
> the generator is resumed with `.return()`, the parameter passed to .return()
> is awaited before generator execution properly continues).
> 
> BUG=v8:5855
> R=​littledan@chromium.org, neis@chromium.org, adamk@chromium.org
> 
> Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
> Change-Id: Ife084076c3ed434b5467e6aeba14082f8b410ad5
> Reviewed-on: https://chromium-review.googlesource.com/523844
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47011}

TBR=rmcilroy@chromium.org,adamk@chromium.org,yangguo@chromium.org,neis@chromium.org,littledan@chromium.org,gsathya@chromium.org,caitp@igalia.com

Change-Id: Ie6ad7e5410a3a89aab7a5dc68de36eb27b9354fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:5855
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/593952
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47013}
2017-07-31 15:23:56 +00:00
Jakob Gruber
17a26c0bc7 Revert "[builtins] Remove Builtins::Name() accessors"
This reverts commit 2f79e03560.

Reason for revert: Conflicts with successor CL.

Original change's description:
> [builtins] Remove Builtins::Name() accessors
> 
> Instead of auto-generating the Name() convenience accessor, use a macro to
> avoid wasting code space.
> 
>   BUILTIN_CODE(isolate, Name)
> 
> expands to
> 
>   isolate->builtins()->builtin_handle(Builtins::kName);
> 
> This reduces the size of libv8.so by 134,752 bytes on a x64 release build.
> 
> Bug: v8:6624
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
> Reviewed-on: https://chromium-review.googlesource.com/593607
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47010}

TBR=yangguo@chromium.org,ahaas@chromium.org,jgruber@chromium.org,bmeurer@chromium.org

Change-Id: Ia9ef5c755b26c3f4e143d87a7c51033614ea435e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6624
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/594048
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47012}
2017-07-31 14:38:21 +00:00
Caitlin Potter
409f84c93b [async-iteration] implement spec-change to yield in async generators
Per https://github.com/tc39/proposal-async-iteration/pull/102/files:

AsyncGeneratorResolve no longer unwraps a value component. Instead, the
value is unwrapped before the builtin call via Await, allowing Promise
rejections to affect the generator control flow.

Thus, all `yield <expr>` implicitly become `yield await <expr>`.

Additionally, `return <expr>` becomes `return await <expr>`. Finally, when
the generator is resumed with `.return()`, the parameter passed to .return()
is awaited before generator execution properly continues).

BUG=v8:5855
R=littledan@chromium.org, neis@chromium.org, adamk@chromium.org

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: Ife084076c3ed434b5467e6aeba14082f8b410ad5
Reviewed-on: https://chromium-review.googlesource.com/523844
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47011}
2017-07-31 14:15:49 +00:00
jgruber
2f79e03560 [builtins] Remove Builtins::Name() accessors
Instead of auto-generating the Name() convenience accessor, use a macro to
avoid wasting code space.

  BUILTIN_CODE(isolate, Name)

expands to

  isolate->builtins()->builtin_handle(Builtins::kName);

This reduces the size of libv8.so by 134,752 bytes on a x64 release build.

Bug: v8:6624
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
Reviewed-on: https://chromium-review.googlesource.com/593607
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47010}
2017-07-31 14:04:19 +00:00
Leszek Swirski
e47d175738 [sfi] Remove opt_count
Remove opt_count from SFI, which only had two real uses:

  1. Detecting OSR in tests -- replaced with a stack walk in
     %GetOptimizationStatus
  2. Naming optimization log files -- replaced with the
     optimization id

This allows us to remove a field from the SFI, moving the
bailout reason into the counters field.

As a drive-by, add optimization marker information (e.g.
marked for optimization) to the optimization status.

Change-Id: Id77deb5dd5439dfba058a7e1e1748de26b717d0d
Reviewed-on: https://chromium-review.googlesource.com/592028
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47009}
2017-07-31 13:18:49 +00:00
Clemens Hammacher
20d25f4036 Revert "[wasm] Allow for arbitrarily long error messages"
This reverts commit 072d0e3eb6.

Reason for revert: Performance regressions (https://crbug.com/749041).

Original change's description:
> [wasm] Allow for arbitrarily long error messages
> 
> We currently have a fixed limit of 256 characters for error messages
> generated in the decoder. However, we sometimes embed names in it,
> which makes it easy to generate a crash by using long names (e.g. for
> exports) in invalid wasm modules.
> This CL fixes this by switching to a stream based interface, allowing
> to pass arbitrary objects to be printed. With this interface, we can
> easily limit the length of output later.
> 
> R=​titzer@chromium.org
> 
> Bug: chromium:740023
> Change-Id: I2848c31c63a015157e2a3a9458b54e523060cd69
> Reviewed-on: https://chromium-review.googlesource.com/565282
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46860}

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

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

Bug: chromium:740023, chromium:749041
Change-Id: I005a60d55dcf01d350230f8d98f715bab9c43886
Reviewed-on: https://chromium-review.googlesource.com/593807
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47008}
2017-07-31 13:00:54 +00:00
Peter Marshall
1a087f027f [test] Crash on InvalidStringLength for correctness fuzzer.
Now that the maximum string length varies between platforms, the
correctness fuzzer is unhappy. It will ignore crashes, so when we know
we have reached platform-dependant behavior just crash if
--abort_on_stack_overflow is enabled.

Also rename abort_on_stack_overflow to
abort_on_stack_or_string_length_overflow.

Bug: chromium:748137
Change-Id: Ie4e96709b90029b5ce3c8408064d928f841b3b9f
Reviewed-on: https://chromium-review.googlesource.com/589269
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47007}
2017-07-31 12:59:50 +00:00
Ross McIlroy
3c31e109ea [Interpreter] Internalize AST before print-ast is triggered
Print AST needs access to the internalized strings, so make sure AST
is internalized before we print it.

BUG=v8:5203

Change-Id: Ia4995147feb7ec466523a0c4a89620749b23dcab
Reviewed-on: https://chromium-review.googlesource.com/593648
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47006}
2017-07-31 12:16:48 +00:00
Clemens Hammacher
3532528f90 Add missing include guards
R=ahaas@chromium.org

Change-Id: Ie46dce0e417ce528bbd81aa6ef87ca63a9fcc869
Reviewed-on: https://chromium-review.googlesource.com/593613
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47005}
2017-07-31 11:31:28 +00:00
jgruber
5c184bf8f4 Reland "[coverage] Ship block coverage"
This is a reland of 7bb6cd63ed
Original change's description:
> [coverage] Ship block coverage
> 
> Enables block coverage by default.
> 
> Design doc: http://goo.gl/hSJhXn
> Tracking bug: http://crbug.com/v8/6000
> 
> Bug: v8:6000
> Change-Id: I8c56474473b60e4707b75dc601b3e88455861a27
> Reviewed-on: https://chromium-review.googlesource.com/583093
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46898}

Bug: v8:6000
Change-Id: I033d89a35c23fcff083f83103df45e33f7962d67
Reviewed-on: https://chromium-review.googlesource.com/592968
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47003}
2017-07-31 11:01:02 +00:00
Michael Lippautz
3d2b211a0c [heap] Scavenger: Restructure main processing method
- Add scopes
- Rename scopes to fit hierarchy
- Scavenge weak collections before parallel phase
- Remove semi space phase which doesn't exist anymore

Bug: chromium:738865
Change-Id: Id3b72793e764f8d3597917e45185d08675b57f5d
Reviewed-on: https://chromium-review.googlesource.com/593611
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47002}
2017-07-31 10:58:22 +00:00
Tobias Tebbi
68fb62152a Reland2: [turbofan] staging new implementation of escape analysis
Reland of https://chromium-review.googlesource.com/c/591667/, removing thread-local variable

Bug: 
Change-Id: Ia9bc73be4a46a6bf052220726193c8b6634eb73e
Reviewed-on: https://chromium-review.googlesource.com/593559
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47001}
2017-07-31 10:01:07 +00:00
Leszek Swirski
488b3e61bd [compiler-dispatcher] Rename ShortPrint to ShortPrintOnMainThread
Also enforce that it is called on the main thread.

Change-Id: I827beefe625bebf6c03fce5220cfbbd68e807984
Reviewed-on: https://chromium-review.googlesource.com/591372
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47000}
2017-07-31 09:49:07 +00:00
Ulan Degenbaev
3f820ebb0b [heap, runtime] Avoid redundant clearing of slots outside an object.
When an object shrinks, we can keep the recorded slots until the sweeper
removes them. It is safe because the recorded slots will not be over-
written with untagged values.

BUG=chromium:694255

Change-Id: I2b910c6345a306e00c7a10396876001e663f51ea
Reviewed-on: https://chromium-review.googlesource.com/591650
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46999}
2017-07-31 09:42:27 +00:00
Ulan Degenbaev
ed76f17b15 [heap, runtime] Avoid redundant clearing of slots in a trimmed array.
The slots outside the trimmed array will be cleared by the sweeper and
will not be overwritten with an untagged value.

BUG=chromium:694255

Change-Id: I3e814b9934ca95a09e883e237687434e6bb58c80
Reviewed-on: https://chromium-review.googlesource.com/591651
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46998}
2017-07-31 09:41:18 +00:00
Ulan Degenbaev
c8c3f3cf75 [heap] Clear old-to-old recorded slots in the sweeper.
Currently we clear only old-to-new slots in the sweeper.
For old-to-old slots we maintain the invariant that there are no
recorded slots in dead objects by explicitly clearing them
on object size change and array trimming.

The write barrier for concurrent marking will record slots
even when the host object is white. Thus, it can introduce slots
in dead objects, which will break evacuation phase if we do not
clear them in the sweeper.

Besides that, the patch makes handling of slots more uniform and
allows us to remove clearing of slots on object size changes.

BUG=chromium:694255

Change-Id: I48f60eb25ddc48c6948be4461367e3f7abf74672
Reviewed-on: https://chromium-review.googlesource.com/592207
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46996}
2017-07-31 08:52:16 +00:00
Loo Rong Jie
1dfaec2647 Partial revert of "Remove ~MaybeHandle and statically assert that handles are trivially copyable"
Reason: cause Blink regression on Android

Original CL: https://chromium-review.googlesource.com/c/538463/

Bug: chromium:735910
Change-Id: I405e71f6ffeaf9fa467036a6fafa0271a60de9d3
Reviewed-on: https://chromium-review.googlesource.com/593247
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Loo Rong Jie <loorongjie@gmail.com>
Cr-Commit-Position: refs/heads/master@{#46995}
2017-07-31 08:46:37 +00:00
jgruber
d4c157ee65 [builtins] Extract isolate-independent metadata
Instead of generating huge switch statements for builtin accessor functions,
simply store isolate-independent metadata in a struct indexed by builtin-id.

Drive-by-fix: Remove duplicate parameter-count lookup accessor.
Drive-by-fix: Print builtin kind with --print-builtin-size.

Bug: v8:6624
Change-Id: Ibe61eeee6b8849d5e1a2361ec8268b233be8bb13
Reviewed-on: https://chromium-review.googlesource.com/591847
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46994}
2017-07-31 08:33:14 +00:00
Michael Lippautz
6432301fc3 [heap] Scavenger: Remove dead code
Bug: chromium:738865
Change-Id: Ia9544707d4117187746fc50a416370b3c08ab842
Reviewed-on: https://chromium-review.googlesource.com/593313
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46993}
2017-07-31 08:15:49 +00:00
Jakob Gruber
793053fd76 [coverage] Don't skip collection if invocation_count is zero
Function-granularity coverage skips functions that are both uncovered
and have an uncovered parent. This optimization needs to be tweaked once
block coverage and incremental collection is in play, as it is possible
to have a function with invocation_count == 0 (i.e. uncovered at
function granularity) that still has relevant block-granularity
coverage.

Bug: v8:6000
Change-Id: I4cc81b8a6935aa58e29d383ed4fa749cbfe69352
Reviewed-on: https://chromium-review.googlesource.com/589508
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46991}
2017-07-31 07:56:28 +00:00
Ulan Degenbaev
962de532f5 [heap] Fix data race in IncrementalMarking::NotifyLeftTrimming.
BUG=chromium:694255
TBR=mlippautz@chromium.org

Change-Id: I7dd9623ff85fcc49f034c71a6f5149f9488a9abb
Reviewed-on: https://chromium-review.googlesource.com/593010
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46990}
2017-07-29 13:34:35 +00:00
Georg Neis
53db05840e Revert "[Memory] Add an OnCriticalMemoryPressure method to V8::Platform."
This reverts commit 3f90d9f994.

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

Original change's description:
> [Memory] Add an OnCriticalMemoryPressure method to V8::Platform.
> 
> Adds virtual V8::Platform::OnCriticalMemoryPressure method, default
> implementation does nothing.
> 
> Calls this method on first allocation failures in NewArray, Malloced,
> and zone AccountingAllocator and adds retry logic.
> 
> Adds utility functions for allocating base::VirtualMemory to functions
> in allocation.h, which call this method and add retry logic.
> 
> Calls these utility functions in heap CodeRange, Spaces, StoreBuffer
> and SequentialMarkingDeque.
> 
> Bug: v8:6635
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: I38afd394f3be556aca037d16675e9884658158cb
> Reviewed-on: https://chromium-review.googlesource.com/583543
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46988}

TBR=bbudge@chromium.org,ulan@chromium.org,mlippautz@chromium.org

Change-Id: I79afea5982e62db1462cc5a5585a226f0ddbe752
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6635
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/592887
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46989}
2017-07-29 04:47:49 +00:00
Bill Budge
3f90d9f994 [Memory] Add an OnCriticalMemoryPressure method to V8::Platform.
Adds virtual V8::Platform::OnCriticalMemoryPressure method, default
implementation does nothing.

Calls this method on first allocation failures in NewArray, Malloced,
and zone AccountingAllocator and adds retry logic.

Adds utility functions for allocating base::VirtualMemory to functions
in allocation.h, which call this method and add retry logic.

Calls these utility functions in heap CodeRange, Spaces, StoreBuffer
and SequentialMarkingDeque.

Bug: v8:6635
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I38afd394f3be556aca037d16675e9884658158cb
Reviewed-on: https://chromium-review.googlesource.com/583543
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46988}
2017-07-29 02:49:44 +00:00
Bill Budge
f8d95d7266 [Turbofan] Fix 128 bit slot swaps on ia32.
- Use a sequence of push/pop instructions to move 128 bit values.
- Generalize HighOperand method to handle other offsets.

Bug: v8:6020
Change-Id: I21467c2f19637b0e6b86a3060952386dd0c5d77a
Reviewed-on: https://chromium-review.googlesource.com/583627
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46987}
2017-07-29 00:55:25 +00:00
Brad Nelson
7662e0634c Enable SharedArrayBuffer by default in standalone v8.
BUG=chromium:709179
R=binji@chromium.org,hablich@chromium.org

Change-Id: I2efb3becc1ca9fef84008c82cd882ef11e2aa3f2
Reviewed-on: https://chromium-review.googlesource.com/589768
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46986}
2017-07-28 22:40:25 +00:00
Alexey Kozyatinskiy
6b0bf1659e [inspector] move SetScriptSource call to native
To avoid using debugging context and debugger-script.js on inspector side we can move SetScriptSource call to v8::internal::Debug. Theoretically we can move live edit implementation to native completely but since it will be reimplemented it looks redundant.

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

Bug: chromium:652939
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Id09492c2d2a93efbde429c9cc1bc181d5fdda19b
Reviewed-on: https://chromium-review.googlesource.com/590736
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46985}
2017-07-28 21:55:05 +00:00
Alexei Filippov
920025f523 [heap-profiler] Remove unused methods from Heap Profiler.
Remove GetProfilerMemorySize from HeapProfiler API.
Remove HeapObjectsMap::FindUntrackedObjects

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I32a9a0676485c17c08c068a8ca501525b0d2670e
Reviewed-on: https://chromium-review.googlesource.com/590651
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46984}
2017-07-28 20:56:24 +00:00
Georg Neis
4a9718c777 [modules] Blame correct module for ambiguous exports.
The error got attached to the module asking for the conflicting name.
This was incorrect in the case where the asking was itself via a star
export. We must attach the error to the module that explicitly asks
for the problematic name via a named import or named export statement.

Test will be added to Chromium:
https://chromium-review.googlesource.com/c/590369/

R=adamk@chromium.org

Bug: v8:1569
Change-Id: Ib3c297c6c5654ed1b8f2c7b2d6525202c78f87cd
Reviewed-on: https://chromium-review.googlesource.com/591307
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46983}
2017-07-28 19:43:36 +00:00
Ulan Degenbaev
774a4c5e24 Revert "[heap] Reland "[heap] Allow a minimum semi-space size of 512K.""
This reverts commit 176a2b24fb.

Reason for revert: performance regression on the benchmarks.

Original change's description:
> [heap] Reland "[heap] Allow a minimum semi-space size of 512K."
> 
> This patch changes the semi-space size to 512K.
> 
> > Original commit message:
> > Revert "[heap] Allow a minimum semi-space size of 512K."
> > This reverts commit 0d2ed6c328.
> > The CL introduced perf regressions: crbug.com/735649.
> > We are going to reland the CL in an isolated V8 roll to ensure
> > that perf regressions are attributed correctly.
> 
> > Original commit message:
> > > [heap] Allow a minimum semi-space size of 512K.
> > > This CL also reduces the minimum semi-space size to 512K.
> > > BUG=chromium:716032
> > BUG=chromium:735649
> 
> Change-Id: Iabc377cba2911b28d51b98bb5b85134d4e893632
> Reviewed-on: https://chromium-review.googlesource.com/575066
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46763}

TBR=ulan@chromium.org,mlippautz@chromium.org

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

Change-Id: I80f8b6699f41e91512f7cec38060c829252ff95e
Reviewed-on: https://chromium-review.googlesource.com/591309
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46982}
2017-07-28 19:42:31 +00:00
Jakob Kummerow
e567dd3ab4 Refactor TransitionArray access
in preparation for caching StoreIC-Transition handlers in there.
This CL should not change behavior or performance.

The TransitionArray class no longer serves a dual purpose; it is now
simply the data structure serving that role. Further, it now supports
storing transitioning handlers in its "target" slot, which in turn have
a WeakCell pointing to the transition target (but this functionality
is not being used yet).

The interface for accessing a map's transitions, previously implemented
as a set of static functions, is now handled by the TransitionsAccessor
class. It distinguishes the following internal states:
- kPrototypeInfo: map is a prototype map, will never cache any transitions.
- kUninitialized: map can cache transitions, but doesn't have any.
- kWeakCell: map caches a single transition, stored inline. Formerly known
             as "IsSimpleTransition".
- kFullTransitionArray: map uses a TransitionArray to store transitions.
- kTuple3Handler, kFixedArrayHandler: to be used in the future for caching
                                      transitioning handlers.

Change-Id: If2aa68390981f96f317b958445a6e0b935c2a14e
Reviewed-on: https://chromium-review.googlesource.com/550118
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46981}
2017-07-28 19:41:21 +00:00
Tobias Tebbi
c87a3ddaf1 Revert "Reland: [turbofan] staging new implementation of escape analysis"
This reverts commit ccd8bb692b.

Reason for revert: https://build.chromium.org/p/client.v8.fyi/builders/Mac%20Release%20%28Intel%29/builds/2643

Original change's description:
> Reland: [turbofan] staging new implementation of escape analysis
> 
> Reland of https://chromium-review.googlesource.com/c/565720, fixing compilation issues on the waterfall.
> 
> Bug: 
> Change-Id: Ide4f1ea4470e946820edc990c9bf027f04844efe
> Reviewed-on: https://chromium-review.googlesource.com/591667
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46975}

TBR=jarin@chromium.org,tebbi@chromium.org

Change-Id: I30016fd8d71535c02bab8678b02147195c3e97a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/591672
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46980}
2017-07-28 19:16:17 +00:00
Adithya Srinivasan
59ddd6061c Change Accessor counters
Counters for some of the getters are renamed to remove the
AccessorNameGetterCallback_ prefix. The prefix causes these getters to
be categorized under Blink C++ (and they shouldn't be). Counters are
also added for some setters which are currently being counted under
GenericNamedPropertySetterCallback and AccessorNameSetterCallback which
are both categorized as Blink C++.

Bug: 
Change-Id: Ifc2c08d3eca0460ea6b5572c7a96b3625dd7d7ea
Reviewed-on: https://chromium-review.googlesource.com/587593
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46979}
2017-07-28 14:56:36 +00:00
Mircea Trofin
13532c0869 [wasm] Streaming API: own the promise.
Avoid leaking because the persistent handle isn't released. To further
clarify ownership, the v8 side owns now completely the promise.

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ief9e44e60235fe6199fc4884ad1ccbd9e34cce8a
Reviewed-on: https://chromium-review.googlesource.com/591067
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46978}
2017-07-28 14:51:16 +00:00
Mathias Bynens
8be73bad18 [printing] Print feedback vectors
This patch makes `%DebugPrint(fn)` print `fn`’s feedback vector when
available.

Example output:

```
d8> fn = (x) => x + '.'; fn(''); %DebugPrint(fn)
DebugPrint: 0x1c12b950df81: [Function]
 - map = 0x1c12b1802361 [FastProperties]
 - prototype = 0x1c12ec904591
 - elements = 0x1c12f5702241 <FixedArray[0]> [HOLEY_ELEMENTS]
 - initial_map =
 - shared_info = 0x1c12ec92fde9 <SharedFunctionInfo fn>
 - name = 0x1c12ec92fcd1 <String[2]: fn>
 - formal_parameter_count = 1
 - kind = [ ArrowFunction ]
 - context = 0x1c12ec903cd1 <FixedArray[278]>
 - code = 0x220721125061 <Code BUILTIN>
 - interpreted
 - bytecode = 0x1c12ec930181
 - source code = (x) => x + '.'
 - properties = 0x1c12f5702241 <FixedArray[0]> {
    #length: 0x1c12e3095eb1 <AccessorInfo> (const accessor descriptor)
    #name: 0x1c12e3095f21 <AccessorInfo> (const accessor descriptor)
 }

 - feedback vector: 0x1c12ec9301f9: [FeedbackVector] in OldSpace
 - length: 1
 SharedFunctionInfo: 0x1c12ec92fde9 <SharedFunctionInfo fn>
 Optimized Code: 0
 Invocation Count: 1
 Profiler Ticks: 0
 Slot #0 BinaryOp MONOMORPHIC
  [0]: 8
0x1c12b1802361: [Map]
 - type: JS_FUNCTION_TYPE
 - instance size: 72
 - inobject properties: 0
 - elements kind: HOLEY_ELEMENTS
 - unused property fields: 0
 - enum length: invalid
 - callable
 - back pointer: 0x1c12f57022d1 <undefined>
 - instance descriptors (own) #2: 0x1c12ec9048e9 <FixedArray[8]>
 - layout descriptor: 0x0
 - prototype: 0x1c12ec904591 <JSFunction (sfi = 0x1c12f5707c91)>
 - constructor: 0x1c12f5702201 <null>
 - code cache: 0x1c12f5702241 <FixedArray[0]>
 - dependent code: 0x1c12f5702241 <FixedArray[0]>
 - construction counter: 0

(x) => x + '.'
```

Example output when feedback vector is not available:

```
d8> %DebugPrint(() => {})
DebugPrint: 0x1c12b950bf49: [Function]
 - map = 0x1c12b1802361 [FastProperties]
 - prototype = 0x1c12ec904591
 - elements = 0x1c12f5702241 <FixedArray[0]> [HOLEY_ELEMENTS]
 - initial_map =
 - shared_info = 0x1c12ec92c021 <SharedFunctionInfo>
 - name = 0x1c12f5702431 <String[0]: >
 - formal_parameter_count = 0
 - kind = [ ArrowFunction ]
 - context = 0x1c12ec903cd1 <FixedArray[278]>
 - code = 0x220721004861 <Code BUILTIN>
 - source code = () => {}
 - properties = 0x1c12f5702241 <FixedArray[0]> {
    #length: 0x1c12e3095eb1 <AccessorInfo> (const accessor descriptor)
    #name: 0x1c12e3095f21 <AccessorInfo> (const accessor descriptor)
 }

 - feedback vector: not available
0x1c12b1802361: [Map]
 - type: JS_FUNCTION_TYPE
 - instance size: 72
 - inobject properties: 0
 - elements kind: HOLEY_ELEMENTS
 - unused property fields: 0
 - enum length: invalid
 - callable
 - back pointer: 0x1c12f57022d1 <undefined>
 - instance descriptors (own) #2: 0x1c12ec9048e9 <FixedArray[8]>
 - layout descriptor: 0x0
 - prototype: 0x1c12ec904591 <JSFunction (sfi = 0x1c12f5707c91)>
 - constructor: 0x1c12f5702201 <null>
 - code cache: 0x1c12f5702241 <FixedArray[0]>
 - dependent code: 0x1c12f5702241 <FixedArray[0]>
 - construction counter: 0

() => {}
```

Change-Id: Ic80289bff652cfc8d04182c68740843c61c87849
Reviewed-on: https://chromium-review.googlesource.com/591369
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46977}
2017-07-28 14:39:36 +00:00
Jaroslav Sevcik
4229ca207e [profiler] Fix logging addresses on Windows.
Change-Id: Iff0dcec95d04b85d31a452fed31b1500ad17a9f0
Reviewed-on: https://chromium-review.googlesource.com/591373
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46976}
2017-07-28 14:36:14 +00:00
Tobias Tebbi
ccd8bb692b Reland: [turbofan] staging new implementation of escape analysis
Reland of https://chromium-review.googlesource.com/c/565720, fixing compilation issues on the waterfall.

Bug: 
Change-Id: Ide4f1ea4470e946820edc990c9bf027f04844efe
Reviewed-on: https://chromium-review.googlesource.com/591667
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46975}
2017-07-28 14:29:34 +00:00
Daniel Clifford
d0579a4beb [csa] Move common FixedArray initialization into AllocateUninitializedJSArrayWithElements
Change-Id: Ifb689a6d5bc5290c6612a92fa45aae6f5db2d81c
Reviewed-on: https://chromium-review.googlesource.com/589433
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46974}
2017-07-28 13:52:14 +00:00
Michael Lippautz
d9d059175e [heap] Decouple RootMarkingVisitor used for seeding items from Minor MC
This visitor can be reused by the full MC when seeding root items.

Bug: chromium:750084
Change-Id: I9d46ce55737961d8f72a34b06f3314c8f75f3b4d
Reviewed-on: https://chromium-review.googlesource.com/591451
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46972}
2017-07-28 13:35:24 +00:00
Michael Lippautz
ca33118d32 [heap] Fix smaller issues in MarkCompactMarkingVisitor
Bug: chromium:750084
Change-Id: I17560b2ab31ad494637a7498a089f4d2b7377907
Reviewed-on: https://chromium-review.googlesource.com/591450
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46971}
2017-07-28 13:30:52 +00:00
Michael Lippautz
52a9b5cb8f [heap] Scavenger: Remove left-over
Also remove the comment on LayoutDescriptor as we want to pretenure
those.

Bug: chromium:738865
Change-Id: I5bdf66d383b481edc3250623e155b97d1081a7cc
Reviewed-on: https://chromium-review.googlesource.com/590235
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46970}
2017-07-28 13:09:05 +00:00
Juliana Patricia Vicente Franco
a193fde97c Revert "Changing the return address on the stack."
This reverts commit e15f554427.

Reason for revert: it breaks the GC stress. 

Original change's description:
> Changing the return address on the stack.
> 
> Rather than patching code, the deoptimizer now replaces the
> return address in the frames with respective trampolines. 
> This change required to change the way we search for Safepoint 
> entries and for Exception Handlers. 
> It's working in architectures: x64, ia32, arm, arm64 and mips. 
> 
> Bug: V8:6563
> Change-Id: I3cbd4d192c3513f307b3a6a2ac99e60d03c753d3
> Reviewed-on: https://chromium-review.googlesource.com/586707
> Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46967}

TBR=jarin@chromium.org,bmeurer@chromium.org,jupvfranco@google.com

Change-Id: I430fa9123beef2e0723b38cdef9537181203f7e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: V8:6563
Reviewed-on: https://chromium-review.googlesource.com/591371
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46969}
2017-07-28 12:41:57 +00:00
Tobias Tebbi
8616be0c94 Revert "[turbofan] staging new implementation of escape analysis"
This reverts commit d230b44f0c.

Reason for revert: compile errors on the waterfall

Original change's description:
> [turbofan] staging new implementation of escape analysis
> 
> Bug: 
> Change-Id: Idebe4fa6d651a404a0dc1947ed4a34a8dc9707a9
> Reviewed-on: https://chromium-review.googlesource.com/565720
> Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46966}

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

Change-Id: I73c3cb270d498aeb181e31bad04f1c73d5ca6741
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/591370
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46968}
2017-07-28 12:18:38 +00:00
Juliana Franco
e15f554427 Changing the return address on the stack.
Rather than patching code, the deoptimizer now replaces the
return address in the frames with respective trampolines. 
This change required to change the way we search for Safepoint 
entries and for Exception Handlers. 
It's working in architectures: x64, ia32, arm, arm64 and mips. 

Bug: V8:6563
Change-Id: I3cbd4d192c3513f307b3a6a2ac99e60d03c753d3
Reviewed-on: https://chromium-review.googlesource.com/586707
Commit-Queue: Juliana Patricia Vicente Franco <jupvfranco@google.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46967}
2017-07-28 11:53:45 +00:00
Tobias Tebbi
d230b44f0c [turbofan] staging new implementation of escape analysis
Bug: 
Change-Id: Idebe4fa6d651a404a0dc1947ed4a34a8dc9707a9
Reviewed-on: https://chromium-review.googlesource.com/565720
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46966}
2017-07-28 11:45:25 +00:00
Michael Lippautz
7c8a75e508 Pretenure LayoutDescriptor
LayoutDescriptor is currently the only case where the Scavenger needs to
potentially follow an updated slot to iterate an object. This scenario
requires at least Acq/Rel semantics.

In order to use relaxed store/load for the slots we need to allocate it
pretenured.

Bug: chromium:738865
Change-Id: I353fa6f252b436918b60fff54ece5ce5c7783072
Reviewed-on: https://chromium-review.googlesource.com/590429
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46965}
2017-07-28 11:43:35 +00:00
Ulan Degenbaev
047e906da5 [heap] Process weak cells in concurrent marking visitor.
BUG=chromium:694255

Change-Id: I6684850ae9759f719e3ed665157eaea2581a65cf
Reviewed-on: https://chromium-review.googlesource.com/590008
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46964}
2017-07-28 11:32:40 +00:00
sreten.kovacevic
3eb4de3497 MIPS[64]: Port [arm] Introduce UseScratchRegisterScope
Add UseScratchRegisterScope for MIPS and use it instead of using at register directly.

Original commit message:
`Introduce a stripped down version of UseScratchRegisterScope for ARM and use it
inside the assembler and macro-assembler. At the exception of the Call
instructions, we now use this scope instead of using the ip register
directly. This is inspired from how the ARM64 backend works.

In general, the benefit of doing this is we can catch cases where ip is being
used both by the caller and by the assembler. But more specifically, TurboFan
reserves r9 as an extra scratch register because ip can already be used by the
assembler. With this utility, we can isolate the cases in the code generator
which need an extra register and potentially fix them, allowing us to give r9
back to the register allocator.

This patch uncovered places in the assembler where we were using ip
unconditionally when we could have re-used the destination register instead.`

Bug: 
Change-Id: I1a35c1661579882801605337abfc95f75b47f052
Reviewed-on: https://chromium-review.googlesource.com/574923
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Cr-Commit-Position: refs/heads/master@{#46963}
2017-07-28 11:31:35 +00:00
Leszek Swirski
ad09fd60d6 [compiler-dispatcher] Pass isolate to main thread step
Rather than storing the isolate in compiler dispatcher jobs, which gets
weird for jobs that are entirely off-thread, instead pass the isolate
in when stepping on the main thread.

This makes it clearer which steps must be executed on the main thread,
as they require the caller to explicitly give them access to the
isolate.

Bug: v8:6537
Change-Id: I02fff7c77fdcdbfb099a38235f94d8c1040699ac
Reviewed-on: https://chromium-review.googlesource.com/589437
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46962}
2017-07-28 10:56:05 +00:00
Leszek Swirski
1c02987d2d [compiler] Kill the deoptimized too many times bailout
With TurboFan, there should no longer be any deopt loops (aside from
bugs). So, the "too many deopts" bailout is no longer needed, at least
in its current form.

This fixes an issue where deopt counts are leaked between native
contexts, resulting in optimization being disabled unnecessarily.

Bug: v8:6402
Change-Id: Ia06374ae6b5c2d473bcdd8eef1284bf02766c2fb
Reviewed-on: https://chromium-review.googlesource.com/588894
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46961}
2017-07-28 10:08:29 +00:00
Mathias Bynens
f4b2b9bef7 Ship RegExp dotAll mode / s flag
Intent to ship:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/0uSHjqvgAwQ/CqmFd6KNAwAJ

BUG=v8:6172

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I50fab93516065195b4e9eea0d3be14ccf935a04f
Reviewed-on: https://chromium-review.googlesource.com/589150
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46960}
2017-07-28 08:17:38 +00:00
jgruber
d4c1b2aaeb [coverage] Include catch and finally keywords in ranges
This includes the catch and finally keywords in the respective range.
For instance:

// Catch range previously:  |<--------->|
try { /* ... */ } catch (e) { /* ... */ }
// Now:           |<------------------->|

Bug: v8:6000
Change-Id: I1bd9f7fce8bb7de945da83ab512833841b9d956a
Reviewed-on: https://chromium-review.googlesource.com/586598
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46959}
2017-07-28 08:06:08 +00:00
Jaroslav Sevcik
b87ba9f2f8 [logging] Add an option to log source code in v8.log.
Bug: v8:6239
Change-Id: I87f72cb97616e28cb44f7160d5170ff740422419
Reviewed-on: https://chromium-review.googlesource.com/584612
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46958}
2017-07-28 07:18:18 +00:00
Daniel Clifford
68a58016a1 [csa] Add IsArrayProtectorCellInvalid utility method
Change-Id: I8ecca14e1d65aeed59cd55626e41f9863d58be50
Reviewed-on: https://chromium-review.googlesource.com/589431
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46955}
2017-07-28 03:44:38 +00:00
Jaideep Bajwa
de9b0a071c PPC/s390: [objects] Make feedback vector a first-class object
Port 37680d6563

Original Commit Message:

    Instead of having feedback vector as a subtype of FixedArray with
    reserved slots, make it a first-class variable-sized object with a
    fixed-size header. This allows us to compress counters to ints in the
    header, rather than forcing them to be Smis.

R=leszeks@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Ia835942de292c4e4b802e34672f1e8bf8a2491c7
Reviewed-on: https://chromium-review.googlesource.com/590168
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46954}
2017-07-28 03:38:22 +00:00
pan.deng@intel.com
eaec875f7f X64: Remove redundant mov instructions.
Bug: None
Change-Id: I31f6c6aba48076b26971ba828411b61ed7e9bae9

Contribute by kanghua.yu@intel.com

Change-Id: I31f6c6aba48076b26971ba828411b61ed7e9bae9
Reviewed-on: https://chromium-review.googlesource.com/567861
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Pan Deng <pan.deng@intel.com>
Cr-Commit-Position: refs/heads/master@{#46953}
2017-07-28 03:37:18 +00:00
Jaroslav Sevcik
a27daf04a3 [turbofan] Revert "Load elimination for Map.prototype.(has|get)."
This reverts commit 3ca6408511.

Reason: it does not seem to improve anything (including microbenchmarks
that only do "if (m.has(x)) s += m.get(x);" in a tight loop).

Bug: v8:6410
Change-Id: I025bf885f313ac5e54ca450ae9cff5b4a15b04fd
Reviewed-on: https://chromium-review.googlesource.com/574020
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46952}
2017-07-27 18:53:17 +00:00
Adam Klein
48a903eb3f Properly fix-up ClassLiterals in ReparentExpressionScope()
Everything inside a class lives inside the class scope, so
reparenting the class scope is the only operation that
should be done to ClassLiterals during reparenting.

Bug: chromium:740591
Change-Id: Ia5b96b44ff1ca6cfa274effb5a04651809bab9bd
Reviewed-on: https://chromium-review.googlesource.com/588054
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46951}
2017-07-27 18:22:57 +00:00
jing.bao
100513c0d0 [ia32][wasm] Add more I32x4 BinOp and ShiftOp
I32x4 Mul, MinS,MaxS,MinU,MaxU, Shl,ShrS,ShrU
Rename WASM_SIMD_TEST(I32x4Min) to WASM_SIMD_TEST(I32x4MinS)

Bug: 
Change-Id: I6c721496bbf772ee734c21a3e98176699b01f890
Reviewed-on: https://chromium-review.googlesource.com/586430
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46950}
2017-07-27 17:37:37 +00:00
Jaideep Bajwa
a2388599db PPC/s390: Reland "[arm] Restrict grouping pushes before a TailCall to registers only"
Port 79bcb45447

Original Commit Message:

    This is a reland of a72b2f88a8
    Original change's description:
    > [arm] Restrict grouping pushes before a TailCall to registers only
    >
    > We optimize parallel moves performed before a TailCall by grouping adjacent
    > pushes. This way, we may use a single instruction to push multiple registers at
    > once. However, we also have support for pushing immediates and stack slots for
    > which the benefit is questionnable therefore this patch removes support for
    > them.
    >
    > Concerning immediate pushes, it looks like a mistake since we do not have
    > support for this case in `AssembleMove` so this patch removes it. Furthermore,
    > if we add a test for this case, we see that a `push ip` instruction is
    > generated, effectively pushing whatever was in `ip` at the time instead of
    > pushing a constant.
    >
    > Concerning stack slot pushes, we generate a more or less equivalent sequence of
    > instructions.
    >
    > Finally, grouping floating point pushes is not used anywhere so this patch
    > removes support for this also.
    >
    > Bug: v8:6553
    > Change-Id: I9b820d33361fc442dd813f66e1f96cda41009110
    > Reviewed-on: https://chromium-review.googlesource.com/567191
    > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
    > Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
    > Cr-Commit-Position: refs/heads/master@{#46718}

R=pierre.langlois@arm.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I8790c7a72f92803ea8fda3c6dc7e6b013e2e09e9
Reviewed-on: https://chromium-review.googlesource.com/588471
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46949}
2017-07-27 17:27:37 +00:00
Ross McIlroy
3b334b73e9 [Compiler] Remove ability to create CompilerDispatcher jobs from parsed literal.
The approach to creating compiler dispatcher jobs for inner functions after
they had been parsed didn't provide the startup benifits we hoped for due
to the need to hold onto the whole zone memory AST while waiting for the
jobs to complete.

This CL removes the ability to create these compilation jobs (which was never
enabled by default anyway). Going forward we will potentially use the
parser task approach to parse+compile inner functions in their own job.

BUG=v8:5203

Change-Id: I63134746aa23b4aa6e3bfa17c539954890fd9b0f
Reviewed-on: https://chromium-review.googlesource.com/590007
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46948}
2017-07-27 16:50:47 +00:00
Alexey Kozyatinskiy
c5e9416b1d [inspector] move stack trace and scope inspection to native
This CL moves us much closer to the point where we can remove debugger-script.js and usage of debugger context from inspector.
There are three main parts left:
- managing breakpoints,
- inspecting stack and scopes (this CL),
- LiveEdit.

In this CL I moved all stack/scope inspection to native. As side effect running debugger and inspector tests are 10-20% faster (it's significant since not all of tests requesting break).

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

Bug: chromium:652939
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I409396a687e18e9c0554c0c9c35b6e1064627be8
Reviewed-on: https://chromium-review.googlesource.com/580645
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46947}
2017-07-27 15:57:30 +00:00
Rodolph Perfetta
b4f1e24078 [instruction scheduler] deal with CSP/JSSP disparity on arm64.
This is preparation work to re-enable the scheduler: on arm64 some opcodes will
be neutral wrt the stack (JSSP) but will modify the underlying CSP. Identify
those opcode as such until JSSP is removed.

Bug: 
Change-Id: Iae633382c5ed38b01edaec896f2ce44d76931fc8
Reviewed-on: https://chromium-review.googlesource.com/568822
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Rodolph Perfetta <rodolph.perfetta@arm.com>
Cr-Commit-Position: refs/heads/master@{#46946}
2017-07-27 15:41:18 +00:00
jgruber
ffeea0fe05 [coverage] Add continuation counters for catch and finally blocks
These counters handle cases in which the catch/finally block contains a jump
statement.

Bug: v8:6000
Change-Id: Ic83f11ee431edabe61f129c9abc3adc12a79c338
Reviewed-on: https://chromium-review.googlesource.com/586595
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46945}
2017-07-27 15:31:58 +00:00
Vyacheslav Chigrin
bde4dc8eda Fix serializing objects that may require non-world aligning.
We must ensure required root objects will be filled when such
objects will be deserialized.

Change-Id: I25136d31cb2e0c0a69a51c5635192f17bbe2a9ba
Reviewed-on: https://chromium-review.googlesource.com/579768
Commit-Queue: Vyacheslav Chigrin <vchigrin@yandex-team.ru>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46944}
2017-07-27 15:30:28 +00:00
Mircea Trofin
be915fd7d1 [wasm] Explicit opt-out of stack checks and traps
We've been passing a context to the compiler, which turns out to be
solely used to determine if we're executing in a specific cctest configuration.

This change adds a configuration to the graph builder that we can use to
explicitly opt out of stack checks and traps. CcTests default to opting out,
except for the few that don't.

Bug: 
Change-Id: I4724e31c2a62e9b3ab4feadb788287c374b39f53
Reviewed-on: https://chromium-review.googlesource.com/585779
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46943}
2017-07-27 14:52:27 +00:00
Michael Starzinger
44f88dcd87 [turbofan] Fix missing callability check on Array callbacks
This fixes the second-order Array.prototype function {forEach} and {map}
to now perform a callability check of the given callback function. For
empty arrays it is observable whether such a check outside the loop has
been elided or not.

R=mvstanton@chromium.org
TEST=mjsunit/regress/regress-crbug-747062
BUG=chromium:747062

Change-Id: I1bbe7f44b3b3d18e9b41ad0436975434adf84321
Reviewed-on: https://chromium-review.googlesource.com/588893
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46942}
2017-07-27 14:49:58 +00:00
Mircea Trofin
bee5436777 [regalloc] Fix for verifier overwritting final assessments.
This fixes a subtle register allocation verifier bug: depending on how moves are 
optimized, and when having duplicate phis, we may end up overwriting a final
assessment.

Bug: 
Change-Id: I8b7891efbdd075aae0219d60270f405b13d50f40
Reviewed-on: https://chromium-review.googlesource.com/577288
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46941}
2017-07-27 14:47:21 +00:00
Leszek Swirski
c80ff604a2 [compiler-dispatcher] Make compiler jobs abstract (reland)
Reland of https://chromium-review.googlesource.com/c/558290/

Makes compiler dispatcher jobs an abstract interface, with unoptimized
compile jobs as an implementation of this interface.

Bug: v8:6537
Change-Id: Ia85781f72c7aaca497896ca4efa91ada97e43b1c
Reviewed-on: https://chromium-review.googlesource.com/589154
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46940}
2017-07-27 14:31:46 +00:00
Michael Lippautz
f3817e9bd7 [heap] Scavenger: Cache compacting property
Bug: chromium:738865
Change-Id: I02cb7ea48a1dfaec25bf702b09242d537fe612f4
Reviewed-on: https://chromium-review.googlesource.com/589271
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46939}
2017-07-27 14:15:23 +00:00
Ulan Degenbaev
1d32273a49 [base] Align the address hint in VirtualMemory.
BUG=chromium:739644

Change-Id: I6c7d0f48c959826dd2a8587d7a321be4387ef39f
Reviewed-on: https://chromium-review.googlesource.com/586529
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46936}
2017-07-27 13:50:06 +00:00
Leszek Swirski
37680d6563 [objects] Make feedback vector a first-class object
Instead of having feedback vector as a subtype of FixedArray with
reserved slots, make it a first-class variable-sized object with a
fixed-size header. This allows us to compress counters to ints in the
header, rather than forcing them to be Smis.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Icc5f088ffbc2e2651b845bc71ea42060639e3e48
Reviewed-on: https://chromium-review.googlesource.com/585129
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46935}
2017-07-27 13:31:55 +00:00
Jaideep Bajwa
9836cdb1ad PPC/s390: Switch JSFunction::code to be a tagged value.
Port 4e207a429a

Original Commit Message:

    This switches the "code entry" field on JSFunction to no longer be an
    inner pointer into a Code object (i.e. to the start of the instruction
    stream), but a properly tagged pointer instead.

    Motivation behind this is the ability to treat this field regularly as
    part of escape analysis in the optimizing compiler. Also simplifies the
    object visitation for JSFunction objects.

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Ifa5998551e041c8de647df7306dd549455936699
Reviewed-on: https://chromium-review.googlesource.com/588468
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46934}
2017-07-27 12:57:55 +00:00
Leszek Swirski
b1e10f4b49 Revert "[compiler-dispatcher] Make compiler jobs abstract"
This reverts commit e4bbf92be3.

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

Original change's description:
> [compiler-dispatcher] Make compiler jobs abstract
> 
> Makes compiler dispatcher jobs an abstract interface, with unoptimized
> compile jobs as an implementation of this interface.
> 
> Bug: v8:6537
> Change-Id: I6569060a89c92d35e4bc7962623f77082a354934
> Reviewed-on: https://chromium-review.googlesource.com/558290
> Reviewed-by: Georg Neis <neis@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46931}

TBR=rmcilroy@chromium.org,neis@chromium.org,leszeks@chromium.org

Change-Id: I023c0455929180fdcde3caf581f483f794ca2368
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6537
Reviewed-on: https://chromium-review.googlesource.com/589153
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46932}
2017-07-27 11:49:47 +00:00
Leszek Swirski
e4bbf92be3 [compiler-dispatcher] Make compiler jobs abstract
Makes compiler dispatcher jobs an abstract interface, with unoptimized
compile jobs as an implementation of this interface.

Bug: v8:6537
Change-Id: I6569060a89c92d35e4bc7962623f77082a354934
Reviewed-on: https://chromium-review.googlesource.com/558290
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46931}
2017-07-27 11:21:26 +00:00
Benedikt Meurer
6a75fcd4df [ignition] Improve code generation for TestTypeOf.
The code generated for the TestTypeOf bytecode was not ideal, mostly
because of the default case that just aborted. If we do CSA_ASSERT to
check the validity of the literal_flag instead anf then just use the
last label as the default, the bytecode handler no longer builds a
stack frame and generated code quality is now really close to ideal.

The TestTypeOf bytecode handler was found to be among the three
hottest bytecode handlers in the Speedometer/AngularJS benchmark.

R=jarin@chromium.org

Change-Id: I47705a0ca0a436d5c42899001064e77d44845a64
Reviewed-on: https://chromium-review.googlesource.com/589207
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46930}
2017-07-27 11:19:44 +00:00
Ulan Degenbaev
2cc8fdfb47 [heap] Re-implement weak cell tracking in the marker.
This replaces the linked list of weak cells with a worklist.

TBR=yangguo@chromium.org

BUG=chromium:694255

Change-Id: Ia877e25010ebbec9c05fbbe48cff460a92d3a132
Reviewed-on: https://chromium-review.googlesource.com/587067
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46929}
2017-07-27 11:09:24 +00:00
Michael Lippautz
20f870c729 [heap] Scavenger: Fix benign race with forwarding pointer load
NOTRY=true

Bug: chromium:738865
Change-Id: I8e3ac86bf6f0b3356398053b157ec03217e78a08
Reviewed-on: https://chromium-review.googlesource.com/589129
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46928}
2017-07-27 09:55:54 +00:00
Leszek Swirski
80f6c19f32 [csa] Fix MSVC handling of VA_ARGS in CSA_ASSERT
MSVC's macro VA_ARGS support behaves slightly differently from
gcc/clang, where VA_ARGS is treated as a single token when passed to
other macros, e.g.

    #define FIRST(X, ...) 'X'
    #define FOO(...) FIRST(__VA_ARGS__)
    FOO(a,b,c)

expands to

    gcc/clang: 'a'
    MSVC: 'a,b,c'

The workaround to this is to wrap the call in a no-op macro, which
expands VA_ARGS first, and only then passes it through:

    #define EXPAND(x) x
    #define FOO(...) EXPAND(FIRST(__VA_ARGS__))

This was causing errors on windows builds when CSA_ASSERT was passed
multiple additional expressions.

Change-Id: Ia40bf23baf97af29c7f6f67c8a83918ecca15364
Reviewed-on: https://chromium-review.googlesource.com/586831
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46927}
2017-07-27 09:17:55 +00:00
Ulan Degenbaev
a61fec358b Do not clear of inline caches in SharedFunctionInfo::ResetForNewContext.
This is a step in making shared function info visitor side effect free.

Change-Id: I5e7a713d2d782590c4988abc69b2068dc85b9bae
Reviewed-on: https://chromium-review.googlesource.com/586927
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46926}
2017-07-27 08:41:14 +00:00
jgruber
e567e5ca16 [coverage] Handle repeated CoverageInfo deletions
Debug::ClearCoverageInfo may be called multiple times, for example
whenever coverage mode is switched to BestEffort. When encountering a
DebugInfo that does not have a CoverageInfo attached, simply do nothing
instead of failing a DCHECK.

TBR=yangguo@chromium.org

Bug: v8:6000
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I3910b21ab40e7db02af5f3b6add3ec3f86e5bd91
Reviewed-on: https://chromium-review.googlesource.com/588788
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46925}
2017-07-27 08:36:54 +00:00
Michael Lippautz
bb840f4fca [heap] Scavenger: Fix benign race in LayoutDescriptor access
We need to write the slot with a relaxed write. No additional barrier is
needed because the new object has been published using Release_CAS and
reading either value is fine (as long as all initializing stores have
been published).

NOTRY=true

Bug: chromium:738865
Change-Id: Ieeacccf00e0a7e8eb950eee01060bd1963e30a42
Reviewed-on: https://chromium-review.googlesource.com/589007
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46924}
2017-07-27 08:24:19 +00:00
Michael Achenbach
f5d42fc417 Revert "[coverage] Ship block coverage"
This reverts commit 7bb6cd63ed.

Reason for revert: layout tests

Original change's description:
> [coverage] Ship block coverage
> 
> Enables block coverage by default.
> 
> Design doc: http://goo.gl/hSJhXn
> Tracking bug: http://crbug.com/v8/6000
> 
> Bug: v8:6000
> Change-Id: I8c56474473b60e4707b75dc601b3e88455861a27
> Reviewed-on: https://chromium-review.googlesource.com/583093
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46898}

NOTRY=true
TBR=yangguo@chromium.org,jgruber@chromium.org

Change-Id: I51d6f13d3ad0d2d2262bdd8d67135931cbc27032
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6000
Reviewed-on: https://chromium-review.googlesource.com/588789
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46923}
2017-07-27 07:38:46 +00:00
Igor Sheludko
10e4fe3d32 [runtime] Don't create class field types for arrays' fields.
... when generalizing const fields to mutable fields.

Bug: chromium:748539, chromium:747979, chromium:738763
Change-Id: Iee772a5d0cddd23599f1f68bca00b8beecb76da0
Reviewed-on: https://chromium-review.googlesource.com/586709
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46921}
2017-07-27 07:11:05 +00:00
Michael Lippautz
e70969a10a [heap] Enable parallel scavenge
-+ssssssyyssssooossooooooo+:`                   
                    :ys+///////oyo//////////////+oy:                  
                   +y+///////////ss///////////////+y/        ``       
                  +y//////////////oy+///////////////yo`   .:o/        
                `oy////////////////sy+///////////////ss-/syh/         
               `ss////////////////+y/yo///////////////oo+oy:          
              .ss////////////////oy- .ss////////////////oy-           
             .yo////////////////oy.   `os//////////////oy.            
             +ss+//////////////ss.     `+y+///////////ss.             
              `./oso+/////////ss`     `-+yo//////////ss.     `        
                  `-+oso+////so`   .:oyysoooooooooooso`  `-/os/       
./ooooooooooooooooo: `.:+ss+y+`  .:///::::-----.....``.:+so+/+y+      
  `-+sso+/////////+y/    `-//                     `-/oso+//////yo`    
     `/yo///////////so`                        .:+oo+///////////ss`   
     :yo/////////////ss.                      .sy+///////////////ss.  
    /y+///////////////oy-                      -yo////////////////oy- 
   +y+//////////////+o++y/                   `  .ss////////////////oy-
  :h///////////////+y+ossy+`                `o   .ss////////////////ss
  :h//////////////oy-  `:+so.              `oy    `os///////////////oy
   oy////////////ss.      `-/`            `sys     `+y+/////////////y/
    +y//////////so`                      .ssss       /y+//////////oy/ 
     +y+///////yyo++++++++++++++++      .yo/ss::::::--oyo++++++osyy-  
      /y+////+yo////////////////sy     -yo//++++++++++ooooooo++oyo.   
       /y+//+yo/////////////////oy    -yo/////////////////////+y+`    
        /y++y+//////////////////oy   :y+/////////////////////+y:      
         :yys///////////////////oy  -y+/////////////////////os-       
          :ys///////////////////oy  `os////////////////////so`        
           -y+//////////////////oy   `oy/////////////////+y+          
            -ss/////////////////oy     +y+//////////////oy:           
             `:ossooooooooooooooss      :y+/oyssssssssso/`            
                 `................       -yooy                        
                                          .yyy                        
                                           `sy                        
                                            `+                        

Bug: chromium:738865
Change-Id: I202f9c61c13fcacfb8fff37458931d91c6f831e5
Reviewed-on: https://chromium-review.googlesource.com/584835
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46920}
2017-07-27 06:50:23 +00:00
Mircea Trofin
c2928fe48d Revert "Revert "[wasm] Consolidate function table representation.""
This reverts commit 862d605c13.

Reason for revert: fixed compile issue

Original change's description:
> Revert "[wasm] Consolidate function table representation."
> 
> This reverts commit 4a45f35f26.
> 
> Reason for revert: https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug%20builder/builds/25471 
> 
> Original change's description:
> > [wasm] Consolidate function table representation.
> > 
> > This CL avoids the need to reference the function tables (and signatures)
> > as either fixed arrays or vectors, preferring vectors.
> > 
> > The only place we need fixed arrays is on the compiled module, to support
> > serialization. When we move off the GC heap, we'll also move away
> > from fixed arrays in that last case.
> > 
> > The CL aids with getting wasm of the GC heap, by reducing the places 
> > and representations we'll need to change  when changing the way we 
> > reference fixed tables.
> > 
> > Bug: 
> > Change-Id: Id4e43905a3df39062bf2839fa72dd5d9a0fe87da
> > Reviewed-on: https://chromium-review.googlesource.com/588334
> > Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
> > Reviewed-by: Brad Nelson <bradnelson@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#46917}
> 
> TBR=bradnelson@chromium.org,titzer@chromium.org,mtrofin@chromium.org,ahaas@chromium.org
> 
> Change-Id: Ie7d04f7ec74d6d0b3783df1c78c91c100ab784f4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/588627
> Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
> Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46918}

TBR=bradnelson@chromium.org,titzer@chromium.org,mtrofin@chromium.org,ahaas@chromium.org

Change-Id: Ic0ba8097c13f2b1afd263b6243360e8ab95ae474
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/588667
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46919}
2017-07-27 05:57:02 +00:00
Mircea Trofin
862d605c13 Revert "[wasm] Consolidate function table representation."
This reverts commit 4a45f35f26.

Reason for revert: https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20debug%20builder/builds/25471 

Original change's description:
> [wasm] Consolidate function table representation.
> 
> This CL avoids the need to reference the function tables (and signatures)
> as either fixed arrays or vectors, preferring vectors.
> 
> The only place we need fixed arrays is on the compiled module, to support
> serialization. When we move off the GC heap, we'll also move away
> from fixed arrays in that last case.
> 
> The CL aids with getting wasm of the GC heap, by reducing the places 
> and representations we'll need to change  when changing the way we 
> reference fixed tables.
> 
> Bug: 
> Change-Id: Id4e43905a3df39062bf2839fa72dd5d9a0fe87da
> Reviewed-on: https://chromium-review.googlesource.com/588334
> Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
> Reviewed-by: Brad Nelson <bradnelson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46917}

TBR=bradnelson@chromium.org,titzer@chromium.org,mtrofin@chromium.org,ahaas@chromium.org

Change-Id: Ie7d04f7ec74d6d0b3783df1c78c91c100ab784f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/588627
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46918}
2017-07-27 05:32:42 +00:00
Mircea Trofin
4a45f35f26 [wasm] Consolidate function table representation.
This CL avoids the need to reference the function tables (and signatures)
as either fixed arrays or vectors, preferring vectors.

The only place we need fixed arrays is on the compiled module, to support
serialization. When we move off the GC heap, we'll also move away
from fixed arrays in that last case.

The CL aids with getting wasm of the GC heap, by reducing the places 
and representations we'll need to change  when changing the way we 
reference fixed tables.

Bug: 
Change-Id: Id4e43905a3df39062bf2839fa72dd5d9a0fe87da
Reviewed-on: https://chromium-review.googlesource.com/588334
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46917}
2017-07-27 05:17:40 +00:00
Karl Schimpf
23e882eb20 Fix missing (function decoding time/function size) UMA metrics.
Check for these UMA stats were in functions only used for testing. Moved the
checks to code inside module decoding.

Note that the module decoder is used both to validate and generate the
intermediate (turbofan) graph of function bodies.  This CL assumes
that the validation phase (of function bodies) is the correct place to
track decoding time.

Bug: v8:6361
Change-Id: I791281daae96473d53cb8ae332fff8bb2673bf6c
Reviewed-on: https://chromium-review.googlesource.com/586974
Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46915}
2017-07-27 01:27:01 +00:00
Jaideep Bajwa
1af12c3c77 PPC/s390: [builtins] Introduce ConstructProxy builtin based on CSA
Port fe046627db
Port d594a6d9cd
Port 53553f5dcb

R=mslekova@google.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I2c160f8e3a1c3a809de6a6631864104ed95900d7
Reviewed-on: https://chromium-review.googlesource.com/587610
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46914}
2017-07-26 21:15:28 +00:00
Alexei Filippov
927322652d [heap-profiler] Fix reporting of fake global objects.
The global objects lookup code mistakingly reports weakly referenced
JSGlobalObject's as normal one. It should not.

The fix just adds is_weak check into V8HeapExplorer::SetGcSubrootReference
the rest is formatting.

Bug: chromium:747382
Change-Id: I3fc62317dd3d8728d261f27bd58654aff13eb6fe
Reviewed-on: https://chromium-review.googlesource.com/585385
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46913}
2017-07-26 20:26:40 +00:00
Jaideep Bajwa
c28d39f093 PPC/s390: [builtins] Introduce CallProxy builtin based on CSA
Port 7f50476b83
Port 1769f892ce

Original Commit Message:

    - Add more conformance tests for proxy call and calling undetectable
    - This improves the performance of calling a proxy by ~5x

R=mslekova@google.com, adamk@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: If5e66093aee815225053c1d3d2a99cfac270aea4
Reviewed-on: https://chromium-review.googlesource.com/587228
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46912}
2017-07-26 18:20:53 +00:00
Georg Neis
e017463189 [modules] Fix mapping of internal status to external status.
Internally, the module status type has one additional value, namely
PreInstantiating. I previously mapped this to Instantiating when
crossing the API boundary but it really should be mapped to
Uninstantiated. That's because when instantiation fails, typically all
modules not yet visited will remain in the PreInstantiating state, yet
they must appear Uninstantiated to the outside.

A relevant test will be added to chromium shortly.

Bug: v8:1569, chromium:748544
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Icb33c7f90db5e62375b6c09d14e3d2d5342b0879
Reviewed-on: https://chromium-review.googlesource.com/586602
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46911}
2017-07-26 17:55:25 +00:00
Jaideep Bajwa
00a8ab2e8d PPC/s390: [turbofan] Widen the fast-path for JSCreateArray.
Port 1edb46cc04

Original Commit Message:

    This improves the general Array constructor call performance (w/o
    usable AllocationSite feedback) in TurboFan by ~2x, i.e. for example
    invoking the Array constructor like this

      var a = Array.call(undefined, n);

    instead of

      var a = Array(n);

    such that the CallIC doesn't know that it's eventually calling the
    Array constructor.

    It also thus changes the single argument Array constructor to always
    return holey arrays. Previously the single argument case for the Array
    constructor was somehow trying to dynamically detect 0 and in that case
    returned a packed array instead of a holey one. That adds quite a lot
    of churn, and doesn't seem to be very useful, especially since this
    might lead to unnecessary feedback pollution later.

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I6a50ae016556ed38a7d7ca5546b575ca25e91b4a
Reviewed-on: https://chromium-review.googlesource.com/586641
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46909}
2017-07-26 16:56:07 +00:00
Jaideep Bajwa
c178cf3871 PPC/s390: [compiler] Don't use Handle<T>::cast in code generator.
Port 6ace4a500e

Original Commit Message:

    In debug mode (SLOW_DCHECK), Handle<T>::cast accesses the object to
    check its type.  Obviously we can no longer do that now that we run
    on a background thread.

    problem. I will look into fixing those as well.

R=neis@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I2140cd7b3e27a6deb24fe3f462d99ad31eeb8276
Reviewed-on: https://chromium-review.googlesource.com/586675
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46908}
2017-07-26 16:53:07 +00:00
Adithya Srinivasan
69dbdb3693 Add counter for Accessors::ReconfigureToDataProperty
Calls to this method are currently being wrongly categorized as Blink C++
when it is cast to a GenericNamedPropertySetterCallback in
Object::GetPropertyWithAccessor and called.

Bug: 
Change-Id: I691346d0d1e6b22dfc12cf4cfb07cfff71a36baf
Reviewed-on: https://chromium-review.googlesource.com/585169
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46907}
2017-07-26 16:19:47 +00:00
Georg Neis
a6f579eb2e [modules] Add --trace-module-status for printing status transitions.
This is for debugging only.

R=adamk@chromium.org

Bug: v8:1569
Change-Id: I6526d3a98e96bb1267f1850268c5dc83a64587a6
Reviewed-on: https://chromium-review.googlesource.com/586590
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46906}
2017-07-26 16:14:07 +00:00
Michael Starzinger
a4663baa42 [utils] Fix undefined behavior in Abs helper.
This fixes undefined behavior in the arithmetic negation operation by
switching to a branch-free implementation.

R=clemensh@chromium.org
TEST=unittests/MachineOperatorReducerTest.Int32DivWithConstant

Change-Id: I518f0e4343fc331607b8bbeefd2bb06285621fe6
Reviewed-on: https://chromium-review.googlesource.com/584870
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46905}
2017-07-26 15:10:47 +00:00
Ross McIlroy
fdf28c7bea [Compiler] Move Ast value internalization until compile finalization.
Moves parser internalization of ast values out of 
ParseAny/Program/Function and instead internalizes during compile 
finalization. Currently also internalizes during scope analysis if
there is a ScopeInfo to enable variable name lookups. We also 
internalize early for FCG / AstGraphBuilder.

BUG=v8:5203

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ia766795947d847517b87cd5ea39797347083174b
Reviewed-on: https://chromium-review.googlesource.com/582407
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46904}
2017-07-26 14:59:07 +00:00
Georg Neis
9e02f326a0 [cleanup] Remove unused MacroAssembler::GetNumberHash.
R=yangguo@chromium.org

Bug: 
Change-Id: I1174bd88c252a0c9d16dca270088a0100ac4eb35
Reviewed-on: https://chromium-review.googlesource.com/584869
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46902}
2017-07-26 14:20:16 +00:00
Jaroslav Sevcik
905aae9af1 [profiler] Start timer when profiling to get timestamps in profview.
Bug: v8:6520
Change-Id: I3d5a019885516d7cbc4f43bfb3892bed655a9628
Reviewed-on: https://chromium-review.googlesource.com/586708
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46901}
2017-07-26 14:09:46 +00:00
Jaideep Bajwa
2b23e892c1 PPC/s390: Move TF parts of MacroAssembler into new TurboAssembler.
Port dfdcaf4316
Port 2e1f5567cc

Original Commit Message:

    This CL introduces TurboAssembler, a super-class of Assembler and sub-class
    of MacroAssembler. TurboAssembler contains all the functionality that is used
    by Turbofan and previously was part of MacroAssembler. TurboAssembler has
    access to the isolate but, in contrast to MacroAssembler, does not expect to
    be running on the main thread.

R=neis@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:6048
LOG=N

Change-Id: I3f51771afefe46410db7cda2625472d78c87f8c6
Reviewed-on: https://chromium-review.googlesource.com/583584
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46900}
2017-07-26 13:23:36 +00:00
Alexandre Talon
231bb1a2ec [Turbofan] Merged the OSR phase into the graph building phase (reland)
Reland of https://chromium-review.googlesource.com/c/543042/.

Now the OSR phase is only used when OSRing from the ast graph builder.
When OSRing from Turbofan, the implementation is now in the graph
building phase, at the beginning of the VisitBytecode function.
We are no longer generating any OSRLoopEntry or OSRNormalEntry nodes,
nor nodes for the possible code of the OSRed function which is before
the OSRed loops.

The trimming and reducing of the OSR phase is not done either. This
change in the way the way the OSR is done enabled to remove the
workaround to the bug mentioned below.

Bug: v8:6112
Bug: v8:6518
Change-Id: Ia02f2138f54fc79cab2f02fed68d9bb522d6ce14
Reviewed-on: https://chromium-review.googlesource.com/584756
Commit-Queue: Alexandre Talon <alexandret@google.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46899}
2017-07-26 13:15:16 +00:00
jgruber
7bb6cd63ed [coverage] Ship block coverage
Enables block coverage by default.

Design doc: http://goo.gl/hSJhXn
Tracking bug: http://crbug.com/v8/6000

Bug: v8:6000
Change-Id: I8c56474473b60e4707b75dc601b3e88455861a27
Reviewed-on: https://chromium-review.googlesource.com/583093
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46898}
2017-07-26 11:54:14 +00:00
Peter Marshall
8315422762 [runtime] Check for overflow when serializing Strings for JSON.
Previously we would shift the length of the string by three, which
could overflow with the new larger string length limit. Now we check
that the length will fit without extra allocation before and after
the shift, because really large strings will never fit, and will
always go to the Checked case.

Bug: chromium:748069, v8:6148
Change-Id: I41cac14b0fde6c5e8ca92305a052cbb743111554
Reviewed-on: https://chromium-review.googlesource.com/584611
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46896}
2017-07-26 11:40:56 +00:00
Ben L. Titzer
7d3c47f3ea [wasm] Add a TODO for reader-writer lock on signature map.
R=clemensh@chromium.org

Bug: 
Change-Id: I5e4cd8dcb9c22cd261b48598c021f84ad712ba58
Reviewed-on: https://chromium-review.googlesource.com/586249
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46895}
2017-07-26 11:03:22 +00:00
Ilija Pavlovic
c32b128102 MIPS[64]: Calculate offsets in branch helpers.
In definitions for BranchShortHelperR6 and BranchAndLinkShortHelperR6
are noted many source code lines which are very often repeated or very
similar. These lines of code calcluate offsets and for them this CL
introduces functions CalculateOffset().

TEST=
BUG=

Change-Id: Ia64020efaeab207e72fc00d1dcb5b35a4003f36a
Reviewed-on: https://chromium-review.googlesource.com/574229
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Reviewed-by: Miran Karić <Miran.Karic@imgtec.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Cr-Commit-Position: refs/heads/master@{#46893}
2017-07-26 09:37:52 +00:00
Miran.Karic
d6c4269c93 MIPS[64]: Optimize compare in code generator.
The CL introduces optimizations in code generator to MipsTst, MipsCmp,
MipsCmpS and MipsCmpD instructions for mips32 and Mips64Tst, Mips64Cmp,
Mips64CmpS and Mips64CmpD for mips64.

BUG=

Change-Id: I6daf465e0ac7475691078b4d683da5247df6ea99
Reviewed-on: https://chromium-review.googlesource.com/584529
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@imgtec.com>
Commit-Queue: Miran Karić <Miran.Karic@imgtec.com>
Cr-Commit-Position: refs/heads/master@{#46892}
2017-07-26 09:36:32 +00:00
Adam Klein
6d17cb3dc1 [ignition] Add DCHECK for FunctionLiteral scoping
This DCHECK would have triggered in the test cases in the attached bug.

Bug: chromium:740591
Change-Id: Ib8e866fe60f5f4ee825e6772f68be768925ed792
Reviewed-on: https://chromium-review.googlesource.com/585401
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46891}
2017-07-26 09:22:42 +00:00
jgruber
dc7abf3e21 [coverage] Support Yield and Async
The yield* statement when used in combination with async iterators is not
supported yet, as that is desugared into a more complex construct that doesn't
offer a good dedicated bytecode to attach the source range information yet.

Note that invocation counts of generator functions are incorrect as they count
each resumption as an individual call. See https://crbug.com/v8/6594.

Bug: v8:6000
Change-Id: I7ac7073473c9b64bb207cdbc4dab083ec1145656
Reviewed-on: https://chromium-review.googlesource.com/582690
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46890}
2017-07-26 09:04:42 +00:00
Michael Starzinger
637b7d645c [asm.js] Switch StdlibSet to be a uint64_t bit set.
This switches the {StdlibSet} to be a data structure that does not
require dynamic memory allocation. This makes it easier to carry it
around as part of a {CompilationJob} and serialize it into the heap.

R=clemensh@chromium.org

Change-Id: I77b2353cfdcd9438a26f04d00749159fed9b9b6c
Reviewed-on: https://chromium-review.googlesource.com/584868
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46889}
2017-07-26 07:34:50 +00:00
Adam Klein
60c0ba3285 [cleanup] Remove runtime/intrinsic support for OrderedHashTable JS code
TBR=yangguo@chromium.org

Change-Id: Ieebc7da56d2c583b2c937b68047b35290f924ec8
Reviewed-on: https://chromium-review.googlesource.com/585554
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46886}
2017-07-25 22:56:45 +00:00
Sathya Gunasekaran
62a7c080d5 [parser] Provide better error when incorrectly using await
Before we try to do ASI and fail with a generic error, we special case
for the await token in the failure case.

Bug: v8:6572, v8:6513
Change-Id: Ia050c98b5a5b20bc326f429a367635b8553e4112
Reviewed-on: https://chromium-review.googlesource.com/582210
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46885}
2017-07-25 22:53:58 +00:00
Aseem Garg
eb65f35e96 [wasm] redirect wasm calls to js functions through a GCed table
With this patch, rather than embedding the JSReceiver address directly
in the WasmToJS wrappers, we put that in a fixed array with global handle
scope and instead embed the location of the handle and the index in the
wrapper. This ensures that the wrapper doesn't need to be patched if the
GC kicks in. This is needed to get the WASM code off the GCed heap.

R=mtrofin@chromium.org

Bug: 
Change-Id: Ie5a77a78cdecec51b04f702c63b8e4285e6a2d8d
Reviewed-on: https://chromium-review.googlesource.com/581682
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46884}
2017-07-25 22:32:39 +00:00
Caitlin Potter
4fe1d71509 [interpreter] make suspend_id an immediate operand to SuspendGenerator
Remove need for shuffling of accumulator and operand registers when
suspending a generator

BUG=v8:6351
TBR=bmeurer@chromium.org

Change-Id: I372509adc03b9781716412b809639554fe16e372
Reviewed-on: https://chromium-review.googlesource.com/578377
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46883}
2017-07-25 19:08:48 +00:00
Mircea Trofin
832e5b9f47 [wasm] Add an explicit Abort to wasm streaming builder.
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Iae6942cf2b223a296dda479af26a978576d0c58a
Reviewed-on: https://chromium-review.googlesource.com/584367
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46882}
2017-07-25 18:27:22 +00:00
Adam Klein
f1f2285715 Rewrite scopes of initializers in for-in/of destructured declarations
Bug: chromium:740591
Change-Id: I869be41d8630b23704b9470c4d3db8a21bbde873
Reviewed-on: https://chromium-review.googlesource.com/583531
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46881}
2017-07-25 18:26:16 +00:00
Bill Budge
92da5a474d [Memory] Don't heap allocate instances of base::VirtualMemory.
- Changes some instance fields from VM pointers to VM.  
- Changes some comments to correctly describe code.  

Bug: v8:6635
Change-Id: I9ec93ef0b09d541c966caa6482c5832cd6b1e149
Reviewed-on: https://chromium-review.googlesource.com/584931
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46880}
2017-07-25 17:16:56 +00:00
Michael Starzinger
57031e82db [asm.js] Enable --validate-asm by default.
R=rmcilroy@chromium.org
BUG=v8:4203

Change-Id: I6741eaff237daa32fd4e88a125ebd51fe80d2adb
Reviewed-on: https://chromium-review.googlesource.com/583655
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46879}
2017-07-25 16:08:26 +00:00
Leszek Swirski
eff31fd1ea [CSA] Allow Assert to print variables
Allow appending expressions to a CSA_ASSERT call, which will be printed
if the assert fails, e.g.

    CSA_ASSERT(csa, IsFixedArray(array), array)
 ->
    CSA_ASSERT failed: IsFixedArray(array) [../../src/foo.cc]
     * array: 0x12345678 <SharedFunctionInfo>

This helps debug assert failures where it may not be immediately obvious
why the assert failed, and the runtime call to print the failure has
already clobbered the registers used by the predicate.

Currently, the number of additional expressions is limited to 5, for
macro simplicity.

Change-Id: I000b6806ea0f8f9240493b3606c9f845ca65faf9
Reviewed-on: https://chromium-review.googlesource.com/584752
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46878}
2017-07-25 15:37:55 +00:00
Mircea Trofin
ae5de6184e [d8] enable os.system only when requested
os.system uses fork(), which is not supported by ASAN/LSAN. Some fuzz tests
consist of js code that randomly picks properties and functions and calls them.
Sometimes, this combination means ASAN will report false positives.

Bug: chromium:740361
Change-Id: Id8d517263251a1fe88abadd33b0225c664b00498
Reviewed-on: https://chromium-review.googlesource.com/580313
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46876}
2017-07-25 14:42:44 +00:00
Camillo Bruni
0392eb20ac [literals] Introduce CreateEmptyArrayLiteral Bytecode
Empty Array literals are amongst the most commonly used literal types on our
top25 page list. Using a custom bytecode we can drop the boilerplate for empty
Array literals alltogether. However, we still need a proper AllocationSite to
track ElementsKind transitions.

Bug: v8:6211, chromium:746935
Change-Id: I891eaa778e4e81e138e483a65f04ae00ae30bd28
Reviewed-on: https://chromium-review.googlesource.com/580932
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46875}
2017-07-25 14:30:43 +00:00
Ross McIlroy
b3ff283754 [Compiler] Use shared_ptr for ast_value_factory in ParseInfo.
Rather than using an ad-hock ownership model for ast_value_factory, use a
shared_ptr.

BUG=v8:5203

Change-Id: I5f2a573c8b175a3138ad8b01aa78bddadd16e6d3
Reviewed-on: https://chromium-review.googlesource.com/582628
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46874}
2017-07-25 13:49:23 +00:00
Camillo Bruni
c7854ed957 [builtins] Array.prototype.sort bug
Bug: chromium:743154
Change-Id: Id5b2a91a9242326b1dafccc4aeb95e18fb0fc8d8
Reviewed-on: https://chromium-review.googlesource.com/580928
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46873}
2017-07-25 13:26:03 +00:00
Michael Lippautz
8c9b0b50bf [heap] Disable parallel scavenge for single-threaded use
Bug: chromium:738865
Change-Id: I7c367116e60117eab36d58d5078a87841e4b03cc
Reviewed-on: https://chromium-review.googlesource.com/584833
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46872}
2017-07-25 13:00:23 +00:00
Georg Neis
a734f3e567 [cleanup] Remove some dead MacroAssembler code.
- Remove StoreRoot.
- Remove IsObjectJSStringType.
- [ppc, s390] Remove TryInlineTruncateDoubleToI.

R=jarin@chromium.org

Bug: 
Change-Id: I57d739f5b4a8de1d6ffbfb7e85e7d2784bfa4582
Reviewed-on: https://chromium-review.googlesource.com/584828
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46871}
2017-07-25 12:16:23 +00:00
Georg Neis
ddec1c4f57 [modules] Fix Object.prototype.hasOwnProperty on namespace objects.
This must throw for uninitialized properties.

R=adamk@chromium.org

Bug: v8:1569, v8:5487
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng;master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I8beb8bf6a197870eb5c038102ab474dd12f6b6eb
Reviewed-on: https://chromium-review.googlesource.com/582013
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46870}
2017-07-25 12:09:41 +00:00
Mike Stanton
fe8b8f2236 [TurboFan] Provide a DebugBreak() operation to the graph assembler.
Now that we are writing more complex code in the effect control
linearizer, it can be helpful to stop in certain cases during
development / debugging.

Bug: 
Change-Id: Ibeafe807c43e092534509d4d9c3f84f9c20525a5
Reviewed-on: https://chromium-review.googlesource.com/584749
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46869}
2017-07-25 12:01:01 +00:00
Leszek Swirski
661726dd39 [runtime] Move profiler ticks from SFI to feedback vector (reland)
Reland of https://chromium-review.googlesource.com/c/544888/.

Instead of counting profiler ticks on the shared function info (which is
shared between native contexts), count them on the feedback vector
(which is not). This allows us to continue pushing optimization
decisions off the SFI, onto the feedback vector.

Note that a side-effect of this is that ICs don't have to walk the stack
to reset profiler ticks, as they can access the feedback vector directly
from their feedback nexus.

Change-Id: I7aa6baed03f726843d1b62629c72b74f05114b48
Reviewed-on: https://chromium-review.googlesource.com/579051
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46868}
2017-07-25 11:54:21 +00:00
Jaroslav Sevcik
87d8db6fc4 [profiler] Do not log Date.now timer events by default.
Bug: v8:6520
Change-Id: Id1249b293fc6aafbeddb7fb9f4b522dfbec7fc78
Reviewed-on: https://chromium-review.googlesource.com/584608
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46867}
2017-07-25 11:49:31 +00:00
Michael Hablich
4f2e6e9ddd Revert "[inspector] support for cases when embedder doesn't call contextDestroyed"
This reverts commit 87aae715df.

Reason for revert: Speculative revert because of ASAN leaks in https://chromium-review.googlesource.com/584488

Original change's description:
> [inspector] support for cases when embedder doesn't call contextDestroyed
> 
> Node.js doesn't have good place to call contextDestroyed.
> We need to cleanup everything on our side to allow clients to not call
> contextDestroyed method.
> 
> R=​dgozman@chromium.org,eostroukhov@google.com
> 
> Bug: none
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: I6bfd4d6039f53eb994a2d20ecbca650744564e29
> Reviewed-on: https://chromium-review.googlesource.com/575519
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46849}

TBR=dgozman@chromium.org,kozyatinskiy@chromium.org,eostroukhov@google.com,eostroukhov@chromium.org

Change-Id: Ic3c2764159f809536670f73ab0cd5ea37317d400
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/584767
Reviewed-by: Michael Hablich <hablich@chromium.org>
Commit-Queue: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46865}
2017-07-25 11:07:51 +00:00
Ulan Degenbaev
6e3d7ee6cb Revert "[heap] Remove clearing of caches and counter of shared function info in"
This reverts commit 8580529302.

Reason for revert: increased memory usage on benchmarks.

BUG=chromium:747806

Original change's description:
> [heap] Remove clearing of caches and counter of shared function info in
> marking visitors.
> 
> This makes incremental and concurrent visitors of share function infos
> side-effect free.
> 
> BUG=chromium:694255
> 
> Change-Id: I85ee7bac17f17bdbc101ef64ecfb46020b5b3458
> Reviewed-on: https://chromium-review.googlesource.com/574851
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46796}

TBR=ulan@chromium.org,mlippautz@chromium.org

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

Bug: chromium:694255
Change-Id: Id28551ce8378820b0272721b7efb388727c442d4
Reviewed-on: https://chromium-review.googlesource.com/584288
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46864}
2017-07-25 10:42:56 +00:00
Ross McIlroy
796566093c [asmjs] Implement AsmJsCompilationJob.
Moves AsmJs compilation into an AsmJs compilation job. This enables it
to be treated like other unoptimized compilations and avoids some
special-casing in compiler.cc.

BUG=v8:5203

Change-Id: I71ad27e3f72815b4c4074634fff0d168a9c89102
Reviewed-on: https://chromium-review.googlesource.com/581487
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46863}
2017-07-25 10:38:36 +00:00
Ross McIlroy
3cbceb215f [Compiler] Split ScopeInfo allocation out of DeclarationScope::Analyse.
Move ScopeInfo allocation out of DeclarationScope::Analyse and do it later
in the compile when finalizing unoptimized code generation. This is to enable
scope analysis to be done without heap allocation so it could run off-thread.

BUG=v8:5203

Change-Id: I954aacd4353925bbbd5a940d979027de2c52e1fd
Reviewed-on: https://chromium-review.googlesource.com/581108
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46862}
2017-07-25 09:35:44 +00:00
Yang Guo
89ef9556d7 Reland: Introduce HASH_TABLE_TYPE instance type.
This is so that we can distinguish hash tables by instance type. We can
then introduce maps for each kind of hash tables to further distinguish.

R=mstarzinger@chromium.org

Bug: v8:6593
Change-Id: Ice9e6bb7b85d825207ac489b6930ac9020d60db8
Reviewed-on: https://chromium-review.googlesource.com/582814
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46861}
2017-07-25 09:19:46 +00:00
Clemens Hammacher
072d0e3eb6 [wasm] Allow for arbitrarily long error messages
We currently have a fixed limit of 256 characters for error messages
generated in the decoder. However, we sometimes embed names in it,
which makes it easy to generate a crash by using long names (e.g. for
exports) in invalid wasm modules.
This CL fixes this by switching to a stream based interface, allowing
to pass arbitrary objects to be printed. With this interface, we can
easily limit the length of output later.

R=titzer@chromium.org

Bug: chromium:740023
Change-Id: I2848c31c63a015157e2a3a9458b54e523060cd69
Reviewed-on: https://chromium-review.googlesource.com/565282
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46860}
2017-07-25 09:17:15 +00:00
Clemens Hammacher
620b544ddf [ostreams] Extend AsHex and add AsHexBytes
Add a third parameter to {AsHex} which specifies whether the prefix
"0x" should be printed. Also, add the {AsHexBytes} helper which
outputs the hex number as individual bytes separated by a whitespace.
Also add unit tests for both helpers.

Both helper will be used in an upcoming refactoring of wasm error
messages:
https://chromium-review.googlesource.com/c/565282

R=titzer@chromium.org

Change-Id: I42d5ace9841ffb918cb4d6803b6347229e446097
Reviewed-on: https://chromium-review.googlesource.com/583448
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46859}
2017-07-25 08:37:46 +00:00
Clemens Hammacher
d8ac28e9ae [wasm] Test more error messages
Extend the errors.js mjsunit test to also check for the message in the
generated errors. This will help catch bugs later, e.g. when
refactoring the way we output errors:
https://chromium-review.googlesource.com/c/565282

Drive-by 1: Fix a superfluous period in one error message.
Drive-by 2: Fix a weird exception catching construct in the test.

R=titzer@chromium.org

Change-Id: I1c2e92fb2c34a481cbf8802153f8502452d45348
Reviewed-on: https://chromium-review.googlesource.com/582960
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46858}
2017-07-25 08:29:13 +00:00
Yang Guo
7924985f9f [regexp] Throw for patterns like /[\p{...}-\p{...}]/u.
Bug: v8:4743
Change-Id: Iacb7681e679faa1ece77c577a2585363f6ef87a2
Reviewed-on: https://chromium-review.googlesource.com/582010
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46857}
2017-07-25 08:25:43 +00:00
Michael Achenbach
aad9d2cd36 Update V8 DEPS.
Rolling v8/build: d9a25a7..9ce44b9

Rolling v8/tools/clang: 34762ec..7185692

This also ports https://chromium-review.googlesource.com/c/582976

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

Change-Id: I6436dd50b7cee016d1cc2d5f48d2d27e9025276d
Reviewed-on: https://chromium-review.googlesource.com/584171
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46855}
2017-07-25 07:10:46 +00:00
Igor Sheludko
c558369af2 [runtime] Don't create "class" field types for arrays' fields.
... when reconfiguring const fields to mutable fields.

Bug: chromium:747979, chromium:738763, chromium:745844
Change-Id: Ibfac1b875a1da8234966ac10658260f1cc718fe5
Reviewed-on: https://chromium-review.googlesource.com/583647
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46854}
2017-07-25 06:54:46 +00:00
Benedikt Meurer
851e8057e6 [cleanup] Remove unused InternalPackedArray.
Inside of V8 there's no use of InternalPackedArray left, so no need to
keep that around.

R=yangguo@chromium.org

Change-Id: I819fc400ef46353339596dec98b70df2d442ed47
Reviewed-on: https://chromium-review.googlesource.com/583653
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46853}
2017-07-25 05:40:16 +00:00
Mike Stanton
d9b98f3d05 [TurboFan] Array.prototype.map inlining error
A Phi is necessary to carry the ElementsKind forward in case transitions
are taken.

Bug: chromium:747075
Change-Id: I9d9d66b0219fe3f67d08536f4d478ee300c76acb
Reviewed-on: https://chromium-review.googlesource.com/583090
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46852}
2017-07-25 04:05:56 +00:00
Erik Luo
46d815e737 inspector: add lengths for binary data descriptions
This CL adds support for ArrayBuffer and SharedArrayBuffer subtypes for injected
script source. It also adds the byteLength/size to the description of these
objects and for the upcoming "blob" subtype when appropriate.

This is dependent on a DevTools frontend patch to accept these new subtypes:
https://chromium-review.googlesource.com/c/582427/

Bug: chromium:653620
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If8f612b54e82e6fd2f056545bd521868ba7349fd
Reviewed-on: https://chromium-review.googlesource.com/582233
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46851}
2017-07-25 00:19:55 +00:00
Sathya Gunasekaran
fe18ad6580 Reland "[runtime] Load only 10 bits as PropertyArray length"
This is a reland of b2bf43d529
Original change's description:
> [runtime] Load only 10 bits as PropertyArray length
> 
> Bug: v8:6404
> Change-Id: I187f20006c14aab4a36e2bfef31ca68ebb249e43
> Reviewed-on: https://chromium-review.googlesource.com/576516
> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46822}

TBR=ulan@chromium.org,mstarzinger@chromium.org,cbruni@chromium.org

Bug: v8:6404
Change-Id: Ia0d8bf276fcfc7bfce704d68ba3427d7ba941ba9
Reviewed-on: https://chromium-review.googlesource.com/583708
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46850}
2017-07-24 22:20:06 +00:00
Alexey Kozyatinskiy
87aae715df [inspector] support for cases when embedder doesn't call contextDestroyed
Node.js doesn't have good place to call contextDestroyed.
We need to cleanup everything on our side to allow clients to not call
contextDestroyed method.

R=dgozman@chromium.org,eostroukhov@google.com

Bug: none
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I6bfd4d6039f53eb994a2d20ecbca650744564e29
Reviewed-on: https://chromium-review.googlesource.com/575519
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46849}
2017-07-24 21:22:06 +00:00
titzer
1bbbc8cc61 [wasm] More extensive indirect dispatch signature mismatch tests.
BUG=chromium:747995

Review-Url: https://codereview.chromium.org/2981883002
Cr-Commit-Position: refs/heads/master@{#46848}
2017-07-24 19:21:28 +00:00
Ulan Degenbaev
ec1c5009fe Revert "[heap] Use AdjustAmountOfExternalMemory to account freed array buffers."
This reverts commit 5ea58bde1c.

Reason for revert: potential perf regression.

BUG=chromium:748100

Original change's description:
> [heap] Use AdjustAmountOfExternalMemory to account freed array buffers.
> 
> Currently GC decrements the external memory counter directly bypassing
> the AdjustAmountOfExternalMemory. This is inconsistent with array
> buffer allocation, which actually uses the API to increment the counter.
> 
> Change-Id: I401087872213fdd60f1a40c99c8f459c14dc0608
> Reviewed-on: https://chromium-review.googlesource.com/582008
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46835}

TBR=ulan@chromium.org,mlippautz@chromium.org

Change-Id: Ibde2acb9ae2e4274946124fc4606321b95c80758
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/583453
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46847}
2017-07-24 17:29:23 +00:00
Jaroslav Sevcik
3d5f2e08bf [builtins] Port Set.prototype.(add|delete) to CSA.
Bug: v8:5717
Change-Id: Iac82b4960cc3ed89820c49b091d6860136839300
Reviewed-on: https://chromium-review.googlesource.com/583147
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46846}
2017-07-24 16:55:00 +00:00
Jaideep Bajwa
fab6fe09df PPC/s390: Don't dereference handles in (macro-)assembler functions used by TF (reland)
Port 9b3174b295

Original Commit Message:

    Remove all IsHeapObject/IsSmi checks from assembler and also from
    the macro-assembler functions that Turbofan code generation uses.

    Note for porters: In case it's unclear which macro-assembler
    functions need to be modified, it may be best to wait until I
    split MacroAssembler in a followup-CL, which will make that clear.

R=neis@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:6048
LOG=N

Change-Id: Ic24c7145fa9c3d44d0359e93583eb5ddf0bcf5a8
Reviewed-on: https://chromium-review.googlesource.com/581796
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46845}
2017-07-24 15:52:10 +00:00
Michael Starzinger
4e207a429a Switch JSFunction::code to be a tagged value.
This switches the "code entry" field on JSFunction to no longer be an
inner pointer into a Code object (i.e. to the start of the instruction
stream), but a properly tagged pointer instead.

Motivation behind this is the ability to treat this field regularly as
part of escape analysis in the optimizing compiler. Also simplifies the
object visitation for JSFunction objects.

R=bmeurer@chromium.org

Change-Id: Ib53a3fc5f3d783a6fed06dbcab319f5568632acc
Reviewed-on: https://chromium-review.googlesource.com/577890
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46844}
2017-07-24 15:42:30 +00:00
Jaideep Bajwa
46344edaac PPC/s390: [compiler] Delay generation of code stubs.
Port 040fa06fb3
Port 659e8f7b5c

R=neis@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:6048
LOG=N

Change-Id: Id3030a64d462344eb8612f8009b0c8e15a5edcb9
Reviewed-on: https://chromium-review.googlesource.com/581744
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Jaideep Bajwa <bjaideep@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#46843}
2017-07-24 15:05:10 +00:00
Michael Lippautz
486e641c11 [heap] Fix Barrier used in Scavenger
The barrier assumed that the number of tasks is fixed. However, we
cannot rely on that because other tasks might take up threads. In the
ein thend this would result in the Scavenge task being (rightfully)
cancelled.

The barrier now assumes no tasks in the beginning and relies on the fact
that reaching the barrier means that no global work is left. Tasks that
lag behing will just observe the barrier being in its end state.

Bug: chromium:738865
Change-Id: I4d47e8ec4b9cf7c615b3d9585e4a6bb9d271d409
Reviewed-on: https://chromium-review.googlesource.com/582947
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46842}
2017-07-24 14:27:28 +00:00
Igor Sheludko
134cc94eb0 Revert "[runtime] Make JSFunction::prototype_or_initial_map field optional."
This reverts commit 3d023952f2.

Reason for revert: breaks gcc build

Original change's description:
> [runtime] Make JSFunction::prototype_or_initial_map field optional.
> 
> Functions that don't have prototype need to store neither prototype nor
> initial map, so the |prototype_or_initial_map| field is not required for
> such maps.
> 
> Bug: v8:6459
> Change-Id: I4b3066bd6a4fed42c19f217bae82a8bce552bdca
> Reviewed-on: https://chromium-review.googlesource.com/570250
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46840}

TBR=jkummerow@chromium.org,jarin@chromium.org,ishell@chromium.org

Change-Id: Ie9951c87b15c8bd365ed187d7f719b8f08dd0bb5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6459
Reviewed-on: https://chromium-review.googlesource.com/583088
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46841}
2017-07-24 14:13:10 +00:00
Igor Sheludko
3d023952f2 [runtime] Make JSFunction::prototype_or_initial_map field optional.
Functions that don't have prototype need to store neither prototype nor
initial map, so the |prototype_or_initial_map| field is not required for
such maps.

Bug: v8:6459
Change-Id: I4b3066bd6a4fed42c19f217bae82a8bce552bdca
Reviewed-on: https://chromium-review.googlesource.com/570250
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46840}
2017-07-24 13:44:43 +00:00
Jaroslav Sevcik
b955d84289 [builtins] Port Map.p.delete to CSA.
Bug: v8:5717
Change-Id: Iff5b71b9e27b3e4a790118cbd4877b4460d07b1d
Reviewed-on: https://chromium-review.googlesource.com/582810
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46839}
2017-07-24 12:13:43 +00:00
Peter Marshall
e8c9649e25 [builtins] Increase the maximum string length on 64-bit platforms.
Increase from 2^28 - 16 to 2^30 - 25 for 64-bit platforms.

Bug: v8:6148
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I3529d7ed757a7ab49a001af8641cf888db171cdb
Reviewed-on: https://chromium-review.googlesource.com/570047
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46838}
2017-07-24 10:38:55 +00:00
jgruber
d8e147752c [regexp] Teach deoptimizer to materialize JSRegExp objects
Now that literal allocation is inlined, it is possible to optimize out regexp
literal allocation completely. If a lazy deopt is triggered in that situation,
the deoptimizer needs to know how to materialize regexp objects.

Bug: v8:6605,v8:6556,chromium:747825
Change-Id: Id491053f8e64fec16540efbfdc6c7c524da3e080
Reviewed-on: https://chromium-review.googlesource.com/582609
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46837}
2017-07-24 10:36:25 +00:00
Michael Lippautz
d70be3fa7d [heap] Switch global pool in Worklist to inlined list
- Avoids allocations when adding entries to the global pool
- Avoids taking the lock when not working on the global pool

Bug: 
Change-Id: I380b91d8fed2cab95fd84c4a3f4144cc8d6de86d
Reviewed-on: https://chromium-review.googlesource.com/582691
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46836}
2017-07-24 09:49:05 +00:00
Ulan Degenbaev
5ea58bde1c [heap] Use AdjustAmountOfExternalMemory to account freed array buffers.
Currently GC decrements the external memory counter directly bypassing
the AdjustAmountOfExternalMemory. This is inconsistent with array
buffer allocation, which actually uses the API to increment the counter.

Change-Id: I401087872213fdd60f1a40c99c8f459c14dc0608
Reviewed-on: https://chromium-review.googlesource.com/582008
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46835}
2017-07-24 09:23:20 +00:00
Michael Starzinger
d07365f9de [turbofan] Handle exceptional edges in ReduceArrayForEach.
This adds handling for exceptional control projections when lowering
calls to {Array.prototype.forEach} in the call reducer.

R=jarin@chromium.org
TEST=mjsunit/optimized-foreach
BUG=v8:1956

Change-Id: I282048b203814cbc1c90df983879578b210f92fb
Reviewed-on: https://chromium-review.googlesource.com/574542
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46834}
2017-07-24 09:04:11 +00:00
Yang Guo
f4867154c4 Revert "Introduce HASH_TABLE_TYPE instance type."
This reverts commit 990dd947bc.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Introduce HASH_TABLE_TYPE instance type.
> 
> This is so that we can distinguish hash tables by instance type. We can
> then introduce maps for each kind of hash tables to further distinguish.
> 
> R=​mstarzinger@chromium.org
> 
> Bug: v8:6593
> Change-Id: I1a532884758e571abdfe2e2743fc5ea611d12f7e
> Reviewed-on: https://chromium-review.googlesource.com/581009
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46828}

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

Change-Id: Ia47d408e5cf47983940227b4cc445a704d7f8d19
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6593
Reviewed-on: https://chromium-review.googlesource.com/581493
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46833}
2017-07-24 07:33:52 +00:00
Benedikt Meurer
5ee1b7ad5a [turbofan] Add IC support for Call/ConstructWithSpread.
Properly hook up the (existing) IC slots for the CallWithSpread and
ConstructWithSpread bytecodes, and change the interpreter to collect
feedback (call counts and regular target function feedback) for those.
There's no integration with the Array constructor yet, since that
requires some yak shaving to thread through the AllocationSite to the
Array constructor stub. Once we have a solution for that, we can also
remove the current code duplication in the Call/Construct IC logic.

Also properly hook up the newly available feedback in TurboFan. This
will fix not only the missing target feedback, but more importantly
the tear-up decisions for optimization are correct now in the presence
of spread calls, and even more importantly the inlining heurstic has
proper call frequencies for those.

Some follow-up changes will be necessary to make sure we use the
feedback even for corner cases that aren't handled properly yet. Also
we should consider collecting feedback about the map of the spread
at some point to be able to always inline the spread calls.

Bug: v8:6399, v8:6527, v8:6630
Change-Id: I818dbcb411fd3951d8e9d31f5d7e794f8d60fa00
Reviewed-on: https://chromium-review.googlesource.com/582647
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46832}
2017-07-24 07:11:50 +00:00
jgruber
e0e3049e6e [interpreter] Print handler sizes on --print-builtin-size
Bytecode handlers are technically not builtins, but very similar to CSA
builtins in most respects (CSA-generated code, currently included in the
snapshot and deserialized for every isolate). This prints bytecode
handler sizes (in addition to standard CSA builtin sizes) when
--print-builtin-size is passed.

Bug: 
Change-Id: Ibd78422c5138b77ccf298f97c7c1fc1b73a3a09b
Reviewed-on: https://chromium-review.googlesource.com/581191
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46831}
2017-07-24 07:00:10 +00:00
Igor Sheludko
21e7f08385 [runtime] Don't track "class" field types for arrays with properties.
... in order to avoid the need to update field types through elements
kind transitions.

Bug: chromium:738763, chromium:745844
Change-Id: I9f0e7f321e7f44ab5b36c06dd4c5633611370807
Reviewed-on: https://chromium-review.googlesource.com/581647
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46830}
2017-07-24 06:34:12 +00:00
Jaroslav Sevcik
f641b7e6a4 [turbofan] Fix truncation query names.
Change-Id: I8a1e53d1836f4c68f571d397c35dd6f091e68076
Reviewed-on: https://chromium-review.googlesource.com/577537
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46829}
2017-07-24 06:27:12 +00:00
Yang Guo
990dd947bc Introduce HASH_TABLE_TYPE instance type.
This is so that we can distinguish hash tables by instance type. We can
then introduce maps for each kind of hash tables to further distinguish.

R=mstarzinger@chromium.org

Bug: v8:6593
Change-Id: I1a532884758e571abdfe2e2743fc5ea611d12f7e
Reviewed-on: https://chromium-review.googlesource.com/581009
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46828}
2017-07-24 06:04:29 +00:00
Jaroslav Sevcik
8b57281f27 [builtins] Port Map.prototype.set to CSA.
Bug: v8:5717
Change-Id: I2c3304070529272e84060bd625bf52a1a91203b5
Reviewed-on: https://chromium-review.googlesource.com/581490
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46827}
2017-07-24 05:59:49 +00:00
Igor Sheludko
5520cae3fd Revert "Reland "[runtime] Add shortcuts for elements kinds transitions.""
This reverts commit 6e27386d68.

Reason for revert: There will be another much simpler and
back-mergeable fix.

Original change's description:
> Reland "[runtime] Add shortcuts for elements kinds transitions."
> 
> This is a reland of b90e83f5da
> Original change's description:
> > [runtime] Add shortcuts for elements kinds transitions.
> >
> > The shortcuts ensure that field type generalization is properly
> > propagated in the transition graph.
> >
> > Bug: chromium:738763
> > Change-Id: Id701a6f95ed6ea093c707fbe0bac228f1f856e9f
> > Reviewed-on: https://chromium-review.googlesource.com/567992
> > Commit-Queue: Igor Sheludko <ishell@chromium.org>
> > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#46622}
> 
> Bug: chromium:738763, chromium:742346, chromium:742381, chromium:745844
> Change-Id: I93974e3906b2c7710bd525f15037a2dd97f263ad
> Reviewed-on: https://chromium-review.googlesource.com/575227
> Commit-Queue: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46759}

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

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

Bug: chromium:738763, chromium:742346, chromium:742381, chromium:745844
Change-Id: I203dc748c47db554e0a86d61f0e2b7b8b96f2370
Reviewed-on: https://chromium-review.googlesource.com/581547
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46826}
2017-07-24 05:31:29 +00:00
Michael Achenbach
bb728e182b Revert "[runtime] Load only 10 bits as PropertyArray length"
This reverts commit b2bf43d529.

Reason for revert: 
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug/builds/14149

Original change's description:
> [runtime] Load only 10 bits as PropertyArray length
> 
> Bug: v8:6404
> Change-Id: I187f20006c14aab4a36e2bfef31ca68ebb249e43
> Reviewed-on: https://chromium-review.googlesource.com/576516
> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Camillo Bruni <cbruni@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46822}

TBR=ulan@chromium.org,jkummerow@chromium.org,mstarzinger@chromium.org,cbruni@chromium.org,gsathya@chromium.org

Change-Id: If55b65f040a5a541726e39c35c12e3a5731aa744
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6404
Reviewed-on: https://chromium-review.googlesource.com/582607
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46823}
2017-07-22 10:46:05 +00:00
Sathya Gunasekaran
b2bf43d529 [runtime] Load only 10 bits as PropertyArray length
Bug: v8:6404
Change-Id: I187f20006c14aab4a36e2bfef31ca68ebb249e43
Reviewed-on: https://chromium-review.googlesource.com/576516
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46822}
2017-07-21 23:26:53 +00:00
Mircea Trofin
d77e98e8df [wasm] Use async compilation in streaming API
This change gets the streaming compile APIs closer to their final shape,
by moving to a promise-based design.

Bug: chromium:747396
Bug: v8:6619
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ifd22ff83c79391a0f2a8ec2e5af39f71df1ea1c2
Reviewed-on: https://chromium-review.googlesource.com/581412
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46821}
2017-07-21 18:03:27 +00:00
Caitlin Potter
00681326a3 [interpreter] refactor BuildGeneratorSuspend/Resume into BuildSuspendPoint
Simplify the model for generating Awaits, because the resume point is
always immediately following the suspend point, and registers used are
always the same for both operations.

Includes a minor refactoring of BytecodeGenerator::VisitYield() to
perform iterator result creation before the SuspendGenerator bytecode,
rather than between SuspendGenerator and Return. This adds a small
number of bytecodes for each yield.

BUG=v8:2355, v8:5855

Change-Id: I4868b89a6bc1b251f887d2a45890c8fa19f7b089
Reviewed-on: https://chromium-review.googlesource.com/576286
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#46820}
2017-07-21 16:48:57 +00:00
Ulan Degenbaev
d8846ffd5f Reland "[heap, runtime] Fix data race in prototype map transition during"
This reverts commit a9428d527e.

Original change's description:
 > [heap, runtime] Fix data race in prototype map transition during
 > concurrent marking.
 >
 > BUG=chromium:694255
 >
 > Change-Id: I172167623e9deab692fb506d7d4211d210b09a80
 > Reviewed-on: https://chromium-review.googlesource.com/579092
 > Reviewed-by: Igor Sheludko <ishell@chromium.org>
 > Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
 > Cr-Commit-Position: refs/heads/master@{#46813}

Change-Id: Ib4b4b989620800ce8a4f4247e4dae2a88c186be9
Reviewed-on: https://chromium-review.googlesource.com/581194
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46819}
2017-07-21 13:20:13 +00:00
jgruber
99248f4d86 [interpreter] Add ConditionalControlFlowBuilder
This refactors logic for handling IfStatement and Conditional nodes (including
block-coverage related slot and counter creation) into a new control-flow
builder.

Bug: v8:6000
Change-Id: Ib5b1724bdf8571fb55d310be79cc60dcf5473b81
Reviewed-on: https://chromium-review.googlesource.com/579509
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46818}
2017-07-21 13:15:43 +00:00
Ross McIlroy
5d0a4327c7 Revert "[Turbofan] Merged the OSR phase into the graph building phase."
This reverts commit 69c8f16da7.

Reason for revert: Causing crashes on Clusterfuzz - http://crbug.com/747154

BUG=chromium:747154

Original change's description:
> [Turbofan] Merged the OSR phase into the graph building phase.
> 
> Now the OSR phase is only used when OSRing from the ast graph builder.
> When OSRing from Turbofan, the implementation is now in the graph
> building phase, at the beginning of the VisitBytecode function.
> We are no longer generating any OSRLoopEntry or OSRNormalEntry nodes,
> nor nodes for the possible code of the OSRed function which is before
> the OSRed loops.
> 
> The trimming and reducing of the OSR phase is not done either. This
> change in the way the way the OSR is done enabled to remove the
> workaround to the bug mentioned below.
> 
> Bug: v8:6112
> Bug: v8:6518
> Change-Id: I1c9231810b923486d55ea618d550d981d695d797
> Reviewed-on: https://chromium-review.googlesource.com/543042
> Commit-Queue: Alexandre Talon <alexandret@google.com>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46801}

TBR=rmcilroy@chromium.org,mstarzinger@chromium.org,leszeks@chromium.org,alexandret@google.com

Change-Id: Ifa9bf5d86e888a47cad7fb10446b36fda5029604
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6112, v8:6518
Reviewed-on: https://chromium-review.googlesource.com/581288
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46817}
2017-07-21 11:12:51 +00:00
Ulan Degenbaev
250ba28a57 [heap, deserializer] Restore marking invariant for deserialized maps
when black allocation is on.

The scenario:
1) Incremental marking is off.
2) Partial deserialization starts and calls Heap::ReserveSpace.
2) ReserveSpace creates (white) reservations in old space.
3) ReserveSpace allocates map placeholders. One of these allocations
starts incremental marking, which starts black allocation (currently
when concurrent marking is on). Subsequent maps are black allocated.
4) ReserveSpace succeeds without triggering a GC.
5) Deserialization continues. Some maps are black. Note that
deserialization emits only old->new write barriers and skips
marking write barriers.
6) Deserialization finishes and re-visits the black allocated
reservations and large object. This misses black allocated maps.
7) There is black->white descriptor array pointer in one of these map.

BUG=chromium:723600

Change-Id: Ifffe46f22a7d7dbc5cff2e882190234fcc722ccb
Reviewed-on: https://chromium-review.googlesource.com/581187
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46816}
2017-07-21 10:36:57 +00:00
Ulan Degenbaev
a9428d527e Revert "[heap, runtime] Fix data race in prototype map transition during"
This reverts commit b2d1f27209.

Reason for revert: assertion failure

Original change's description:
> [heap, runtime] Fix data race in prototype map transition during
> concurrent marking.
> 
> BUG=chromium:694255
> 
> Change-Id: I172167623e9deab692fb506d7d4211d210b09a80
> Reviewed-on: https://chromium-review.googlesource.com/579092
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46813}

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

Change-Id: Ida5c66c3e880b9a03ffacbc6f32b1d5b2cfc8260
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:694255
Reviewed-on: https://chromium-review.googlesource.com/581287
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46815}
2017-07-21 10:35:00 +00:00
Ross McIlroy
c179400bdf [Compiler] Remove SharedFunctionInfo from ParseInfo.
Removes the SharedFunctionInfo field from the ParseInfo structure. Instead
require a SharedFunctionInfo to be explicitly passed to ParseFunction.
Also renames GetUnoptimizedCode to CompileUnoptimizedFunction to make it
clear it should only be called for non-top-level code.

BUG=v8:5203

Change-Id: Ibce016e6a5290c3685f7f0a2f5fb1eb2df2ffc3b
Reviewed-on: https://chromium-review.googlesource.com/574589
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46814}
2017-07-21 10:02:47 +00:00
Ulan Degenbaev
b2d1f27209 [heap, runtime] Fix data race in prototype map transition during
concurrent marking.

BUG=chromium:694255

Change-Id: I172167623e9deab692fb506d7d4211d210b09a80
Reviewed-on: https://chromium-review.googlesource.com/579092
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46813}
2017-07-21 09:58:08 +00:00
Michael Lippautz
6dce5c668d [heap] Use all freelist sizes in LocalAllocator
The Scavenger is the only consumer of free list entries besides MC
evacuation and pretenured allocations. Make use of all size classes for
allocation.

Bug: chromium:738865
Change-Id: Ieb62c01b41f2aa62222efac91dde4dce2127ff70
Reviewed-on: https://chromium-review.googlesource.com/580409
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46812}
2017-07-21 09:44:08 +00:00
Andreas Haas
e605a14e8a Add a not-NaN DCHECK to the Float32 constructor
The class Float32 stores the bit pattern of a float as uint32_t to
guarantee that the exact bit pattern of the contained value is
preserved. This is necessary because the bit pattern of a NaN may
change, e.g. when it is passed as a parameter.

For convenience the Float32 class provides a constructor with a float
parameter. Since this constructor cannot guarantee that the right bit
pattern will be stored for NaNs, this CL adds a DCHECK now to make
sure that the constructor is never used with a NaN.

R=mstarzinger@chromium.org

Change-Id: Iba85a5a1bb2778d5f8bdc1aad97524ef8369b73d
Reviewed-on: https://chromium-review.googlesource.com/579367
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46811}
2017-07-21 09:22:28 +00:00
Ross McIlroy
0b7361d168 [Interpreter] Fix --print-bytecode after moving of SFI creation.
After moving the shared function info creation to be during unoptmized
compile finalization the --print-bytecode flag caused a crash by trying
to access the shared function info before it was created. This CL fixes it.

BUG=v8:5203

Change-Id: I82c0431bace51aa44154c55ad4bebde897f7a39e
Reviewed-on: https://chromium-review.googlesource.com/579769
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46810}
2017-07-21 08:12:46 +00:00
Yang Guo
0e4965e59e Remove PREPARED_SCOPE_DATA instance type.
And alpha-sort some lists.

R=jgruber@chromium.org

Change-Id: I01fcf01cf8e1eb1e6c99202156c1013e92bf4e7e
Reviewed-on: https://chromium-review.googlesource.com/579711
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46809}
2017-07-21 07:19:39 +00:00