Commit Graph

64724 Commits

Author SHA1 Message Date
Jakob Kummerow
6c07d6e3d8 [typedarray] Throw rather than crash when too large to sort
Sorting a TypedArray with a custom compare function requires us to
copy the array's contents to a FixedArray. When the TypedArray is
larger than FixedArray::kMaxLength, we should throw a RangeError
rather than crashing with an OOM message.

Fixed: v8:10931
Change-Id: I8a27cc0ac80a9172bc5e8e154fdf4ccce5974317
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440575
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70232}
2020-09-30 15:20:33 +00:00
Leszek Swirski
74f3665c64 Revert "[serializer] Allocate during deserialization"
This reverts commit 5d7a29c90e.

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

Original change's description:
> [serializer] Allocate during deserialization
>
> This patch removes the concept of reservations and a specialized
> deserializer allocator, and instead makes the deserializer allocate
> directly with the Heap's Allocate method.
>
> The major consequence of this is that the GC can now run during
> deserialization, which means that:
>
>   a) Deserialized objects are visible to the GC, and
>   b) Objects that the deserializer/deserialized objects point to can
>      move.
>
> Point a) is mostly not a problem due to previous work in making
> deserialized objects "GC valid", i.e. making sure that they have a valid
> size before any subsequent allocation/safepoint. We now additionally
> have to initialize the allocated space with a valid tagged value -- this
> is a magic Smi value to keep "uninitialized" checks simple.
>
> Point b) is solved by Handlifying the deserializer. This involves
> changing any vectors of objects into vectors of Handles, and any object
> keyed map into an IdentityMap (we can't use Handles as keys because
> the object's address is no longer a stable hash).
>
> Back-references can no longer be direct chunk offsets, so instead the
> deserializer stores a Handle to each deserialized object, and the
> backreference is an index into this handle array. This encoding could
> be optimized in the future with e.g. a second pass over the serialized
> array which emits a different bytecode for objects that are and aren't
> back-referenced.
>
> Additionally, the slot-walk over objects to initialize them can no
> longer use absolute slot offsets, as again an object may move and its
> slot address would become invalid. Now, slots are walked as relative
> offsets to a Handle to the object, or as absolute slots for the case of
> root pointers. A concept of "slot accessor" is introduced to share the
> code between these two modes, and writing the slot (including write
> barriers) is abstracted into this accessor.
>
> Finally, the Code body walk is modified to deserialize all objects
> referred to by RelocInfos before doing the RelocInfo walk itself. This
> is because RelocInfoIterator uses raw pointers, so we cannot allocate
> during a RelocInfo walk.
>
> As a drive-by, the VariableRawData bytecode is tweaked to use tagged
> size rather than byte size -- the size is expected to be tagged-aligned
> anyway, so now we get an extra few bits in the size encoding.
>
> Bug: chromium:1075999
> Change-Id: I672c42f553f2669888cc5e35d692c1b8ece1845e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2404451
> Commit-Queue: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70229}

TBR=ulan@chromium.org,jgruber@chromium.org,leszeks@chromium.org

Change-Id: I2bd792a24861e8f54897e51522769b50f8f814e2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1075999
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440827
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70231}
2020-09-30 14:24:01 +00:00
Gus Caplan
1682a876e4 [regexp] Refactor experimental instruction emits and labels
This is some general cleanup for the experimental regexp implementation.
DeferredLabels have been merged into Labels, label APIs more closely
resemble other parts of V8, and instruction codegen has been moved into
its own class.

Bug: v8:10765
Change-Id: I139c0a0df30e539ee39eae70fc206e6406d898b1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2433058
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Gus Caplan <snek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70230}
2020-09-30 14:14:54 +00:00
Leszek Swirski
5d7a29c90e [serializer] Allocate during deserialization
This patch removes the concept of reservations and a specialized
deserializer allocator, and instead makes the deserializer allocate
directly with the Heap's Allocate method.

The major consequence of this is that the GC can now run during
deserialization, which means that:

  a) Deserialized objects are visible to the GC, and
  b) Objects that the deserializer/deserialized objects point to can
     move.

Point a) is mostly not a problem due to previous work in making
deserialized objects "GC valid", i.e. making sure that they have a valid
size before any subsequent allocation/safepoint. We now additionally
have to initialize the allocated space with a valid tagged value -- this
is a magic Smi value to keep "uninitialized" checks simple.

Point b) is solved by Handlifying the deserializer. This involves
changing any vectors of objects into vectors of Handles, and any object
keyed map into an IdentityMap (we can't use Handles as keys because
the object's address is no longer a stable hash).

Back-references can no longer be direct chunk offsets, so instead the
deserializer stores a Handle to each deserialized object, and the
backreference is an index into this handle array. This encoding could
be optimized in the future with e.g. a second pass over the serialized
array which emits a different bytecode for objects that are and aren't
back-referenced.

Additionally, the slot-walk over objects to initialize them can no
longer use absolute slot offsets, as again an object may move and its
slot address would become invalid. Now, slots are walked as relative
offsets to a Handle to the object, or as absolute slots for the case of
root pointers. A concept of "slot accessor" is introduced to share the
code between these two modes, and writing the slot (including write
barriers) is abstracted into this accessor.

Finally, the Code body walk is modified to deserialize all objects
referred to by RelocInfos before doing the RelocInfo walk itself. This
is because RelocInfoIterator uses raw pointers, so we cannot allocate
during a RelocInfo walk.

As a drive-by, the VariableRawData bytecode is tweaked to use tagged
size rather than byte size -- the size is expected to be tagged-aligned
anyway, so now we get an extra few bits in the size encoding.

Bug: chromium:1075999
Change-Id: I672c42f553f2669888cc5e35d692c1b8ece1845e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2404451
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70229}
2020-09-30 14:04:03 +00:00
Michael Achenbach
bf3adea58a [test] Add fallback to legacy output directory
The infrastructure will soon start using the canonical build output
location out/build. New flake bisect jobs will then be started with
--outdir=out/build.

This change picks the current out/Release or out/Debug as an
alternative output location to be compatible with the future value
of the flag.

This code will be removed when the property change happens.

This prepares:
https://crrev.com/c/2426643

Bug: chromium:1132088
Change-Id: I1fe3bcb239b05d069a1006646bc9306a16a3cecd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440336
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70228}
2020-09-30 13:36:03 +00:00
Samuel Groß
919d1dd770 Fix unhandled promise rejections in REPRL mode
Previously, unhandled promise rejections weren't reset between REPRL
executions, leading to incorrect exit statuses being reported. This CL
fixes the issue and adds further tests to verify the correct behaviour.

Change-Id: Ied47d9359b0fbc05ebb211667687a0a4041ef767
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431205
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Commit-Queue: Samuel Groß <saelo@google.com>
Cr-Commit-Position: refs/heads/master@{#70227}
2020-09-30 13:34:23 +00:00
Jakob Kummerow
5f1ae37a01 [messages] Cap string length we try to format
When building the error message for a TypeError when e.g.
a non-callable is called, we should avoid running into the
max string length. Printing many megabytes there isn't going
to be useful anyway.

Fixed: v8:10963
Change-Id: Ief89800f660bdd48585f84c3e3d4ece21b02b760
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2438068
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70226}
2020-09-30 13:29:53 +00:00
Milad Fa
44355d750a PPC: Mark console-messages-limits as slow
Bug: v8:10965
Change-Id: Iba23cfcfaed44b52fe38851713e2ffedd118430f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2437172
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70225}
2020-09-30 13:23:53 +00:00
Clemens Backes
2a71b32062 [wasm] Rename {ValidateFlag} constants
As a preparation to add a "boolean validation" mode, rename the existing
flags. This removes many unrelated changes from the follow-up change and
makes it easier to review.

R=thibaudm@chromium.org

Bug: v8:10969
Change-Id: I5f71405b525a7caa91be46c035e31d4d960e4e4c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440036
Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70224}
2020-09-30 13:19:03 +00:00
Michael Achenbach
7b24b13981 [test] Use the correct precedence for choosing the build directory
This breaks looking for build output after finding valid output.
Otherwise build output with lower precedence can overwrite output
with higher precedence.

This also moves a static method.

Bug: chromium:1132088
Change-Id: I1824028243f964ab0956e54ca24921e6f32f2ca3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2440337
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Auto-Submit: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70223}
2020-09-30 13:01:43 +00:00
Igor Sheludko
60de9d5a6f [runtime] Fix assert in EnsureInitialMap()
Bug: chromium:1132640
Change-Id: I40e8aecc98d9fc20bbe1df6e31be127af8710723
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436334
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70222}
2020-09-30 12:39:43 +00:00
Jakob Gruber
c11a054ea0 [nci] Update invocation count in the NCI prologue
The invocation count is part of call feedback, and is used during
tier-up to determine inlining candidates. For bytecode, it is updated
by the InterpreterEntryTrampoline, which can be seen as a global
prologue for all bytecode functions.

Since NCI tiers up, it must also track the invocation count. This CL
adds it to the NCI prologue sequence (emitted as part of every NCI
code object).

Bug: v8:8888
Change-Id: I04b33c9c8b0bdd975aceb97145f159798e18b97b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436340
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70221}
2020-09-30 11:06:57 +00:00
Victor Gomes
d8217c3257 [wasm] Remove arguments adaptor frame
Change-Id: I33294dc5b93d5842a3a51779bfec30f20bf4f23f
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436345
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70220}
2020-09-30 11:03:01 +00:00
Victor Gomes
f5456f37dd [frames] Fix GetActualArgumentCount typo
Change-Id: I624b16162dd859dc88b5f26cfc7d1a4a15089095
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2438455
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70219}
2020-09-30 10:58:57 +00:00
Thibaud Michaud
e60d8600b5 [wasm] Add GenericJSToWasmWrapper to the list of executable builtins
Ensure that a valid off-heap trampoline is created for the
GenericJSToWasmWrapper builtin by adding it to the list of executable
builtins.

R=ahaas@chromium.org
CC=​evih@chromium.org

Bug: v8:10701
Change-Id: I49b8144237aca20f5f663c7b32810a16f715ad5f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2438415
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70218}
2020-09-30 10:45:47 +00:00
Vicky Kontoura
30c0326a83 [wasm] Support fast transformation for heap numbers in js-to-wasm wrapper
This CL extends fast-path transformations of JavaScript parameters
when calling an exported WebAssembly function from JavaScript
to support heap numbers for types kF32 and kF64.

Bug: v8:10943
Change-Id: Ifbb745cb7bee3ef34bb40b7c01597703fde340bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2435366
Commit-Queue: Vicky Kontoura <vkont@google.com>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70217}
2020-09-30 10:33:37 +00:00
Zhao Jiazhong
2abb9de6f5 [mips] Skip inspector/debugger/wasm-scope-info* tests
Since the inspector/debugger/wasm-scope-info* tests need simd128,
but not all mips cpus support it, we skip the tests on mips
platforms without simd support.

Change-Id: Iebefa5d6b33d80d707ad0077be7d4f25e3e52b4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2439769
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70216}
2020-09-30 10:15:05 +00:00
Manos Koukoutos
2e9cb16c14 [wasm][bug] Compare signatures correctly in ResolveWasmImportCall
Changes:
- Implement WasmExportedFunction::MatchesSignature.
- Use it over comparison with == in ResolveWasmImportCall.
- Add a test which exposes the existing bug.
- Add a few reminder TODOs.

Bug: v8:9495
Change-Id: Ibbe31dbf550be212dbf2170ab8cdab9b4b6de734
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2438060
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70215}
2020-09-30 09:56:27 +00:00
Zhao Jiazhong
90f9decefa [mips] Fix floating point abs operation
Float32/64 abs operation should only clear the sign bit, but abs.s
and abs.d instructions of mips64r2 would convert nan to canonical
nan.

Change-Id: Ibbd05cdb3a73acfe0e532030d1815d262c3ac433
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2439768
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70214}
2020-09-30 09:37:07 +00:00
Jakob Gruber
75b8c238dc [turboprop] Add TURBOPROP code kind
Turboprop-generated Code objects will now have the dedicated
TURBOPROP code kind instead of OPTIMIZED_FUNCTION. When possible,
the code kind is used as the source of truth instead of
FLAG_turboprop. This is the initial step towards implementing
tier-up from Turboprop to Turbofan.

Future work: Rename OPTIMIZED_FUNCTION to TURBOFAN, rename STUB to
DEOPT_ENTRIES_OR_FOR_TESTING, implement TP tier-up.

No-Try: true
Bug: v8:9684
Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
Change-Id: I3c9308718d7e9a2b7e6796e7ea94f17e5ff84c0a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2424140
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70213}
2020-09-30 08:52:57 +00:00
v8-ci-autoroll-builder
83133d95f2 Update V8 DEPS.
Rolling v8/build: 38a49c1..3ede101

Rolling v8/buildtools: 3ff4f50..4be464e

Rolling v8/third_party/aemu-linux-x64: FfxmX7LQ9OID3pVAmcemr6u9lK3xjXzAXxvqzEcclMwC..oJeWXQJJ1lVY6P7l39pBV-mrbeWlw0swPZQuNmcix5AC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/18d69fb..0f6ed71

Rolling v8/third_party/depot_tools: 1099c11..991ead1

Rolling v8/third_party/instrumented_libraries: 3c52ccd..6ba978c

Rolling v8/third_party/zlib: 4668fea..26211a5

Rolling v8/tools/clang: 3017eda..bd8e096

TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Change-Id: Icb156ce2fe693cd4838c7e11b31cb96282125c92
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2439341
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@{#70212}
2020-09-30 04:03:46 +00:00
Zhao Jiazhong
656a687902 [mips] Support unaligned loading and storing kWord8 value
Change-Id: Ib5728e22815339096dec72cc3a6d8732da436062
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2437514
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#70211}
2020-09-30 01:59:34 +00:00
Ng Zhi An
d8a36591ed [wasm-simd][scalar-lowering] Fix sign extend/masks of lanes
For replacing lanes (i8x16 and i16x8) the replacement value is stored in
a word32. Simply storing it will cause us to have the wrong value, we
need to mask (for overflow) and extend appropriately.

Same for extracting, the values are stored in sign-extended form,
unsigned extracts should zero the top bits.

Bug: v8:10507
Change-Id: If5ed79f5b6bdb64f900a54b9e148b2d96a74f312
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436612
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70210}
2020-09-30 00:16:24 +00:00
Andrey Kosyakov
582de025d8 Do not pause on breaks while installing additional command line API
A break may cause the session disconnect (and therefore agents destruction)
on a nested message loop. The runtime agent code is generally prepared to
handle this during evaluate, but the code outside of it may be not. Besides,
having a break before the console API installed is generally not what
user wants or expects, so just disable all breaks while installing the API.

Bug: chromium:1122487
Change-Id: I1d40f5007f2e1e4ec07a50ef57988513d0309b7e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2437383
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70209}
2020-09-30 00:12:24 +00:00
Ng Zhi An
ed7204bbde [wasm-simd] Add saturating conversion opcodes to wasm-module-builder.js
Bug: v8:10933
Change-Id: I6709dac3598f9dea96fe6f5efec452c1bbdcbc2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436611
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70208}
2020-09-29 20:18:13 +00:00
Etienne Pierre-doray
6d776e5792 [Jobs]: Fix task id lifetime.
Delegate kept task id around for longer than the worker is considered
active, thus breaking the task_id < num_worker garantee. The fix is to
adjust the delegate lifetime.

Change-Id: I9aabb1286d507c09bfe9be4fd4f810f232d6e6b9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2437005
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70207}
2020-09-29 18:00:33 +00:00
Ng Zhi An
805f19319e [wasm-simd] Rename load splat and load extend (arch)
Perform the renames for all arch-dependent opcodes too.
This is a follow-up of https://crrev.com/c/2422357.

Bug: v8:10946,v8:10933
Change-Id: I02f048b64dd4d75f06d6b7919660ffebd0e78b50
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431798
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70206}
2020-09-29 17:29:43 +00:00
Ng Zhi An
98e2796555 [wasm-simd] Protected load transforms are not eliminatable
LoadTransform operators contain a LoadKind, which can be unaligned,
protected, poisoned, normal.

If it is protected, we cannot eliminiate that load,
since we rely on the segv signal handling. So, we use partial template
specialization on LoadKind::kProtected, and don't set the operator to
not be eliminatable.

Bug: chromium:1132461
Change-Id: If45fc6562348ffd4dbaa27058e6c5d4242f79abb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436081
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70205}
2020-09-29 17:24:53 +00:00
Samuel Groß
32e2584405 [sandbox][x64] Access external pointer through a table
This change moves external pointers into a separate table and turns
external pointers in heap objects into indices into that table.

This CL implements one of two possible ownership models for the table
entries. With this one, every heap object owns its table entries, and
they are allocated when the owning object is allocated. As such, setting
external pointer fields does not require allocation of table entries. On
the other hand, table indices cannot be shared between multiple objects.

This CL does not yet implement freeing of external pointer table
entires. This will later happen by a table garbage collector.

Bug: v8:10391
Change-Id: I4d37785295c25a7d1dcbc9871dd5887b9d788a4f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2235700
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Samuel Groß <saelo@google.com>
Cr-Commit-Position: refs/heads/master@{#70204}
2020-09-29 17:13:43 +00:00
Ng Zhi An
5082a1d924 [ia32] Consolidate rounding opcodes in disasm
Bug: v8:10933

Change-Id: I71869306fded6212a231f9825a6b7091f5f6f19d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2383070
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70203}
2020-09-29 17:09:23 +00:00
Santiago Aboy Solanes
82aa10fe11 [CSA] Refactor NonNumberToNumberOrNumeric
We used to have a loop that it was used for JSReceivers. However, this
was not used as a proper loop since at most it would have two loop
iterations. Then, it could be changed to a Branch case.

Since I was refactoring the method, I also de-duplicated code by using
the common code from PlainPrimitiveNonNumberToNumber. In order to do so,
said method was renamed to TryPlain... and was reworked as well.

Bug: v8:6949, v8:10933
Change-Id: I860601a3b9e8bdeed052dcd237a767ac7ed80c92
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2435110
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70202}
2020-09-29 16:32:43 +00:00
Milad Fa
0b635d7f67 PPC: Skip inspector/runtime/console-messages-limits on sim
Bug: v8:10965
Change-Id: Ie98d77c681cfdc468ae8c1fef51e8b6ec2aa185a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2438230
Reviewed-by: Junliang Yan <junyan@redhat.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#70201}
2020-09-29 15:07:23 +00:00
Sathya Gunasekaran
28f3d23658 [turboprop] Introduce a builtin to perform dynamic map checks
Instead of always inlining the polymorphic map checks, this CL
introduces a builtin to perform these polymorphic map checks
when the IC is monomorphic at compile time.

This reduces the time we spend compiling and code bloat while trading it
for performance.

Bug: v8:10582, v8:9684
Change-Id: I7aea698988f8ead3cbf3f4a836218f53223f0f98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2398525
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70200}
2020-09-29 14:11:33 +00:00
Seth Brenith
a149be889e Fix handling of v8_builtins_profiling_log_file gn argument
There were two problems:
1. v8_builtins_profiling_log_file was not declared in "sources" or
   "inputs", so Ninja wouldn't re-run mksnapshot if it changed.
2. v8_builtins_profiling_log_file was passed directly to mksnapshot
   without rebasing the path, which makes it awkward and inconsistent
   with how most other gn arguments work.

Bug: v8:10470
Change-Id: Id8edba325b867e8d9561d3c76f28e121641d0dd4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2434103
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#70199}
2020-09-29 13:50:21 +00:00
Philip Pfaffe
4a20fe3869 Enable evaluateOnCallFrame for wasm frames
This is the first step to support debug evaluate on wasm call frames.
This CL enables calling evaluateOnCallFrame when a wasm frame is
selected, which before always returned undefined. The CL mirrors global
evaluation, and actually enabling inspecting the wasm frame will be part
of a second change.

Bug: chromium:1127914
Change-Id: If0ad0be7c402d85ab2a8e95376398f4f4ef94948
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436338
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70198}
2020-09-29 13:43:21 +00:00
Camillo Bruni
8d389204a6 [log][test] Skip log_two_byte.js test in predictable mode
Allocating the log string causes allocation differences.
Skipping test for now.

Drive-by-fix: remove two more console.log from test

Bug: v8:10966, v8:10668
Change-Id: Ifb93393fb82a983e779246ea728b1f6caf650426
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436457
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70197}
2020-09-29 13:18:51 +00:00
Jakob Gruber
942c2ef85c [builtins] Remove builtins-call.cc
There's no builtin implementation code here, the two functions should
live in builtins.cc.

Change-Id: Ie3cff4f1a22c86984a99a3b5d1b82c0f9f9a1f5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436458
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70196}
2020-09-29 11:49:41 +00:00
Georg Neis
44f23d617a Revert "[compiler] Check for stack overflow in recursive ReduceJSCall"
This reverts commit d734bb4c5d.

Reason for revert: Flawed.

Original change's description:
> [compiler] Check for stack overflow in recursive ReduceJSCall
>
> Gracefully handle hugely nested JSBoundFunctions.
>
> Bug: chromium:1125145
> Change-Id: I08f136fa9d35cf16ea8da5132d4d483a75d0ba94
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2418091
> Auto-Submit: Georg Neis <neis@chromium.org>
> Reviewed-by: Maya Lekova <mslekova@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70164}

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

Change-Id: I2d4ed79e2470981dab7ccba8e0c7e1004fe91369
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1125145
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436342
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70195}
2020-09-29 11:33:52 +00:00
Victor Gomes
52bebb7b2e [compiler][x64] Remove arguments adaptor frame
Removes the arguments adaptor frame during optimization (for x64) and deoptimization.

Change-Id: Ica78ebbb9216555dd3f1adf05d6b293e8add0050
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2410195
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70194}
2020-09-29 10:28:51 +00:00
Manos Koukoutos
f542fdefd5 [zone] Remove redundant size roundup in Zone
Change-Id: I2859b2f83a1b3a8f70f906f698a8531796b767af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436332
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70193}
2020-09-29 10:10:11 +00:00
Mike Stanton
1079320886 [Turbofan] Make GraphAssembler respect a Reducer context
Here is an alternate fix for chromium:1123379, which addresses a
TODO. A callback is provided to the GraphAssembler when it's working
on an unscheduled graph. In such cases, changed nodes in the main
graph need to be revisited after change. The callback ensures that
the GraphAssembler kicks that process off when necessary.

Bug: chromium:1123379
Change-Id: I9d864c3390fbe670ee450152a67555dcbfa8f581
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2433924
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70192}
2020-09-29 09:54:41 +00:00
Dominik Inführ
81ceccd598 [test] Fix timeout in AddTraceEventMultiThreaded
Initializing running_ to true in Run() could happen after Stop().

Bug: v8:10315
Change-Id: Ibde2ff8cb8a5db862f970df261481cb55f8b6c96
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436459
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70191}
2020-09-29 09:15:51 +00:00
Manos Koukoutos
21d954154c [wasm][cleanup] Rename kLocal<type> constants -> k<type>Code
Change-Id: I7bca3ed949a5dd036c3255cc5853819312387cce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436330
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70190}
2020-09-29 08:48:21 +00:00
Jakob Kummerow
14ec01762b [cleanup] Drop outdated tools/trace-maps-processor.py
V8 can no longer produce the data this script used to consume.

Bug: v8:10933
Change-Id: Ia78f24b34ce84e19a1a0bf98c75f1ca5de36618e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2435228
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70189}
2020-09-29 08:39:01 +00:00
Jakob Kummerow
a3eeeb2a99 [cleanup] Drop empty header file
Bug: v8:10933
Change-Id: I33aad48c65292fa4e886c4485518735bc5926fdf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2435647
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70188}
2020-09-29 07:43:31 +00:00
Santiago Aboy Solanes
b8ea338d4e [compiler] Revert to serialization for some classes
Reverted:
 * FixedDoubleArray
 * BigInt
 * HeapNumber
 * Partial work of JSDataView

Bug: v8:7790
Change-Id: I075e1d6d50129771f6208f198911797c6db3b7cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2431944
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70187}
2020-09-29 05:49:21 +00:00
v8-ci-autoroll-builder
a8f46352e3 Update V8 DEPS.
Rolling v8/build: 693ed52..38a49c1

Rolling v8/third_party/aemu-linux-x64: H7hrpKGUlOVzq9skYXcIJ0DSDdaFuCLaA8hiD5ii0fEC..FfxmX7LQ9OID3pVAmcemr6u9lK3xjXzAXxvqzEcclMwC

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/3cd3b4e..18d69fb

Rolling v8/third_party/depot_tools: 77397c4..1099c11

TBR=machenbach@chromium.org,tmrts@chromium.org,v8-waterfall-sheriff@grotations.appspotmail.com

Change-Id: I0d6101aa24325a778ee3044f8ac9f93f60c078a0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436695
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@{#70186}
2020-09-29 03:34:20 +00:00
Ng Zhi An
c84b85cc30 [wasm-simd][scalar-lowering] Fix signature with lowered Simd
Functions with Simd128 in their signature will be lowered to 4 Word32.
Later for Int64 lowering, it needs to use the lowered signature.
Otherwise we will have weird parameter and signature mismatch, since it
expects Parameter[1] to be == signature()->GetParam(0).

Bug: v8:10507
Change-Id: Ia9417ecd46c1768344ed1fb3ebfe4e8dd9c3e397
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2432626
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70185}
2020-09-29 00:15:05 +00:00
Ng Zhi An
78391a4450 [wasm-simd] Fix typo in constructing SIMD Global
The value should be v128 according to
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#global-constructor.

Change-Id: I9d29905daaaf19cdcaf686991f4887c3e709d2d6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2436638
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70184}
2020-09-28 23:29:44 +00:00
Ng Zhi An
f4b97a40ff [wasm-simd][scalar-lowering] Fix lowering of returns
If return's input counts did not change, there is no need to change the
node at all.

Bug: chromium:1127620
Change-Id: I16d14a273d44b9fcd0b5a8af74b7a5a2eda569ff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2434998
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70183}
2020-09-28 22:16:04 +00:00