|
|
Description[wasm] Add stack checks at the beginning of each function.
TEST=mjsunit/wasm/stack.js:testStackOverflow
R=titzer@chromium.org
Committed: https://crrev.com/bb187a106edf9d1d5fb23b567bb457b260289ff6
Cr-Commit-Position: refs/heads/master@{#38742}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Do not trap but use the runtime stack guard call #
Total comments: 6
Patch Set 3 : Comments. #Patch Set 4 : Rebase. #
Total comments: 2
Patch Set 5 : Update comment. #Patch Set 6 : Rebase #Patch Set 7 : Use the BuildCallToRuntime function. #
Total comments: 2
Patch Set 8 : Use the right control input. #
Messages
Total messages: 49 (36 generated)
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/buil...) v8_linux64_avx2_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng_trig...)
https://codereview.chromium.org/2256603002/diff/1/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/1/src/compiler/wasm-compiler.... src/compiler/wasm-compiler.cc:387: trap_->AddTrapIfFalse(wasm::kTrapStackOverflow, check, position); We'll need to use the regular JS machinery here and not a WASM trap, since V8/Blink may "request an interrupt" by changing the stack limit, which is not a stack overflow.
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2256603002/diff/1/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/1/src/compiler/wasm-compiler.... src/compiler/wasm-compiler.cc:387: trap_->AddTrapIfFalse(wasm::kTrapStackOverflow, check, position); On 2016/08/17 at 08:23:28, titzer wrote: > We'll need to use the regular JS machinery here and not a WASM trap, since V8/Blink may "request an interrupt" by changing the stack limit, which is not a stack overflow. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... src/compiler/wasm-compiler.cc:390: Node* branch = graph()->NewNode( Can use a Diamond here? https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... File src/compiler/wasm-compiler.h (right): https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... src/compiler/wasm-compiler.h:140: void InitStackCheck(wasm::WasmCodePosition position); Why not simply StackCheck? https://codereview.chromium.org/2256603002/diff/20001/src/wasm/ast-decoder.cc File src/wasm/ast-decoder.cc (right): https://codereview.chromium.org/2256603002/diff/20001/src/wasm/ast-decoder.cc... src/wasm/ast-decoder.cc:562: if (builder_) { Will the BUILD() macro work here?
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... src/compiler/wasm-compiler.cc:390: Node* branch = graph()->NewNode( On 2016/08/17 at 11:17:23, titzer wrote: > Can use a Diamond here? Done. https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... File src/compiler/wasm-compiler.h (right): https://codereview.chromium.org/2256603002/diff/20001/src/compiler/wasm-compi... src/compiler/wasm-compiler.h:140: void InitStackCheck(wasm::WasmCodePosition position); On 2016/08/17 at 11:17:23, titzer wrote: > Why not simply StackCheck? Done. https://codereview.chromium.org/2256603002/diff/20001/src/wasm/ast-decoder.cc File src/wasm/ast-decoder.cc (right): https://codereview.chromium.org/2256603002/diff/20001/src/wasm/ast-decoder.cc... src/wasm/ast-decoder.cc:562: if (builder_) { On 2016/08/17 at 11:17:23, titzer wrote: > Will the BUILD() macro work here? Actually not, because InitStackCheck does not return a Node*.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm with nit https://codereview.chromium.org/2256603002/diff/10008/src/compiler/wasm-compi... File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/10008/src/compiler/wasm-compi... src/compiler/wasm-compiler.cc:410: // Generate a call to the runtime if there is a stack overflow. s/stack overflow/stack check failure/ Since, as mentioned in previous comment, the runtime uses stack checks to interrupt running programs.
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
PTAL, I changed the {StackCheck} function to use the {BuildCallToRuntime} function instead of duplicating that code. https://codereview.chromium.org/2256603002/diff/10008/src/compiler/wasm-compi... File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/10008/src/compiler/wasm-compi... src/compiler/wasm-compiler.cc:410: // Generate a call to the runtime if there is a stack overflow. On 2016/08/18 at 10:55:09, titzer wrote: > s/stack overflow/stack check failure/ > > Since, as mentioned in previous comment, the runtime uses stack checks to interrupt running programs. Done.
mstarzinger@chromium.org changed reviewers: + mstarzinger@chromium.org
https://codereview.chromium.org/2256603002/diff/110001/src/compiler/wasm-comp... File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/110001/src/compiler/wasm-comp... src/compiler/wasm-compiler.cc:413: effect_, control_); This should be s/control_/diamond.if_false/ here, otherwise it is pure luck that the runtime call is scheduled inside the else branch. Unconditionally calling the runtime would be a valid schedule too.
Description was changed from ========== [wasm] Add stack checks at the beginning of each function. TEST=mjsunit/wasm/stack.js:testStackOverflow R=titzer@chromium.org ========== to ========== [wasm] Add stack checks at the beginning of each function. TEST=mjsunit/wasm/stack.js:testStackOverflow R=titzer@chromium.org ==========
mstarzinger@chromium.org changed reviewers: - mstarzinger@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ahaas@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2256603002/diff/110001/src/compiler/wasm-comp... File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2256603002/diff/110001/src/compiler/wasm-comp... src/compiler/wasm-compiler.cc:413: effect_, control_); On 2016/08/18 at 17:22:48, Michael Starzinger wrote: > This should be s/control_/diamond.if_false/ here, otherwise it is pure luck that the runtime call is scheduled inside the else branch. Unconditionally calling the runtime would be a valid schedule too. Thanks for noticing this. I fixed it now.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2016/08/19 07:13:42, ahaas wrote: > https://codereview.chromium.org/2256603002/diff/110001/src/compiler/wasm-comp... > File src/compiler/wasm-compiler.cc (right): > > https://codereview.chromium.org/2256603002/diff/110001/src/compiler/wasm-comp... > src/compiler/wasm-compiler.cc:413: effect_, control_); > On 2016/08/18 at 17:22:48, Michael Starzinger wrote: > > This should be s/control_/diamond.if_false/ here, otherwise it is pure luck > that the runtime call is scheduled inside the else branch. Unconditionally > calling the runtime would be a valid schedule too. > > Thanks for noticing this. I fixed it now. lgtm
The CQ bit was checked by ahaas@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== [wasm] Add stack checks at the beginning of each function. TEST=mjsunit/wasm/stack.js:testStackOverflow R=titzer@chromium.org ========== to ========== [wasm] Add stack checks at the beginning of each function. TEST=mjsunit/wasm/stack.js:testStackOverflow R=titzer@chromium.org ==========
Message was sent while issue was closed.
Committed patchset #8 (id:130001)
Message was sent while issue was closed.
Description was changed from ========== [wasm] Add stack checks at the beginning of each function. TEST=mjsunit/wasm/stack.js:testStackOverflow R=titzer@chromium.org ========== to ========== [wasm] Add stack checks at the beginning of each function. TEST=mjsunit/wasm/stack.js:testStackOverflow R=titzer@chromium.org Committed: https://crrev.com/bb187a106edf9d1d5fb23b567bb457b260289ff6 Cr-Commit-Position: refs/heads/master@{#38742} ==========
Message was sent while issue was closed.
Patchset 8 (id:??) landed as https://crrev.com/bb187a106edf9d1d5fb23b567bb457b260289ff6 Cr-Commit-Position: refs/heads/master@{#38742} |