Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Issue 2396433008: [wasm] Add guard regions to end of WebAssembly.Memory buffers (Closed)

Created:
4 years, 2 months ago by Eric Holk
Modified:
4 years, 1 month ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Add guard regions to end of WebAssembly.Memory buffers With this change, WebAssembly.Memory objects have backing stores allocated as an 8GB region where everything beyond the size of the Wasm heap is inaccessible. GrowMemory is now implemented by changing the protection on the guard regions to make the new portions of the heap accessible. Guard pages are not enabled by default, but this change adds a flag and a test variant to make sure we get test coverage on them. BUG= https://bugs.chromium.org/p/v8/issues/detail?id=5277 Committed: https://crrev.com/eaed31c5f59abfb146c3ca82059ca1c41b1729b9 Cr-Commit-Position: refs/heads/master@{#41089}

Patch Set 1 #

Patch Set 2 : Support grow_memory with guard pages #

Patch Set 3 : Enable tests for --wasm_trap_handler, make them pass #

Patch Set 4 : Fixing 32-bit compile #

Patch Set 5 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Patch Set 6 : Fix windows build #

Patch Set 7 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Patch Set 8 : Fix windows 32-bit build #

Patch Set 9 : More robust 32-bit build #

Patch Set 10 : Better handling of pre-existing array buffers. #

Patch Set 11 : Cleanup and trying to fix gcmole #

Patch Set 12 : Attempt to convert previously existing array buffers into guarded ones #

Patch Set 13 : Make test cases pass, and other stuff too. #

Patch Set 14 : Cleanup #

Total comments: 4

Patch Set 15 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Patch Set 16 : Code review feedback #

Total comments: 23

Patch Set 17 : Move 64-bit constant to all platforms. #

Patch Set 18 : Fix 32-bit builds #

Patch Set 19 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Patch Set 20 : Feedback #

Patch Set 21 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Total comments: 21

Patch Set 22 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Patch Set 23 : Addressing machenbach feedback #

Patch Set 24 : Changes based on titzer's comments. #

Patch Set 25 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Total comments: 5

Patch Set 26 : Pruning tests and fixing bugs #

Patch Set 27 : Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into guard-pages #

Patch Set 28 : Fixing Windows #

Patch Set 29 : Fixing Linux #

Patch Set 30 : Fixing Linux better #

Patch Set 31 : Merging with master #

Total comments: 4

Patch Set 32 : Minor fix #

Patch Set 33 : Merging with master #

Patch Set 34 : Merging with master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+330 lines, -109 lines) Patch
M src/base/platform/platform.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +8 lines, -0 lines 0 comments Download
M src/base/platform/platform-linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 15 chunks +36 lines, -74 lines 0 comments Download
M src/base/platform/platform-posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2 chunks +23 lines, -0 lines 0 comments Download
M src/base/platform/platform-win32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 chunks +7 lines, -0 lines 0 comments Download
M src/compiler/wasm-compiler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +1 line, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +5 lines, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +4 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +8 lines, -0 lines 0 comments Download
M src/wasm/wasm-js.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +2 lines, -3 lines 0 comments Download
M src/wasm/wasm-module.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +8 lines, -0 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 6 chunks +142 lines, -30 lines 0 comments Download
M test/cctest/cctest.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +25 lines, -0 lines 0 comments Download
M test/debugger/debugger.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +9 lines, -0 lines 0 comments Download
M test/inspector/inspector.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +10 lines, -0 lines 0 comments Download
M test/intl/intl.status View 1 2 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +18 lines, -0 lines 0 comments Download
M test/mozilla/mozilla.status View 1 2 3 4 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M test/test262/test262.status View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +3 lines, -0 lines 0 comments Download
M test/unittests/unittests.status View 1 2 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M test/webkit/webkit.status View 1 2 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M tools/run-tests.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +1 line, -0 lines 0 comments Download
M tools/testrunner/local/variants.py View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 93 (62 generated)
Eric Holk
4 years, 1 month ago (2016-10-26 18:12:43 UTC) #28
Michael Lippautz
JSArrayBuffer usage looks good to me. Deferring the actual review to the wasm folks. https://codereview.chromium.org/2396433008/diff/260001/src/base/platform/platform-posix.cc ...
4 years, 1 month ago (2016-10-27 14:41:50 UTC) #29
Eric Holk
https://codereview.chromium.org/2396433008/diff/260001/src/base/platform/platform-posix.cc File src/base/platform/platform-posix.cc (right): https://codereview.chromium.org/2396433008/diff/260001/src/base/platform/platform-posix.cc#newcode133 src/base/platform/platform-posix.cc:133: void OS::Unprotect(void* address, const size_t size) { On 2016/10/27 ...
4 years, 1 month ago (2016-10-28 16:20:14 UTC) #30
titzer
https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc#newcode235 src/wasm/wasm-js.cc:235: memory = i::WasmJs::GetWasmMemoryArrayBuffer(i_isolate, mem_obj); Can we split out the ...
4 years, 1 month ago (2016-10-28 16:24:57 UTC) #31
Eric Holk
https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc#newcode235 src/wasm/wasm-js.cc:235: memory = i::WasmJs::GetWasmMemoryArrayBuffer(i_isolate, mem_obj); On 2016/10/28 16:24:57, titzer wrote: ...
4 years, 1 month ago (2016-10-28 18:44:40 UTC) #38
Mircea Trofin
https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc#newcode231 src/wasm/wasm-js.cc:231: if (args.Length() > 2 && args[2]->IsObject()) { please separate ...
4 years, 1 month ago (2016-10-28 22:16:29 UTC) #40
Eric Holk
https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-js.cc#newcode231 src/wasm/wasm-js.cc:231: if (args.Length() > 2 && args[2]->IsObject()) { On 2016/10/28 ...
4 years, 1 month ago (2016-10-29 00:04:30 UTC) #41
Michael Lippautz
https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2396433008/diff/300001/src/wasm/wasm-module.cc#newcode2089 src/wasm/wasm-module.cc:2089: ->AdjustAmountOfExternalAllocatedMemory(pages * WasmModule::kPageSize); On 2016/10/29 00:04:30, Eric Holk wrote: ...
4 years, 1 month ago (2016-10-29 07:39:19 UTC) #42
Michael Achenbach
Regarding testing: You also need to add the variant here so that it's actually run ...
4 years, 1 month ago (2016-11-04 17:52:54 UTC) #44
titzer
https://codereview.chromium.org/2396433008/diff/400001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2396433008/diff/400001/src/compiler/wasm-compiler.cc#newcode2963 src/compiler/wasm-compiler.cc:2963: DCHECK(FLAG_wasm_guard_pages); I think it's better to have FLAG_wasm_trap_handler imply ...
4 years, 1 month ago (2016-11-07 19:54:53 UTC) #45
Michael Achenbach
https://codereview.chromium.org/2396433008/diff/400001/test/mjsunit/mjsunit.status File test/mjsunit/mjsunit.status (right): https://codereview.chromium.org/2396433008/diff/400001/test/mjsunit/mjsunit.status#newcode722 test/mjsunit/mjsunit.status:722: On 2016/11/04 17:52:54, machenbach (slow) wrote: > What about ...
4 years, 1 month ago (2016-11-08 07:51:08 UTC) #46
Eric Holk
https://codereview.chromium.org/2396433008/diff/400001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2396433008/diff/400001/src/compiler/wasm-compiler.cc#newcode2963 src/compiler/wasm-compiler.cc:2963: DCHECK(FLAG_wasm_guard_pages); On 2016/11/07 19:54:52, titzer wrote: > I think ...
4 years, 1 month ago (2016-11-08 23:58:15 UTC) #47
Michael Achenbach
https://codereview.chromium.org/2396433008/diff/400001/test/mjsunit/mjsunit.status File test/mjsunit/mjsunit.status (right): https://codereview.chromium.org/2396433008/diff/400001/test/mjsunit/mjsunit.status#newcode722 test/mjsunit/mjsunit.status:722: On 2016/11/08 23:58:15, Eric Holk wrote: > On 2016/11/08 ...
4 years, 1 month ago (2016-11-09 08:05:32 UTC) #48
titzer
lgtm on the wasm side https://codereview.chromium.org/2396433008/diff/480001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2396433008/diff/480001/src/compiler/wasm-compiler.cc#newcode2973 src/compiler/wasm-compiler.cc:2973: DCHECK(FLAG_wasm_guard_pages); Generally want to ...
4 years, 1 month ago (2016-11-09 19:23:47 UTC) #49
Eric Holk
@machenbach: I pruned out a lot of the cctests. On my z840, it cut the ...
4 years, 1 month ago (2016-11-09 20:02:59 UTC) #50
Michael Achenbach
On 2016/11/09 20:02:59, Eric Holk wrote: > @machenbach: I pruned out a lot of the ...
4 years, 1 month ago (2016-11-10 07:35:47 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2396433008/500001
4 years, 1 month ago (2016-11-10 17:01:05 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: v8_android_arm_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/builds/27723) v8_linux64_asan_rel_ng on master.tryserver.v8 (JOB_FAILED, ...
4 years, 1 month ago (2016-11-10 17:02:42 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2396433008/520001
4 years, 1 month ago (2016-11-10 18:54:08 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: v8_win64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win64_rel_ng/builds/17547) v8_win64_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, ...
4 years, 1 month ago (2016-11-10 19:34:44 UTC) #61
Eric Holk
Jochen - it'd probably be good to have your input on the changes in base/platform ...
4 years, 1 month ago (2016-11-11 05:45:58 UTC) #75
jochen (gone - plz use gerrit)
can you please reformat your CL description to use < 80c per line. also, the ...
4 years, 1 month ago (2016-11-12 21:05:45 UTC) #76
jochen (gone - plz use gerrit)
+machenbach for test question https://codereview.chromium.org/2396433008/diff/600001/tools/run-tests.py File tools/run-tests.py (right): https://codereview.chromium.org/2396433008/diff/600001/tools/run-tests.py#newcode114 tools/run-tests.py:114: "wasm_traps", is there no better ...
4 years, 1 month ago (2016-11-12 21:07:21 UTC) #77
Michael Achenbach
https://codereview.chromium.org/2396433008/diff/600001/tools/run-tests.py File tools/run-tests.py (right): https://codereview.chromium.org/2396433008/diff/600001/tools/run-tests.py#newcode114 tools/run-tests.py:114: "wasm_traps", On 2016/11/12 21:07:20, jochen (travelling til Nov 18) ...
4 years, 1 month ago (2016-11-14 07:41:50 UTC) #78
Eric Holk
https://codereview.chromium.org/2396433008/diff/600001/src/base/platform/platform-posix.cc File src/base/platform/platform-posix.cc (right): https://codereview.chromium.org/2396433008/diff/600001/src/base/platform/platform-posix.cc#newcode106 src/base/platform/platform-posix.cc:106: if (allocated != requested) { On 2016/11/12 21:05:45, jochen ...
4 years, 1 month ago (2016-11-14 19:05:56 UTC) #80
jochen (gone - plz use gerrit)
lgtm
4 years, 1 month ago (2016-11-17 02:00:34 UTC) #81
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2396433008/640001
4 years, 1 month ago (2016-11-17 17:55:51 UTC) #84
commit-bot: I haz the power
Try jobs failed on following builders: v8_android_arm_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/builds/28135) v8_linux64_asan_rel_ng on master.tryserver.v8 (JOB_FAILED, ...
4 years, 1 month ago (2016-11-17 17:57:21 UTC) #86
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2396433008/660001
4 years, 1 month ago (2016-11-17 18:15:42 UTC) #89
commit-bot: I haz the power
Committed patchset #34 (id:660001)
4 years, 1 month ago (2016-11-17 18:48:22 UTC) #91
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 22:38:56 UTC) #93
Message was sent while issue was closed.
Patchset 34 (id:??) landed as
https://crrev.com/eaed31c5f59abfb146c3ca82059ca1c41b1729b9
Cr-Commit-Position: refs/heads/master@{#41089}

Powered by Google App Engine
This is Rietveld 408576698