Commit Graph

42762 Commits

Author SHA1 Message Date
Clemens Hammacher
83162121b4 [wasm] [decoder] Also trace global index
With --trace-wasm-decoder, we were printing the local variable index
for values on the stack generated by get_local instructions. This CL
adds the same feature for globals.

R=titzer@chromium.org

Change-Id: Ie113ebcc2d1abcd67df2d01bf4bdb452635732c8
Reviewed-on: https://chromium-review.googlesource.com/684737
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48170}
2017-09-26 16:09:01 +00:00
Michael Starzinger
02d999abad [asm.js] Fix Math.abs signature to return unsigned.
This fixes the signature of "Math.abs" from "(signed) -> signed" to
"(signed) -> unsigned" and hence fixes cases where the absolute value
would overflow the range of signed 32-bit values. This is in sync with
spec erratas (and ECMAScript semantics).

Note that this also switches the underlying implementation of the above
absolute value function to a branch-free version.

R=clemensh@chromium.org
TEST=mjsunit/regress/regress-6838-3
BUG=v8:6838

Change-Id: Ib13b7ecd336ae386cbde7c574e727bf52f841e00
Reviewed-on: https://chromium-review.googlesource.com/684181
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48169}
2017-09-26 13:02:53 +00:00
Andreas Haas
ab7bd9f408 [wasm] Reduce size of the trap handler ool code
With this CL we use the same optimizations for the trap handler ool code
which we already use for trap-if.

* Call a builtin instead of calling the runtime directly.
* Use one call per ool code instead of a source position parameter.
* Do not pass the trap reason as parameter.

R=titzer@chromium.org, eholk@chromium.org

Change-Id: Ieef6da96f340269c3e91efd21ac24e61a42193f4
Reviewed-on: https://chromium-review.googlesource.com/684436
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48168}
2017-09-26 13:00:34 +00:00
Tobias Tebbi
e6d84f4ecb [csa] fix variable merge for switch default label
Bug: 
Change-Id: I52e757aa2de951ff40660545472321c7dec84241
Reviewed-on: https://chromium-review.googlesource.com/632156
Reviewed-by: Daniel Clifford <danno@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48167}
2017-09-26 12:31:29 +00:00
Maya Lekova
e0b76c9a84 Add fast path to ObjectGetOwnPropertyDescriptor
Bug: v8:6557
Change-Id: I384e9f36058c73d40be1faf5ae1bf8c01d068f0e
Reviewed-on: https://chromium-review.googlesource.com/682059
Commit-Queue: Maya Lekova <mslekova@google.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48166}
2017-09-26 12:21:43 +00:00
Marja Hölttä
f130bfd394 [unicode] Fix overlong / surrogate sequences detection some more.
Follow up to https://chromium-review.googlesource.com/671020

We still didn't return the correct amount of invalid characters, according to
the Encoding spec ( https://encoding.spec.whatwg.org/#utf-8-decoder ), when we
saw a byte sequence which was as start of an overlong / invalid sequence, but
there weren't enough continuation bytes.

A more rigorous test will follow in
https://chromium-review.googlesource.com/c/v8/v8/+/681217

BUG=chromium:765608

Change-Id: I535670edc14d3bae144e5a9ca373f12eec78a934
Reviewed-on: https://chromium-review.googlesource.com/681674
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48165}
2017-09-26 12:08:24 +00:00
Yang Guo
dc7b2b2ba7 Reland "[snapshot] include version string in the startup snapshot."
This is a reland of 629406d1e9
Original change's description:
> [snapshot] include version string in the startup snapshot.
> 
> This is to easier diagnose build issues involving the snapshot.
> Sample error message for mismatching snapshot:
> 
> #
> # Fatal error in ../../src/snapshot/snapshot-common.cc, line 286
> # Version mismatch between V8 binary and snapshot.
> #   V8 binary version: 6.3.1 (candidate)
> #    Snapshot version: 6.3.0 (candidate)
> # The snapshot consists of 2820444 bytes and contains 1 contexts.
> #
> 
> 
> R=machenbach@chromium.org
> 
> Bug: chromium:764327
> Change-Id: Icdc7aeac77819b113985b424feda814a072d5406
> Reviewed-on: https://chromium-review.googlesource.com/684295
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48161}

Bug: chromium:764327
Change-Id: I3721689824e0a6909eede86d0829dc258ae40c4d
Reviewed-on: https://chromium-review.googlesource.com/684494
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48164}
2017-09-26 11:29:44 +00:00
Tobias Tebbi
8f2977a3c6 [turbofan] fix escape analysis for not word aligned fields
On big endian 64 bit architectures, kHashFieldOffset is not word-aligned. 
This breaks the assumption in escape analysis that all fields are word-aligned. 
Fix this by not dematerializing such objects.

Alternative fix for https://chromium-review.googlesource.com/c/v8/v8/+/681335

Change-Id: I7d8e4c7934d9306cc06a614ae110e7cf7235394f
Reviewed-on: https://chromium-review.googlesource.com/681714
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48163}
2017-09-26 11:10:53 +00:00
Yang Guo
dc64a7311d Revert "[snapshot] include version string in the startup snapshot."
This reverts commit 629406d1e9.

Reason for revert: cross platform builds break.

Original change's description:
> [snapshot] include version string in the startup snapshot.
> 
> This is to easier diagnose build issues involving the snapshot.
> Sample error message for mismatching snapshot:
> 
> #
> # Fatal error in ../../src/snapshot/snapshot-common.cc, line 286
> # Version mismatch between V8 binary and snapshot.
> #   V8 binary version: 6.3.1 (candidate)
> #    Snapshot version: 6.3.0 (candidate)
> # The snapshot consists of 2820444 bytes and contains 1 contexts.
> #
> 
> 
> R=​machenbach@chromium.org
> 
> Bug: chromium:764327
> Change-Id: Icdc7aeac77819b113985b424feda814a072d5406
> Reviewed-on: https://chromium-review.googlesource.com/684295
> Reviewed-by: Michael Achenbach <machenbach@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48161}

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

Change-Id: I35a9b575e4f7fe5c45c9dc6f9e774c3e6d30049c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:764327
Reviewed-on: https://chromium-review.googlesource.com/684315
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48162}
2017-09-26 10:32:41 +00:00
Yang Guo
629406d1e9 [snapshot] include version string in the startup snapshot.
This is to easier diagnose build issues involving the snapshot.
Sample error message for mismatching snapshot:

#
# Fatal error in ../../src/snapshot/snapshot-common.cc, line 286
# Version mismatch between V8 binary and snapshot.
#   V8 binary version: 6.3.1 (candidate)
#    Snapshot version: 6.3.0 (candidate)
# The snapshot consists of 2820444 bytes and contains 1 contexts.
#


R=machenbach@chromium.org

Bug: chromium:764327
Change-Id: Icdc7aeac77819b113985b424feda814a072d5406
Reviewed-on: https://chromium-review.googlesource.com/684295
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48161}
2017-09-26 09:55:53 +00:00
Yang Guo
7f9de3dce9 [snapshot] add kProduceExhaustiveCodeCache option.
- Add kProduceExhaustiveCodeCache to v8::ScriptCompiler::CompileOptions
  to request eager compilation to add as much as possible to the code
  cache for the script.
- Repurpose ParseInfo::kLazy flag.
- Remove ParseInfo::kDebug flag.
- Remove --serialize-toplevel as it has become obsolete.

R=marja@chromium.org

Bug: chromium:768705
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ife14f7a1d1c02e525f0b9dbfd2452013d67c7167
Reviewed-on: https://chromium-review.googlesource.com/684019
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48160}
2017-09-26 09:53:53 +00:00
Andreas Haas
2c8ec6b510 [wasm] Remove fixed todo
NOTRY=true

R=clemensh@chromium.org

Change-Id: I1d4d2eee771103a91f0b4878056b8cd72e06337c
Reviewed-on: https://chromium-review.googlesource.com/684077
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48159}
2017-09-26 09:20:41 +00:00
Andreas Haas
17a8867023 [wasm] Allow traps in tests with many parameters in cctests
In the test-run-wasm and test-run-wasm-64 cctests it is not possible to
call runtime functions. To test traps in these cctests we therefore
replace the runtime call with a call to a c-callback, followed by a
return. This CL fixes the problem that the return did not clean up stack
parameters.

This CL unblocks
https://chromium-review.googlesource.com/c/v8/v8/+/671008. Originally I
wanted to mitigate the problem in that CL by defining an additional
parameter register for arm. However, adding additional parameter
registers lets other tests fail.

R=titzer@chromium.org, rodolph.perfetta@arm.com
CC=enricobacis@google.com

Bug: v8:6858
Change-Id: Ia8de73b70a0677ca4d379ed5b16272faee92a78d
Reviewed-on: https://chromium-review.googlesource.com/684017
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48158}
2017-09-26 07:53:39 +00:00
Michael Achenbach
34ac2b7b31 Revert "[bigint] Implement Divide and Remainder"
This reverts commit 2f88c9b2df.

Reason for revert: Specualtive, seems to break win clang compilation:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20clang/builds/8318

Original change's description:
> [bigint] Implement Divide and Remainder
> 
> Bug: v8:6791
> Change-Id: I5ab97feeb25da29bc76cd28088836b4f12d1d916
> Reviewed-on: https://chromium-review.googlesource.com/678037
> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
> Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48152}

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

Change-Id: I400beee84782d0ff7fa972e4188a6d2b6d39bb96
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6791
Reviewed-on: https://chromium-review.googlesource.com/684075
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48157}
2017-09-26 07:44:43 +00:00
Michael Achenbach
215da25548 Revert "Update V8 DEPS."
This reverts commit daca907875.

Reason for revert: https://crbug.com/v8/6857

Original change's description:
> Update V8 DEPS.
> 
> Rolling v8/build: 898597f..57716b3
> 
> Rolling v8/buildtools: cbc33b9..f6d165d
> 
> Rolling v8/third_party/catapult: e3fe21f..9a255f5
> 
> Rolling v8/tools/clang: cf5e2ed..66be66d
> 
> TBR=machenbach@chromium.org,hablich@chromium.org
> 
> Change-Id: I8c7a9604d7ed71f9580cc17e7c4236348983e0a9
> Reviewed-on: https://chromium-review.googlesource.com/681848
> Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
> Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48150}

TBR=v8-autoroll@chromium.org,machenbach@chromium.org,hablich@chromium.org

Bug: v8:6857
Change-Id: I5fc28fb81c5b60fecefbd3324d6b1f1af85f85e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/684215
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48156}
2017-09-26 07:28:33 +00:00
Michael Achenbach
6f6adaa342 Revert "Update V8 DEPS."
This reverts commit 5a5783e3bf.

Reason for revert: https://crbug.com/v8/6857

Original change's description:
> Update V8 DEPS.
> 
> Rolling v8/build: 57716b3..e7d7f78
> 
> Rolling v8/third_party/catapult: 9a255f5..852ba76
> 
> TBR=machenbach@chromium.org,hablich@chromium.org
> 
> Change-Id: I43c0f1d7286ca8ea959f2de4b78337cac9fe3f7d
> Reviewed-on: https://chromium-review.googlesource.com/683735
> Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
> Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48153}

TBR=v8-autoroll@chromium.org,machenbach@chromium.org,hablich@chromium.org

Bug: v8:6857
Change-Id: I52bc977eacce90247fcf25f1c641402daa940024
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/684214
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48155}
2017-09-26 07:27:30 +00:00
Ulan Degenbaev
1e3ee8cc27 [heap] Adjust incremental marking step size heuristics.
After 52e8d0a incremental marking observer is invoked ~8 times more
often than before. This patch increases the allocation observer
threshold for incremental marking and scales the step size based
on the number of concurrent marking tasks.

Bug: chromium:768664
TBR: mlippautz@chromium.org
Change-Id: I0afd5dccd55f32c7f545d9c3a47edc20c6fd83db
Reviewed-on: https://chromium-review.googlesource.com/683955
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48154}
2017-09-26 06:42:57 +00:00
v8-autoroll
5a5783e3bf Update V8 DEPS.
Rolling v8/build: 57716b3..e7d7f78

Rolling v8/third_party/catapult: 9a255f5..852ba76

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

Change-Id: I43c0f1d7286ca8ea959f2de4b78337cac9fe3f7d
Reviewed-on: https://chromium-review.googlesource.com/683735
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48153}
2017-09-26 03:45:56 +00:00
Jakob Kummerow
2f88c9b2df [bigint] Implement Divide and Remainder
Bug: v8:6791
Change-Id: I5ab97feeb25da29bc76cd28088836b4f12d1d916
Reviewed-on: https://chromium-review.googlesource.com/678037
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48152}
2017-09-26 00:12:08 +00:00
Mostyn Bramley-Moore
a32c948344 [jumbo] also exclude test-bytecode-generator.cc from cctest jumbo builds
This caused trouble for my downstream CI tests, even though it builds
successfully in the canonical v8 tree.  To be investigated properly
later.

Bug: chromium:746958
Change-Id: I180a5ecc51051e4eb6617180ccba787ff80bcf45
Reviewed-on: https://chromium-review.googlesource.com/682695
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#48151}
2017-09-25 21:00:26 +00:00
v8-autoroll
daca907875 Update V8 DEPS.
Rolling v8/build: 898597f..57716b3

Rolling v8/buildtools: cbc33b9..f6d165d

Rolling v8/third_party/catapult: e3fe21f..9a255f5

Rolling v8/tools/clang: cf5e2ed..66be66d

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

Change-Id: I8c7a9604d7ed71f9580cc17e7c4236348983e0a9
Reviewed-on: https://chromium-review.googlesource.com/681848
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48150}
2017-09-25 18:06:32 +00:00
Eric Holk
71655f47a0 [wasm] Enable trap handlers by default in D8 on Linux x64
Bug: v8:5277
Change-Id: I5887e2ac3742350c6cb4e5780e2c1c5d02baa34d
Reviewed-on: https://chromium-review.googlesource.com/673548
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48149}
2017-09-25 17:43:33 +00:00
Karl Schimpf
49106e4858 Add capability of throwing values in WASM
This is a second attempt at landing CL 644866 which was reverted by
CL 667019.

Extends the current implementation of WASM exceptions to be able to
throw exceptions with values (not just tags).

A JS typed (uint_16) array is used to hold the thrown values. This
allows all WASM types to be stored (i32, i64, f32, and f64) as well as
be inspected in JS.

The previous CL was reverted because the WASM compiler made calls to
run time functions with tagged objects, which must not be done. To fix
this, all run time calls use the thread-level isolate to hold the
exception being processed.

Bug: v8:6577
Change-Id: I4b1ef7e2847b71a2fab8e9934a0531057db9de63
Reviewed-on: https://chromium-review.googlesource.com/677056
Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48148}
2017-09-25 16:58:19 +00:00
Mostyn Bramley-Moore
dbe9457fcb [jumbo]: allow cctest jumbo mode builds
There is no jumbo_executable target atm, so split the cctest v8_executable
target into cctest and cctest_sources.

Bug: chromium:746958
Change-Id: Iec0956234d026039c4d29921170dd2f0955222ca
Reviewed-on: https://chromium-review.googlesource.com/680575
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#48147}
2017-09-25 16:56:09 +00:00
Hans Wennborg
72484a6a82 Add V8_EXPORT_PRIVATE to v8::internal::GetRandomMmapAddr()
To unbreak the component build of unittests on Mac after #48124.

Bug: chromium:768094
Change-Id: I0e0f4ade0e19a71554f68e7050c525376f125ae5
Reviewed-on: https://chromium-review.googlesource.com/682094
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48146}
2017-09-25 16:52:44 +00:00
Mostyn Bramley-Moore
54f1f4dfc1 [jumbo] add test source file namespace in test-hashmap.cc
Bug: chromium:746958
Change-Id: Ia251d99ffe142fadb99fc83082683aa87676c47d
Reviewed-on: https://chromium-review.googlesource.com/680574
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#48145}
2017-09-25 16:51:38 +00:00
Eric Holk
c7b3fddcbb [wasm] do not register trap handler data for previously registered code
Previously, we would blindly register new handler data, leading to us leaking
the old handler data. This meant we could then end up with overlapping handler
data where the instruction offset and landing pads didn't line up right.

Bug: v8:6841
Change-Id: Iedcd75925b8d9d59c8f9accf288cae954fdc568f
Reviewed-on: https://chromium-review.googlesource.com/677632
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48144}
2017-09-25 16:44:57 +00:00
Mostyn Bramley-Moore
4187a62734 [jumbo] undef some more macros defined in .cc files
Bug: chromium:746958
Change-Id: I81ad56e3bfbdc458c3e318927191f6c5e137c448
Reviewed-on: https://chromium-review.googlesource.com/680554
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#48143}
2017-09-25 16:37:54 +00:00
Michael Starzinger
d175cefaa8 [asm.js] Fix Math.ceil/floor/sqrt to return floatish.
This fixes the signatures of "Math.ceil", "Math.floor" and "Math.sqrt"
from "(float?) -> float" to "(float?) -> floatish" which avoids using a
resulting float value without coercing the value via explicit "fround"
annotations. This ensures proper ECMAScript semantics are maintained.

R=clemensh@chromium.org
TEST=mjsunit/regress/regress-6838-2
BUG=v8:6838

Change-Id: Ib5821641265bc862184adb270e8dbf8c703fdfb0
Reviewed-on: https://chromium-review.googlesource.com/681694
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48142}
2017-09-25 15:53:04 +00:00
Ali Ijaz Sheikh
52e8d0ab40 Reland "Reland "[profiler] proper observation of old space inline allocations""
This is a reland of ec952aaa68.

Included is a fix that ensures that top_on_previous_step_ is cleared when we
release a page.

Original change's description:
> Reland "[profiler] proper observation of old space inline allocations"
>
> This is a reland of 672a41c3ca
> Original change's description:
> > [profiler] proper observation of old space inline allocations
> >
> > Bug: chromium:633920
> > Change-Id: I9a2f4a89f6b9c0f63cb3b166b06a88a12f0a203c
> > Reviewed-on: https://chromium-review.googlesource.com/631696
> > Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
> > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#48043}
>
> Bug: chromium:633920
> Change-Id: I6fe743d31b8ff26f3858488d4c014c62d3c85add
> Reviewed-on: https://chromium-review.googlesource.com/671127
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
> Cr-Commit-Position: refs/heads/master@{#48085}

Bug: chromium:633920
Change-Id: I8a0dcc4eaffc1f1d3ac5b3f8d344001cdae36606
Reviewed-on: https://chromium-review.googlesource.com/677407
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#48141}
2017-09-25 15:13:01 +00:00
Benedikt Meurer
855b88ae5a [turbofan] Properly optimize literals in inlined functions.
When inlining based on SharedFunctionInfo rather than based on concrete
JSFunction, we weren't able to properly optimize array, object and
regexp literals inside the inlinee, because we didn't know the concrete
FeedbackVector for the inlinee inside JSCreateLowering. This was because
JSCreateLowering wasn't properly updated after the literals moved to the
FeedbackVector. Now with this CL we also have the VectorSlotPair on the
literal creation operators, just like we do for property accesses and
calls, and are thus able to always access the appropriate FeedbackVector
and optimize the literal creation.

The impact is illustrated by the micro-benchmark on the tracking bug,
which goes from

  createEmptyArrayLiteral: 1846 ms.
  createShallowArrayLiteral: 1868 ms.
  createShallowObjectLiteral: 2246 ms.

to

  createEmptyArrayLiteral: 1175 ms.
  createShallowArrayLiteral: 1187 ms.
  createShallowObjectLiteral: 1195 ms.

with this CL, so up to 2x faster now.

Drive-by-fix: Also remove the unused CreateEmptyObjectLiteral builtin
and cleanup the names of the other builtins to be consistent with the
names of the TurboFan operators and Ignition bytecodes.

Bug: v8:6856
Change-Id: I453828d019b27c9aa1344edac0dd84e91a457097
Reviewed-on: https://chromium-review.googlesource.com/680656
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48140}
2017-09-25 13:05:16 +00:00
Michael Starzinger
63f9ee1645 [asm.js] Fix Math.min/max signatures to take signed.
This fixes the signature of "Math.min" and "Math.max" for integer values
from "(int, int...) -> signed" to "(signed, signed..) -> signed" which
properly distinguishes signed from unsigned values now. This is in sync
with the spec errata (and ECMAScript semantics).

R=clemensh@chromium.org
TEST=mjsunit/regress/regress-6838-1
BUG=v8:6838

Change-Id: Id72836513dd86e93472a22cf1ac2e2d382ed4f23
Reviewed-on: https://chromium-review.googlesource.com/681357
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48139}
2017-09-25 12:58:57 +00:00
Clemens Hammacher
8d38c15e04 [cleanup] Fix (D)CHECK macros in src/{debug,inspector}
Use the (D)CHECK_{EQ,NE,GT,...} macros instead of (D)CHECK with an
embedded comparison. This gives better error messages and also does the
right comparison for signed/unsigned mismatches.

This will allow us to reenable the readability/check cpplint check.

R=yangguo@chromium.org

Bug: v8:6837
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I88e5afea1ad0fdf23a81b380e64ff356bbc20112
Reviewed-on: https://chromium-review.googlesource.com/681374
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48138}
2017-09-25 12:20:59 +00:00
v8-autoroll
76ba883bfa Update V8 DEPS.
Rolling v8/build: 48a2b7b..898597f

Rolling v8/buildtools: 5af0a3a..cbc33b9

Rolling v8/third_party/android_tools: https://chromium.googlesource.com/android_tools/+log/e9d4018..aadb2fe

Rolling v8/third_party/catapult: 7149cbf..e3fe21f

Rolling v8/tools/clang: 40f6966..cf5e2ed

Rolling v8/tools/swarming_client: 42721e1..5e8001d

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

Change-Id: I5881bcaa603d721167d1ed3e893d0171de617c04
Reviewed-on: https://chromium-review.googlesource.com/657634
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48137}
2017-09-25 11:06:13 +00:00
Clemens Hammacher
f137052e9e [cleanup] Fix (D)CHECK macros in src/heap
Use the (D)CHECK_{EQ,NE,GT,...} macros instead of (D)CHECK with an
embedded comparison. This gives better error messages and also does the
right comparison for signed/unsigned mismatches.

This will allow us to reenable the readability/check cpplint check.

R=ulan@chromium.org

Bug: v8:6837
Change-Id: I8d900f3c703dea6ee3bcc225a1d2754e91666b9d
Reviewed-on: https://chromium-review.googlesource.com/671047
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48136}
2017-09-25 10:25:13 +00:00
Clemens Hammacher
7ed27c474a [cleanup] [compiler] Fix (D)CHECK macros
Use the (D)CHECK_{EQ,NE,GT,...} macros instead of (D)CHECK with an
embedded comparison. This gives better error messages and also does the
right comparison for signed/unsigned mismatches.

This will allow us to reenable the readability/check cpplint check.

R=jarin@chromium.org

Bug: v8:6837
Change-Id: I712580c2a4326e06ee3d6d0eb4ff8c7d24f5fdb9
Reviewed-on: https://chromium-review.googlesource.com/671227
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48135}
2017-09-25 10:21:34 +00:00
Michael Achenbach
571076ecb1 [build] Port "Add patched eu-strip in third_party"
This ports:
https://chromium-review.googlesource.com/c/544798/

This is needed to unblock rolling build into v8 at:
https://chromium-review.googlesource.com/c/v8/v8/+/657634

Bug: chromium:593874, chromium:742655
Change-Id: Ie00f2d13cfd052881a84b6e0cb95c336b7d2581c
Reviewed-on: https://chromium-review.googlesource.com/680815
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48134}
2017-09-25 09:52:23 +00:00
Maya Lekova
e35a0327c0 Port ObjectGetOwnPropertyDescriptor to CSA
Bug: 
Change-Id: I7cb8ace4183c0dcf34d71d1b378204383c17ba56
Reviewed-on: https://chromium-review.googlesource.com/678718
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Maya Lekova <mslekova@google.com>
Cr-Commit-Position: refs/heads/master@{#48133}
2017-09-25 09:21:24 +00:00
Marja Hölttä
62960a0340 [parser] Skipping inner funcs: fix async arrow funcs.
Track whether the async arrow func parameter list was simple or not; the
information is already there, we just didn't pipe it through correctly. It's
needed by PreParser so that it can create the correct Scope structure.

Implementation notes:

- I could've used async_classifier for transmitting the "is_simple" bit, but I
  made it explicit (it would be unnecessary to use ExpressionClassifier for
  this, as we're not classifying any expressions) instead.

- I'm also moving work (setting parameter_list.is_simple) from Parser to
  ParserBase, and adding a DCHECK in Parser to assert that the work was indeed
  already done.

BUG=v8:5516,chromium:765532

Change-Id: Iacf91b150d1b57996544b5e64baa7d91ac134445
Reviewed-on: https://chromium-review.googlesource.com/674695
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48132}
2017-09-25 06:03:00 +00:00
Benedikt Meurer
7816413f29 [turbofan] Constant-fold keyed loads of sealed properties.
We can constant-fold JSLoadProperty(o, i) when o is a known object (i.e.
TurboFan's context specialization provides a known non-null/-undefined
constant value for it), i is a known array index and o["i"] is an
element on the receiver, that is non-configurable and non-writable (i.e.
o was frozen using Object.freeze earlier, or o is a String object).

This significantly reduces execution time of the tagged templates
micro-benchmarks (ES6 and Babel transpiled), when combined with the
CL https://chromium-review.googlesource.com/c/v8/v8/+/677462, it goes
from

  templateStringTagES5: 4552 ms.
  templateStringTagES6: 14185 ms.
  templateStringTagBabel: 7626 ms.

to

  templateStringTagES5: 4550 ms.
  templateStringTagES6: 616 ms.
  templateStringTagBabel: 589 ms.

so overall a solid 23x improvement on the ES6 benchmark. This is
representative of the six-speed-templatestringtag-es6 benchmark.

Bug: v8:6819, v8:6820, v8:6831
Change-Id: Ia45fbdf92977bfbe7400cfa60bd362b78086dc26
Reviewed-on: https://chromium-review.googlesource.com/677603
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48131}
2017-09-25 05:55:00 +00:00
Ulan Degenbaev
dc3bbbdbe8 [heap] Tune the number of concurrent marking tasks.
This patch ensures that the concurrent marking tasks do not
use more than the half of the available background threads.

Bug: chromium:694255
Change-Id: I67d6eb3e717945f777d0711bd094630573c78661
Reviewed-on: https://chromium-review.googlesource.com/678636
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48130}
2017-09-25 04:39:35 +00:00
Michael Lippautz
ff94986d81 [heap] Remove UMAs for fractions
Spaces sizes will be replaced with absolute values.

Bug: 
Change-Id: I3d9f32b723ad8872a088f436bd279a0a3f66401e
Reviewed-on: https://chromium-review.googlesource.com/680769
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48129}
2017-09-25 04:32:37 +00:00
Michael Lippautz
7c7c493ccf [heap] Fix cast in FixStaleLeftTrimmedHandlesVisitor
Casting to HeapObject before checking whether the object actually is
a HeapObject is undefined behavior.

Bug: chromium:738743
Change-Id: I7be8dfbc18203c6be008af73549a915f9b6bd3de
Reviewed-on: https://chromium-review.googlesource.com/680768
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48128}
2017-09-25 04:26:44 +00:00
Deepti Gandluri
0dffd972e2 [wasm] Use the right access operand for atomic ops
Bug=v8:6842,v8:6532

Change-Id: I6ae1064e1e9a54c189311d6f34fc5fad85f13b7f
Reviewed-on: https://chromium-review.googlesource.com/678594
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48127}
2017-09-23 19:52:42 +00:00
Benedikt Meurer
79ac69b83c [es2015] Introduce dedicated GetTemplateObject bytecode.
Tagged templates were previously desugared during parsing using some
combination of runtime support written in JavaScript and C++, which
prevented some optimizations from happening, namely the constant folding
of the template object in TurboFan optimized code. This CL adds a new
bytecode GetTemplateObject (with a corresponding GetTemplateObject AST
node), which represents the abstract operation in the ES6 specification
and allows TurboFan to simply constant-fold template objects at compile
time (which is explicitly supported by the specification).

This also pays down some technical debt by removing the template.js
runtime support and therefore should reduce the size of the native
context (snapshot) a bit.

With this change in-place the ES6 version microbenchmark in the
referenced tracking bug is now faster than the transpiled Babel
code, it goes from

  templateStringTagES5: 4552 ms.
  templateStringTagES6: 14185 ms.
  templateStringTagBabel: 7626 ms.

to

  templateStringTagES5: 4515 ms.
  templateStringTagES6: 7491 ms.
  templateStringTagBabel: 7639 ms.

which corresponds to a solid 45% reduction in execution time. With some
further optimizations the ES6 version should be able to outperform the
ES5 version. This micro-benchmark should be fairly representative of the
six-speed-templatestringtag-es6 benchmark, and as such that benchmark
should also improve by around 50%.

Bug: v8:6819,v8:6820
Tbr: mlippautz@chromium.org
Change-Id: I821085e3794717fc7f52b5c306fcb93ba03345dc
Reviewed-on: https://chromium-review.googlesource.com/677462
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48126}
2017-09-22 19:52:30 +00:00
Karl Schimpf
87713b3756 Fix UMA stats for WASM functions
Fixes the collection of V8.WasmFuncctionSizeBytes.wasm for UMA stats.

Bug: v8:6852
Change-Id: Ib25d249dd2856ffb8a3205e54ba052c1bc9a09cf
Reviewed-on: https://chromium-review.googlesource.com/678448
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Commit-Queue: Karl Schimpf <kschimpf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48125}
2017-09-22 19:29:24 +00:00
Bill Budge
d607f1e72d [Memory] Move GetRandomMmapAddr from base::OS platform to v8::internal.
- Moves GetRandomMmapAddr from platform to v8::internal allocation
  primitives, in preparation for delegating this to the embedder.
- Adds hint parameters to OS functions that used to use this function.

Bug: chromium:756050
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Iad72e6eac9c08a3e22c2cd2b2905623b8e514ae0
Reviewed-on: https://chromium-review.googlesource.com/677777
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48124}
2017-09-22 15:26:18 +00:00
Albert Mingkun Yang
c9b08c6579 Use args to avoid unnecessary work in RecordWrite stub
TurboAssembler::CallRecordWriteStub contains info that could be used to
conditionally skip generational write barrier or skip saving float-point
registers. This commits uses those info in RecordWrite stub.

Bug: chromium:749486
Change-Id: I41c9a593473e1f8863a09887fd2ce917f1d4fb3b
Reviewed-on: https://chromium-review.googlesource.com/672527
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Albert Mingkun Yang <albertnetymk@google.com>
Cr-Commit-Position: refs/heads/master@{#48123}
2017-09-22 12:28:38 +00:00
Mostyn Bramley-Moore
b4ff29d870 [jumbo] drop duplicate BUILD macro from test-run-wasm-js.cc
BUILD is already defined in test/cctest/wasm/wasm-run-utils.h.

Bug: chromium:746958
Change-Id: Icf577ce91424d9851d2db39658fd52c68c864995
Reviewed-on: https://chromium-review.googlesource.com/676843
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#48122}
2017-09-22 11:15:08 +00:00
Georgia Kouveli
9f01414923 [arm64] Pad registers in interpreter frame.
Add padding for the interpreter registers when needed, to make the
interpreter frame a multiple of 16 bytes. The padding needs to be added
in the InterpreterEntryTrampoline and when generating an interpreter
frame in the deoptimizer. It also needs to be considered when
calculating the size of the interpreter frame during OSR and stack
unwinding.

Bug: v8:6644
Change-Id: Icfec94079cf0785fc8a2506ff555b5f9e89e3d13
Reviewed-on: https://chromium-review.googlesource.com/664563
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48121}
2017-09-22 10:58:28 +00:00