Commit Graph

55618 Commits

Author SHA1 Message Date
Mythri A
f0cf0b2862 [ic] Fix TraceIC to also work without feedback vector
TraceIC always expects a valid feedback vector to check for state
transitions. With lazy feedback allocations, it is possible that we don't
have feedback vectors. This cl fixes TraceIC to also work when there is no
feedback vector.

Bug: v8:8394
Change-Id: If7e40a9f16de7415e04a812440ccc0cfcf1cbc07
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584322
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61126}
2019-04-30 15:39:03 +00:00
Ulan Degenbaev
7c42628676 [heap] Use normal marking write barrier for fixed array elements
This simplifies the marking write barrier for elements to mark the
values instead of revisiting the array.

Bug: chromium:918485

Change-Id: Id5da0d5b9ff8385a256fe14f4bf7171f9f6343e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588459
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61125}
2019-04-30 15:31:22 +00:00
Frederik Gossen
5a0f0ebfad [wasm] Remove unused {UseLazyStubs}
Remove unused function {UseLazyStubs}. Lazy compile stubs are now set on
a per function basis. This made the function {UseLazyStubs} redundant.

Change-Id: I8e715d6a9774c39841219c04c42364fc2e964569
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588473
Commit-Queue: Frederik Gossen <frgossen@google.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61124}
2019-04-30 15:16:12 +00:00
Milad Farazmand
18c29ab939 PPC/s390: Reland "[ptr-compr] New RelocInfo for compressed pointers."
Port ed319e841c

Original Commit Message:

    Failure addressed by not exposing the new test to the jitless environment.
    (jgruber@ on TBR).

    New enum RelocInfo::COMPRESSED_EMBEDDED_OBJECT created to support
    compressed pointers in generated code. Enum name EMBEDDED_OBJECT
    changed to FULL_EMBEDDED_OBJECT.

    RelocInfo::[set_]target_object() abstract away the difference between
    FULL_EMBEDDED_OBJECT and COMPRESSED_EMBEDDED_OBJECT.

    Compressed embedded objects can only be created at this time on
    x64 with pointer compression turned on. Arm64 constant pools don't
    support compressed objects at this time.

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

Change-Id: I8bdb5391fd2b2565d2fcaf6c806fcdbe1a1f27b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1589862
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#61123}
2019-04-30 14:39:22 +00:00
Mythri A
41ef63df21 [Test] Add %PrepareForOptimization in tests
With bytecode flushing and lazy feedback allocation, we need to call
%PrepareForOptimization before we call %OptimizeFunctionOnNextCall

Bug: v8:8801, v8:8394
Change-Id: I81918f174b2f97cbaa8b8ef2e459080c2581f535
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588415
Commit-Queue: Mythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61122}
2019-04-30 14:18:22 +00:00
Jakob Gruber
397f53ed0f [arm] Fix relative code target relocation
Relative code targets are emitted as pc-relative jumps. The
relocation delta must be subtracted (not added) from the branch
offset.

Before GC:

        |-------- branch offset --->|
 [host code object]                 [target code object]

After GC:

 |- delta ->|      |- new offset -->|
            [host code object]      [target code object]

See also the similar fix for mips in https://crrev.com/c/1581239.

Bug: v8:6666
Change-Id: Ie0867d98906d4a8daa7e335884f7a4d814333872
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581260
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61121}
2019-04-30 14:05:45 +00:00
Yu Yin
61672d9d7d [mips] Fix build error after switch to CodeBuilder.
Fix several small compile problems which causes by
https://crrev.com/c/1585737.

Change-Id: I78a07d597db9d81d4a99aac08e257f380be8f7e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1589202
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#61120}
2019-04-30 13:50:03 +00:00
Michael Starzinger
8215f39860 [platform] Remove dead {OS::StrChr} wrapper.
Change-Id: Ifbf1b49d7caad9b050945b07065ee5ecb9d9f9e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588470
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61119}
2019-04-30 13:47:51 +00:00
Sigurd Schneider
f0a4b252c8 Revert "[turbofan] Avoid raw InferReceiverMaps in JSCallReducer"
This reverts commit 9284ad5731.

Reason for revert: breaks blink tests:
https://ci.chromium.org/p/v8/builders/ci/V8-Blink%20Win/16839

Original change's description:
> [turbofan] Avoid raw InferReceiverMaps in JSCallReducer
> 
> Instead provide an abstraction that makes it hard to forget
> dealing with unreliable maps.
> 
> This also fixes a deopt loop in Function.prototype.bind and
> one in Array.prototype.reduce.
> 
> Bug: v8:9137
> Change-Id: If6a51182c8693a62e9fb6d302cec19b4d48e25cb
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1578501
> Commit-Queue: Georg Neis <neis@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61106}

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

Change-Id: I97e0f47fb82eda76656905a3f7cc494babd92be6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9137
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588433
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61118}
2019-04-30 13:46:06 +00:00
Sigurd Schneider
febe3a10dd [regalloc] Enable control-flow aware allocation
We enable this feature to collect performance data; revert at will.

Bug: v8:9088
Change-Id: I57cd79707fe56ec5a2d6d5ee65b7ce24bda57773
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585726
Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61117}
2019-04-30 13:45:02 +00:00
Frederik Gossen
0ffd860e03 [wasm-hints] Unify Lazy Validation
Treat lazy functions the same no matter whether they are lazy due to
compilation hints or flags ({--wasm-lazy-compilation},
{--asm-wasm-lazy-compilation}). Test coverage is given by regression
tests 956771 and 956771b.

Bug: v8:9003
Change-Id: I123f83636f055fb142cd71f6cde88480f3c141bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585846
Commit-Queue: Frederik Gossen <frgossen@google.com>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61116}
2019-04-30 13:33:31 +00:00
Jaroslav Sevcik
da6ebfafad [turbofan] Handle -0 truncation in word32->float64 rep change.
This just adds the same case we already added in
https://chromium-review.googlesource.com/c/v8/v8/+/1478192
for conversions to tagged representation.

Bug: chromium:957559
Change-Id: I62a388ba47bd72d65fa07d0141362d7f1383c96e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588428
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61115}
2019-04-30 13:21:21 +00:00
Frederik Gossen
197b1d979c [wasm] Fix Wasm Lazy Compilation
Fix recognition of lazy functions when {--wasm-lazy-compilation} is
used.

Bug: chromium:956771
Change-Id: I3f9bb25ccf3920a6c3d266876faace8841dcdc61
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585843
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Frederik Gossen <frgossen@google.com>
Cr-Commit-Position: refs/heads/master@{#61114}
2019-04-30 13:05:20 +00:00
Sigurd Schneider
0a0d70eb8c [builtins] Check for stack overflow in JSConstructStub
Bug: chromium:951322
Change-Id: Ibbc656c4a22adffc7d7df305541d4264a3b199ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1583760
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61113}
2019-04-30 12:28:56 +00:00
Andreas Haas
c7627bbc8a [wasm] Refactor WasmTableObject::Grow
This CL refactors WasmTableObject::Grow to make it usable for the
table.grow instruction of WebAssembly.

The refactored version of WasmTableObject::Grow does additionally:
* Check if growing is possible
* Grow the FixedArray backing store of the table and initialize the new
  fields.
* Calculate the return value of WasmTableObject::Grow.

R=jkummerow@chromium.org

Bug: v8:7581
Change-Id: Ic6c867b96c30bd987ea281d5b3515a04bc5a3900
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588136
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61112}
2019-04-30 11:38:26 +00:00
Yang Guo
2e6b9f576c Revert "[test] Remove longer timeout on bots"
This reverts commit e632f8f45b.

Reason for revert: Seems to cause some timeouts to trigger failures: https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20TSAN/26129

Original change's description:
> [test] Remove longer timeout on bots
> 
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_gc_stress_dbg
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_gcc_rel
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_msan_rel
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_tsan_rel
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_arm64_dbg
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_mac64_asan_rel
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_win64_dbg
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_android_arm64_n5x_rel_ng
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_cfi_rel_ng
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_ubsan_rel_ng
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_arm_lite_rel_ng
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_noi18n_rel_ng
> CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_mac64_dbg_ng
> 
> Bug: v8:9145
> Change-Id: I6efee8579d9d9e0aad0431f6b87c152141d4ec7f
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581261
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Reviewed-by: Tamer Tas <tmrts@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61107}

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

Change-Id: I5e23aebc41e6ab15baa57093f7f056cdabd58f21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9145
Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg, luci.v8.try:v8_linux_gcc_rel, luci.v8.try:v8_linux64_msan_rel, luci.v8.try:v8_linux64_tsan_rel, luci.v8.try:v8_linux_arm64_dbg, luci.v8.try:v8_mac64_asan_rel, luci.v8.try:v8_win64_dbg, luci.v8.try:v8_android_arm64_n5x_rel_ng, luci.v8.try:v8_linux64_cfi_rel_ng, luci.v8.try:v8_linux64_ubsan_rel_ng, luci.v8.try:v8_linux_arm_lite_rel_ng, luci.v8.try:v8_linux_noi18n_rel_ng, luci.v8.try:v8_mac64_dbg_ng
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588425
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61111}
2019-04-30 11:01:39 +00:00
Peng Fei
1c4482ec3d [mips32] Fix the target address when relocate relative reference.
Change-Id: Ie44615daa6e0bef13a969cfb4fa62654ce31f448
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581239
Commit-Queue: peng fei <pfgenyun@gmail.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61110}
2019-04-30 10:32:27 +00:00
Clemens Hammacher
cce8439f48 Remove sorting methods from Vector
Instead, use std::sort and std::stable_sort at the 3 (!) call sites
directly. This also removes the weird comparer adaptors from Vector,
which are only used in ZoneList.

R=jkummerow@chromium.org

Bug: v8:9183
Change-Id: I4d0377976fb0a965cb68a21d4307df9ba09fd55d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587394
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61109}
2019-04-30 10:18:06 +00:00
Mike Stanton
9c938706a7 [ptr-compr] Fix build break with CodeBuilder
New RelocInfo test needs to adapt to the new pattern.

Change-Id: I09e531d099541511f94b929de647a3e3510f748f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588465
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61108}
2019-04-30 09:52:16 +00:00
Michael Achenbach
e632f8f45b [test] Remove longer timeout on bots
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_gc_stress_dbg
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_gcc_rel
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_msan_rel
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_tsan_rel
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_arm64_dbg
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_mac64_asan_rel
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_win64_dbg
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_android_arm64_n5x_rel_ng
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_cfi_rel_ng
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux64_ubsan_rel_ng
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_arm_lite_rel_ng
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_linux_noi18n_rel_ng
CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_mac64_dbg_ng

Bug: v8:9145
Change-Id: I6efee8579d9d9e0aad0431f6b87c152141d4ec7f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581261
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61107}
2019-04-30 09:50:26 +00:00
Georg Neis
9284ad5731 [turbofan] Avoid raw InferReceiverMaps in JSCallReducer
Instead provide an abstraction that makes it hard to forget
dealing with unreliable maps.

This also fixes a deopt loop in Function.prototype.bind and
one in Array.prototype.reduce.

Bug: v8:9137
Change-Id: If6a51182c8693a62e9fb6d302cec19b4d48e25cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1578501
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61106}
2019-04-30 09:19:56 +00:00
Frederik Gossen
150a8abaf5 [test] Prevent Unintentionally Undefined Error Types
Ignore the error type in {assertThrows} only if it was not passed as an
argument. If users do not care about the error type they can user the
generic type {Error}. Before this change, an undefined error type would
simply be ignored. A simple typo could therefore disable the error type
assertion without being recognized.

Change-Id: I9becfd0bf14dcaa511854e65ff94f94481cc79b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585855
Commit-Queue: Frederik Gossen <frgossen@google.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61105}
2019-04-30 08:43:06 +00:00
Mike Stanton
ed319e841c Reland "[ptr-compr] New RelocInfo for compressed pointers."
Failure addressed by not exposing the new test to the jitless environment.
(jgruber@ on TBR).

New enum RelocInfo::COMPRESSED_EMBEDDED_OBJECT created to support
compressed pointers in generated code. Enum name EMBEDDED_OBJECT
changed to FULL_EMBEDDED_OBJECT.

RelocInfo::[set_]target_object() abstract away the difference between
FULL_EMBEDDED_OBJECT and COMPRESSED_EMBEDDED_OBJECT.

Compressed embedded objects can only be created at this time on
x64 with pointer compression turned on. Arm64 constant pools don't
support compressed objects at this time.

NOPRESUBMIT=true

Bug: v8:7703
TBR: jgruber@chromium.org
Change-Id: Ifff53b041bab09b4b8c3e16085e5df4aa2b99f4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588461
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61104}
2019-04-30 07:37:06 +00:00
v8-ci-autoroll-builder
da5b9a55ae Update V8 DEPS.
Rolling v8/build: c185a34..4087d63

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/d235eb2..5b26b37

Rolling v8/third_party/depot_tools: 6837707..e49aed3

Rolling v8/tools/clang: 396602c..210f1dc

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

Change-Id: I7844de2802808ecbcc98c5ca80ebe8b0613b4395
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588730
Reviewed-by: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: v8-ci-autoroll-builder <v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#61103}
2019-04-30 03:39:25 +00:00
Milad Farazmand
0875682600 PPC/s390: [cleanup] Use Vector::begin instead of Vector::start
Port 4b0f9c856e

Original Commit Message:

    Our {Vector} template provides both {start} and {begin} methods. They
    return exactly the same value. Since the {begin} method is needed for
    iteration, and is also what standard containers provide, this CL
    switches all uses of the {start} method to use {begin} instead.

    Patchset 1 was auto-generated by using this clang AST matcher:
        callExpr(
            callee(
              cxxMethodDecl(
                hasName("start"),
                ofClass(hasName("v8::internal::Vector")))
            ),
            argumentCountIs(0))

    Patchset 2 was created by running clang-format. Patchset 3 then
    removes the now unused {Vector::start} method.

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

Change-Id: I119532691af31a3db1107c47de8b6f0c84697b5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588226
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#61102}
2019-04-29 21:36:34 +00:00
Jakob Kummerow
4349e32d4c [ubsan] Fix overflow in AdjustAmountOfExternalAllocatedMemory
Similar issue as crbug.com/933103, so the fix follows the same
pattern too.

No regression test, because it will OOM anyway.

Bug: chromium:957015
Change-Id: Ic5b67d84aa1c44609e6c96485974af9ecab2ed0e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585854
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61101}
2019-04-29 20:36:39 +00:00
Benedikt Meurer
4995c85f28 [runtime] Optimize general object spread.
This adds a new %_CopyDataProperties intrinsic, that reuses most of the
existing machinery that we already have in place for Object.assign() and
computed property names in object literals. This speeds up the general
case for object spread (where the spread is not the first item in an
object literal) and brings it on par with Object.assign() at least - in
most cases it's significantly faster than Object.assign().

In the test case [1] referenced from the bug, the performance goes from

  objectSpreadLast: 3624 ms.
  objectAssignLast: 1938 ms.

to

  objectSpreadLast: 646 ms.
  objectAssignLast: 1944 ms.

which corresponds to a **5-6x performance boost**, making object spread
faster than Object.assign() in general.

Drive-by-fix: This refactors the Object.assign() fast-path in a way that
it can be reused appropriately for object spread, and adds another new
builtin SetDataProperties, which does the core of the Object.assign()
work. We can teach TurboFan to inline Object.assign() based on the new
SetDataProperties builtin at some later point to further optimize
Object.assign().

[1]: https://gist.github.com/bmeurer/0dae4a6b0e23f43d5a22d7c91476b6c0

Bug: v8:9167
Change-Id: I57bea7a8781c4a1e8ff3d394873c3cd4c5d73834
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587376
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61100}
2019-04-29 18:47:19 +00:00
Suraj Sharma
57b30632d8 [torque] Convert few class layout definitions to torque.
Converted JSGlobalObject, JSIteratorResult, JSLocale, JSDateTimeFormat,
JSListFormat, JSNumberFormat, JSPluralRules, JSRelativeTimeFormat,
JSSegmenter, JSAsyncFromSyncIterator to torque.

Bug: v8:8952
Change-Id: Id912197054727815b481b2c683b93473bfcbd0c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1574491
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Suraj Sharma <surshar@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61099}
2019-04-29 18:10:59 +00:00
Maciej Goszczycki
561b9b07fd [cleanup] Remove Movability from globals.h
It was once widely used throughout v8 but now there is no need for it
anymore.

Bug: v8:9183
Change-Id: Id766987d468383cf459414eb5edfdee71b83a60b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585839
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61098}
2019-04-29 17:25:49 +00:00
Michael Lippautz
8e01d664dc heap/api: EmbedderHeapTracer: Pass along memory reducing mode
Change-Id: I55e8e42b88c8df1f75ff05f22b39d69e9dc586ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588457
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61097}
2019-04-29 16:56:09 +00:00
Maciej Goszczycki
9d7b0f1c5f [cleanup] Switch to CodeBuilder everywhere
Switch all uses of NewCode and TryNewCode to CodeBuilder and remove these
methods.

NewCode and TryNewCode use a large number of default parameters, which makes
it difficult to use and add any new ones. Large chunks of code were also
duplicated across TryNewCode and NewCode. The previous CL
(https://chromium-review.googlesource.com/c/v8/v8/+/1585736) added a new
CodeBuilder class which allows much simpler building of Code objects.

Bug: v8:9183
Change-Id: I9f6884f35a3284cbd40746376f0f27e36f9051b5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585737
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61096}
2019-04-29 16:48:39 +00:00
Sergiy Belozorov
ceaeca9d2c [tools] Record durations also for unsuccesful runs
This is needed to allow deriving timeout and near_timeout runnables on the
recipe side and drop corresponding fields in the output.

We also remove some unused code that was removed in previous refactoring CLs.

R=tmrts@chromium.org

No-Try: true
No-Tree-Checks: true
Bug: chromium:841700
Change-Id: Ib7cec9baceff994fb9b32be09ba4a4079ebff2c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588417
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61095}
2019-04-29 16:00:41 +00:00
Igor Sheludko
28294e877c [cleanup] Move object lists macros and forward declarations from objects.h
... to a separate file.

Bug: v8:9183
Change-Id: I87f98ed0fec84eb32403c3447bec7be50a79261d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588095
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61094}
2019-04-29 15:59:36 +00:00
Igor Sheludko
ebc8998095 [cleanup] Move MAYBE_RETURN macro and friends to isolate.h
... where the other set of similar macros live.

Bug: v8:9183
Change-Id: I114237a90c45205417b6d3fb0d939542c5c4fc76
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588096
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61093}
2019-04-29 15:56:51 +00:00
Clemens Hammacher
423b357b6b [cleanup] Remove {StrLength} function
The {Vector} class does not use it any more. External uses should be
converted to {size_t} instead of {int}.
This CL removes the function from vector.h and updates all users to
either use {size_t}, or cast to {int} explicitly. In tests, no further
checks are needed if the string is a constant.

R=mstarzinger@chromium.org

Bug: v8:9183
Change-Id: I60f99302504c74d8a7c79b147ca01d8ba61b6879
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587393
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61092}
2019-04-29 15:55:46 +00:00
Igor Sheludko
35c1bf0019 [cleanup] Cleanup how we check heap object tags
1) HAS_[STRONG|WEAK]_HEAP_OBJECT_TAG macros are to be used for
   checking raw representations of tagged values (Address or Tagged_t)
2) HasWeakHeapObjectTag(Object) function is for overzealous checking of
   Object tags

Bug: v8:9183
Tbr: jgruber@chromium.org
Change-Id: Iaa456dbcb21f43a8df0d9ca706c0fc3b2ede075d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588455
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61091}
2019-04-29 15:27:36 +00:00
Santiago Aboy Solanes
f50f548f80 [csa][cleanup] Use the ParameterRepresentation function
See https://cs.chromium.org/chromium/src/v8/src/code-stub-assembler.h?l=244
for the implementation.

Change-Id: I848e86aa69aaa9ceef9fff8b62ad947b0f67b781
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588235
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Auto-Submit: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61090}
2019-04-29 14:47:46 +00:00
Clemens Hammacher
b76ccb9471 [wasm][gc] Stress wasm code gc in --gc-stress mode
This makes the gc-stress bots set the '--stress-wasm-code-gc' flag.
Note that this also implicitly enables wasm code gc on these bots.

R=mstarzinger@chromium.org, machenbach@chromium.org

Cq-Include-Trybots: luci.v8.try:v8_linux_gc_stress_dbg
Cq-Include-Trybots: luci.v8.try:v8_mac64_gc_stress_dbg
Bug: v8:8217
Change-Id: Idc4fb996f50632d5621200e138f3ddc572ed9b05
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585721
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61089}
2019-04-29 14:32:46 +00:00
Georg Neis
073b6ea63d [turbofan] Replace two bool arguments with a new flags type
Also const-ify and refactor a few things in BytecodeAnalysis.

Change-Id: Ibd261bb67d8c035b1f818e9114d09db08737000d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587384
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61088}
2019-04-29 14:01:46 +00:00
Ross McIlroy
7e677b2eae Revert "[ptr-compr] New RelocInfo for compressed pointers."
This reverts commit b5da9fcb51.

Reason for revert: Breaks pointer compression bot:
https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20-%20pointer%20compression/3098

Original change's description:
> [ptr-compr] New RelocInfo for compressed pointers.
> 
> New enum RelocInfo::COMPRESSED_EMBEDDED_OBJECT created to support
> compressed pointers in generated code. Enum name EMBEDDED_OBJECT
> changed to FULL_EMBEDDED_OBJECT.
> 
> RelocInfo::[set_]target_object() abstract away the difference between
> FULL_EMBEDDED_OBJECT and COMPRESSED_EMBEDDED_OBJECT.
> 
> Compressed embedded objects can only be created at this time on
> x64 with pointer compression turned on. Arm64 constant pools don't
> support compressed objects at this time.
> 
> Bug: v8:7703
> Change-Id: I03bfd84effa33c65cf9bcefa5df680ab7eace9dd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1547661
> Commit-Queue: Michael Stanton <mvstanton@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61076}

TBR=ulan@chromium.org,mvstanton@chromium.org,mstarzinger@chromium.org,jgruber@chromium.org,ishell@chromium.org

Change-Id: I262b2b98315fa987c5a66b1050dc726563ccdb2d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7703
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1588135
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61087}
2019-04-29 13:54:38 +00:00
Clemens Hammacher
527f589978 [wasm] Do not expose OnFinishedUnit(s)
The method is only called from module-compiler.cc, hence we can call it
on {CompilationStateImpl} directly and do not need to expose it.

R=mstarzinger@chromium.org
CC=frgossen@google.com

Change-Id: I72dcd7b109cfdb0b3fd78be635c482289c69dd9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587389
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61086}
2019-04-29 13:53:06 +00:00
Ross McIlroy
c0720d28db [Test] Add PrepareForOptimization to debugger/ tests.
BUG=v8:8801

Change-Id: Id5ef6219ba2dca2be0603dd0d45e7b27136836e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587391
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61085}
2019-04-29 13:47:16 +00:00
Clemens Hammacher
884a45a72d [wasm] Remove {TurbofanWasmCompilationUnit}
{TurbofanWasmCompilationUnit} does not store any data except for a
pointer back to the {WasmCompilationUnit}, and has a single method only.
Thus remove it, and replace it by a static function.
This saves one field per compilation unit.

R=mstarzinger@chromium.org

Change-Id: I2bcb9246c65e6971aa747488ea631886ca3bc037
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587388
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61084}
2019-04-29 13:39:06 +00:00
Clemens Hammacher
ea2de39ff1 [wasm] Remove {InterpreterCompilationUnit}
{InterpreterCompilationUnit} does not store any data except for a
pointer back to the {WasmCompilationUnit}, and has a single method only.
Thus remove it, and replace it by a static function.
This saves one field per compilation unit. We can probably also remove
{TurbofanWasmCompilationUnit} in a similar way, which I will do in a
follow-up CL.

R=mstarzinger@chromium.org

Change-Id: I8fc2e18366757573499fd57f909ec8222c27be38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587387
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61083}
2019-04-29 13:27:06 +00:00
Clemens Hammacher
99254554c1 Fix msan build
This fixes an msan compile error after https://crrev.com/c/1587381.

TBR=jkummerow@chromium.org

No-Try: true
No-Tree-Checks: true
Bug: v8:9183
Change-Id: I50c5fc2ddb698a6441896ec393bce62eee7afdc9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587390
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61082}
2019-04-29 13:02:06 +00:00
Clemens Hammacher
4b0f9c856e [cleanup] Use Vector::begin instead of Vector::start
Our {Vector} template provides both {start} and {begin} methods. They
return exactly the same value. Since the {begin} method is needed for
iteration, and is also what standard containers provide, this CL
switches all uses of the {start} method to use {begin} instead.

Patchset 1 was auto-generated by using this clang AST matcher:
    callExpr(
        callee(
          cxxMethodDecl(
            hasName("start"),
            ofClass(hasName("v8::internal::Vector")))
        ),
        argumentCountIs(0))

Patchset 2 was created by running clang-format. Patchset 3 then
removes the now unused {Vector::start} method.

R=jkummerow@chromium.org
TBR=mstarzinger@chromium.org,yangguo@chromium.org,verwaest@chromium.org

Bug: v8:9183
Change-Id: Id9f01c92870872556e2bb3f6d5667463b0e3e5c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587381
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61081}
2019-04-29 12:43:16 +00:00
Clemens Hammacher
3e1b350209 [wasm] Remove {LiftoffCompilationUnit}
{LiftoffCompilationUnit} does not store any data, and has a single
method only. Thus remove it, and replace it by a static function.
This saves one field per compilation unit. We can probably also remove
{TurbofanWasmCompilationUnit} and {InterpreterCompilationUnit} in a
similar way, which I will do in follow-up CLs.

R=mstarzinger@chromium.org

Change-Id: I5e1a7d4245fd8bce4862cc83c96f9dac8e0c635e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1587386
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61080}
2019-04-29 12:39:21 +00:00
Maciej Goszczycki
3a2424d054 [heap] Add a new CodeBuilder class to factory
CodeBuilder allows much simpler building of Code objects. The current
approach uses a large number of default parameters, which makes it difficult
to use and add any new ones. Large chunks of code are also duplicated across
TryNewCode and NewCode. The follow up CL completely removes these methods.

Bug: v8:9183
Change-Id: I6e988fd00bb89b871346100fe56dd01a9bd46073
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585736
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61079}
2019-04-29 12:38:16 +00:00
Joey Gouly
4f65233fd2 Reland "[arm64] Cleanup TODO around handling of x18"
This is a reland of 7a2651cbf5

x18 is not allocatable nor callee-saved in v8, so stop comparing
the before/after value in tests.

Presumably the Nexus failure was due to printf on that platform
clobbering x18.
This can be reproduced locally by modifying `CorruptAllCallerSavedCPURegister`
to also corrupt x18.

CQ_INCLUDE_TRYBOTS=luci.v8.try:v8_android_arm64_n5x_rel_ng

Original change's description:
> [arm64] Cleanup TODO around handling of x18
>
> Use `padreg` instead of x18 to maintain alignment in the CPURegList.
>
> Also clean up some comments and tidy up RequiredStackSizeForCallerSaved
> and PushCallerSaved.
>
> Change-Id: I80a780e5649e69a1746c43f37c2d1d875120c7a0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1581609
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
> Cr-Commit-Position: refs/heads/master@{#60987}

Change-Id: I7c023a4706a98bcb9aa5acd37016a6d01e3979a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1583762
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Martyn Capewell <martyn.capewell@arm.com>
Cr-Commit-Position: refs/heads/master@{#61078}
2019-04-29 12:31:16 +00:00
Frederik Gossen
529c066432 [wasm-hints] Lazy Baseline Compilation
Allow for a third compilation strategy that compiles baseline code
lazily but initiates top tier compilation immediately. The strategy aims
at reducing startup time.

Bug: v8:9003
Change-Id: Ifd2060b25386c5221a45f6038c3849afeb956e69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1571620
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Frederik Gossen <frgossen@google.com>
Cr-Commit-Position: refs/heads/master@{#61077}
2019-04-29 12:26:26 +00:00