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

Issue 1838973002: optimized switch implementation (Closed)

Created:
4 years, 8 months ago by aseemgarg
Modified:
4 years, 8 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] optimized switch implementation in asm.js to wasm builder This change implements switch as a balanced if/else tree or break table or hybrid. A lot of asm.js modules are expected to extensively use switch alongside function tables that can benefit from a better implementation. BUG=v8:4203 TEST=mjsunit/asm-wasm R=titzer@chromium.org,bradnelson@chromium.org,ahaas@chromium.org LOG=N Committed: https://crrev.com/1d37d4216b23bd54822ada4e92457291ad70829b Cr-Commit-Position: refs/heads/master@{#35455}

Patch Set 1 #

Patch Set 2 : unskip embenchen tests #

Total comments: 8

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Patch Set 6 : #

Total comments: 2

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Total comments: 10

Patch Set 10 : #

Patch Set 11 : #

Total comments: 7

Patch Set 12 : #

Total comments: 6

Patch Set 13 : #

Patch Set 14 : #

Total comments: 4

Patch Set 15 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+740 lines, -108 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M src/wasm/asm-wasm-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +109 lines, -32 lines 0 comments Download
A src/wasm/switch-logic.h View 1 2 3 4 5 1 chunk +31 lines, -0 lines 0 comments Download
A src/wasm/switch-logic.cc View 1 2 3 4 5 6 1 chunk +63 lines, -0 lines 0 comments Download
M test/mjsunit/mjsunit.status View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M test/mjsunit/wasm/asm-wasm.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -76 lines 0 comments Download
A test/mjsunit/wasm/asm-wasm-switch.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +442 lines, -0 lines 0 comments Download
M test/unittests/unittests.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
A test/unittests/wasm/switch-logic-unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +89 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 69 (27 generated)
aseemgarg
hey guys Please take a look. Seems like there was a bug earlier. Now the ...
4 years, 8 months ago (2016-03-29 05:10:20 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/20001
4 years, 8 months ago (2016-03-29 05:11:24 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-03-29 05:32:24 UTC) #5
bradnelson
https://codereview.chromium.org/1838973002/diff/20001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/20001/src/wasm/asm-wasm-builder.cc#newcode302 src/wasm/asm-wasm-builder.cc:302: int case_count = clauses->length(); You actually need to handle ...
4 years, 8 months ago (2016-03-29 19:38:45 UTC) #6
bradnelson
As we'd said offline, that other interface might be hard to test. It feels like ...
4 years, 8 months ago (2016-03-29 22:20:49 UTC) #7
Jakob Kummerow
DBC: - The change description lacks a [wasm] tag; labeling makes scanning through regression ranges ...
4 years, 8 months ago (2016-03-30 12:15:06 UTC) #8
aseemgarg
Added [wasm] to commit message and put a little more explanation in commit message. https://codereview.chromium.org/1838973002/diff/20001/src/wasm/asm-wasm-builder.cc ...
4 years, 8 months ago (2016-03-31 20:16:07 UTC) #9
bradn
Can you edit the issue and post your updated commit message (it doesn't automatically get ...
4 years, 8 months ago (2016-03-31 21:16:32 UTC) #11
aseemgarg
On 2016/03/31 21:16:32, bradn wrote: > Can you edit the issue and post your updated ...
4 years, 8 months ago (2016-03-31 21:22:10 UTC) #14
bradn
Actually can you split out enabling those two testing into a separate CL? I'm concerned ...
4 years, 8 months ago (2016-03-31 21:24:31 UTC) #15
aseemgarg
On 2016/03/31 21:24:31, bradn wrote: > Actually can you split out enabling those two testing ...
4 years, 8 months ago (2016-03-31 21:35:07 UTC) #17
bradn
https://codereview.chromium.org/1838973002/diff/40001/src/wasm/switch-logic.h File src/wasm/switch-logic.h (right): https://codereview.chromium.org/1838973002/diff/40001/src/wasm/switch-logic.h#newcode17 src/wasm/switch-logic.h:17: int begin_; Since you're using this as a struct, ...
4 years, 8 months ago (2016-03-31 21:39:09 UTC) #18
aseemgarg
https://codereview.chromium.org/1838973002/diff/40001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/40001/src/wasm/asm-wasm-builder.cc#newcode353 src/wasm/asm-wasm-builder.cc:353: delete (v); On 2016/03/31 21:24:31, bradn wrote: > drop ...
4 years, 8 months ago (2016-03-31 22:04:55 UTC) #19
bradnelson
lgtm with two more suggested tests. https://codereview.chromium.org/1838973002/diff/100001/test/unittests/wasm/switch-logic-unittest.cc File test/unittests/wasm/switch-logic-unittest.cc (right): https://codereview.chromium.org/1838973002/diff/100001/test/unittests/wasm/switch-logic-unittest.cc#newcode75 test/unittests/wasm/switch-logic-unittest.cc:75: TEST_F(SwitchLogicTest, Single_Case) { ...
4 years, 8 months ago (2016-04-01 00:14:50 UTC) #20
aseemgarg
https://codereview.chromium.org/1838973002/diff/100001/test/unittests/wasm/switch-logic-unittest.cc File test/unittests/wasm/switch-logic-unittest.cc (right): https://codereview.chromium.org/1838973002/diff/100001/test/unittests/wasm/switch-logic-unittest.cc#newcode75 test/unittests/wasm/switch-logic-unittest.cc:75: TEST_F(SwitchLogicTest, Single_Case) { On 2016/04/01 00:14:50, bradnelson wrote: > ...
4 years, 8 months ago (2016-04-01 00:23:11 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/120001
4 years, 8 months ago (2016-04-01 00:28:05 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_avx2_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel/builds/12371) v8_linux_arm64_rel on tryserver.v8 (JOB_FAILED, ...
4 years, 8 months ago (2016-04-01 00:29:58 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/140001
4 years, 8 months ago (2016-04-01 00:44:55 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_avx2_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel/builds/12372) v8_linux64_rel_ng on tryserver.v8 (JOB_FAILED, ...
4 years, 8 months ago (2016-04-01 00:47:06 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/160001
4 years, 8 months ago (2016-04-01 01:11:45 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/160001
4 years, 8 months ago (2016-04-01 03:02:53 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/13100)
4 years, 8 months ago (2016-04-01 03:06:06 UTC) #39
titzer
https://codereview.chromium.org/1838973002/diff/160001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/160001/src/wasm/asm-wasm-builder.cc#newcode256 src/wasm/asm-wasm-builder.cc:256: if (node->left != nullptr) { I kind of doubt ...
4 years, 8 months ago (2016-04-01 09:22:45 UTC) #40
bradn
Oops, thought I sent this out a last week. https://codereview.chromium.org/1838973002/diff/160001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/160001/src/wasm/asm-wasm-builder.cc#newcode256 src/wasm/asm-wasm-builder.cc:256: ...
4 years, 8 months ago (2016-04-04 22:31:12 UTC) #41
aseemgarg
https://codereview.chromium.org/1838973002/diff/160001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/160001/src/wasm/asm-wasm-builder.cc#newcode348 src/wasm/asm-wasm-builder.cc:348: for (int i = 0; i < case_count; i++) ...
4 years, 8 months ago (2016-04-07 23:32:36 UTC) #42
bradn
https://codereview.chromium.org/1838973002/diff/200001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/200001/src/wasm/asm-wasm-builder.cc#newcode291 src/wasm/asm-wasm-builder.cc:291: if (node->begin != 0) { Can you add a ...
4 years, 8 months ago (2016-04-07 23:46:59 UTC) #43
aseemgarg
https://codereview.chromium.org/1838973002/diff/200001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/200001/src/wasm/asm-wasm-builder.cc#newcode291 src/wasm/asm-wasm-builder.cc:291: if (node->begin != 0) { On 2016/04/07 23:46:59, bradn ...
4 years, 8 months ago (2016-04-11 20:59:19 UTC) #44
aseemgarg
https://codereview.chromium.org/1838973002/diff/200001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/200001/src/wasm/asm-wasm-builder.cc#newcode291 src/wasm/asm-wasm-builder.cc:291: if (node->begin != 0) { On 2016/04/11 20:59:19, aseemgarg ...
4 years, 8 months ago (2016-04-11 21:00:32 UTC) #45
bradn
lgtm (if you add the a couple tests with case values around MIN/MAX_INT). https://codereview.chromium.org/1838973002/diff/220001/src/wasm/asm-wasm-builder.cc File ...
4 years, 8 months ago (2016-04-12 20:36:10 UTC) #46
bradn
https://codereview.chromium.org/1838973002/diff/220001/test/unittests/wasm/switch-logic-unittest.cc File test/unittests/wasm/switch-logic-unittest.cc (right): https://codereview.chromium.org/1838973002/diff/220001/test/unittests/wasm/switch-logic-unittest.cc#newcode20 test/unittests/wasm/switch-logic-unittest.cc:20: ZoneVector<int> values(&zone); Actually this doesn't merge anymore. Since you're ...
4 years, 8 months ago (2016-04-12 20:46:47 UTC) #47
aseemgarg
https://codereview.chromium.org/1838973002/diff/220001/src/wasm/asm-wasm-builder.cc File src/wasm/asm-wasm-builder.cc (right): https://codereview.chromium.org/1838973002/diff/220001/src/wasm/asm-wasm-builder.cc#newcode280 src/wasm/asm-wasm-builder.cc:280: for (int v = node->begin; v <= node->end; v++) ...
4 years, 8 months ago (2016-04-12 22:20:17 UTC) #48
bradn
lgtm
4 years, 8 months ago (2016-04-12 22:53:05 UTC) #49
aseemgarg
4 years, 8 months ago (2016-04-12 22:54:37 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/260001
4 years, 8 months ago (2016-04-12 23:00:16 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux_arm64_rel_ng on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel_ng/builds/32)
4 years, 8 months ago (2016-04-12 23:03:20 UTC) #56
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/260001
4 years, 8 months ago (2016-04-12 23:12:13 UTC) #58
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-12 23:50:02 UTC) #60
ahaas
rubber stamp lgtm https://codereview.chromium.org/1838973002/diff/260001/test/mjsunit/wasm/asm-wasm-switch.js File test/mjsunit/wasm/asm-wasm-switch.js (right): https://codereview.chromium.org/1838973002/diff/260001/test/mjsunit/wasm/asm-wasm-switch.js#newcode110 test/mjsunit/wasm/asm-wasm-switch.js:110: switch(x|0) { Is there a reason ...
4 years, 8 months ago (2016-04-13 16:27:48 UTC) #61
aseemgarg
https://codereview.chromium.org/1838973002/diff/260001/test/mjsunit/wasm/asm-wasm-switch.js File test/mjsunit/wasm/asm-wasm-switch.js (right): https://codereview.chromium.org/1838973002/diff/260001/test/mjsunit/wasm/asm-wasm-switch.js#newcode110 test/mjsunit/wasm/asm-wasm-switch.js:110: switch(x|0) { On 2016/04/13 16:27:47, ahaas wrote: > Is ...
4 years, 8 months ago (2016-04-13 21:19:20 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1838973002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1838973002/280001
4 years, 8 months ago (2016-04-13 21:19:38 UTC) #65
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 8 months ago (2016-04-13 21:56:01 UTC) #67
commit-bot: I haz the power
4 years, 8 months ago (2016-04-13 21:56:54 UTC) #69
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/1d37d4216b23bd54822ada4e92457291ad70829b
Cr-Commit-Position: refs/heads/master@{#35455}

Powered by Google App Engine
This is Rietveld 408576698