Commit Graph

47763 Commits

Author SHA1 Message Date
Hannes Payer
8251c14664 [heap] Cleanup: Use std::atomic<T> instead of base::AtomicNumber<T> in sweeper.
Bug: chromium:842083
Change-Id: Ided2d8542e4501250208dde6146f00da77410f48
Reviewed-on: https://chromium-review.googlesource.com/1054234
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53121}
2018-05-11 11:29:35 +00:00
Hannes Payer
ff5bb7e5ce [heap] Cleanup: Use std::atomic<T> instead of base::AtomicNumber<T> in concurrent marker.
Bug: chromium:842083
Change-Id: I4ce2b58aa7fcafe7e886a3c80d3ddf7bfe3e4415
Reviewed-on: https://chromium-review.googlesource.com/1055389
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53120}
2018-05-11 09:38:05 +00:00
Hannes Payer
ace192211b Revert "[heap] Clear the memory of pooled pages when allocating from the pool."
This reverts commit c280e7d4f4.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [heap] Clear the memory of pooled pages when allocating from the pool.
>
> Bug: chromium:999634
> Change-Id: Ia7a0dd6ddc2477a7656a26548e9a247470d9143f
> Reviewed-on: https://chromium-review.googlesource.com/1041688
> Commit-Queue: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52948}

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

Change-Id: I838d5fe1e6c6ac8b726a90a44b2eacbea9057866
Reviewed-on: https://chromium-review.googlesource.com/1054070
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53119}
2018-05-11 08:57:36 +00:00
Kanghua Yu
4233436350 [turbofan][x64] Reduce compare-zero followed by flags-setting binop
On IA architecture, arithmetic and shifting operations set the flags
according to the computation result.

    subl rsi,0x1
    REX.W movq rbx,[rbx+0x17]
    cmpl rsi, 0                       <-- TO BE REDUCED
    jnz 0x3f54d2dcef0
==>
    REX.W movq rbx,[rbx+0x17]
    subl rsi,0x1
    jnz 0x3f54d2dcef0
&
    orl rdx,rbx
    cmpl rdx,0x0                      <-- TO BE REDUCED
    jnz 0x3f54d22b0f5
==>
    orl rdx,rbx
    jnz 0x3f54d22b0f5

Change-Id: If69c023712212ad7b9fa8b29f4b98274f7885e35
Reviewed-on: https://chromium-review.googlesource.com/1051445
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kanghua Yu <kanghua.yu@intel.com>
Cr-Commit-Position: refs/heads/master@{#53118}
2018-05-11 02:42:54 +00:00
Ivica Bogosavljevic
a83277498c [wasm] Force proper code alignment in wasm serializer
Test mjsunit/wasm/compiled-module-serialization fails on those
architectures that do not support missaligned memory access.
We fix this by adding padding between code header and code start
in NativeModule serializer/deserializer so the code start is
properly aligned.

TEST=mjsunit/wasm/compiled-module-serializationx

Change-Id: I4f35b78a1190194088795b6f09becc3ad4251fdb
Reviewed-on: https://chromium-review.googlesource.com/1044186
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53117}
2018-05-10 15:02:55 +00:00
Dan Elphick
0b4b14bc48 [elements] Avoid NOP operation when shrinking HashTables
Avoid writing NumberOfElements to HashTable when it hasn't changed as
the HashTable could be in RO_SPACE and this operation will crash.

Bug: v8:841592
Change-Id: Iffadd567fc10aa9cd13d953da81275464b16c6c0
Reviewed-on: https://chromium-review.googlesource.com/1052693
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53116}
2018-05-10 11:09:59 +00:00
Alexey Kozyatinskiy
aab49f372f [inspector] do not allocate scope inside CallStackDepth
Allocation is super slow and produce big performance regression on
blink side.

Bug: chromium:839567,chromium:839809
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I3e9989435515ecfaedaee60c1f0c6939b9053e95
Reviewed-on: https://chromium-review.googlesource.com/1053105
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53115}
2018-05-09 22:31:39 +00:00
Vincent Belliard
65f8a5c790 [arm64][Liftoff] implement calls
Remove cp from cache register list

Bug: v8:6600
Change-Id: If17d4558e4f89dd620c757e2a8288658f1489435
Reviewed-on: https://chromium-review.googlesource.com/1047645
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Vincent Belliard <vincent.belliard@arm.com>
Cr-Commit-Position: refs/heads/master@{#53114}
2018-05-09 22:03:39 +00:00
Alexei Filippov
1426ea1d6d [cpu-profiler] Lazily create CPU profiler.
We cannot drop the deprecated API right away because we need to keep binary compatiblity.
As a short term solution create CPU profiler lazily if the API is called.

BUG=v8:7070

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I04029844895976b25db165f4fba6afbfe1681913
Reviewed-on: https://chromium-review.googlesource.com/1047848
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53113}
2018-05-09 19:13:29 +00:00
Andreas Haas
0263383d69 [wasm] Move the CompilationManager into the WasmEngine
The CompilationManager was introduced to manage the memory of
AsyncCompileJobs. However, by now this can be done better by the new
WasmEngine.

This CL just moves the code to wasm-engine.[h,cc] and adjusts the
callsites.

R=titzer@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Icd2c1f19feeaa854c74e020b41e314b8ad00cea5
Reviewed-on: https://chromium-review.googlesource.com/1052109
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53112}
2018-05-09 16:41:35 +00:00
Clemens Hammacher
aae0732c72 Reland "Fix SourcePositionInfo for wasm"
This is a reland of e084eea628.
Undefined behavious was fixed in https://crrev.com/c/1051235.

Original change's description:
> Fix SourcePositionInfo for wasm
>
> In wasm we often don't have a SharedFunctionInfo associated with a
> compilation job, so we can't get a Script. Just print "unknown" in
> these cases (instead of crashing).
>
> R=titzer@chromium.org
> CC=​herhut@chromium.org
>
> Bug: chromium:840757, v8:7738
> Change-Id: I850c6adfd9e07c9a0f6dd018f1a9314feb89d887
> Reviewed-on: https://chromium-review.googlesource.com/1049632
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53080}

TBR=titzer@chromium.org

Bug: chromium:840757, v8:7738
Change-Id: If04040a33766955cfed78e7c27226dd04c3f9b9f
Reviewed-on: https://chromium-review.googlesource.com/1051266
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53111}
2018-05-09 16:39:55 +00:00
Igor Sheludko
ddd840884b [csa] Introduce TrySmi[Add/Sub](TNode<Smi>, TNode<Smi>, Label* if_overflow) helpers.
Bug: v8:7570
Change-Id: I2101a3fed996385b076352d20a2ca4d65c31a828
Reviewed-on: https://chromium-review.googlesource.com/1044374
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53110}
2018-05-09 16:19:15 +00:00
Clemens Hammacher
ae8405080d [x64] Add disassembler support for 'pause'
The 'pause' instruction is used for implementing retpolines. It is
currently being printed as 'nop', which is incorrect.

R=titzer@chromium.org

Change-Id: I134b6dae332103fd7f9b3c4e5520f0d5db06ba74
Reviewed-on: https://chromium-review.googlesource.com/1051789
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53109}
2018-05-09 16:06:52 +00:00
Clemens Hammacher
7d356ac492 [Liftoff] Implement retpoline for indirect calls
As SSCA mitigation, use retpoline for each indirect call. We currently
only support retpolines on ia32 and x64.

R=titzer@chromium.org

Bug: v8:6600, chromium:798964
Change-Id: I32472c15e149977b00bf923f4d87e259b7b54800
Reviewed-on: https://chromium-review.googlesource.com/1052113
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53108}
2018-05-09 16:05:46 +00:00
Clemens Hammacher
c8ae9729ec [lsan] Ignore code comments
Code comments are heap-allocated and never freed. We don't want to
attach them to the code object via a finalizer, since that could change
gc timing and heap layout when you enable code comments. They are used
to testing only anyway, so leaking is acceptable here.

R=bmeurer@chromium.org, jarin@chromium.org

Bug: v8:7738
Change-Id: I27b0f95db1d66b57f4f113c154f23edb84e6700d
Reviewed-on: https://chromium-review.googlesource.com/1051241
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53107}
2018-05-09 15:13:34 +00:00
Dominic Farolino
c9a728aaa0 [inspector] implement console.countReset()
Implement console.countReset() from the WHATWG Console Standard

R=bmeurer@chromium.org, dgozman@chromium.org, kozyatinskiy@chromium.org

Bug: chromium:839947
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I8a900e9cdf3e5b08506f709cf6497476c8c6c00b
Reviewed-on: https://chromium-review.googlesource.com/1044902
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#53106}
2018-05-09 14:59:04 +00:00
Andreas Haas
8f1c90d2ee [api] Add better documentation to Isolate::Allocate
R=ulan@chromium.org
CC=​jbroman@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I606a182774188b953247b62e5426ee7feadd1a74
Reviewed-on: https://chromium-review.googlesource.com/1047206
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53105}
2018-05-09 14:57:59 +00:00
Andreas Haas
d0a034a264 [libplatform] Deprecate EnsureEventLoopInitialized
R=ulan@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Iaa9968945ce8196de75b4c4a637bda9ee57c0509
Reviewed-on: https://chromium-review.googlesource.com/1047207
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53104}
2018-05-09 14:56:54 +00:00
Marja Hölttä
f3b7f8eed9 [in-place weak refs] Cleanup: Add types to CSA::LoadFeedbackVectorSlot callsites.
Bug: v8:7308

Change-Id: I967e036dc584f585dddda0eef480389a33e45bdf
Reviewed-on: https://chromium-review.googlesource.com/1046649
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53103}
2018-05-09 14:52:04 +00:00
Igor Sheludko
09d4ba01ee [builtins] Properly handle non-simple target in Object.assign.
Plus a bit of CSA typification.

Bug: v8:7725
Change-Id: I43fea4a4c0739f9c24d84035816b046e742372ee
Reviewed-on: https://chromium-review.googlesource.com/1051653
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53102}
2018-05-09 13:44:00 +00:00
Simon Zünd
18f2636ac7 [array] Add counter for sorting non-packed JSArrays.
This CL adds a counter for sorting non-packed JSArrays where
Object.prototype was modified, or the prototype of the instance
differs from Array.prototype.

This is the V8 side of the change.
The Chromium-side CL: https://crrev.com/c/1051651

R=jgruber@chromium.org

Bug: v8:7382
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I3ce9789a5df4bb9af5d1bfc89681fcd112e28e83
Reviewed-on: https://chromium-review.googlesource.com/1051650
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53101}
2018-05-09 13:35:10 +00:00
Clemens Hammacher
199533558e Fix undefined behaviour on CommentOperator
The {CommentOperator}, used for implementing the --code-comments flag,
is not UBSan-safe. This CL fixes this and adds a test which uses code
comments.

R=bmeurer@chromium.org

Bug: v8:7744
Change-Id: Ia6ec509e77d998df085ac7377cb24854354e3aa2
Reviewed-on: https://chromium-review.googlesource.com/1051235
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53100}
2018-05-09 13:31:21 +00:00
Marja Hölttä
d951495561 [in-place weak refs] Write the CSA::DispatchMaybeObject check differently.
The previous version was correct too, since we check sminess before. But with the
new check, it's easier to see it's correct.

BUG=v8:7308

Change-Id: I1632353ee5dfd305479858ec4a690b17bb70e6a6
Reviewed-on: https://chromium-review.googlesource.com/1039525
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53099}
2018-05-09 13:19:16 +00:00
Clemens Hammacher
9e94bb23b6 [wasm] Use correct type for {NativeModule::remaining_uncommitted_}
Instead of {base::AtomicNumber<intptr_t>} use {std::atomic<size_t>},
since we really want to store a size_t in there, and only abused
negative values before to avoid a compare-and-swap loop.

R=mstarzinger@chromium.org

Bug: v8:7570
Change-Id: Ibff0fe0550396f11b343f7e3c098ccf94f6e8dbb
Reviewed-on: https://chromium-review.googlesource.com/1049067
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53098}
2018-05-09 13:18:10 +00:00
Igor Sheludko
11aaf0fb84 [api] Move tagging scheme definition up in include/v8.h
... in order to be able to use it in other constants definitions in the header.

Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Id5d6ae34ab401ecf063bf5897b87b6bb87c24960
Reviewed-on: https://chromium-review.googlesource.com/1032782
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53097}
2018-05-09 13:17:07 +00:00
Dan Elphick
9d5aea8dc4 Reland "[heap] Move even more objects into RO_SPACE"
Moves all Oddballs, empty_feedback_metadata, lots of symbols and
immortal heap numbers and several other empty collection objects.

      RO_SPACE  NEW_SPACE  OLD_SPACE  CODE_SPACE  MAP_SPACE  LO_SPACE
old      31800          0     241976       24032        176         0
new      35080          0     238680       24032        176         0
diff     +3280                 -3296

Reland of https://chromium-review.googlesource.com/c/v8/v8/+/1025996,
without the empty_property_dictionary which is not read-only.

Bug: v8:7464
Change-Id: I84840d86eb3e5906ddb8b4c4e9e70bfec0cf78bc
Reviewed-on: https://chromium-review.googlesource.com/1049611
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53096}
2018-05-09 13:12:01 +00:00
Dan Elphick
6098ddeaff [snapshot] Ensure padding is always cleared in tests
Re-enables and fixes msan test failures due to string padding being
cleared only selectively in tests. This change instead makes sure it
always happens in TestIsolate.

Bug: v8:7746
Change-Id: I259b43ad25cb7af18bf16d29effb15772c981a67
Reviewed-on: https://chromium-review.googlesource.com/1051647
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53095}
2018-05-09 11:31:49 +00:00
Clemens Hammacher
d096508fe8 Skip failing msan tests
These tests started failing after https://crrev.com/c/1046657.

R=ahaas@chromium.org

Bug: v8:7748
No-Try: true
Change-Id: I67b44b144e5e62c5a88cbf6683e0678e6eab1dc6
Reviewed-on: https://chromium-review.googlesource.com/1051243
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53094}
2018-05-09 09:40:49 +00:00
Georg Neis
cff007f43a [torque] Map Torque's JSFunction to V8's JSFunction.
The 'generates' clause was missing (so I suppose it got mapped
to JSReceiver).

Change-Id: I146546921e552f17dbadf74082b31315bf868bf7
Reviewed-on: https://chromium-review.googlesource.com/1032434
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Reviewed-by: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53093}
2018-05-09 09:38:09 +00:00
Hannes Payer
15e40c3860 [heap] Remove unused CodeRange CommitRawMemory and UncommitRawMemory functions.
Change-Id: I14237a71c34872e114d7e2afb73a758e011fd731
Reviewed-on: https://chromium-review.googlesource.com/1051239
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53092}
2018-05-09 09:34:49 +00:00
Mike Stanton
5945e1ccd0 [Builtins] Torque version of Array.prototype.forEach()
BUG=v8:7672

Change-Id: I0c157ce88b31312dfbea7a149c1d9fbdfb398278
Reviewed-on: https://chromium-review.googlesource.com/1013524
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53091}
2018-05-09 08:58:39 +00:00
Hannes Payer
4a1ceff1aa Remove --use-allocation-folding relict from tests.
Change-Id: Ia4d4211dbc8f0714dd11983ac7bc899f51ba69c5
Reviewed-on: https://chromium-review.googlesource.com/1051237
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53090}
2018-05-09 08:50:59 +00:00
Clemens Hammacher
d5f29907f7 [msan] Treat more memory uninitialized
After closing a handle scope, and when allocating a new segment in a
zone, treat that memory as uninitialized in MSan. This will hopefully
catch more errors than handle zapping, which needs to be enabled
explicitly.

R=ahaas@chromium.org

Bug: v8:7570
Change-Id: Ie3be07434bed878fb607a522787514421f397197
Reviewed-on: https://chromium-review.googlesource.com/1046657
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53089}
2018-05-09 08:39:04 +00:00
Clemens Hammacher
b50ac57d12 [Liftoff][cleanup] Fix comment and use register constant
The comment in {CallRuntime} was misleading. The {rsi}/{esi} register
did not hold the instance, but the context instead. The generated code
was correct thought.

R=titzer@chromium.org

Change-Id: I18020a04ac75faedf7ad5e4b07cab27ae0aedae7
Reviewed-on: https://chromium-review.googlesource.com/1051232
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53088}
2018-05-09 08:37:59 +00:00
Dan Elphick
600641338d Reland "[heap] Mark RO_SPACE as read-only after deserialization"
This is a reland of 40f1aaf330

Put back padding clearing into the SerializeObject method but only when
the String is not in RO_SPACE. For RO_SPACE strings, if required
iterate over the space before serialization clearing the strings.

Original change's description:
> [heap] Mark RO_SPACE as read-only after deserialization
>
> Adds MarkAsReadOnly and MarkAsReadWrite to ReadOnlySpace. The latter
> is only usable with ReadOnlySpace::WritableScope to avoid the space
> being left writable). MarkAsReadOnly updates the high water mark and
> makes several previously mutating methods into no-ops.
>
> Moves some writes to immutable objects out of the bootstrapper to
> setup-heap-internal so they don't write to a read-only page.
>
> Also avoid writing hashes to strings that already have the value set as
> that invariably means writing to the "0" and "1" constant strings in
> RO_SPACE.
>
> Before serialization, it makes RO_SPACE writable again so that any
> padding can be cleared before writing it.
>
> Bug: v8:7464
> Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
> Change-Id: I22edc20dba7dde8943991a8fcaf87244af4490a3
> Reviewed-on: https://chromium-review.googlesource.com/1014128
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Reviewed-by: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52943}

Bug: v8:7464
Change-Id: Ia8386c4ff5f5df3207f584caf7a9b1ff1e405f25
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1042145
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53087}
2018-05-09 08:31:49 +00:00
Ben L. Titzer
e847124b01 [wasm] Refactor WasmGraphBuilder to use MachineGraph
This CL removes the JSGraph from WasmGraphBuilder and uses MachineGraph,
which is independent of the isolate, instead. In addition to using
the machine graph in the WasmGraphBuilder, this CL splits off a subclass
for compiling wrappers that does have a JSGraph and encapsulates it in
the .cc file. This makes the separation of WASM function graphs and WASM
wrapper graphs more explicit.

R=mstarzinger@chromium.org
CC=ahaas@chromium.org
BUG=v8:7721

Change-Id: I3c190baef2084919d22a9a89a8c9f11d2ddcf3d0
Reviewed-on: https://chromium-review.googlesource.com/1050266
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53086}
2018-05-09 08:05:06 +00:00
Peter Marshall
3e9f8a4f63 [cpu-profiler] Add a HandleScope to limit memory consumption.
The handles created for each SharedFunctionInfo within
SourcePosition::InliningStack live for the life of the profile,
reaching 5MiB+ on an example server application for Node.

This HandleScope limits their lifetime locally, given that the handles
do not escape.

This saves ~10% of peak memory.

Bug: v8:7719
Change-Id: I97ce0fd3658be89fdd9cb9c1369ea5bfae0ce579
Reviewed-on: https://chromium-review.googlesource.com/1049647
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53085}
2018-05-09 08:03:05 +00:00
Michael Starzinger
8c57a54b86 [wasm] Create module object in async compilation earlier.
This makes sure that the {WasmModuleObject} has been allocated before
any debug events are fired. Since {WasmScript} objects reference the
module object, it needs to be allocated earlier by now.

R=ahaas@chromium.org
TEST=debugger/regress/regress-crbug-840288
BUG=chromium:840288

Change-Id: I02783ce126c463ac953eb2192acb65f3a5d420a1
Reviewed-on: https://chromium-review.googlesource.com/1050246
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53084}
2018-05-09 07:54:56 +00:00
Jaroslav Sevcik
d520ebb9a8 [turbofan] Fix NumberFloor typing.
Bug: chromium:841117
Change-Id: I1e83dfc82f87d0b49d3cca96290ae1d738e37d20
Reviewed-on: https://chromium-review.googlesource.com/1051228
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53083}
2018-05-09 07:32:46 +00:00
Michael Achenbach
2b6fb352a6 Revert "Fix SourcePositionInfo for wasm"
This reverts commit e084eea628.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20UBSanVptr/builds/3163

Original change's description:
> Fix SourcePositionInfo for wasm
> 
> In wasm we often don't have a SharedFunctionInfo associated with a
> compilation job, so we can't get a Script. Just print "unknown" in
> these cases (instead of crashing).
> 
> R=​titzer@chromium.org
> CC=​​herhut@chromium.org
> 
> Bug: chromium:840757, v8:7738
> Change-Id: I850c6adfd9e07c9a0f6dd018f1a9314feb89d887
> Reviewed-on: https://chromium-review.googlesource.com/1049632
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Ben Titzer <titzer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53080}

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

Change-Id: Ib2020ea3f2b778df9fe50ccbe803938f2f4fd709
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:840757, v8:7738
Reviewed-on: https://chromium-review.googlesource.com/1051265
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53082}
2018-05-09 07:11:03 +00:00
Junliang Yan
7ff35bd542 PPC/s390: [builtins] Convert CEntry/GetProperty/StringAdd stubs to builtins
Port d8131cd63a

Original Commit Message:

    Stubs and builtins are very similar. The main differences are that
    stubs can be parameterized and may be generated at runtime, whereas
    builtins are generated at mksnapshot-time and shipped with the snapshot
    (or embedded into the binary).

    My main motivation for these conversions is that we can generate
    faster calls and jumps to (embedded) builtins callees from (embedded)
    builtin callers. Instead of going through the builtins constants table
    indirection, we can simply do a pc-relative call/jump.

    This also unlocks other refactorings, e.g. removal of
    CallRuntimeDelayed.

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

Change-Id: I193e4275470d492912a7d0f8523c3b8c29f1b146
Reviewed-on: https://chromium-review.googlesource.com/1050732
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#53081}
2018-05-08 21:56:35 +00:00
Clemens Hammacher
e084eea628 Fix SourcePositionInfo for wasm
In wasm we often don't have a SharedFunctionInfo associated with a
compilation job, so we can't get a Script. Just print "unknown" in
these cases (instead of crashing).

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

Bug: chromium:840757, v8:7738
Change-Id: I850c6adfd9e07c9a0f6dd018f1a9314feb89d887
Reviewed-on: https://chromium-review.googlesource.com/1049632
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53080}
2018-05-08 18:23:04 +00:00
Hannes Payer
8ddaafb143 Revert "[heap] Clear from space after garbage collection."
This reverts commit 494068c1c2.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=840282

Original change's description:
> [heap] Clear from space after garbage collection.
>
> Bug: chromium:829771
> Change-Id: I9e71e6cbba347dd6951e5415332e5178df9b5122
> Reviewed-on: https://chromium-review.googlesource.com/1041685
> Commit-Queue: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52957}

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

Bug: chromium:829771
Change-Id: I3c36baaf849a7d5dbf48db2ae2178e15b3b886f8
Reviewed-on: https://chromium-review.googlesource.com/1049888
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53079}
2018-05-08 18:04:44 +00:00
Eric Holk
4d4a3294b9 [test] Reverse sense of wasm_traps variant
D8 enables the Wasm trap handler by default now, but we need to make sure the
older bounds check case still gets test coverage too, as bounds checks will
continue to be a supported configuration.

Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I5b0bdded6929a9b3a8480e87d038398b8d2a0fd8
Reviewed-on: https://chromium-review.googlesource.com/1048835
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53078}
2018-05-08 17:49:14 +00:00
Dan Elphick
8751debc3f [cleanup] Remove unused parameters from heap/*
Removes lots of parameters that are never used (found using
-Wunused-parameter).

Also wires up the pretenure parameter for Factory::NewFrameArray so it's
actually used.

Change-Id: I486e22ac0683afb84bba6a286947674254f93832
Reviewed-on: https://chromium-review.googlesource.com/1041687
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53077}
2018-05-08 16:23:02 +00:00
Clemens Hammacher
35e3fda172 [Liftoff] Add masking for indirect calls
Next SSCA mitigation: Mask the function index on indirect calls. This
avoids speculative jumps to arbitrary memory.

R=titzer@chromium.org

Bug: v8:6600, chromium:798964
Change-Id: Id4a54fbb42096655d48965b63202bb58f98dc9aa
Reviewed-on: https://chromium-review.googlesource.com/1049627
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53076}
2018-05-08 15:47:39 +00:00
Leszek Swirski
b3f0cc098e [weakref] Fix another MaybeObject conversion in ObjectStats
Change-Id: I2afefab5bf43abee5e5dc66224cea1c68fb85179
Reviewed-on: https://chromium-review.googlesource.com/1049973
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53075}
2018-05-08 14:31:09 +00:00
Alexey Kozyatinskiy
4c5926d593 [debug] handle termination after break
If termination was requested on pause we should handle it properly as
soon as execution resumed.

R=yangguo@chromium.org

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ica50500094138097f115545db716264126fbe59e
Reviewed-on: https://chromium-review.googlesource.com/1049486
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53074}
2018-05-08 14:25:41 +00:00
Clemens Hammacher
8ae6bc6068 [asan] Move asan macros to asan.h
Similar to msan.h, asan should get its own header file such that the
functionality can be reused.

R=ahaas@chromium.org

Bug: v8:7570
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ib81e4ff4b1d08158df7730c32345d4facf9453b0
Reviewed-on: https://chromium-review.googlesource.com/1046656
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53073}
2018-05-08 14:14:34 +00:00
Andreas Haas
8aee014194 [wasm] Remove the wasm-stream-compilation flag
In addition to a git grep I ran the
virtual/enable_wasm_streaming/http/tests/wasm_streaming/wasm_response_apis.html
layout test locally to confirm that the flag is not used in Chrome.

R=titzer@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I00d013b85b585d26e50aacaeb82fb0b1ce1ff56c
Reviewed-on: https://chromium-review.googlesource.com/1049965
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53072}
2018-05-08 14:13:29 +00:00