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

Issue 1913153003: Subzero. Wasm. Implement sbrk and correctly do bounds checks. (Closed)

Created:
4 years, 8 months ago by Eric Holk
Modified:
4 years, 8 months ago
Reviewers:
Jim Stichnoth, Karl, sehr, John
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Subzero. Wasm. Implement sbrk and correctly do bounds checks. Cleans up and generally improves memory handling in WASM. WasmTranslator now outputs the number of pages requested so the runtime can do correct bounds checks. The runtime also initializes the stack pointer correctly (stored at address 1024), so we no longer have to deal with negative pointers. This allows bounds checks to be done with a single comparison against the size of the heap. Because of this, we now support non-power-of-two heap sizes. Sbrk is implemented by having the runtime keep track of the current heap break and incrementing it as necessary. The heap break is initialized to the start of the first page beyond any initialized data in the WASM heap. These changes allow us to pass the complete set of torture tests that are passing on the Wasm waterfall. BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4369 R=kschimpf@google.com, stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=4aae81af8a41f824ab80c58fd84113817431fcc6

Patch Set 1 #

Patch Set 2 : Cleanup #

Total comments: 28

Patch Set 3 : Code review feedback #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -40 lines) Patch
M fetch-torture-tests.sh View 1 chunk +2 lines, -2 lines 0 comments Download
M pydir/wasm-run-torture-tests.py View 1 2 1 chunk +2 lines, -19 lines 0 comments Download
M runtime/wasm-runtime.cpp View 1 2 6 chunks +46 lines, -10 lines 0 comments Download
M src/WasmTranslator.cpp View 1 2 7 chunks +58 lines, -9 lines 4 comments Download

Messages

Total messages: 10 (2 generated)
Eric Holk
4 years, 8 months ago (2016-04-22 18:37:27 UTC) #2
Karl
Otherwise, LGTM. https://codereview.chromium.org/1913153003/diff/20001/src/WasmTranslator.cpp File src/WasmTranslator.cpp (right): https://codereview.chromium.org/1913153003/diff/20001/src/WasmTranslator.cpp#newcode1315 src/WasmTranslator.cpp:1315: CfgNode *getAbortTarget() { Does this need an ...
4 years, 8 months ago (2016-04-22 19:18:14 UTC) #3
Jim Stichnoth
Awesome! https://codereview.chromium.org/1913153003/diff/20001/pydir/wasm-run-torture-tests.py File pydir/wasm-run-torture-tests.py (right): https://codereview.chromium.org/1913153003/diff/20001/pydir/wasm-run-torture-tests.py#newcode24 pydir/wasm-run-torture-tests.py:24: # waterfall known failures There are a number ...
4 years, 8 months ago (2016-04-22 20:48:54 UTC) #4
Eric Holk
https://codereview.chromium.org/1913153003/diff/20001/src/WasmTranslator.cpp File src/WasmTranslator.cpp (right): https://codereview.chromium.org/1913153003/diff/20001/src/WasmTranslator.cpp#newcode1315 src/WasmTranslator.cpp:1315: CfgNode *getAbortTarget() { On 2016/04/22 19:18:14, Karl wrote: > ...
4 years, 8 months ago (2016-04-22 21:02:10 UTC) #5
Eric Holk
https://codereview.chromium.org/1913153003/diff/20001/pydir/wasm-run-torture-tests.py File pydir/wasm-run-torture-tests.py (right): https://codereview.chromium.org/1913153003/diff/20001/pydir/wasm-run-torture-tests.py#newcode24 pydir/wasm-run-torture-tests.py:24: # waterfall known failures On 2016/04/22 20:48:53, stichnot wrote: ...
4 years, 8 months ago (2016-04-22 22:32:48 UTC) #6
Jim Stichnoth
lgtm https://codereview.chromium.org/1913153003/diff/20001/src/WasmTranslator.cpp File src/WasmTranslator.cpp (right): https://codereview.chromium.org/1913153003/diff/20001/src/WasmTranslator.cpp#newcode1317 src/WasmTranslator.cpp:1317: AbortTarget = Func->makeNode(); On 2016/04/22 22:32:48, Eric Holk ...
4 years, 8 months ago (2016-04-23 16:23:05 UTC) #7
Eric Holk
Committed patchset #3 (id:40001) manually as 4aae81af8a41f824ab80c58fd84113817431fcc6 (presubmit successful).
4 years, 8 months ago (2016-04-25 19:52:53 UTC) #9
Eric Holk
4 years, 8 months ago (2016-04-25 19:53:04 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/1913153003/diff/40001/src/WasmTranslator.cpp
File src/WasmTranslator.cpp (right):

https://codereview.chromium.org/1913153003/diff/40001/src/WasmTranslator.cpp#...
src/WasmTranslator.cpp:1153: return Ctx->getConstantZero(IceType_i32);
On 2016/04/23 16:23:04, stichnot wrote:
> Maybe use getPointerType() instead of IceType_i32, to be a bit more
> future-proof?

Done.

https://codereview.chromium.org/1913153003/diff/40001/src/WasmTranslator.cpp#...
src/WasmTranslator.cpp:1173: // terrible (see https://goto.google.com/aqydy). 
Try adding a new
On 2016/04/23 16:23:04, stichnot wrote:
> Use a link that is externally viewable...

I thought goto was, but just to be safe, I switched it to a goo.gl link.

Powered by Google App Engine
This is Rietveld 408576698