This CL reverts commit 38bec2eadc and
implements the same functionality via Assembler::RecordRelocInfo.
Bug: v8:6666
Change-Id: I2e6b60697f68e956257f4c0877342da1bffca361
Reviewed-on: https://chromium-review.googlesource.com/1107710
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53911}
Move out all serialization related tests to
{test-wasm-serialization.cc}, to reduce the size of
{test-run-wasm-module.cc}.
R=titzer@chromium.org
Bug: v8:7754
Change-Id: I0b2133baf69e2557df27d1733cc267d1d4cf7452
Reviewed-on: https://chromium-review.googlesource.com/1107980
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53909}
Byteswap operations are used a lot in WASM on big endian
architecture. This CL removed unused 1-byte swapping,
rewrite tests so they have better coverage and cleans up
some other minor things.
TEST=cctest/test-run-wasm/RunWasmTurbofan_I32DivSOnDifferentRegisters
Change-Id: I60466bbd5fe3f64e8e55684265dc43e92fcabc2c
Reviewed-on: https://chromium-review.googlesource.com/1106379
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Sreten Kovacevic <sreten.kovacevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#53908}
This is a reland of 2c1e4aa990
Original change's description:
> [test] Initialize slow-dcheck runtime flag with compile time value
>
> This makes sure slow dchecks are part of the snapshot when the compile
> time flag is set. It'll also obviate the need to set the runtime flag
> in general, making configurations simpler.
>
> It's still possible to opt out at runtime for the non-snapshot dchecks
> using the negated runtime flag.
>
> Bug: v8:7853
> Change-Id: Iadfc46ed691d32e9d39717e2ea0383e784660d1d
> Reviewed-on: https://chromium-review.googlesource.com/1105050
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Commit-Queue: Michael Achenbach <machenbach@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53819}
TBR=jgruber@chromium.org
Bug: v8:7853
Change-Id: I21d82ea907c0beead4ad2bc90fecc4dc9036dc1b
Reviewed-on: https://chromium-review.googlesource.com/1109418
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53906}
The assertion is invalid if dst aliases src, which is the case in
InterpreterOnStackReplacement:
__ SmiUntag(x1,
FieldMemOperand(x1, FixedArray::OffsetOfElementAt(
DeoptimizationData::kOsrPcOffsetIndex)));
This didn't fail so far because slow asserts in snapshotted code are
never executed.
Bug: v8:7853
Change-Id: I5b2dad780da94b5821aa9a624a3fcb9d083b3aa3
Reviewed-on: https://chromium-review.googlesource.com/1109503
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53905}
It doesn't depend on anything from PropertyAccessBuilder other than
CompilationDependencies. Move it there instead.
R=jarin@chromium.org
Bug: v8:7790
Change-Id: I0545a990829f4591ebf5089b6a9e8c1a96899b93
Reviewed-on: https://chromium-review.googlesource.com/1107797
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53903}
This is a preliminary step for adding support for additional flags and return types.
Bug: v8:7754, v8:6600
Change-Id: I1f65ec41f22b61a9471eb7105033007744563e91
Reviewed-on: https://chromium-review.googlesource.com/1107917
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53894}
Port of 733b7c8258
Original description:
> [wasm] Introduce jump table
>
> This introduces the concept of a jump table for WebAssembly, which is
> used for every direct and indirect call to any WebAssembly function.
> For lazy compilation, it will initially contain code to call the
> WasmCompileLazy builtin, where it passes the function index to be
> called.
> For non-lazy-compilation, it will contain a jump to the actual code.
> The jump table allows to easily redirect functions for lazy
> compilation, tier-up, debugging and (in the future) code aging. After
> this CL, we will not need to patch existing code any more for any of
> these operations.
>
> R=mstarzinger@chromium.org, titzer@chromium.org
>
> Bug: v8:7758
> Change-Id: I45f9983c2b06ae81bf5ce9847f4542fb48844a4f
> Reviewed-on: https://chromium-review.googlesource.com/1097075
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53805}
Change-Id: Ifa7c2abe89a6dc5dbb03a547db2fab68e292f344
Reviewed-on: https://chromium-review.googlesource.com/1107630
Commit-Queue: Sreten Kovacevic <sreten.kovacevic@mips.com>
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53893}
This CL fixes a bug where execution would continue on a fast-path
even though a previous recursion step bailed to the slow path. This
would allow possibly illegal loads that could leak to JS.
Drive-by change: Instead of bailing to the slow-path on each recursion
step, we now bail completely and start the slow-path afterwards.
R=cbruni@chromium.org, jgruber@chromium.org
Bug: chromium:854299, v8:7382
Change-Id: Ib2fd5d85dbd0c3894d7775c4f62e053c31b5e5d1
Reviewed-on: https://chromium-review.googlesource.com/1107702
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53892}
This CL attempts to simplify the Assembler's dependency on the
isolate, in particular on a global "serializer_enabled" mode contained
therein. The "serializer_enabled" condition enabled and disabled
a number of things in both the assemblers and macro assemblers. To
make these dependencies explicit, the Assembler::IsolateData is refactored
to be a proper Assembler::Options struct that controls specific assembler
behaviors, with default settings easily computable from the isolate.
This also helps make the contract for compiling WASM code more explicit
(since WASM code needs to have reloc info recorded for external references)
we can explicitly enable this recording without trying to "trick" the
assembler using "serializer_enabled".
R=jgruber@chromium.orgCC=mstarzinger@chromium.org, herhut@chromium.org
Change-Id: I7a8ba49df7b75b292d73ec2aa6e507c27a3d99c8
Reviewed-on: https://chromium-review.googlesource.com/1105982
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53890}
When encountering a LoadStackPointer input to a comparison, generate a register
LocationOperand that points to the stack pointer. This can avoid unnecessary
spilling of the stack pointer.
Since sp is a special register for arm64, we need to add a mechanism to print
its name in RegisterConfiguration.
This is a port of https://chromium-review.googlesource.com/1055568 that made
the same change for arm.
It also ports the tests added in
https://chromium-review.googlesource.com/1099068 to arm and arm64.
Bug: v8:7844
Change-Id: I5adc672ff877b9888ef755e8e60e4eabbc61061b
Reviewed-on: https://chromium-review.googlesource.com/1107810
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/master@{#53889}
There is no point calling AllocationSpaceName manually every time. We
could get rid of AllocationSpaceName entirely, except that the
serializer calls it directly on ints that are casted to AllocationSpace
objects first.
Change-Id: I26b2181347dba960c8523d5dcecf8128208c59a2
Reviewed-on: https://chromium-review.googlesource.com/1107816
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53888}
Some cctests force fresh creation of heap constants, even though the
cctest binary itself is an embedded snapshot build (i.e.: a snapshot
blob exists, and a binary-embedded blob exists). This breaks a few
assumptions, for example that off-heap builtins have a single,
canonical off-heap code range.
Unfortunately this isn't that easy to fix. I see a few alternatives:
1. In builtins setup, if an embedded blob exists, regenerate the
builtins for their metadata (things like the safepoint table offset),
and then replace them by off-heap trampolines.
2. As above, but deserialize the trampolines from the snapshot blob.
3. As above, but pack required metadata into the embedded blob and
create trampolines from there.
4. Act as if the embedded blob does not exist.
Alternative 1 does not work because the generated code can be slightly
different at at runtime vs. mksnapshot-time. Alternative 2 is out
because we do not have access to the snapshot blob in TestIsolate
setup. Alternative 3 is probably the preferred option but would be a
more involved change.
This CL takes path 4. It's not an optimal solution, but it can be
replace by alternative 3 later.
TBR=ulan@chromium.org
Bug: v8:7718, v8:7751
Change-Id: I36c024cb0179615011c886ed3978bc95f0d197ac
Reviewed-on: https://chromium-review.googlesource.com/1098924
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53886}
The stack check builtin really has stub linkage, not wasm linkage. For
the stack check, it technically does not make a difference currently
since the stack check does not receive any arguments.
R=mstarzinger@chromium.org
Change-Id: Ia3e6ea192250dc3799c7a5166cf616f883c1f63f
Reviewed-on: https://chromium-review.googlesource.com/1107709
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53883}
Unconditionally setting the JSFunction code to that of the SFI
may skip initializing the feedback vector.
R=leszeks@chromium.org
Bug: v8:7857
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I65d4bf32493be4cade2eaf3d665d44f93e80f809
Reviewed-on: https://chromium-review.googlesource.com/1107618
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53881}
This test was not adapted for the jump table yet.
R=mstarzinger@chromium.org
Bug: v8:7867
Change-Id: Ifd03899b0757972525dcc54f04949635d03fa493
Reviewed-on: https://chromium-review.googlesource.com/1107624
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53878}
If the isolate is available via another object (including JSReceivers
and Contexts), grab it through that rather than HeapObject::GetIsolate.
As a drive-by, fix up places where this looked like it would work but
didn't because of null or uninitialized objects.
Bug: v8:7786
Change-Id: I3454840073d1455b3738e0ac34ccaa3c9a220896
Reviewed-on: https://chromium-review.googlesource.com/1104170
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53876}
Replace all implicit Handle<T>(T*) constructors in src/bootstrapper.cc
with explicit ones that use a local variable or parameter.
(All done using Leszek's awesome new tool!)
Bug: v8:7786
Change-Id: Iec01fda502dd121bc1815d5dab73bd09bb3e5aa6
Reviewed-on: https://chromium-review.googlesource.com/1107697
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53873}
This is a reland of 380dba0a5c
Original change's description:
> [runtime][gc] Drop AllocationSite::weak_next field for sub-literals
>
> Use AllocationSite without Weaknext field for all the allocations in nested
> literal except for Root. The nested field is sufficient to link all the
> allocations in a nested literal. Only the Root is added to heap weak_alloc_list
> for GC to traverse
>
> Change-Id: I946e63292c6d168197cd2a087f697c73cc431272
> Reviewed-on: https://chromium-review.googlesource.com/1101323
> Commit-Queue: Chandan Reddy <chandanreddy@google.com>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53813}
Change-Id: Ic451fb3600b87f8f69748b1659ff89a80c9322fa
Reviewed-on: https://chromium-review.googlesource.com/1106257
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Chandan Reddy <chandanreddy@google.com>
Cr-Commit-Position: refs/heads/master@{#53872}
There's no need to assume anything when we don't reduce the node.
R=bmeurer@chromium.org
Change-Id: Ic39b6e634c662824a72affd91318ca024f3e1055
Reviewed-on: https://chromium-review.googlesource.com/1105832
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53870}
This CL adds a constexpr int31 == operator that returns
a constexpr bool value.
It also fixes a bug that this introduces because branch generation
for ternary operators incorrectly assumed that the condition value
was bool, whereas it can also be constexpr bool now.
Change-Id: Ie7d3497c9d1112c121b4a29561fe065b5bf01fb6
Reviewed-on: https://chromium-review.googlesource.com/1106343
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Théotime Grohens <theotime@google.com>
Cr-Commit-Position: refs/heads/master@{#53867}
This is in order to check if we can get rid of the cache.
Bug: v8:7790
Change-Id: Id6625ffc440665b090f999564b006506f947ae45
Reviewed-on: https://chromium-review.googlesource.com/1107620
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53865}
We can instead pass the deopt id in a register, where before we were passing the
deopt entry address. This removes the need for the deopt tables altogether,
saving 192kB.
Change-Id: I479d4de1a0245de328720b6b03a1955c8c63f696
Reviewed-on: https://chromium-review.googlesource.com/1076472
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/master@{#53863}
Also fix an oversight in my previous CL.
R=jarin@chromium.org
Bug: v8:7790
Change-Id: I61c783392b7b7b38ea28dc44dc1e932d15b55bc6
Reviewed-on: https://chromium-review.googlesource.com/1106170
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53862}