Commit Graph

60731 Commits

Author SHA1 Message Date
Andreas Haas
15d9575a16 [wasm] Update spec tests
R=thibaudm@chromium.org

Change-Id: I68688e9613a9af4091963175b041df82410bddc4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037446
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66139}
2020-02-05 15:42:51 +00:00
Milad Farazmand
d1edf08d5b PPC/s390: [wasm] Add builtin and runtime function for debug breaks
Port 59bda19676

Original Commit Message:

    This CL adds the "WasmDebugBreak" builtin for x64, ia32, arm and arm64.
    It stores all wasm parameter registers to the stack and calls the
    respective runtime function.
    The runtime function does not do anything yet, but the
    inspector/debugger/wasm-set-breakpoint-liftoff test will already execute
    both the builtin and the runtime function.

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

Change-Id: I881a22f1e7c8f9c0714caaa0de75e00177da51e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2038136
Reviewed-by: Junliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#66138}
2020-02-05 15:35:41 +00:00
Michael Lippautz
562c15d652 Reland "heap: Delay completing marking"
Delay completing marking (and thus the atomic GC pause) during JS
executions, increasing the chance to finalize the garbage collection
from a task. This is beneficial as it avoids stack scanning which is
expensive and can keep alive outdated objects in case of unified heap.

Completing will be delayed at most by some overshoot factor (10%).

In addition, the GC keeps the weighted average of previously recorded
time to incremental marking task invocations and bails out if the
task is expected to arrive too late.

Reland: Do not schedule a delayed task when marking has already been
finalized.

This reverts commit 1775684e86.

Bug: chromium:1044630, v8:10178
Change-Id: Ic46e9504ce7c200bd1d37ee8d0190fb8727a3f96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037436
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66137}
2020-02-05 14:48:10 +00:00
Clemens Backes
b2733d755a [wasm] Implement i32 to tagged conversion in GraphAssembler
This makes the code more readable, and allows for easier future
performance optimizations.

R=jkummerow@chromium.org

Bug: v8:10123, v8:10070
Change-Id: Ifd27f0c888da21bb7f5729c550e8993e793ae7d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037438
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66136}
2020-02-05 14:41:08 +00:00
Georg Neis
8c8af291e1 [api] Add comment on assumptions about SetWeak callback argument
Bug: v8:10101
Change-Id: If833324b1acebcde8a3bce8888d86c598ed14249
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037442
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66135}
2020-02-05 13:33:18 +00:00
Michael Achenbach
dd8ff2cfdc [foozzie] Remove obsolete suppression
The bug appears to be fixed.

No-Try: true
Bug: chromium:693426
Change-Id: Ibd029c906dca87a3fd0c3e00be0b795e87390bd4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037439
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66134}
2020-02-05 13:00:58 +00:00
Peter Marshall
bba4be3aaa Revert "[tooling] Keep track of idle state even when we aren't profiling"
This reverts commit cf1fad5899.

Reason for revert: Breaks web tests: https://ci.chromium.org/p/v8/builders/ci/V8%20Blink%20Linux%20Debug/2684

Original change's description:
> [tooling] Keep track of idle state even when we aren't profiling
> 
> It isn't expensive to set this enum on the isolate and we only call
> this in chrome when the ThreadDebugger is enabled anyway.
> 
> This means we have a correct idle state to use with the upcoming
> CDP event which emits the thread state.
> 
> Bug: chromium:1025490
> Change-Id: Ia555ac8c401d0ad7c72d4cbc442be388ce166131
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036087
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Peter Marshall <petermarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66125}

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

Change-Id: I3823197974a2e683364f56819de6ea33dbb8b296
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1025490
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037441
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66133}
2020-02-05 12:30:38 +00:00
Clemens Backes
3ffd021f8d [wasm] Speed up the js-to-wasm fast path
When converting JS values to wasm, we have a fast path for smi inputs.
This CL makes this fast path faster by making the alternative (calling
ToNumber) deferred. That slow path will be slower then, especially since
register allocation (in particular the spilling decisions) are less
optimal.

Bug: v8:10070
Change-Id: I633a32e85b5a32f490980351b258da8e7a32a9e6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037435
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66132}
2020-02-05 12:10:18 +00:00
Sathya Gunasekaran
1d0693e2eb [callprinter] Correctly point to the incorrect spread arg
The source position is set to the function call (console.log) not the
spread (..x), in the bytecode generator, as the spread operation is
done as part of the CallWithSpread bytecode.

The CallPrinter stops at the function call and doesn't look at the
arguments as well (in CallPrinter::VisitCall) to see if the error is
from an incorrect spread operation.


With this patch, we pass some state to the CallPrinter in the
CallWithSpread error case and check that in CallPrinter::VisitCall
before returning.

For the given source string:
```
x = undefined;
console.log(1, ...x);
```

Previously, the error was -

```
test.js:2: TypeError: console.log is not iterable (cannot read property Symbol(Symbol.iterator))
console.log(1, ...x);
        ^
TypeError: console.log is not iterable (cannot read property Symbol(Symbol.iterator))
    at test.js:2:9
```


Now, the error is -

```
_test.js:2: TypeError: x is not iterable (cannot read property undefined)
console.log(1, ...x);
                  ^
TypeError: x is not iterable (cannot read property undefined)
    at _test.js:2:9
```

Bug: v8:10038
Change-Id: I199de9997f1d949c6f9b7b4f41d51f422b8b5131
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037431
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66131}
2020-02-05 11:27:58 +00:00
Dan Elphick
f57e7da439 [snapshot] Fix deref of raw pointer after potential GC
Fixes the one case after calling EnsureSourcePositionsCollected that we
were still using the non-handle version of the SharedFunctionInfo.

Bug: chromium:1048555
Change-Id: Iefd35fab13623a1f05212c98864be62c37463942
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037437
Commit-Queue: Dan Elphick <delphick@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66130}
2020-02-05 11:15:58 +00:00
Clemens Backes
002003912e [wasm] Always use new Liftoff code in debugging mode
If new Liftoff code is generated but we already have either Liftoff or
TurboFan code, we still want to install and use the new Liftoff code if
we are in debugging.

This logic can probably be simplified again when the "tier down to
liftoff on Debugger.enable" logic is fully implemented. I left a TODO to
revisit the logic later.

R=thibaudm@chromium.org

Bug: v8:10147
Change-Id: Ie3a6bdf1cde4f1af884edc8cf1f1b5a507283a5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036089
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66129}
2020-02-05 10:35:58 +00:00
Clemens Backes
7e364f12fd [wasm] Implement DebugBreak runtime function
This implements the runtime function for DebugBreak functionality in
Liftoff code. We find the Liftoff frame on the stack, get the position
within that frame, find breakpoints set at that position, and then call
{OnDebugBreak} with these breakpoints.

Note that one additional change is needed in order to make this actually
hit the right breakpoints. Once everything is in place, we will see a
change in the expected output in the wasm-set-breakpoint-liftoff test.

R=thibaudm@chromium.org

Bug: v8:10147
Change-Id: I5ca569a68aa436bbcf70739ea430efb9e459fad5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036086
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66128}
2020-02-05 10:28:48 +00:00
Andreas Haas
a1e7895b11 [wasm] Extend fuzzer to test AtomicExchange and AtomicCompareExchange
R=clemensb@chromium.org
CC=zhin@chromium.org

Bug: v8:10108
Change-Id: I68b81f46166d806ac0bc9bc7cc9ae9fcb4ea6d84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030729
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66127}
2020-02-05 09:01:58 +00:00
Clemens Backes
59bda19676 [wasm] Add builtin and runtime function for debug breaks
This CL adds the "WasmDebugBreak" builtin for x64, ia32, arm and arm64.
It stores all wasm parameter registers to the stack and calls the
respective runtime function.
The runtime function does not do anything yet, but the
inspector/debugger/wasm-set-breakpoint-liftoff test will already execute
both the builtin and the runtime function.

R=thibaudm@chromium.org

Bug: v8:10147
Change-Id: I445fdd7c202480ece951f5efbb4845cf21410d91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036082
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66126}
2020-02-05 08:10:28 +00:00
Peter Marshall
cf1fad5899 [tooling] Keep track of idle state even when we aren't profiling
It isn't expensive to set this enum on the isolate and we only call
this in chrome when the ThreadDebugger is enabled anyway.

This means we have a correct idle state to use with the upcoming
CDP event which emits the thread state.

Bug: chromium:1025490
Change-Id: Ia555ac8c401d0ad7c72d4cbc442be388ce166131
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036087
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66125}
2020-02-05 08:07:49 +00:00
v8-ci-autoroll-builder
b73de06bcb Update V8 DEPS.
Rolling v8/build: 2283658..7dffbb7

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/ebf2bec..2e4a40a

Rolling v8/third_party/googletest/src: 306f375..10b1902

Rolling v8/third_party/icu: dbd3825..9f40209

Rolling v8/tools/clang: 9ce85c8..847296c

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

Change-Id: I28cafd08fccb8d9549717d90c10d7da1948fdb72
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2035739
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@{#66124}
2020-02-05 03:56:57 +00:00
Ng Zhi An
9fba0cb07e [cleanup] Move some instructions into macro lists
These instructions were probably leftover from an earlier cleanup. We
can move them into respective macro lists, then delete away the
redundant declarations, definitions, disasm, and tests.

We were missing disasm tests for SSE2_INSTRUCTION_LIST_SD, so add that
in.

Change-Id: I8f27beaf57e7a338097690073910a0863f00b26a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036833
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66123}
2020-02-05 01:57:17 +00:00
Andreas Haas
bc436ed752 [turbofan] Don't assume that Word32AtomicPairCompareExchange has a projection-0
The instruction selector assumed for Word32AtomicPairCompareExchange
nodes that if there exists a Projection(1) user, then there also exists
a Projection(0) user. This, however, is not the case, because TurboFan
eliminates unreachable nodes. The missing projection node lead to a
failed DCHECK in the register allocator.

With this CL we allocate the right registers for the existing
projections, and allocate the other needed registers as temp registers.

R=gdeepti@chromium.org

Bug: v8:10140
Change-Id: Id50768c3cb712db5e0eb3b9dcd0a8a479e20953a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030731
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66122}
2020-02-04 19:47:37 +00:00
Ng Zhi An
148b53910e [wasm-simd] Unify sse and avx impl for i16x8 shifts
The implementation is pretty much the same, and we instead delegate to a
macro assembler to decide if we want the sse or avx instruction.

This unification will simplify optimization of constant shifts later on.

Bug: v8:10115
Change-Id: I68e60cb3fd51156438989812be189f71e6e47ba7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2026470
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66121}
2020-02-04 19:44:47 +00:00
Michael Achenbach
1775684e86 Revert "heap: Delay completing marking"
This reverts commit 02e5787389.

Reason for revert: High flakiness and broken GPU builders. See:
https://crbug.com/v8/10178
(speculative revert)

Original change's description:
> heap: Delay completing marking
> 
> Delay completing marking (and thus the atomic GC pause) during JS
> executions, increasing the chance to finalize the garbage collection
> from a task. This is beneficial as it avoids stack scanning which is
> expensive and can keep alive outdated objects in case of unified heap.
> 
> Completing will be delayed at most by some overshoot factor (10%).
> 
> In addition, the GC keeps the weighted average of previously recorded
> time to incremental marking task invocations and bails out if the
> task is expected to arrive too late.
> 
> Bug: chromium:1044630
> Change-Id: I10e63e6aaa88d8488d4415f311016dce2b4e62a2
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030906
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66107}

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

Change-Id: I0cd3f1189d0f83754350d5bdaaf82cb3c4d402c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1044630, v8:10178
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037434
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66120}
2020-02-04 19:35:37 +00:00
Ng Zhi An
06594a8dac Reland "[wasm-simd][liftoff] Add S128 case for stack movements"
This relands commit 5cfe053e45.

Original change's description:
> [wasm-simd][liftoff] Add S128 case for stack movements
>
> The two cases we are fixing here are Construct and
> LoadCallerFrameSlot, which are closely related.
>
> Construct is called during PrepareCall, where we build up
> LiftoffStackSlots when we need to move an arg from caller's stack frame
> into callee's stack frame. LoadCallerFrameSlot is the parallel to
> this, called in ProcessParameter during decoding of the callee's
> function body.
>
> In most cases, Construct needs a new case to handle kWasmS128, and calls
> the relevant assembler to push a s128 onto the stack.
>
> ARM64 requires 16-byte alignment of sp, so we need to Claim the right
> number of kXRegSize slots first, which requires
> us traversing the list of slots to figure out how many s128 values there
> are. This is a straightforward way to fix this, if efficiency is a
> problem, we can change LiftOffStackSlots::Add to sum up the slot sizes.
>
> On IA32, pushing s128 values will require 4 calls to push. Instead, we
> use a sub and two movdqu, which will generate less code in most cases.
>
> On x64, there is no 128-bit push, so we call push twice.
>
> Bug: v8:9909
> Change-Id: I3af35b8462ea9c3b9b2d90800c37d11b5e95be59
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2015945
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65956}

Bug: v8:9909
Change-Id: Icdaead289abe13faf75bb9e049929f7fd7c59a08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036760
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66119}
2020-02-04 18:28:26 +00:00
Thibaud Michaud
868e4e19ab Reland "[wasm] Use memcmp to compare module bytes"
This is a reland of 45ea015080

Original change's description:
> [wasm] Use memcmp to compare module bytes
> 
> This is much faster than std::lexicographical_compare.
> 
> R=clemensb@chromium.org
> 
> Bug: chromium:1048554
> Change-Id: I5f0ba22654e172535b6e6fcf6d2a460e278d3cfd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036078
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66109}

Bug: chromium:1048554
Change-Id: I04d4b1ea8354f7d0567100dec10be0de6ca0ed37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037432
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66118}
2020-02-04 18:26:26 +00:00
Thibaud Michaud
7a9e7f5084 [wasm] Trigger top tier callback for cached modules
Ensure that the top tier streaming callback is called, even when the
native module is actually fetched from the cache rather than compiled.
This preserves the old behavior, such that the cache stays an
implementation detail to clients of the streaming compilation API.

R=clemensb@chromium.org

Bug: v8:10165
Change-Id: Ib243c97529900f76b7b9cd5d1d57f259bc38225c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2035875
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66117}
2020-02-04 18:05:46 +00:00
Johannes Henkel
edaec0cb71 [DevTools] Roll inspector_protocol (V8)
"Remove the JSON parser and revamp Value::parseBinary."
Upstream review: https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/2026351

In addition to the upstream changes, this PR includes the necessary
tweaks to the V8 inspector (now taking the detour via
CBOR to parse Javascript).

New Revision: 0e0a1995497511008864546c094e885f3f1e13a3

Change-Id: I5ccfea5a3e1bab3e183b45c87726747d17d06944
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2020518
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66116}
2020-02-04 17:56:05 +00:00
Michael Lippautz
5ae7258c91 heap: Fix marking regression when not using embedder heap tracer
When not being embedded, there's no need to try to share time with the
embedder.

Additionally, avoid too small step sizes.

Bug: chromium:1044630, chromium:1048631
Change-Id: I227bfd120b5ce1976935d27c2140263f7364eb51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036085
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66115}
2020-02-04 15:37:17 +00:00
Michael Achenbach
28abde86ca [foozzie] Add option to skip suppressions
This will allow uploading repro test cases to clusterfuzz for
already suppressed known issues. This will allow tracking if those
issues still reproduce and that suppressions don't become stale.

No-Try: true
Bug: chromium:1044942
Change-Id: I997f11293c51836b97d143b0fea992055b39955e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036083
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66114}
2020-02-04 15:33:37 +00:00
Steve Blackburn
59aebb19da TPH needs internal isolates
Change the TPH API so that it uses v8::internal::Isolate rather
than v8::isolate.

The third party heap is within the internal namespace and ultimately
needs access to v8::internal::Isolate to do things such as adding code
ranges.  There's no reason for it to use v8:Isolate.

Bug: v8:9533
Change-Id: I8c3ecd6278081f03133013d4e3b02fb3ed228baf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036088
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Cr-Commit-Position: refs/heads/master@{#66113}
2020-02-04 15:24:17 +00:00
Michael Achenbach
9fbb56f544 [foozzie] Mock out WebAssembly when comparing with jitless
No-Try: true
Bug: chromium:1048620
Change-Id: I399144a9d8075efe40125dfcbe1dbbd0aabe0fe9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036080
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66112}
2020-02-04 15:18:39 +00:00
Maya Lekova
8fbcaf115e Revert "[wasm] Use memcmp to compare module bytes"
This reverts commit 45ea015080.

Reason for revert: Breaks UBSan - https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64%20UBSan/9777

Original change's description:
> [wasm] Use memcmp to compare module bytes
> 
> This is much faster than std::lexicographical_compare.
> 
> R=​clemensb@chromium.org
> 
> Bug: chromium:1048554
> Change-Id: I5f0ba22654e172535b6e6fcf6d2a460e278d3cfd
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036078
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66109}

TBR=clemensb@chromium.org,thibaudm@chromium.org

Change-Id: Ic4323af356bfd2698043b4f3ecb21367f1044446
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1048554
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2037430
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66111}
2020-02-04 14:44:57 +00:00
Clemens Backes
0f6ae8b9d1 [wasm][debug] Store debug side table per code object
The debug side table is indexed by pc offset. Offsets change if
breakpoints are added or removed, hence we cannot reuse the debug side
table when compiling another version of the function (with a different
set of breakpoints). Thus store the debug side table per code object
instead of per function.

R=thibaudm@chromium.org

Bug: v8:10147
Change-Id: Ifd77dd8f43c9b80bc4715ffe5ca8f0adca2aaf42
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030922
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66110}
2020-02-04 14:39:23 +00:00
Thibaud Michaud
45ea015080 [wasm] Use memcmp to compare module bytes
This is much faster than std::lexicographical_compare.

R=clemensb@chromium.org

Bug: chromium:1048554
Change-Id: I5f0ba22654e172535b6e6fcf6d2a460e278d3cfd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036078
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66109}
2020-02-04 14:00:27 +00:00
Steve Blackburn
e63ab1040f Add missing TPH guards
These guards are needed since the third part heaps don't use the
deserialization reservation system.

Bug: v8:9533
Change-Id: I0e8bd7928581979bed15abdfaf639c9fdfc8a30f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030908
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66108}
2020-02-04 13:43:08 +00:00
Michael Lippautz
02e5787389 heap: Delay completing marking
Delay completing marking (and thus the atomic GC pause) during JS
executions, increasing the chance to finalize the garbage collection
from a task. This is beneficial as it avoids stack scanning which is
expensive and can keep alive outdated objects in case of unified heap.

Completing will be delayed at most by some overshoot factor (10%).

In addition, the GC keeps the weighted average of previously recorded
time to incremental marking task invocations and bails out if the
task is expected to arrive too late.

Bug: chromium:1044630
Change-Id: I10e63e6aaa88d8488d4415f311016dce2b4e62a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030906
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66107}
2020-02-04 12:50:28 +00:00
Michael Lippautz
94723c1971 api: Remove deprecated TracedReference::SetFinalizationCallback method
TracedReference is supposed to be as light-weight as possible without
destructor or other callbacks, essentially just representing a plain managed
reference.

Change-Id: Iae52cf7460e3623f1fb7d183757ecd39b2431369
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2033173
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66106}
2020-02-04 12:04:53 +00:00
Leszek Swirski
aa3aaa76b6 [offthread] OffThreadFactory support for BigInt
This CL templatizes some methods in BigInt on the Isolate type, to allow
BigInts to be allocated off-thread from a BigInt literal.

A necessary side-effect is exporting the Isolate class in its entirety,
to allow it to be used as a specializing type for ' HandleFor' in
unittests.

Bug: chromium:1011762
Change-Id: I768f9e4d46a4532d6818d9a67c13801bc5952e5d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036079
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66105}
2020-02-04 12:03:17 +00:00
Michael Achenbach
e955999356 [foozzie] Remove obsolete suppression
No-Try: true
Bug: chromium:99679
Change-Id: I38af71ff062cb3662034f2e52da86a8f1de9280c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036081
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66104}
2020-02-04 11:59:12 +00:00
Victor Gomes
4ba141f3f5 [heap-snapshot] Fix context header size
Different contexts have different header sizes now.

The function ScopeInfo::ContextHeaderLength should be used instead of
Context::MIN_CONTEXT_SLOTS.

Bug: chromium:1021884
Change-Id: Ia9ea321cfb19d2a2ae0bc12c7db621f7d35b3b51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036074
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66103}
2020-02-04 11:58:07 +00:00
Clemens Backes
091e100cb5 [wasm] Remove IIFE around generated test code
This is mostly used for regression tests which don't need that function.
If we want to wrap it for inclusion in an existing test file, we can
easily add a function around it, and name it properly.

R=ahaas@chromium.org

Bug: v8:10177
Change-Id: I2aedcdfad09fe1fe07af9f0caa2b8bd45da902f3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036077
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66102}
2020-02-04 11:49:19 +00:00
Leszek Swirski
7a20b6b9d3 [offthread] Add an OffThreadIsolate
The Factory/OffThreadFactory allows us to cleanly separate object
construction behaviour between main-thread and off-thread in a
syntactically consistent way (so that methods templated on the factory
type can be made to work on both).

However, there are cases where we also have to access the Isolate, for
handle creation or exception throwing. So far we have been pushing more
and more "customization points" into the factories to allow these
factory-templated methods to dispatch on this isolate behaviour via
these factory methods. Unfortunately, this is an increasing layering
violation between Factory and Isolate, particularly around exception
handling.

Now, we introduce an OffThreadIsolate, analogous to Isolate in the same
way as OffThreadFactory is analogous to Factory. All methods which were
templated on Factory are now templated on Isolate, and methods which
used to take an Isolate, and which were recently changed to take a
templated Factory, are changed/reverted to take a templated Isolate.
OffThreadFactory gets an isolate() method to match Factory's.

Notably, FactoryHandle is changed to "HandleFor", where the template
argument can be either of the Isolate type or the Factory type (allowing
us to dispatch on both depending on what is available).

Bug: chromium:1011762
Change-Id: Id144176f7da534dd76f3d535ab2ade008b6845e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030909
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66101}
2020-02-04 11:37:47 +00:00
Michael Achenbach
deb3fd8a74 [foozzie] Remove obsolete suppressions
Respective differences were fixed and the suppressions didn't fire
anymore according to the statistics.

No-Try: true
Bug: chromium:664068, chromium:667678
Change-Id: I5e1aa802e0b0288a73d0f236c154289ab45314a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2035878
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66100}
2020-02-04 11:34:58 +00:00
Clemens Backes
a0cbfe7542 [wasm] Add comment after each line of generated wasm test code
This makes the output of --wasm-fuzzer-gen-test more useful by adding a
comment at the end of each line. This prevents clang-format from
breaking up individual lines.

R=ahaas@chromium.org

Bug: v8:10177
Change-Id: I222f7e30c84712357159e837e8b2e36737696669
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036076
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66099}
2020-02-04 11:29:47 +00:00
Michael Achenbach
8bb8d18772 [test] Bump shards on slow builder
TBR=mslekova@chromium.org

No-Try: true
Change-Id: Ib39993d6c82d499d8dc0f278cff4ec7dbfb345d0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036075
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66098}
2020-02-04 10:09:21 +00:00
Toon Verwaest
24c83d4918 [modules] Setup module exports in Runtime_DeclareModuleExports
This changes how we setup modules from being entirely bytecode based to a
single fixed array with metadata that's passed into a runtime function
DeclareModuleExports, similar to DeclareGlobals. This is preperatory work to
replace the bytecode that calls those functions with explicit calls before we
even start running the code. In the case of modules that will obviate the need
for modules to be generators.

Change-Id: Ibf1c913a9dc78041e3001b174c66ab89226d9c8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030733
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66097}
2020-02-04 09:58:12 +00:00
Clemens Backes
e395d16984 [api] Remove deprecated DeserializeOrCompile method
This method was used to implement deserialization via the value
serializer. It was deprecated since this functionality is not used any
more, and hence untested.
This CL cleans up by removing the deprecated method and two private
helper methods.

R=adamk@chromium.org

Bug: v8:10155
Change-Id: I4dda1949fd4f1b499cb6f8d6e6a76b642179303a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2033171
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66096}
2020-02-04 09:56:04 +00:00
Clemens Backes
0e2e50dd5b [liftoff][ia32] Fix AtomicStore register spilling
If we need a byte register, but {src} is none, we should definitely use
another register.

R=ahaas@chromium.org

Bug: chromium:1048241
Fixed: chromium:1048241
Change-Id: I3396826986e1823250ad6855b84f4b05faaf3b90
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036073
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66095}
2020-02-04 09:39:54 +00:00
Yu Yin
ec33d92b62 [mips][wasm-simd][liftoff] Implement i32/f32x4.splat.
port c10153b https://crrev.com/c/2023399
port 009993a https://crrev.com/c/2014753

Bug: v8:9909
Change-Id: Ia4f54340f0c6751f14c5852688741fa8fbef1f74
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2035511
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#66094}
2020-02-04 04:28:33 +00:00
v8-ci-autoroll-builder
ae6e4d8cac Update V8 DEPS.
Rolling v8/build: 67cd3fb..2283658

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/0b01653..ebf2bec

Rolling v8/third_party/depot_tools: 906bfde..e931018

Rolling v8/tools/clang: 80ad0bd..9ce85c8

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

Change-Id: I1772b79cdf76f43eb1db5361f3d5ff360dbf5a82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2035735
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@{#66093}
2020-02-04 03:59:33 +00:00
Natalie Silvanovich
535c5053e4 Adding counters for elements on Array.prototype and Object.prototype
Bug: chromium:1048354
Change-Id: Ib37c33f918e96b100926b8247a2ca034482fb978
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2028840
Commit-Queue: Natalie Silvanovich <natashenka@google.com>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66092}
2020-02-04 00:07:49 +00:00
Michael Lippautz
bd02f663d3 heap: Improved incremental scheduling for unified heap
When the embedder integrates in V8's garbage collector the performance
of the atomic phase is sensitive to how much embedder memory is found
through marking the overall transitive closure.

Before this patch, V8 would help out tracing the embedder's heap when
making progress through tasks but not on allocations. In addition, V8
would complete the garbage collection when it has observed it's own
marking worklists as empty 3 times (*). This can create performance
cliffs when there's a lot of work still to be done on the embedder
side.

This patch adds helping steps on allocation that are proportional to
the bytes that V8 would otherwise process, guaranteeing some progress
as long as there's V8 allocations. This allows us to remove (*).

Potential Tradeoffs:
- More time spent in V8's garbage collection metrics as we slightly
  limit the chances for the embedder to mark objects through tasks.
- Prolonged V8.execute time (JS execution)
+ Faster progress
+ Less memory
+ Smaller atomic pause time

Change-Id: I160f063209f7e129b9c884206f833706b69dadc1
Bug: chromium:1044630
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2025371
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66091}
2020-02-03 20:11:29 +00:00
Ng Zhi An
cccbd5f123 Reland "[wasm-simd][liftoff] Check CpuFeatures for SIMD support"
This relands commit 7c32fa05df.

Some test cases need to be updated, since we will bail out to TurboFan
where previously Liftoff was happy to run, when SIMD is not supported.

Original change's description:
> [wasm-simd][liftoff] Check CpuFeatures for SIMD support
>
> If Wasm simd128 is not supported on this particular hardware, we bail
> out to TurboFan.
>
> Bug: v8:9909
> Change-Id: Ie46e154426783ba099b7c0facc906670cda1bdd0
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2029427
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Commit-Queue: Zhi An Ng <zhin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66055}

Bug: v8:9909
Bug: v8:10169
Change-Id: I850e1fe6bfbd12fb2eec052aa8367624c09f7a08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030354
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66090}
2020-02-03 19:43:09 +00:00