[Linux] Clear WasmMemory with madvice instead of memset
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 13:11:00 +0000 (13:11 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 13:11:00 +0000 (13:11 +0000)
commit8aafc2018f2f7db992c63d3674989cf08f6f6d13
tree34a9d076ebcb87ee4de77fd63d224b16e40df810
parent58c66a562d84de47f491b4ed7fa73c9ac8c17e4c
[Linux] Clear WasmMemory with madvice instead of memset
https://bugs.webkit.org/show_bug.cgi?id=175150

Reviewed by Filip Pizlo.

In Linux, zeroing pages with memset populates backing store.
Instead, we should use madvise with MADV_DONTNEED. It discards
pages. And if you access these pages, on-demand-zero-pages will
be shown.

We also commit grown pages in all OSes.

* wasm/WasmMemory.cpp:
(JSC::Wasm::commitZeroPages):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::grow):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@220401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmMemory.cpp