Commit Graph

45149 Commits

Author SHA1 Message Date
Michal Majewski
cfd43ee713 [test] Added test processor documentation.
Bug: v8:6917
Change-Id: I6ecfab76e6d2ee0b4ab86380e8cfbb68df07599e
Reviewed-on: https://chromium-review.googlesource.com/852295
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50457}
2018-01-09 17:05:13 +00:00
Michal Majewski
1d9035ab3b [test] Introduce flag to stress atomic gc.
--fuzzer-gc-analysis prints allocations count without need for
predictable mode.

--random_gc_interval is similar to --gc-interval with 2 differences:
1) Causes gc every random(0, X) allocations instead of constant X.
2) Doesn't update the allocation timeout when there is a GC for
different reason than timeout equals to 0.

Bug: v8:6972
Change-Id: I07ad935fc264a61069255c7358b4fcbe42bfb17a
Reviewed-on: https://chromium-review.googlesource.com/815214
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50456}
2018-01-09 16:57:32 +00:00
Michael Achenbach
5d4e11a77e Revert "[turbofan] Handle mixed packed/unpacked multimaps in Array.prototype.push"
This reverts commit ae14edca68.

Reason for revert: Test fails with gc stress:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20GC%20Stress%20-%20custom%20snapshot/builds/17067

Original change's description:
> [turbofan] Handle mixed packed/unpacked multimaps in Array.prototype.push
> 
> Bug: v8:7127, v8:7204, v8:7205
> Change-Id: I4eb009492222b208ff8875b4b7940174dfb132ff
> Reviewed-on: https://chromium-review.googlesource.com/847576
> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Michael Stanton <mvstanton@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50451}

TBR=mvstanton@chromium.org,sigurds@chromium.org

Change-Id: Ic1dac13e59565d2f0f2a4265c24f6532973f630a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7127, v8:7204, v8:7205
Reviewed-on: https://chromium-review.googlesource.com/857636
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50455}
2018-01-09 16:51:36 +00:00
Michael Achenbach
163b5d705e Revert "[esnext] load iterator.next only once at beginning of iteration"
This reverts commit bf4cc9ee15.

Reason for revert: Breaks windows with msvc and linux with gcc
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/841
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/17265

Original change's description:
> [esnext] load `iterator.next` only once at beginning of iteration
> 
> https://github.com/tc39/ecma262/pull/988 gained concensus during the
> september 2017 TC39 meetings. This moves the load of the "next" method
> to the very beginning of the iteration protocol, rather than during
> each iteration step.
> 
> This impacts:
> 
> - yield*
> - for-of loops
> - spread arguments
> - array spreads
> 
> In the v8 implementation, this also affects async iteration versions of
> these things (the sole exception being the Async-From-Sync iterator,
> which requires a few more changes to work with this, likely done in a
> followup patch).
> 
> This change introduces a new AST node, ResolvedProperty, which can be used
> as a callee by Call nodes to produce the same bytecode as Property calls,
> without observably re-loading the property. This is used in several
> AST-desugarings involving the iteration protocol.
> 
> BUG=v8:6861, v8:5699
> R=​rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org
> 
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b
> Reviewed-on: https://chromium-review.googlesource.com/687997
> Commit-Queue: Caitlin Potter <caitp@igalia.com>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Adam Klein <adamk@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50452}

TBR=rmcilroy@chromium.org,adamk@chromium.org,neis@chromium.org,caitp@igalia.com,caitp@chromium.org

Change-Id: I1797c0d596dfd6850d6f0f505f591a7a990dd1f1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6861, v8:5699
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/857616
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50454}
2018-01-09 16:50:33 +00:00
Michal Majewski
5c56e27d49 [test] Introduce flag for fuzzer analysis phase.
--stress-marking and --stress-scavenge flags with the value
greater than 0 enable additional tracking, allocation observers etc.

--fuzzer-analysis switches --stress-* flags into analysis mode,
which means that all allocation observers and additional checks
are still executed, but GC is not influenced by them. It also
provides analysis information needed by the fuzzer on the stdout.

Bug: v8:6972
Change-Id: I5ac45adb311441d57d5b951aeec036e689930e9f
Reviewed-on: https://chromium-review.googlesource.com/814536
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#50453}
2018-01-09 16:28:30 +00:00
Caitlin Potter
bf4cc9ee15 [esnext] load iterator.next only once at beginning of iteration
https://github.com/tc39/ecma262/pull/988 gained concensus during the
september 2017 TC39 meetings. This moves the load of the "next" method
to the very beginning of the iteration protocol, rather than during
each iteration step.

This impacts:

- yield*
- for-of loops
- spread arguments
- array spreads

In the v8 implementation, this also affects async iteration versions of
these things (the sole exception being the Async-From-Sync iterator,
which requires a few more changes to work with this, likely done in a
followup patch).

This change introduces a new AST node, ResolvedProperty, which can be used
as a callee by Call nodes to produce the same bytecode as Property calls,
without observably re-loading the property. This is used in several
AST-desugarings involving the iteration protocol.

BUG=v8:6861, v8:5699
R=rmcilroy@chromium.org, neis@chromium.org, adamk@chromium.org

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ib81106a0182687fc5efea0bc32302ad06376773b
Reviewed-on: https://chromium-review.googlesource.com/687997
Commit-Queue: Caitlin Potter <caitp@igalia.com>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50452}
2018-01-09 16:21:30 +00:00
Sigurd Schneider
ae14edca68 [turbofan] Handle mixed packed/unpacked multimaps in Array.prototype.push
Bug: v8:7127, v8:7204, v8:7205
Change-Id: I4eb009492222b208ff8875b4b7940174dfb132ff
Reviewed-on: https://chromium-review.googlesource.com/847576
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50451}
2018-01-09 16:07:20 +00:00
Andreas Haas
1c857d5d81 [wasm] Update spec tests.
R=titzer@chromium.org

Change-Id: Iefa0c90f572acbf4cdc3fc4c4f046a760fb59df9
Reviewed-on: https://chromium-review.googlesource.com/857197
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50450}
2018-01-09 15:58:51 +00:00
Michael Starzinger
36345adada [asm.js] Switch source position type to {size_t}.
This switches the source positions consumed by {WasmFunctionBuilder} to
have type {size_t} instead of {int}. All checks for accidental loss due
to overflow in static casts can now be moved into one place.

R=clemensh@chromium.org

Change-Id: Id0b0da5fe799eac794c9d610c4c4c9a72a587b3f
Reviewed-on: https://chromium-review.googlesource.com/857196
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50449}
2018-01-09 15:54:52 +00:00
Ben L. Titzer
ae45cc1f5c [wasm] Pad all WASM memories to the next power of 2 size
Combined with existing masking, provides protection against speculative
OOB accesses.

R=clemensh@chromium.org

Bug: chromium:798964
Change-Id: Ib7cdc8bccc6d22b8b45896c63f69cb647deba383
Reviewed-on: https://chromium-review.googlesource.com/856980
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50448}
2018-01-09 15:50:11 +00:00
Clemens Hammacher
826a6e7fbd [wasm] Add interface callback before each instruction
In Liftoff, we want to trace the cache state basically before or after
processing each instruction. Instead of duplicating this code
everywhere, introduce a new interface method {NextInstruction}, which
is called before each instruction.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Iea61738d200076690a8440a75a2fd90018efa43b
Reviewed-on: https://chromium-review.googlesource.com/852457
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50447}
2018-01-09 15:09:00 +00:00
Clemens Hammacher
6b5578eca4 Reland "[Liftoff] Rename kConstant to kI32Const"
This is a reland of f22156bf37.

Original change's description:
> [Liftoff] Rename kConstant to kI32Const
>
> This makes it more clear that we only store i32 values as constants in
> the cache state.
>
> R=ahaas@chromium.org
>
> Bug: v8:6600
> Change-Id: I3022e963e864c9c533cbb673bd8502481389799b
> Reviewed-on: https://chromium-review.googlesource.com/853870
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50437}

Bug: v8:6600
Change-Id: I4c28f379eab525a0c86866c39b2e6b55f7c5ab1a
Reviewed-on: https://chromium-review.googlesource.com/857017
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50446}
2018-01-09 15:02:10 +00:00
Hannes Payer
e1c85e213d [heap] Only allow valid inner pointers when calling GcSafeFindCodeForInnerPointer.
Bug: chromium:800251
Change-Id: I9cf94a1e17ca12970b5660f0320c02151d7b79a3
Reviewed-on: https://chromium-review.googlesource.com/856637
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50445}
2018-01-09 14:49:11 +00:00
Clemens Hammacher
453d60b1e9 [wasm] Fix code printing for off-the-heap code
We were trying to disassemble the whole body of a function, including
safepoints and the constant pool. This lead to DCHECK errors on mips.
This CL fixes that, and adds printing of source positions.
It also fixes the output of instructions size to only contain the
instructions for both on-the-heap and off-the-heap code.

R=titzer@chromium.org

Bug: chromium:800233
Change-Id: Idb15a779680af7997eb78aea2a329189b684d53e
Reviewed-on: https://chromium-review.googlesource.com/856458
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50444}
2018-01-09 14:11:13 +00:00
Clemens Hammacher
54cb64ac94 [asm] Store source position for all loops
Loop headers contain a stack check in wasm, hence an exception can be
thrown at the position of the loop instruction. This means that for
asm.js, we need to store a source position for each loop instruction.

R=mstarzinger@chromium.org

Bug: chromium:799690
Change-Id: I129abef11461992e2f10af8e6afc28ce1cf83341
Reviewed-on: https://chromium-review.googlesource.com/856338
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50443}
2018-01-09 13:56:28 +00:00
Andreas Haas
1016e6257d [d8] Run the message loop in the same RealmScope as the script
In d8 a script is executed in a RealmScope. However, all micro task
which are created by the script are not executed within the RealmScope
at the moment. With this CL I move the execution of the micro task into
the RealmScope.

I thought about creating a new RealmScope for the micro tasks, but
(1) It did not fix the crashing repro;
(2) It seems wrong that the micro tasks are executed in a different
    realm than the script;

Therefore I just moved the execution of the micro tasks into the
RealmScope of the script.

Thereby I moved the execution tasks also into the Context::Scope of the
script. The problem is that the Context::Scope surrounds the RealmScope,
and when I to open the RealmScope before the Context::Scope, not even
the execution of the script works anymore.

R=yangguo@chromium.org

Bug: chromium:797846
Change-Id: If152af282beec8f0b0564dcc9682fee8588e142c
Reviewed-on: https://chromium-review.googlesource.com/856497
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50442}
2018-01-09 13:51:41 +00:00
Clemens Hammacher
0e7d4ccd32 [Liftoff] Implement i32 unops
This adds support for i32.eqz, i32.clz, and i32.ctz.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I0dd7c14cf98b68463edae7de3ced9a9d1f82de44
Reviewed-on: https://chromium-review.googlesource.com/852456
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50441}
2018-01-09 13:36:02 +00:00
Georg Neis
8d8f8756ee [compiler] Clean up deoptimization reasons.
- Remove unused deoptimization reasons.
- Replace most uses of kNoReason with an actual reason (some are new).
- Rename kNoReason to kUnknown.

Bug: 
Change-Id: Ia8df54fca0f0f4885ef0c3523ce8f67b557a635d
Reviewed-on: https://chromium-review.googlesource.com/839421
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50440}
2018-01-09 13:30:51 +00:00
sreten.kovacevic
0c138bae3b [simulator] MIPS64: Fix implementation of SDL
Fix implementation of SDL instruction in MIPS64 simulator.
Use rt register as unsigned for shift operation.

TEST: cctest/test-run-wasm-64/RunWasmTurbofan_Store_i64_narrowed
Change-Id: I3a900631f8db401cf041e103436d4ec263a6f1c4
Reviewed-on: https://chromium-review.googlesource.com/856577
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#50439}
2018-01-09 13:29:11 +00:00
Clemens Hammacher
e714a62d39 Revert "[Liftoff] Rename kConstant to kI32Const"
This reverts commit f22156bf37.

Reason for revert: Lots of compile errors. Try bots sloppy??

Original change's description:
> [Liftoff] Rename kConstant to kI32Const
> 
> This makes it more clear that we only store i32 values as constants in
> the cache state.
> 
> R=​ahaas@chromium.org
> 
> Bug: v8:6600
> Change-Id: I3022e963e864c9c533cbb673bd8502481389799b
> Reviewed-on: https://chromium-review.googlesource.com/853870
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50437}

TBR=ahaas@chromium.org,clemensh@chromium.org

Change-Id: I6e224d4aa03ff18d6d55e9f8d4726fac711c7665
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6600
Reviewed-on: https://chromium-review.googlesource.com/857016
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50438}
2018-01-09 13:23:33 +00:00
Clemens Hammacher
f22156bf37 [Liftoff] Rename kConstant to kI32Const
This makes it more clear that we only store i32 values as constants in
the cache state.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: I3022e963e864c9c533cbb673bd8502481389799b
Reviewed-on: https://chromium-review.googlesource.com/853870
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50437}
2018-01-09 13:16:13 +00:00
v8-autoroll
aa1845d37a Update V8 DEPS.
Rolling v8/build: 1a03e2d..1ce2f5d

Rolling v8/third_party/catapult: https://chromium.googlesource.com/catapult/+log/95f3b4d..e1f9b2c

Rolling v8/third_party/icu: e3b480d..f3d25bc

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

Change-Id: I59e5ca65d4ba45ecbddaacc68a7b0c970856a02e
Reviewed-on: https://chromium-review.googlesource.com/856836
Reviewed-by: v8 autoroll <v8-autoroll@chromium.org>
Commit-Queue: v8 autoroll <v8-autoroll@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50436}
2018-01-09 12:57:12 +00:00
Choongwoo Han
864372000e [csa] Fix type casing in GetProperty
The checked node and used node were mismatched. It checked if
"var_unique" is a string, but it used "key" which may not be a string.

Bug: v8:4911, v8:7161, chromium:800077
Change-Id: Ia2aee8b77ac33500430365a4800bf9cca40a28fc
Reviewed-on: https://chromium-review.googlesource.com/855138
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50435}
2018-01-09 12:56:07 +00:00
Ben L. Titzer
244a05fb39 [wasm] Encapsulate WASM native module serialization in CC file.
This CL simply moves the implementation classes for WASM native
module serialization into the CC file and simplifies them a bit.

R=mstarzinger@chromium.org

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Id560d2c35eb12bdd461f5d80cb5211a2f4f51684
Reviewed-on: https://chromium-review.googlesource.com/856677
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50434}
2018-01-09 12:27:51 +00:00
Yang Guo
11e80a3509 [snapshot] support attaching arbitrary v8::Data.
In collaboration with Qingyan Li <qingyan.liqy@alibaba-inc.com>.

R=jgruber@chromium.org, mlippautz@chromium.org

Bug: v8:7249
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I87f62103ec5b31de274fa22ad275f1c1bcb3ed86
Reviewed-on: https://chromium-review.googlesource.com/846750
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50433}
2018-01-09 12:06:40 +00:00
jgruber
3f8d6f6074 [regexp] Properly handle large values in AdvanceStringIndex
There were two separate bugs here. First, a signed/unsigned mismatch
where we took the result of PositiveNumberToUint32 and treated it as a
signed int. Second, AdvanceStringIndex did not handle large input
values correctly.

Both are fixed by using uint64_t consistently.

Bug: chromium:799813, v8:7258
Change-Id: If2819f87986d0ca732bc24df290f6dc7614083e8
Reviewed-on: https://chromium-review.googlesource.com/854272
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50432}
2018-01-09 12:03:55 +00:00
Leszek Swirski
b3749e929f [runtime] Fix AbortJS builtin to call AbortJS
Instead of calling Abort, which was failing when trying to read its
string argument as a Smi.

Change-Id: I008b8620cbb7df2a56fc5c5ea42f4d573b159f76
Reviewed-on: https://chromium-review.googlesource.com/856778
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50431}
2018-01-09 12:02:50 +00:00
Clemens Hammacher
16876610bc [Liftoff] Implement if blocks
This adds support for if blocks to Liftoff.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Iac7f3ec6526e1259b447ab6ec794a8a1c7ae05c3
Reviewed-on: https://chromium-review.googlesource.com/853501
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50430}
2018-01-09 11:46:10 +00:00
sreten.kovacevic
31399db82e MIPS64: Add missing instructions to disasm-mips64.cc
Add SDL and SDR instructions to disassembler on MIPS64.

Bug: 
Change-Id: I9cfcfe05d34aa483b8f7504267b76a782dd06558
Reviewed-on: https://chromium-review.googlesource.com/856676
Reviewed-by: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#50429}
2018-01-09 11:24:10 +00:00
Michal Majewski
ed619fa6c6 [test] Make variant names unique
Temporary workaround to avoid the same variant name for multiple
variants of the same test.

Bug: v8:6917
Change-Id: I9a25dcaf81d35da0dc2617c089cb4811c2a958cb
Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/852833
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50428}
2018-01-09 11:18:40 +00:00
Clemens Hammacher
566b3bf4a7 [Liftoff] Implement direct calls
This adds support for direct calls in Liftoff.

Drive-by: Fix / extend two tests for calls which were helpful for
developing this CL.

R=ahaas@chromium.org

Bug: v8:6600
Change-Id: I20a98d9dd330da9a020c8c9b5c10b04e94af684d
Reviewed-on: https://chromium-review.googlesource.com/847579
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50427}
2018-01-09 10:54:56 +00:00
Clemens Hammacher
30fabc4cdf Replace CALL_GENERATED_CODE by GeneratedCode wrapper
This ensures that there is only one entrance point from C++ to
generated code, hence only one method has to be excluded from CFI.
It also introduces type safety by only allowing the code to be called
with the right arguments.
This CL includes minor drive-by fixes in the tests, like removing
unused dummy variables.

R=mstarzinger@chromium.org

Bug: v8:7182
Change-Id: Ied9164a2497db9e7c032324c5e082094fdffc72d
Reviewed-on: https://chromium-review.googlesource.com/852213
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50426}
2018-01-09 10:33:36 +00:00
Clemens Hammacher
c176c0544e [Liftoff] Store protected instruction info
Store protected instruction info needed for the wasm trap handler.
This code will be used and covered by existing tests once we add support
for if-constructs to Liftoff.

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

Bug: v8:6600, v8:5277
Change-Id: I508b0ab8572ef8b5c7943564714fcec7e9eb8e3b
Reviewed-on: https://chromium-review.googlesource.com/853497
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50425}
2018-01-09 10:02:56 +00:00
Hannes Payer
4bf8043148 [heap] Refactor and clean-up runtime allocation.
Bug: chromium:796896
Change-Id: I7f46f82d079502b8ec04c5e3be5f803ec9e62ffa
Reviewed-on: https://chromium-review.googlesource.com/854797
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50424}
2018-01-09 09:51:21 +00:00
Choongwoo Han
8fbc6a05c1 Optimize TypedArraySpeciesCreate using SpeciesProtector of Array
If there is no constructor or species updates on Array or TypedArrays,
then skip lookups of constructor and species so that we can create a new
typed array quickly. This path makes TA.p.slice() 4x faster in fast
cases.

Bug: v8:7161
Change-Id: Ib8d2a3f6b8b5ed356c5822a814164166d1285f64
Reviewed-on: https://chromium-review.googlesource.com/828343
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50423}
2018-01-09 09:50:16 +00:00
Clemens Hammacher
96d869fd91 [Liftoff] Remove obsolete bailout in memory store
This seems to be a merge error. The if moved down by a few lines and
now actually implements the bounds check instead of bailing out.
Taking it out revealed a bug where we were trying to access the lowest
8 bits on a register where this is not allowed on ia32, thus a few
more changes were needed in this CL.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ib1ef131a12df050302ae50115493a1fcd8323fe5
Reviewed-on: https://chromium-review.googlesource.com/852734
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50422}
2018-01-09 08:46:55 +00:00
Jaroslav Sevcik
f13540e96e [turbofan] Fix array masking for the length==index case.
Bug: chromium:798964
Change-Id: I48d6662d60765f04004b324f67ed3aadf11ee07b
Reviewed-on: https://chromium-review.googlesource.com/854132
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50421}
2018-01-09 07:12:55 +00:00
Alexey Kozyatinskiy
784e2f5e00 [inspector] little better injected-script-source
We can call less getters on node objects.

R=dgozman@chromium.org

Bug: chromium:799791
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iecfe76c2be6b6bed675013ac4aaa117b714d4ba5
Reviewed-on: https://chromium-review.googlesource.com/854623
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50420}
2018-01-08 23:53:15 +00:00
Junliang Yan
40d6a6cfa0 PPC/s390: Refactor bailout reasons
Port fba4cdf16c

Original Commit Message:

    This patch breaks out bailout reasons into two enum classes.

    This helps save 3 bits on the SharedFunctionInfo as we don't have to
    track the abort reasons.

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

Change-Id: Ib2b2ce10b2f1ef6380193964aa9d868168fe129a
Reviewed-on: https://chromium-review.googlesource.com/855016
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#50419}
2018-01-08 21:36:24 +00:00
Eric Holk
92183d8a48 Reland "[wasm] use allocation tracker to track reserved address space"
This is a reland of 9c79b37aa7
Original change's description:
> [wasm] use allocation tracker to track reserved address space
> 
> This is a step towards falling back on bounds checks when there are too many
> guarded Wasm memories.
> 
> Bug: v8:7143
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
> Change-Id: I01916cbdd5ddb08fe1d946ab83b801f37a8fe1c6
> Reviewed-on: https://chromium-review.googlesource.com/832944
> Commit-Queue: Eric Holk <eholk@chromium.org>
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50390}

Bug: v8:7143
Change-Id: Iaf0d22d300a3f2da22649552a17162dcf7bc608b
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/853142
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50418}
2018-01-08 18:53:14 +00:00
Sathya Gunasekaran
779c080895 [ESNext] Implement optional catch binding
This is just a rebased version of
https://chromium-review.googlesource.com/c/v8/v8/+/571453 with
no functional changes

Bug: v8:6889
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Ia082cc09ca527505b288ac88e68e0b74eae94765
Reviewed-on: https://chromium-review.googlesource.com/849423
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50417}
2018-01-08 18:09:34 +00:00
Yang Guo
9c0edf6813 Do not run gyp as gclient hook for building for node.
This causes issues when running tools/node/fetch_deps.py on systems without
gyp as pre-installed python module. And we do not even need to do this for
building for node (with GN).

R=machenbach@chromium.org

Bug: v8:6105
Change-Id: If0089dedf176bb509b9fd000e5fe829f8a32bac6
Reviewed-on: https://chromium-review.googlesource.com/852458
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50416}
2018-01-08 18:04:24 +00:00
Clemens Hammacher
4adfd97b29 [wasm] Fix decoder tracing
This fixes two issues with --trace-wasm-decoder and --trace-liftoff.
First, cache state tracing in liftoff only makes sense together with
--trace-wasm-decoder, so disable it otherwise.
Second, we were sometimes hitting a DCHECK with --trace-wasm-decoder on
functions which bailed out to Turbofan, since the bailout was resetting
the end pointer of the decoder to the current pc.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: Ib4e052a1cdec6389b12b4a0ea57f07c031324ed5
Reviewed-on: https://chromium-review.googlesource.com/853493
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50415}
2018-01-08 17:38:22 +00:00
Choongwoo Han
2ca420e46c [csa] Relax bailout condition for integer indexed exotic
GetProperty CSA implementation bailouts prototype lookup when the
holder is a typed array, which is to handle integer indexed exotic
cases. However, this strict condition made too much overheads for
search of common names such as "constructor". This CL checks the
first character of a name, and do not bailout if we are sure that
the name cannot be a special index.

Bug: v8:4911, v8:7161
Change-Id: I2229ff3bebe14a452718e0b1f8354bb05437c09c
Reviewed-on: https://chromium-review.googlesource.com/842963
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50414}
2018-01-08 17:24:19 +00:00
Clemens Hammacher
a3baa35372 [simulator] Make Call variadic
In order to remove the CALL_GENERATED_CODE macro, it helps a lot to
unify the interfaces of the simulators and make the Call method variadic
in the number of arguments.
This CL does that for each simulator. A follow-up CL will then
completely remove the CALL_GENERATED_CODE macro and replace uses with
the (new) GeneratedCode wrapper.

R=mstarzinger@chromium.org

Bug: v8:7182
Change-Id: I1f81445ec2faba30f0bd233b022ae1f0fae4e96f
Reviewed-on: https://chromium-review.googlesource.com/850873
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50413}
2018-01-08 16:53:45 +00:00
Clemens Hammacher
06bf1245cf [Liftoff] Measure liftoff compile time separately
Add a counter to measure the pure liftoff compile time. With background
compilation, the reported result will roughly match the cpu time, not
wall-clock time.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I9c76673a4cbe833de5b41a23d09892f577401374
Reviewed-on: https://chromium-review.googlesource.com/853859
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50412}
2018-01-08 16:52:40 +00:00
Clemens Hammacher
30aa7b073c [wasm] Add some documentation for bounds checks
And apply a minor change: the {end_offset} is currently always >= 1, and
we sometimes use {end_offset - 1}. Change this to compute the
{end_offset} to be one less than before, and use {Uint32LessThan}
instead of {Uint32LessThanOrEqual}.
This matches the documentation I added and makes reasoning about the
correctness of the checks easier (at least for me).

R=titzer@chromium.org

Change-Id: I9a18ad5c72895cbadb6593cb74d6edc24f9ab032
Reviewed-on: https://chromium-review.googlesource.com/852145
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50411}
2018-01-08 16:51:35 +00:00
Ivica Bogosavljevic
789f327d30 MIPS: Fix stack overwrite when calling complex turbofan functions
TEST=cctest/test-code-generator/FuzzAssembleMoveAndSwap

Bug: 
Change-Id: I36d0b7df56f3c895a7fd4017e5e9a7cfd0053b2a
Reviewed-on: https://chromium-review.googlesource.com/850399
Reviewed-by: Miran Karić <miran.karic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#50410}
2018-01-08 15:51:35 +00:00
Clemens Hammacher
9180b2ca46 [wasm] Fix more 32/64 bit issues
For simplicity, we currently use the approach to do all computations
and bounds checks on 32 bit values, and only convert to pointer size
right before using the value as memory offset.
Unfortunately, there are still cases left where we use 32-bit values
for 64-bit operations, which can lead to subtle bugs.
This CL hopefully fixes the last of these bugs.

R=titzer@chromium.org

Bug: v8:7257

Change-Id: I8d340f83ad17925c0d18d4e788350ef6101786ea
Reviewed-on: https://chromium-review.googlesource.com/852299
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50409}
2018-01-08 14:29:10 +00:00
Ross McIlroy
a4de840cd3 [Flags] Remove obsolete --extra-masking flag
Change-Id: I668a4ac9ce80daa1952b05fdee754db190f3fb3c
Reviewed-on: https://chromium-review.googlesource.com/853866
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50408}
2018-01-08 13:56:39 +00:00