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

Issue 2679853002: X87: [wasm] TrapIf and TrapUnless TurboFan operators implemented on ia32. (Closed)

Created:
3 years, 10 months ago by zhengxing.li
Modified:
3 years, 10 months ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

X87: [wasm] TrapIf and TrapUnless TurboFan operators implemented on ia32. port f435d6222fa194c96c6be2e2d8a753016437931a(r41735) original commit message: Original commit message: [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. Some instructions in WebAssembly trap for some inputs, which means that the execution is terminated and (at least at the moment) a JavaScript exception is thrown. Examples for traps are out-of-bounds memory accesses, or integer divisions by zero. Without the TrapIf and TrapUnless operators trap check in WebAssembly introduces 5 TurboFan nodes (branch, if_true, if_false, trap-reason constant, trap-position constant), in addition to the trap condition itself. Additionally, each WebAssembly function has four TurboFan nodes (merge, effect_phi, 2 phis) whose number of inputs is linear to the number of trap checks in the function. Especially for functions with high numbers of trap checks we observe a significant slowdown in compilation time, down to 0.22 MiB/s in the sqlite benchmark instead of the average of 3 MiB/s in other benchmarks. By introducing a TrapIf common operator only a single node is necessary per trap check, in addition to the trap condition. Also the nodes which are shared between trap checks (merge, effect_phi, 2 phis) would disappear. First measurements suggest a speedup of 30-50% on average. This CL only implements TrapIf and TrapUnless on x64. The implementation is also hidden behind the --wasm-trap-if flag. Please take a special look at how the source position is transfered from the instruction selector to the code generator, and at the context that is used for the runtime call. BUG= Review-Url: https://codereview.chromium.org/2679853002 Cr-Commit-Position: refs/heads/master@{#42998} Committed: https://chromium.googlesource.com/v8/v8/+/b240c4ffab2a2722aa0f15f4a92fde88c5738d60

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -99 lines) Patch
M src/compiler/wasm-compiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/x87/code-generator-x87.cc View 3 chunks +110 lines, -85 lines 0 comments Download
M src/compiler/x87/instruction-selector-x87.cc View 5 chunks +29 lines, -13 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
zhengxing.li
PTAL, thanks!
3 years, 10 months ago (2017-02-07 02:08:01 UTC) #2
zhengxing.li
On 2017/02/07 02:08:01, zhengxing.li wrote: > PTAL, thanks! Hi, titzer/ahaas: This CL adds V8_TARGET_ARCH_X87 in ...
3 years, 10 months ago (2017-02-07 02:10:52 UTC) #3
ahaas
On 2017/02/07 at 02:10:52, zhengxing.li wrote: > On 2017/02/07 02:08:01, zhengxing.li wrote: > > PTAL, ...
3 years, 10 months ago (2017-02-07 13:18:22 UTC) #4
Michael Starzinger
LGTM (rubber-stamp of architecture-independent part, didn't look at the rest).
3 years, 10 months ago (2017-02-07 13:19:50 UTC) #6
zhengxing.li
On 2017/02/07 13:19:50, Michael Starzinger wrote: > LGTM (rubber-stamp of architecture-independent part, didn't look at ...
3 years, 10 months ago (2017-02-07 14:18:29 UTC) #7
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/2679853002/1
3 years, 10 months ago (2017-02-07 14:18:44 UTC) #9
commit-bot: I haz the power
3 years, 10 months ago (2017-02-07 14:41:03 UTC) #12
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/v8/v8/+/b240c4ffab2a2722aa0f15f4a92fde88c57...

Powered by Google App Engine
This is Rietveld 408576698