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

Issue 2438603003: [wasm] Track in the interpreter if a NaN could have been produced. (Closed)

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

Description

[wasm] Track in the interpreter if a NaN could have been produced. The wasm specification does not fully specify the binary representation of NaN: the sign bit can be non-deterministic. The wasm-code fuzzer found a test case where the wasm interpreter and the compiled code produce a different sign bit for a NaN, and as a consequence they produce different results. With this CL the interpreter tracks whether it executed an instruction which can produce a NaN, which are div and sqrt instructions. The fuzzer uses this information and compares the result of the interpreter with the result of the compiled code only if there was no instruction which could have produced a NaN. R=titzer@chromium.org TEST=cctest/test-run-wasm-interpreter/TestMayProduceNaN BUG=chromium:657481 Committed: https://crrev.com/57b14b0606e43d0ab023caf0514d0a252f72cae1 Cr-Commit-Position: refs/heads/master@{#40474}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Comments addressed. #

Total comments: 2

Patch Set 3 : Fixed nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -13 lines) Patch
M src/wasm/wasm-interpreter.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/wasm/wasm-interpreter.cc View 1 12 chunks +45 lines, -8 lines 0 comments Download
M test/cctest/wasm/test-run-wasm-interpreter.cc View 1 1 chunk +66 lines, -0 lines 0 comments Download
M test/cctest/wasm/wasm-run-utils.h View 1 4 chunks +5 lines, -1 line 0 comments Download
M test/common/wasm/wasm-module-runner.h View 1 chunk +1 line, -1 line 0 comments Download
M test/common/wasm/wasm-module-runner.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M test/fuzzer/wasm-code.cc View 1 2 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (9 generated)
ahaas
4 years, 2 months ago (2016-10-20 10:49:23 UTC) #1
titzer
General approach looks good, see comments https://chromiumcodereview.appspot.com/2438603003/diff/1/src/wasm/wasm-interpreter.cc File src/wasm/wasm-interpreter.cc (right): https://chromiumcodereview.appspot.com/2438603003/diff/1/src/wasm/wasm-interpreter.cc#newcode1616 src/wasm/wasm-interpreter.cc:1616: may_produced_nan_ |= true; ...
4 years, 2 months ago (2016-10-20 10:53:24 UTC) #4
ahaas
https://chromiumcodereview.appspot.com/2438603003/diff/1/src/wasm/wasm-interpreter.cc File src/wasm/wasm-interpreter.cc (right): https://chromiumcodereview.appspot.com/2438603003/diff/1/src/wasm/wasm-interpreter.cc#newcode1616 src/wasm/wasm-interpreter.cc:1616: may_produced_nan_ |= true; \ On 2016/10/20 at 10:53:24, titzer ...
4 years, 2 months ago (2016-10-20 13:43:23 UTC) #9
titzer
lgtm with nit https://chromiumcodereview.appspot.com/2438603003/diff/20001/test/common/wasm/wasm-module-runner.cc File test/common/wasm/wasm-module-runner.cc (right): https://chromiumcodereview.appspot.com/2438603003/diff/20001/test/common/wasm/wasm-module-runner.cc#newcode117 test/common/wasm/wasm-module-runner.cc:117: WasmVal* args, bool* may_produced_nan) { name ...
4 years, 2 months ago (2016-10-20 13:45:48 UTC) #10
ahaas
https://codereview.chromium.org/2438603003/diff/20001/test/common/wasm/wasm-module-runner.cc File test/common/wasm/wasm-module-runner.cc (right): https://codereview.chromium.org/2438603003/diff/20001/test/common/wasm/wasm-module-runner.cc#newcode117 test/common/wasm/wasm-module-runner.cc:117: WasmVal* args, bool* may_produced_nan) { On 2016/10/20 at 13:45:48, ...
4 years, 2 months ago (2016-10-20 13:48:35 UTC) #11
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/2438603003/40001
4 years, 2 months ago (2016-10-20 13:48:51 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-10-20 14:27:30 UTC) #15
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 22:08:22 UTC) #17
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/57b14b0606e43d0ab023caf0514d0a252f72cae1
Cr-Commit-Position: refs/heads/master@{#40474}

Powered by Google App Engine
This is Rietveld 408576698