Commit Graph

4447 Commits

Author SHA1 Message Date
Marja Hölttä
bd0a7fd64c [iwyu] Remove include heap-inl.h -> counters.h
This reduces the build steps after touching counters.h from 710 to 191, thus
detaching counters.h from the giant include cluster.

BUG=v8:7490,v8:8238

Change-Id: I0c7e707fb945e293f8a5604cc8da438cd35b3210
Reviewed-on: https://chromium-review.googlesource.com/c/1329695
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57468}
2018-11-13 13:19:38 +00:00
Jakob Kummerow
fe61cd6487 [ubsan] Port Code to the new design
Bug: v8:3770
Change-Id: I413ce57f7fa91cef2445995ca22650477f92b0df
Reviewed-on: https://chromium-review.googlesource.com/c/1321892
Reviewed-by: Dan Elphick <delphick@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57445}
2018-11-12 18:47:04 +00:00
Jakob Gruber
ff06752acf [builtins] Isolate-independent CallStubDelayed
This is only used by ProfileEntryHookStub. For builtins, this also
needs to go through an indirection.

Bug: v8:6666
Change-Id: I088fa472e2d365ccfb2d027bfbdad182ffae487e
Reviewed-on: https://chromium-review.googlesource.com/c/1326025
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57379}
2018-11-09 08:58:47 +00:00
Igor Sheludko
4001f86afa [ptr-compr] Make cleared weak reference value pointer compression friendly
because otherwise cleared weak references require special treatment during
decompression.

Bug: v8:7703
Change-Id: I38761d656c606e7ba7fc3075dffbd855a9f72302
Reviewed-on: https://chromium-review.googlesource.com/c/1322909
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57315}
2018-11-07 13:28:43 +00:00
Jakob Kummerow
6d706ae3a0 [ubsan] Port Smi to the new design
and split Smi out of objects.h into smi.h.

Bug: v8:3770, v8:5402
Change-Id: I5ff7461495d29c785a76c79aca2616816a29ab1e
Reviewed-on: https://chromium-review.googlesource.com/c/1313035
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57252}
2018-11-05 20:52:51 +00:00
Michael Starzinger
fbeaeb26ef [wasm] Remove test-only {RelocInfo::JS_TO_WASM_CALL}.
The relocation mode in question was by now only used in tests to model a
wrapper call from wrapper code (on the GC'ed heap) to a non-movable wasm
code object. Instead of using a special relocation mode, we switch to
using the existing {EXTERNAL_REFERENCE} mode similar to other static C++
functions called from generated code.

R=sigurds@chromium.org
BUG=v8:8238

Change-Id: I30af98b92aed207c52ccccaf018a455ecac39c2b
Reviewed-on: https://chromium-review.googlesource.com/c/1309821
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57239}
2018-11-05 13:49:18 +00:00
Jakob Kummerow
18ac14688d Reland "[ubsan] Replace Object** in GlobalHandles"
and reland "[ubsan] More Object** replacements"

This reverts commit 162d4e6de8.

Reason for revert: Not the culprit, test failed before.

Original change's description:
> Revert "[ubsan] Replace Object** in GlobalHandles"
> 
> This reverts commit 9392727982.
> 
> Reason for revert: Speculative revert, seems the most probable cause of
> https://bugs.chromium.org/p/v8/issues/detail?id=8396
> 
> Revert "[ubsan] More Object** replacements"
> 
> This reverts commit 5cce694d60.
> 
> Speculative revert.
> 
> NOTRY=true
> 
> Bug: v8:8396
> Change-Id: I9c2866a9db707cd03e4cf90822acde20813cebf0
> Reviewed-on: https://chromium-review.googlesource.com/c/1309761
> Commit-Queue: Maya Lekova <mslekova@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57174}

TBR=yangguo@chromium.org,mstarzinger@chromium.org,mslekova@chromium.org

Bug: v8:8396
Change-Id: I64fc80804b4ec324cef80ac528d08b724963f7f7
Reviewed-on: https://chromium-review.googlesource.com/c/1311813
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57194}
2018-10-31 23:56:23 +00:00
Maya Lekova
162d4e6de8 Revert "[ubsan] Replace Object** in GlobalHandles"
This reverts commit 9392727982.

Reason for revert: Speculative revert, seems the most probable cause of
https://bugs.chromium.org/p/v8/issues/detail?id=8396

Revert "[ubsan] More Object** replacements"

This reverts commit 5cce694d60.

Speculative revert.

NOTRY=true

Bug: v8:8396
Change-Id: I9c2866a9db707cd03e4cf90822acde20813cebf0
Reviewed-on: https://chromium-review.googlesource.com/c/1309761
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57174}
2018-10-31 14:48:57 +00:00
Jakob Kummerow
5cce694d60 [ubsan] More Object** replacements
mostly in HandleScopeImplementer and related classes.

Bug: v8:3770
Change-Id: I9da757c60be99434b711fe74a5f5d296a0f08b22
Reviewed-on: https://chromium-review.googlesource.com/c/1300854
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57154}
2018-10-31 05:17:16 +00:00
Michael Starzinger
cc91a10249 [cleanup] Remove dead Enter/LeaveBuiltinFrame methods.
R=jgruber@chromium.org

Change-Id: Ic9ef3cd231c2180563c3520ab58895f2ccce5408
Reviewed-on: https://chromium-review.googlesource.com/c/1307421
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57123}
2018-10-30 13:16:40 +00:00
Jakob Gruber
1dec99f538 [ia32,root] Remove ebx from ALLOCATABLE_GENERAL_REGISTERS
This CL restores consistency with other platforms. ebx is now the
kRootRegister on ia32, and thus not an allocatable register any more.

The PreserveRootIA32 register configuration can be removed since it is
now identical to the Default configuration.

Bug: v8:6666
Change-Id: If4e2b4c52aa8b5db40bcd3b4469004b29c0e3d99
Reviewed-on: https://chromium-review.googlesource.com/c/1299078
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57018}
2018-10-26 08:33:48 +00:00
Michael Starzinger
e893eb1403 [wasm] Support encoding reference types in exceptions.
This adds support for having reference type values (i.e. anyref) stored
in an exception. It is the natural combination of the reference type
proposal and the exception handling proposal.

Note that this also introduces support for having write barriers in
generated WasmCode, as this is the first time we are storing references
within generated code. Such write barriers will be needed for other uses
of reference types (e.g. mutable global) regardless.

R=clemensh@chromium.org
TEST=mjsunit/wasm/exceptions-anyref
BUG=v8:8341

Change-Id: I1211d4a850954622cb873eede0b4024fecc3dd8b
Reviewed-on: https://chromium-review.googlesource.com/c/1296484
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56995}
2018-10-25 15:44:29 +00:00
Jakob Gruber
640fd567bc [ia32] Remove embedded builtin ifdefs in macro assembler
This removes the last V8_EMBEDDED_BUILTIN ifdefs from the ia32 macro
assembler. It also enables root-relative accesses in a few more spots
where they are cheap.

Bug: v8:6666
Change-Id: I10c8e69d8a76fccd3d0753dad020cced4d92a4a2
Reviewed-on: https://chromium-review.googlesource.com/c/1299018
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56990}
2018-10-25 14:11:58 +00:00
Jakob Gruber
ff6138ad08 Reland "[ia32] Remove poisoning logic on ia32"
This is a reland of a31a623047

Original change's description:
> [ia32] Remove poisoning logic on ia32
>
> Poisoning has been disabled by default on ia32 a while ago. This CL
> removes its logic from ia32 code generation, which will let us move
> towards fuller (and unconditional) root register support.
>
> Bug: chromium:860429, v8:8254
> Change-Id: I8f672cf48a6ffc7bf21e7794c1b7463d7f8b9594
> Reviewed-on: https://chromium-review.googlesource.com/c/1296131
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56978}

Tbr: mstarzinger@chromium.org,jarin@chromium.org
Bug: chromium:860429, v8:8254
Change-Id: Ia65ac57fdc6b9a0f59cc64455d6a000005e9be3b
Reviewed-on: https://chromium-review.googlesource.com/c/1299080
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56984}
2018-10-25 12:45:55 +00:00
Michael Achenbach
17f47d7402 Revert "[ia32] Remove poisoning logic on ia32"
This reverts commit a31a623047.

Reason for revert:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20nosnap%20-%20debug/21332

Original change's description:
> [ia32] Remove poisoning logic on ia32
> 
> Poisoning has been disabled by default on ia32 a while ago. This CL
> removes its logic from ia32 code generation, which will let us move
> towards fuller (and unconditional) root register support.
> 
> Bug: chromium:860429, v8:8254
> Change-Id: I8f672cf48a6ffc7bf21e7794c1b7463d7f8b9594
> Reviewed-on: https://chromium-review.googlesource.com/c/1296131
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56978}

TBR=mstarzinger@chromium.org,jarin@chromium.org,jgruber@chromium.org

Change-Id: I305e9e1719fb4b3f8ef267c232723db9b52966e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:860429, v8:8254
Reviewed-on: https://chromium-review.googlesource.com/c/1299015
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56980}
2018-10-25 11:15:56 +00:00
Jakob Gruber
a31a623047 [ia32] Remove poisoning logic on ia32
Poisoning has been disabled by default on ia32 a while ago. This CL
removes its logic from ia32 code generation, which will let us move
towards fuller (and unconditional) root register support.

Bug: chromium:860429, v8:8254
Change-Id: I8f672cf48a6ffc7bf21e7794c1b7463d7f8b9594
Reviewed-on: https://chromium-review.googlesource.com/c/1296131
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56978}
2018-10-25 10:46:27 +00:00
Igor Sheludko
0e09760881 [ptr-compr] Make IsolateData be the bottleneck for root-relative accesses
Bug: v8:8182
Change-Id: I4dadd9cab071ecd4314c370be5f444e36acb708e
Reviewed-on: https://chromium-review.googlesource.com/c/1297317
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56973}
2018-10-25 08:46:58 +00:00
Michael Starzinger
68f7c3a776 [builtins][ia32] Bring back register for record write stub.
This adds back another register to the record write stub to have one
additional register on top of the parameter register as allocation
general purpose register. It has only been recently reduced to just four
registers due to embedded builtins. This is needed to be able to tail
call a record write stub.

R=ulan@chromium.org
CC=jgruber@chromium.org
BUG=v8:8341

Change-Id: Id16f9e96d611a871fbe1180581eaf14275a7332e
Reviewed-on: https://chromium-review.googlesource.com/c/1297955
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56955}
2018-10-24 15:14:15 +00:00
Jakob Gruber
adfe25c0ce [ia32] Remove embedded builtin porting helpers
This removes a bunch of porting helpers, e.g. scopes that mark
the addressability of ebx, printing embedded builtin candidates, and
the call/jump mechanism through a virtual target register.

This also disables root register verification by default on ia32. It
can be completely removed in a bit.

Bug: v8:6666
Change-Id: I4705d61991ddc57c30981c311a1c8c5e2f8ddf4d
Reviewed-on: https://chromium-review.googlesource.com/c/1288271
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56864}
2018-10-22 16:13:04 +00:00
Sigurd Schneider
1dc1d1ae4e [assembler] Move ConstantPools out of src/assembler.h
Drive-by: Eliminate unnecessary includes to src/assembler.h.

Bug: v8:8238
Change-Id: Ia0408b993b8b1c21a76c947f406f96b63fe41994
Reviewed-on: https://chromium-review.googlesource.com/c/1288810
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56817}
2018-10-19 11:38:39 +00:00
Sigurd Schneider
f6ed1f9626 [ia32] Remove ShouldGenerateIsolateIndependentCode helper
Change-Id: I4464932425f1fa0f05a644983262742fe7f25364
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1286679
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56765}
2018-10-18 09:31:06 +00:00
Sigurd Schneider
60f94823d2 [ia32] Implement PC-relative calls for snapshot code
Bug: v8:6666
Change-Id: I3e89fd09e2c8de568bf5dffdad3a5d8a9ef39ff5
Reviewed-on: https://chromium-review.googlesource.com/c/1286676
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56744}
2018-10-17 16:02:12 +00:00
Jakob Gruber
708be823a1 [root] Refactor root offset accessors in TurboAssembler
Some confusion has crept in over time, specifically around
the distinction between an offset to an external reference's
address and an offset to its entry in the external reference
table. This CL unifies naming and interfaces.

Drive-by: Fix formatting in macro-assembler-x64.

Bug: v8:6666
Change-Id: Iade98ca28a7304aba0254b92b553343826a08e41
Reviewed-on: https://chromium-review.googlesource.com/c/1286674
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56741}
2018-10-17 14:30:17 +00:00
Jakob Gruber
90cb014493 [ia32,root] Make remainining builtins isolate-independent
Drive-by: Fix ExternalReferenceAddressAsOperand. Now it correctly
returns an operand to within the external reference table.

Bug: v8:6666
Change-Id: I8226257f27a2747584d37fd948d66c6e9b0d7ecf
Reviewed-on: https://chromium-review.googlesource.com/c/1286671
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56739}
2018-10-17 14:23:49 +00:00
Jakob Gruber
1849b47ce1 [ia32,root] Make more builtins isolate-independent
This bundles a bunch of miscellaneous things to make more builtins
isolate-independent (e.g.: using tasm::Move instead of asm::mov
methods).

Drive-by: The isolate-independence whitelist was changed to a blacklist.

Bug: v8:6666
Change-Id: I7e0fbe8bb2ca3dc751ad070f1a92aebb88b43125
Reviewed-on: https://chromium-review.googlesource.com/c/1286331
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56728}
2018-10-17 12:24:44 +00:00
Jakob Gruber
d25088e9ba Reland "[ia32,root] Add indirect calls and jumps through virtual register"
This is a reland of 650703557a

Original change's description:
> [ia32,root] Add indirect calls and jumps through virtual register
>
> This adds a temporary mechanism for isolate-independent calls and
> jumps.  The problem was that - as ia32 doesn't have a scratch register
> - Call and Jump cannot call through a register. This CL adds a
> so-called virtual register (= a pointer-sized field) on IsolateData.
>
> The virtual register can be removed once pc-relative calls are
> implemented and all builtins have been embedded.
>
> Bug: v8:6666
> Change-Id: I1f9d8a25643fad0b3919dd813dbe219d20fcc6bc
> Reviewed-on: https://chromium-review.googlesource.com/c/1282991
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56693}

TBR=sigurds@chromium.org

Bug: v8:6666
Change-Id: If463e68036673c7873d0d5e1a8a01ef31263cbfa
Reviewed-on: https://chromium-review.googlesource.com/c/1283052
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56700}
2018-10-16 14:05:12 +00:00
Sigurd Schneider
f64edae08f [assembler] Add scratch register to cvtui2sd SSE instruction
Change-Id: I861babb77f224626f6cdb88a7be08db75f5cf327
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1283089
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56698}
2018-10-16 13:53:30 +00:00
Sigurd Schneider
3299127220 [ia32,root] Make API entry code isolate independent
Change-Id: I7691c12acc1b2d0be3e35cf699bb16df4ca84b6e
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1280435
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56695}
2018-10-16 13:28:13 +00:00
Jakob Gruber
08403cc763 Revert "[ia32,root] Add indirect calls and jumps through virtual register"
This reverts commit 650703557a.

Reason for revert: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20noi18n%20-%20debug/23308

Original change's description:
> [ia32,root] Add indirect calls and jumps through virtual register
> 
> This adds a temporary mechanism for isolate-independent calls and
> jumps.  The problem was that - as ia32 doesn't have a scratch register
> - Call and Jump cannot call through a register. This CL adds a
> so-called virtual register (= a pointer-sized field) on IsolateData.
> 
> The virtual register can be removed once pc-relative calls are
> implemented and all builtins have been embedded.
> 
> Bug: v8:6666
> Change-Id: I1f9d8a25643fad0b3919dd813dbe219d20fcc6bc
> Reviewed-on: https://chromium-review.googlesource.com/c/1282991
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Igor Sheludko <ishell@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#56693}

TBR=sigurds@chromium.org,jgruber@chromium.org,ishell@chromium.org

Change-Id: I782651140eee3e75d57ad57d614a981e420fdfeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1283051
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56694}
2018-10-16 12:49:03 +00:00
Jakob Gruber
650703557a [ia32,root] Add indirect calls and jumps through virtual register
This adds a temporary mechanism for isolate-independent calls and
jumps.  The problem was that - as ia32 doesn't have a scratch register
- Call and Jump cannot call through a register. This CL adds a
so-called virtual register (= a pointer-sized field) on IsolateData.

The virtual register can be removed once pc-relative calls are
implemented and all builtins have been embedded.

Bug: v8:6666
Change-Id: I1f9d8a25643fad0b3919dd813dbe219d20fcc6bc
Reviewed-on: https://chromium-review.googlesource.com/c/1282991
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56693}
2018-10-16 12:19:21 +00:00
Sigurd Schneider
f56195fc2b [ia32] Extend availability of root array in JSEntryStub
Change-Id: Ibc8a086c5761c732b454fbb6cc1e06abb9f5e90f
Bug: v8:7777
Reviewed-on: https://chromium-review.googlesource.com/c/1283032
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56690}
2018-10-16 11:20:41 +00:00
Sigurd Schneider
0112748741 [ia32,root] Make JSEntryStub (almost) isolate independent
Bug: v8:6666, v8:7777
Change-Id: I842e61731a6df22f9bcdaa92cb6841af5c8ef796
Reviewed-on: https://chromium-review.googlesource.com/c/1280228
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56684}
2018-10-16 10:48:07 +00:00
Sigurd Schneider
66afdda69d [ia32,root] Make stack comparisons ready for root support
Change-Id: I673c4bddca876dd506be4979bbf2208e6f0af329
Bug: v8:6666
Also-By: jgruber@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/1280326
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56675}
2018-10-16 09:23:16 +00:00
Jakob Gruber
1df203a2c7 [ia32,root] Extend support for root-relative accesses
This adds root-relative access in a couple of spots (e.g.: LoadRoot,
CompareRoot, PushRoot, Push, Move, etc.). Some methods now dispatch
based on whether the given Immediate is an embedded object.

ShouldGenerateIsolateIndependentCode() was added as a porting crutch:
it forces isolate-independent code for builtins even though the
builtin is not in the Builtins::IsIsolateIndependent() whitelist. This
allows us to easily figure out which builtins can be white-listed with
--print-embedded-builtin-candidates.

Newly isolate-independent builtins are now whitelisted.

Drive-by: Remove dead CompareRoot and JumpIfRoot helpers.

Bug: v8:6666
Change-Id: I6b5f6f71b90ac22e7e15482af0617b0ca1c319da
Reviewed-on: https://chromium-review.googlesource.com/c/1280665
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56673}
2018-10-16 08:59:30 +00:00
Sigurd Schneider
f30960afc1 [ia32,root] Fix counter loads to use ExternalOperand
Change-Id: I5804585565acfabc110b019c5fcecdcabbaf022e
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1276428
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56636}
2018-10-15 13:21:28 +00:00
Sigurd Schneider
d205a6a76c [ia32,root] Add ExternalOperand and some uncontroversial usages
This is the first CL in a series that removes the StaticVariable operand.

Change-Id: I2acdbf4a7481af43321b8af10dbe38f8f481bea8
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1276365
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56635}
2018-10-15 13:17:28 +00:00
Jakob Gruber
cddf5bbdc1 [ia32,root] Initialize kRootRegister and verify through IsolateData
With this CL we finally actually set the root register to the correct
value.  Verification is still preserved by keeping a magic number in
IsolateData.

Bug: v8:6666
Change-Id: I89cb7cb36f977ac677ec33a814a2798baab4cec4
Reviewed-on: https://chromium-review.googlesource.com/c/1278277
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56627}
2018-10-15 10:19:00 +00:00
Jakob Gruber
7a43aa532e [ia32,root] Remove porting helper function
TBR=sigurds@chromium.org

Bug: v8:6666
Change-Id: I85dbc33a4baf5fb3775a6f557fc146437e17ab80
Reviewed-on: https://chromium-review.googlesource.com/c/1276430
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56585}
2018-10-12 06:10:58 +00:00
Benedikt Meurer
a63987a41a [async] Introduce dedicated JSAsyncFunctionObject.
This JSAsyncFunctionObject represents the implicit generator object
inside of async functions, and also holds the outer promise for the
async functions. This in turn allows us to get rid of the .promise
in the Parser / BytecodeGenerator completely, and will make it
possible to build zero-cost async stack traces independent of the
concrete synchronous part of the stack frame (which currently breaks
in Node.js).

In the bytecode all the async function operations now take this new
JSAsyncFunctionObject instead of passing both the .generator_object
and the .promise, which further simplifies and shrinks the bytecode.
It also reduces the size of async function frames, potentially making
the suspend/resume cheaper.

This also changes `await` to use intrinsics instead of calling to
special JSFunctions on the native context, and thus reduces the size of
the native contexts.

Drive-by-fix: Introduce a dedicated JSCreateAsyncFunctionObject operator
to TurboFan.

Bug: v8:7253, v8:7522
Change-Id: I2305302285156aa1f71328ecac70377abdd92c80
Ref: nodejs/node#11865
Design-Document: http://bit.ly/v8-zero-cost-async-stack-traces
Reviewed-on: https://chromium-review.googlesource.com/c/1273049
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56554}
2018-10-11 09:22:58 +00:00
Igor Sheludko
54855b67d4 [ptr-compr] Move Heap::root() to Isolate
... and Heap::root_handle() to RootsTable.

This is a preliminary step before moving IsolateData object from Heap to Isolate
which is required for pointer-compression friendly heap layout.

Bug: v8:8182
Change-Id: Ideacc1c9e4435be7a33db08415ac1ad46e956199
Reviewed-on: https://chromium-review.googlesource.com/c/1273238
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56552}
2018-10-11 08:59:50 +00:00
Sigurd Schneider
9d53e539f0 [ia32, root] Enable root register verification
Bug: v8:6666
Change-Id: I702ca633de56a5e1228f281de89e8bf7c12002a4
Reviewed-on: https://chromium-review.googlesource.com/c/1273077
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56517}
2018-10-10 10:36:36 +00:00
Ben L. Titzer
4cbec82cbe [wasm] Use a name for the lazy compile func index
Pure refactoring CL. Introduce a symbolic name for the register
used to hold the function index when calling the lazy compile stub.
This makes it easier to see this contract when looking at the
macro assembler.

R=ahaas@chromium.org
CC=clemensh@chromium.org

Change-Id: I714f978883ced001a1435338dcefd96744bfb2ae
Reviewed-on: https://chromium-review.googlesource.com/c/1273099
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56516}
2018-10-10 10:35:31 +00:00
Sigurd Schneider
ed93fc67d3 [ia32,root] Enable compilation with the PreserveRoot register config
Change-Id: I2499c3ada16bdf51f7830847753b856aa8aaff46
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1270836
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56515}
2018-10-10 10:34:10 +00:00
Sigurd Schneider
1c13f23374 [ia32] Remove StaticArray operand constructor
Change-Id: Ie6606869acbeadea747c4e664c78cfbffe942321
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1273135
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56512}
2018-10-10 10:04:19 +00:00
Igor Sheludko
33ebe358a5 [cleanup] Split the mutable roots list into immovable and movable
... and remove Heap::RootCanBeWrittenAfterInitialization() and
Heap::RootCanBeTreatedAsConstant() in favour of RootsTable::IsImmortalImmovable().

Bug: v8:8238
Change-Id: I804d06136de9584b8c4940fd8ab9d18fb3ef7980
Reviewed-on: https://chromium-review.googlesource.com/c/1270837
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56500}
2018-10-10 00:05:11 +00:00
Sigurd Schneider
4192bd4c82 [assembler] Add dcheck to mov[sz]x_b to ensure source is byte register
Drive-by: Fix bug where 8x16ExtractLane could extract garbage value.

Change-Id: I7eaa758c0c649e4e79e64039d1db6e19092d1293
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1271056
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56493}
2018-10-09 15:30:44 +00:00
Sigurd Schneider
de2f9f8024 [ia32,root] Remove ebx from Wasm linkage
Change-Id: I41b5c8e2700ebef102ffd3e7bdc9140978d971b7
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1264281
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56471}
2018-10-09 10:20:29 +00:00
Sigurd Schneider
a298eb56a2 [ia32,root] Add more ebx access scopes
R=jarin@chromium.org

Change-Id: Ib4dd0135e7ade3bbe5dd89ae8d2915ca6707f015
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1264275
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56470}
2018-10-09 10:03:04 +00:00
Clemens Hammacher
e39cba6bab [assembler] Unify reloc info recording
This removes duplication in the platform-dependent assemblers by
introducing {AssemblerBase::ShouldRecordRelocInfo}.
On arm64, we also remove a bool and replace it by an early exit.

R=mstarzinger@chromium.org

Bug: v8:8238
Change-Id: I08c623a19167a358c3188dc9008f045120da82b1
Reviewed-on: https://chromium-review.googlesource.com/1251085
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56319}
2018-10-01 14:26:23 +00:00
Clemens Hammacher
1b6afe4bf0 [assembler] Remove dead no_reg definitions
We have the generic {no_reg} and {no_dreg}, other definitions are dead.
Currently even {no_dreg} is dead, but I am keeping this because I can
see future need for that.

R=mstarzinger@chromium.org

Bug: v8:8238
Change-Id: I0de597fead6b3def18fd5c530419d3c149f235a8
Reviewed-on: https://chromium-review.googlesource.com/1251123
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56288}
2018-09-28 11:47:39 +00:00
Sigurd Schneider
2a4f602aaa [ia32,root] Allow usage of ebx for register code only in 'neg'
Bug: v8:6666
Change-Id: I5af95a3e9dcffb4be26a8ffd2948784d2910d64a
Reviewed-on: https://chromium-review.googlesource.com/1242804
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56196}
2018-09-25 10:11:34 +00:00
Sigurd Schneider
3815ad6db2 [ia32,root] Refactor register renaming
This CL addresses comments left post-merge on
https://crrev.com/c/1238653
which improve readablity.

R=jarin@chromium.org

Bug: v8:6666, v8:8015
Change-Id: Idafd848dafdd97af525646d6321e0ca40ce856c5
Reviewed-on: https://chromium-review.googlesource.com/1242885
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56192}
2018-09-25 09:13:26 +00:00
Jakob Gruber
004a6bf2c5 [ia32,root] Port Deoptimizer::TableEntryGenerator
This swaps out ebx in favor of esi. The root pointer value itself is
pushed and restored from the stack through pushad/popad.

Bug: v8:6666
Change-Id: I2a685f6659a5fbe2f7d91e431c5addff85664b5b
Reviewed-on: https://chromium-review.googlesource.com/1238653
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56162}
2018-09-24 11:21:54 +00:00
Jakob Gruber
5e8581a77c [ia32,root] Allow read-only ebx access in VerifyRootRegister
TBR=sigurds@chromium.org

Bug: v8:6666
Change-Id: I6fffc2187f7d457bfefe34cc78ad304cfb0a34a7
Reviewed-on: https://chromium-review.googlesource.com/1237678
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56124}
2018-09-21 10:49:32 +00:00
Jakob Gruber
e693b02d03 [root,ia32] Port CallApiCallback,CallApiGetter,JSEntry,ProfileEntryHook
Bug: v8:6666
Change-Id: I3867339640de252884b7941abdacff0872eaff39
Reviewed-on: https://chromium-review.googlesource.com/1235916
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56120}
2018-09-21 09:55:34 +00:00
Igor Sheludko
2fde54330a [cleanup] Move enum Heap::RootListIndex to enum class RootIndex
and introduce RootsTable - a V8 heap roots storage.

So, the renaming part looks like this:
  Heap::RootListIndex -> RootIndex
  Heap::kBlahBlahRootIndex -> RootIndex::kBlahBlah

Bug: v8:8015, v8:8182
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I38e1f3e3f6813ef35e37b0bed35e9ae14a62134f
Reviewed-on: https://chromium-review.googlesource.com/1234613
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56067}
2018-09-20 11:16:05 +00:00
Jakob Gruber
23cf68ac2c [ia32,root] Port all CallFunction variants
As part of this, we also update all InvokeFunctionCode callers to pass
ecx as the expected-argc register.

Drive-by: Inline InvokeFunction overload into its single use.

Bug: v8:6666
Change-Id: I67590ecc3f4981d014642c9e18d3ed6db9831e54
Reviewed-on: https://chromium-review.googlesource.com/1233653
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56040}
2018-09-19 13:39:12 +00:00
Jakob Gruber
d2ca9b0b7d [ia32,root] Port all CEntry variants
Not much to do here. This CL bakes in incompatibility between
poisoning and embedded builtins, since we cannot unconditionally reset
the poison register (which we reused as kRootRegister) as we used to.

It also exposes a bug introduced in [0] where we set
Isolate::c_function to a garbage value.

[0] https://chromium-review.googlesource.com/1185011

Bug: v8:6666
Change-Id: Ia606f5d0e86c7ff68aa2af22acb89c2844519bf5
Reviewed-on: https://chromium-review.googlesource.com/1233255
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56038}
2018-09-19 13:37:05 +00:00
Jakob Gruber
41ea0372bd [ia32,root] DoubleToI, MathPow, InterruptCheck, StackCheck
This also adds checks that ebx contains the root pointer during indirect load.
And we work around a few spots where we create an ebx Register but do not
actually reference it (e.g. when emitting xmm3, which has the same code as
ebx).

Bug: v8:6666
Change-Id: I7ec9e644c2e9c59d6395a71c6c5f479fac711d8d
Reviewed-on: https://chromium-review.googlesource.com/1231093
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56037}
2018-09-19 13:35:28 +00:00
Maya Lekova
fef047a4a5 [turbofan] Implement constant folding of string concatenations
This CL implements the following design doc:
https://docs.google.com/document/d/1h5kdfemMQMpUd15PSKW1lqikJW5hsGwrmOvoqhGFRts/edit?ts=5b978756#heading=h.urs7r34mx9p

Bug: v8:7790
Change-Id: I5f758c6d906ea9275c30b28f339063c64a2dc8d8
Reviewed-on: https://chromium-review.googlesource.com/1221807
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56021}
2018-09-19 09:47:23 +00:00
Jakob Gruber
1ab3888fd2 [ia32] Remove invalid indirect call/jump code
Indirect calls need a scratch register to load the target address. On
ia32 there's no easily-available scratch register.

This removes invalid code and documents a potential solution. But
ideally, this will remain unreachable since all inter-builtin calls
will be pc-relative.

Bug: v8:6666
Change-Id: I19e0ac699ee4757e3d5ec130b3e34a67cd1f851c
Reviewed-on: https://chromium-review.googlesource.com/1230096
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55999}
2018-09-18 14:25:58 +00:00
Jakob Gruber
a9716807e9 [ia32] Add scopes and verification to assist in root register ports
In the near future all ia32 ASM builtins must be audited & possibly refactored
to ensure they do not address ebx (= kRootRegister).

This CL adds mechanisms to verify ebx usage. SupportsRootRegisterScope marks
regions that are root-register-ready (i.e. does not use ebx).
AllowExplicitEbxAccessScope marks regions that are explicitly allowed to use
ebx, e.g. because they spill and restore its value at all boundaries and do not
contain any root-relative accesses.

Consistency is verified by calling the new AssertIsAddressable function at
strategic spots in the Assembler.

All of this code is temporary and should be removed once ia32 fully supports
the kRootRegister.

Bug: v8:6666
Change-Id: I7c5514794db0da889bdae9e3c23bc0d54780879d
Reviewed-on: https://chromium-review.googlesource.com/1226805
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55992}
2018-09-18 12:27:54 +00:00
Igor Sheludko
e53b929e27 [cleanup] Support V8-agnostic mode in MacroAssembler
This allows to avoid passing around Isolate instance for no actual reason when
generating "codegen" functions.

Bug: v8:8015
Change-Id: Ic3a9bd5a8ecb5b559479e44c5e1309a78a1546e7
Reviewed-on: https://chromium-review.googlesource.com/1226133
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55926}
2018-09-15 03:09:44 +00:00
Clemens Hammacher
87238b71ba [assembler][ia32] Make all imm8 values unsigned
Most were using uint8_t already, but some were declared as int8_t. This
CL consistently makes 8-bit immediates unsigned values.

R=titzer@chromium.org

Change-Id: I8f829486fb5ab1bf597b0be1eabc9b811543c3e3
Reviewed-on: https://chromium-review.googlesource.com/1220147
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55820}
2018-09-12 09:39:17 +00:00
Clemens Hammacher
c887e40c9a [assembler][ia32] Don't clobber random registers
The fallback for {Pinsrd} and {Pextrd} for the non-avx and non-sse
variant clobbered the {xmm0} register. This CL fixes this by storing
the values on the stack and modifying them there instead.
The alternative would have been to pass in a scratch register. But this
path is not commonly used and we cannot express in the API whether the
scratch register is needed or not. So we would sometimes have to spill a
register to pass it as scratch register even though it is then unused.

R=titzer@chromium.org
CC=​mstarzinger@chromium.org

Bug: v8:6600
Change-Id: Ieae53b892cc55eed4fcfa3d0e7f82f3e1afe72be
Reviewed-on: https://chromium-review.googlesource.com/1219633
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55800}
2018-09-11 16:12:56 +00:00
Clemens Hammacher
b9d71d9339 [assembler][ia32] Replace UNREACHABLE by FATAL with message
This improves the error message if we accidentally call this method on
a CPU which does not support it.

R=mstarzinger@chromium.org

Bug: v8:6600
Change-Id: If67bf9e95ab0e71d832a833a70b6ba748b53296e
Reviewed-on: https://chromium-review.googlesource.com/1219631
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55796}
2018-09-11 14:28:35 +00:00
Clemens Hammacher
a2139261ca [cleanup] Remove empty and deprecated BASE_EMBEDDED macro
The macro has been deprecated since 2016, and it keeps confusing me, so
let's just remove it completely from the code base.

R=leszeks@chromium.org
TBR=mstarzinger@chromium.org, verwaest@chromium.org, jgruber@chromium.org

Bug: v8:8015
Change-Id: Ibe1122fd9d2624bc94873d9c51dc8499c54a04fd
Reviewed-on: https://chromium-review.googlesource.com/1209322
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55779}
2018-09-11 09:33:18 +00:00
Igor Sheludko
51224eab41 [ptr-compr] Explicitly pass v8::PageAllocator instance to helper functions.
... like AllocatePage[s](), FreePages() and SetPermissions().
This CL also changes base::PageAllocator to cache AllocatePageSize and CommitPageSize
values returned by the OS.
This is a necessary cleanup before introducing BoundedPageAllocator.

Bug: v8:8096
Change-Id: Ifb7cdd2caa6a1b029ce0fca6545c61df9d281be2
Reviewed-on: https://chromium-review.googlesource.com/1209343
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55690}
2018-09-06 14:45:58 +00:00
jgruber
5b992f5343 Ensure kRootRegister is unused in interface descriptors
Now that we've removed kRootRegister from all ia32 interface
descriptors, let's make sure it does not sneak back in.

Bug: v8:6666
Change-Id: Ie3528908a142c36f106b0053041ed974216533d4
Reviewed-on: https://chromium-review.googlesource.com/1202083
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55590}
2018-09-03 13:35:55 +00:00
jgruber
6276642357 Remove isolate parameter from RecordWrite builtin
The isolate can be efficiently loaded through other means: either as a
root-relative load (if embedded builtins are enabled), or as an embedded
external reference (i.e. the absolute pointer is included in the
instruction stream) otherwise.

The generated code should be at least as fast as previously. On x64
(with embedded builtins):

Before:
 // Register moves in prologue:
 0x7f47a6b4860a     a  488955e0       REX.W movq [rbp-0x20],rdx
 // And the load from a stack slot at each use-site.
 0x7f47a6b486f2    f2  488b7de0       REX.W movq rdi,[rbp-0x20]

After:
 // Each use-site just loads a root-relative offset.
 0x7f1645fcc6ce    ee  498dbd38ffffff REX.W leaq rdi,[r13-0xc8]

On ia32 (no embedded builtins), before:
 0x5c608930    10  8955f0         mov [ebp-0x10],edx
 0x5c6089fb    db  891424         mov [esp],edx

After:
 0x41d0898d    8d  b80033b156     mov eax,0x56b13300

Removal reduces register pressure, and frees up ebx as the root register
on ia32.

Note that the set of allocatable registers was only reduced on ia32 to
exclude the root register.

Bug: v8:6666
Change-Id: I14e401e2823c82042c76acae10c3c935b9982993
Reviewed-on: https://chromium-review.googlesource.com/1201586
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55587}
2018-09-03 12:12:01 +00:00
jgruber
158216e948 [ia32] Pass InterpreterPushArgsThenConstruct args on the stack
In preparation for kRootRegister support on ia32.

Instead of pushing the register args first thing within the builtin to
free up needed scratch registers, we just pass the last 3 arguments on
the stack.

Drive-by: Update documentation of helper function.

Bug: v8:6666
Change-Id: I4a194d6885ac9cdfb9f5e66d687522442fae39ba
Reviewed-on: https://chromium-review.googlesource.com/1199025
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55585}
2018-09-03 12:06:37 +00:00
jgruber
85cd0d87bb Refactor InterpreterPushArgsThenConstruct
This reorders arguments in preparation for removing ebx from its
calling convention (in a follow-up some args will be passed on the
stack).

Drive-by: Improve readability in the code handling different cases
(array,spread,...).

Bug: v8:6666
Change-Id: I0160f8efafd0fd0e841739578e01c32b38adb66e
Reviewed-on: https://chromium-review.googlesource.com/1196884
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55557}
2018-08-31 15:30:43 +00:00
jgruber
fdb3130207 [ia32] Unalias kRootRegister in ApiCallback,InterpreterPushArgsThenCall
In preparation for kRootRegister support on ia32.

For both descriptors we simply shuffle registers around to remove ebx
from the calling convention.

Possible follow-up work: The ApiCallbackDescriptor could be simplified
by passing call_data (and the Undefined constant) on the stack. This
currently happens in the builtin body.

Drive-by: Minor refactoring in InterpreterPushArgsMode to deobfuscate
the different paths (spread/no-spread). Also use
{Push,Pop}ReturnAddress helpers.

Bug: v8:6666
Change-Id: I25fd738501fff71c038a0745cec04363f90df660
Reviewed-on: https://chromium-review.googlesource.com/1196552
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55554}
2018-08-31 14:59:51 +00:00
Sigurd Schneider
30f9d52960 [ia32] Make InterpreterEntryTrampoline preserve kRootRegister (ebx)
Also takes care of InterpreterEnterBytecodeAdvance.

Drive-by:
 - Add DCHECK to ensure cmpb is only used with byte registers.
 - Add Push/PopRootRegister to TurboAssembler with DCHECK ensuring
   that there is a NoRootArrayScope


Change-Id: Ibcf1c91b12767bdf6425b18872c41b31124de3ba
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/1190305
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55512}
2018-08-30 08:07:34 +00:00
jgruber
d13e9c692e [ia32] Unalias kRootRegister in IC, Construct and ArgumentsAdaptor descriptors
This replaces ebx usage in several more interface descriptors.

- IC descriptors already passed most arguments on the stack (updated
  their Register accessors to reflect that).
- The allocation site argument appears to be unused in the
  ConstructStub descriptor. It can probably be removed in a follow-up.

Drive-by: Rename ArgumentAdaptorDescriptor to
ArgumentsAdaptorDescriptor to match the builtin name.

Bug: v8:6666
Change-Id: I4cdf1775a5b4b74491d6d303c49a8af9b6cd3c03
Reviewed-on: https://chromium-review.googlesource.com/1195367
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55495}
2018-08-29 14:35:12 +00:00
jgruber
c85128fdb4 [ia32] Unalias kRootRegister in LoadWithVector and LoadGlobalWithVector
In preparation for kRootRegister support on ia32.

LoadWithVector now passes the vector on the stack.
LoadGlobalWithVector is able to reuse edx (used as ReceiverRegister in
LoadWithVector).

Drive-by: Aliasing DCHECKs and updated unused Register accessors.

Bug: v8:6666
Change-Id: If0e93d22c3c11f764bc0805c3e6a51654cdcc5f9
Reviewed-on: https://chromium-review.googlesource.com/1193891
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55490}
2018-08-29 13:40:24 +00:00
jgruber
97a0f14317 [ia32] Unalias kRootRegister in misc. descriptors
In preparation for kRootRegister support on ia32.

Updated: GrowArrayElements, Typeof, ConstructWithArrayLike.

Bug: v8:6666
Change-Id: I05c3f752948ecc714c0ef16a2c540b26d89628ce
Reviewed-on: https://chromium-review.googlesource.com/1195462
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55489}
2018-08-29 13:31:36 +00:00
Sigurd Schneider
452d8a3a82 [ia32] Change descriptor of frame dropper trampoline
This changes the interface descriptor for the frame dropper trampoline
to not use the kRootRegister (ebx) anymore.

Change-Id: I15df6af57f70d8aeea6c97298b437ad96af19cd4
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/1193242
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55484}
2018-08-29 10:41:43 +00:00
jgruber
573ed1efd5 [ia32] Unalias kRootRegister in several Call/Construct descriptors
In preparation for kRootRegister support on ia32.

Updated: CallWithSpread, CallWithArrayLike, ConstructWithSpread.

Bug: v8:6666
Change-Id: I41c166aebee99356efa5c175739b2124d5557d58
Reviewed-on: https://chromium-review.googlesource.com/1188563
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55461}
2018-08-28 14:00:20 +00:00
jgruber
988d703f23 [ia32] Unalias kRootRegister in Call/ConstructVarargs
These two builtins are a special case in that their calling convention
must be kept in-sync since they are both generated from
Generate_CallOrConstructVarargs.

ConstructVarargs in particular used all available registers. In order
to free ebx, the calling convention is changed to pass the last
argument on the stack.

As part of this change, the order of the last two arguments is swapped
since the stack parameter must be tagged.

Bug: v8:6666
Change-Id: If1ad14fc09693c36dd63ffebb6f34fcd3f012896
Reviewed-on: https://chromium-review.googlesource.com/1193444
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55458}
2018-08-28 13:04:24 +00:00
jgruber
a839bd42bd [ia32] Unalias kRootRegister and kJavaScriptCallExtraArg1Register
In preparation for kRootRegister support on ia32.

Bug: v8:6666
Change-Id: I6bbc87734d189bb8cde5d057a54f8155606d142d
Reviewed-on: https://chromium-review.googlesource.com/1188319
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55406}
2018-08-24 13:16:52 +00:00
jgruber
9d341c4c18 [ia32] Fix off-heap trampoline handling
This fixes several issues related to off-heap trampoline handling on
ia32.

Unlike other architectures, ia32 uses a pc-relative call/jump for the
off-heap trampoline. That means we cannot skip reloc info emission,
and we need to relocate when the buffer grows during code generation.

Finally, inlined trampolines must not clobber and thus also need to
use a pc-relative call/jump.

Drive-by: Use PreserveRootIA32 config only for whitelisted builtins to
build successfully by default.

Bug: v8:6666
Change-Id: I2b72147c6c70036cd13d8b22e2c80ade786c47b8
Reviewed-on: https://chromium-review.googlesource.com/1188316
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55397}
2018-08-24 12:07:53 +00:00
Bill Budge
d67d91dbe6 [memory] Replace Memory class with templated Memory functions.
Change-Id: I0870a13fd257e014a3b6dca8ee7ccb3aa5485066
Reviewed-on: https://chromium-review.googlesource.com/1183525
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55359}
2018-08-23 15:20:21 +00:00
Sigurd Schneider
f5bc82f72b [ia32] Add root register checks at StackCheck
This change writes a magic number into the root register,
and checks that we have the number still in at StackChecks.

Change-Id: Ib00d2a7ede651997ae9459cf4bdcc6be3952353b
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/1186402
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55353}
2018-08-23 13:00:52 +00:00
Michael Starzinger
1be73abae2 [cleanup] Remove dead {CommuteCondition} helper.
R=sigurds@chromium.org

Change-Id: Ib024d099946d4351bfce9de8eb61be1dba5e1ce5
Reviewed-on: https://chromium-review.googlesource.com/1186415
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55351}
2018-08-23 12:27:23 +00:00
jgruber
cf8f23082e [ia32] Remove kRootRegister from default interface descriptors
This is another step towards a kRootRegister on ia32 and removes
kRootRegister from generic interface descriptors.

Drive-by: Better error message for type mismatches in machine graph
verification.
Drive-by: Use PreserveRootIA32 register config for all builtins.

Bug: v8:6666
Change-Id: I920d4d6f3085da9734f6aa3bd3ee020abbc289fc
Reviewed-on: https://chromium-review.googlesource.com/1186330
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55338}
2018-08-23 10:04:42 +00:00
jgruber
51a76d8ce9 [masm,ia32] Add initial indirect load implementations
A first baby-step towards embedded builtins on ia32. This adds the
initial implementation for indirect load functionality (they still
depend on embedded external references to get the roots pointer).

External reference operands still directly embed external references.
We can change these sites to be root-relative once the root register
exists.

Drive-by: replace raw jmp(HeapObject), call(HeapObject),
mov(HeapObject) uses by their macro-assembler counterparts and add
sanity-checks to ensure we're not calling them by accident when
generating isolate-independent code.

Bug: v8:6666
Change-Id: Ide11273721bcdaaee06934eedeca9f39346d1d50
Reviewed-on: https://chromium-review.googlesource.com/1170687
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55332}
2018-08-23 08:48:23 +00:00
jgruber
c17053c2c3 [ia32] Change CEntry calling convention to free kRootRegister
And other related cleanups (additional asserts, use named register
constants instead of the raw register name where appropriate).

Drive-by: Unset kOffHeapTrampolineRegister (it's unused on ia32).

Bug: v8:6666
Change-Id: Id2b94e0b9dbfa5d3bbacc80ec7424d38c4145658
Reviewed-on: https://chromium-review.googlesource.com/1185011
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55328}
2018-08-23 08:08:23 +00:00
jgruber
258ec2c5f1 [builtins] Unify CEntry interface descriptors
This adds a kRuntimeCallArgvRegister definition in platform-specific
macro assemblers and unifies interface descriptor initialization.

Bug: v8:6666
Change-Id: I6fd98bf9ac46083dd2e557ab558d0a5117dd7b94
Reviewed-on: https://chromium-review.googlesource.com/1185003
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55310}
2018-08-22 15:10:24 +00:00
jgruber
e5e30b3463 [wasm] Ensure all wasm runtime stubs are PIC
Some builtins, so-called wasm runtime stubs, are copied off-heap to
ensure reachability through near jumps. These builtins must be
individually position-independent. In particular, they may not contain
pc-relative calls to other builtins.

Drive-by: Set hard_abort mode for all wasm runtime stubs to avoid Abort
calls.

Bug: v8:6666
Change-Id: Ie5bc9fc539d6a043dcf7dff66c3b4643baec69ab
Reviewed-on: https://chromium-review.googlesource.com/1183236
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55296}
2018-08-22 10:03:16 +00:00
jgruber
6ab1908775 [builtins] Mark initial builtins on ia32 isolate-independent
This populates the isolate-independent builtin whitelist with initial
builtins that do not access any isolate-dependent data and thus don't
need the root register at all.

Unlike most other platforms, we can't use a scratch register in the
off-heap trampoline since there's no free register available. The
trampolines on ia32 are thus implemented as pc-relative jumps
(thankfully we can address the entire address space).

Drive-by: Made Code::IsIsolateIndependent consistent with
FinalizeEmbeddedCodeTargets. Code targets are only allowed on some
platforms.

Bug: v8:6666
Change-Id: I0bf02eecba8a099afa7b7c892188cd377cbda840
Reviewed-on: https://chromium-review.googlesource.com/1183224
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55265}
2018-08-21 11:52:24 +00:00
jgruber
72937ea4a8 Register alloc config for kRootRegister on ia32
This CL prepares the way for adding a root register on ia32. The new
register allocation configuration PreserveRootIA32 treats
kRootRegister as an unallocatable register.

Note that kRootRegister (on ia32) is still completely unused,
unallocated, and may be clobbered at many points. This is left to
future work.

Bug: v8:6666
Change-Id: I4aacdf9c3bb365d6ed49fea8f013f79b7b1f0a98
Reviewed-on: https://chromium-review.googlesource.com/1181023
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55224}
2018-08-20 14:51:34 +00:00
Ulan Degenbaev
9554b5fce3 [heap, iwyu] Refactor write-barrier for code.
This moves write-barrier for writes into code to heap-write-barrier.h
and adds four new functions:
- WriteBarrierForCode(host, rinfo, object) - combined generational
  and marking write barrier.
- WriteBarrierForCode(host) - combined write barrier that rescans
  all pointers in the host (former RecordWritesIntoCode).
- GenerationalWriteBarrierForCode.
- MarkingWriteBarrierForCode.

Bug: v8:8054,v8:7490
Change-Id: Ib1e07cfa1d5998fca2fa44e2ad08c52305f1373f
Reviewed-on: https://chromium-review.googlesource.com/1174436
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55185}
2018-08-17 09:21:23 +00:00
Benedikt Meurer
5fecd146bf [turbofan] Further optimize DataView accesses.
This adds support for unaligned load/store access to the DataView
backing store and uses byteswap operations to fix up the endianess
when necessary. This changes the Word32ReverseBytes operator to be
a required operator and adds the missing support on the Intel and
ARM platforms (on 64-bit platforms the Word64ReverseBytes operator
is also mandatory now).

This further improves the performance on the dataviewperf.js test
mentioned in the tracking bug by up to 40%, and at the same time
reduces the code complexity in the EffectControlLinearizer.

Bug: chromium:225811
Change-Id: I7c1ec826faf46a144a5a9068f8f815a5fd040997
Reviewed-on: https://chromium-review.googlesource.com/1174252
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55111}
2018-08-14 09:20:47 +00:00
Leszek Swirski
6a62d88e9b Revert "[turbofan] Further optimize DataView accesses."
This reverts commit c46915b931.

Reason for revert: Disasm failures https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20debug/21727 

Original change's description:
> [turbofan] Further optimize DataView accesses.
> 
> This adds support for unaligned load/store access to the DataView
> backing store and uses byteswap operations to fix up the endianess
> when necessary. This changes the Word32ReverseBytes operator to be
> a required operator and adds the missing support on the Intel and
> ARM platforms (on 64-bit platforms the Word64ReverseBytes operator
> is also mandatory now).
> 
> This further improves the performance on the dataviewperf.js test
> mentioned in the tracking bug by up to 40%, and at the same time
> reduces the code complexity in the EffectControlLinearizer.
> 
> Bug: chromium:225811
> Change-Id: I296170b828c2ccc1c317ed37840b564aa14cdec2
> Reviewed-on: https://chromium-review.googlesource.com/1172777
> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55099}

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

Change-Id: If7a62e3a1a4ad26823fcbd2ab6eb4c053ad11c49
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:225811
Reviewed-on: https://chromium-review.googlesource.com/1174171
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55107}
2018-08-14 08:25:24 +00:00
Benedikt Meurer
c46915b931 [turbofan] Further optimize DataView accesses.
This adds support for unaligned load/store access to the DataView
backing store and uses byteswap operations to fix up the endianess
when necessary. This changes the Word32ReverseBytes operator to be
a required operator and adds the missing support on the Intel and
ARM platforms (on 64-bit platforms the Word64ReverseBytes operator
is also mandatory now).

This further improves the performance on the dataviewperf.js test
mentioned in the tracking bug by up to 40%, and at the same time
reduces the code complexity in the EffectControlLinearizer.

Bug: chromium:225811
Change-Id: I296170b828c2ccc1c317ed37840b564aa14cdec2
Reviewed-on: https://chromium-review.googlesource.com/1172777
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55099}
2018-08-13 19:23:28 +00:00
Deepti Gandluri
145dd87b90 Add I64Atomic Load/Store ops for ia32
Bug: v8:6532
Change-Id: I6391c3d5e86d2b04735e241a1e0549a170ab4852
Reviewed-on: https://chromium-review.googlesource.com/1164640
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55027}
2018-08-09 19:47:30 +00:00
jgruber
9c5f1abcf5 [builtins] Pad embedded builtins with int3
This fills the padding between builtins in the embedded blob with a
sequence of int3 instructions (ia32,x64).

Drive-by: Unify code zapping. We can add better support for other
architectures later.

Bug: v8:6666
Change-Id: Ibcb120ec18a8062d7527e0c6fe5ca86869c0dad8
Reviewed-on: https://chromium-review.googlesource.com/1167050
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54976}
2018-08-08 13:07:17 +00:00
Michael Starzinger
da3c2db949 [cleanup] Unify {AreAliased} predicates.
R=sigurds@chromium.org

Change-Id: I1ca0e215da36400a8817bc8c8912ccfde8eca613
Reviewed-on: https://chromium-review.googlesource.com/1166911
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54973}
2018-08-08 12:06:21 +00:00
Michael Starzinger
13cb050402 [wasm] Fix JumpTableAssembler corrupting surrounding code.
We instantiate the JumpTableAssembler in patching mode (i.e. directly on
existing code without an intermittent buffer). In this mode it is not
possible to record reloc information. This makes sure we no longer just
blindly write into the non-existing buffer.

R=clemensh@chromium.org
BUG=v8:8028

Change-Id: I4abb8f06cf819fef608e901c4740263f0cecd08a
Reviewed-on: https://chromium-review.googlesource.com/1166834
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54966}
2018-08-08 10:34:59 +00:00